blob: e32b4a9a2c2282c2554e854965f7f8b784ffe3eb [file] [log] [blame]
Valentine Barshak84e3ad52007-09-22 00:44:38 +10001/*
2 * This file contains low level CPU setup functions.
3 * Valentine Barshak <vbarshak@ru.mvista.com>
4 * MontaVista Software, Inc (c) 2007
5 *
Stefan Roese464076a2008-02-24 08:07:41 +11006 * Based on cpu_setup_6xx code by
Valentine Barshak84e3ad52007-09-22 00:44:38 +10007 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16#include <asm/processor.h>
17#include <asm/cputable.h>
18#include <asm/ppc_asm.h>
19
Valentine Barshak81127532007-09-22 00:46:57 +100020_GLOBAL(__setup_cpu_440ep)
21 b __init_fpu_44x
22_GLOBAL(__setup_cpu_440epx)
Valentine Barshak340ffd22007-09-22 00:50:09 +100023 mflr r4
24 bl __init_fpu_44x
25 bl __plb_disable_wrp
Benjamin Herrenschmidt47c0bd12007-12-21 15:39:21 +110026 bl __fixup_440A_mcheck
Valentine Barshak340ffd22007-09-22 00:50:09 +100027 mtlr r4
28 blr
29_GLOBAL(__setup_cpu_440grx)
Josh Boyer9ac30c32007-12-04 13:02:18 -060030 mflr r4
31 bl __plb_disable_wrp
32 bl __fixup_440A_mcheck
33 mtlr r4
34 blr
Stefan Roese464076a2008-02-24 08:07:41 +110035_GLOBAL(__setup_cpu_460ex)
Josh Boyer939e6222008-06-11 07:52:40 -040036_GLOBAL(__setup_cpu_460gt)
Madhulika Madishetty6c712092009-02-05 13:31:36 +000037_GLOBAL(__setup_cpu_460sx)
Tirumala Marri6edc3232010-09-13 13:26:11 +000038_GLOBAL(__setup_cpu_apm821xx)
Benjamin Herrenschmidt6612d9b2008-11-11 16:02:43 +000039 mflr r4
40 bl __init_fpu_44x
41 bl __fixup_440A_mcheck
42 mtlr r4
43 blr
44
Grant Likely640d17d2008-12-04 05:39:55 +000045_GLOBAL(__setup_cpu_440x5)
Benjamin Herrenschmidt47c0bd12007-12-21 15:39:21 +110046_GLOBAL(__setup_cpu_440gx)
47_GLOBAL(__setup_cpu_440spe)
48 b __fixup_440A_mcheck
Valentine Barshak340ffd22007-09-22 00:50:09 +100049
Valentine Barshak81127532007-09-22 00:46:57 +100050/* enable APU between CPU and FPU */
51_GLOBAL(__init_fpu_44x)
52 mfspr r3,SPRN_CCR0
53 /* Clear DAPUIB flag in CCR0 */
54 rlwinm r3,r3,0,12,10
55 mtspr SPRN_CCR0,r3
56 isync
57 blr
58
Valentine Barshak340ffd22007-09-22 00:50:09 +100059/*
60 * Workaround for the incorrect write to DDR SDRAM errata.
61 * The write address can be corrupted during writes to
62 * DDR SDRAM when write pipelining is enabled on PLB0.
63 * Disable write pipelining here.
64 */
65#define DCRN_PLB4A0_ACR 0x81
66
67_GLOBAL(__plb_disable_wrp)
68 mfdcr r3,DCRN_PLB4A0_ACR
69 /* clear WRP bit in PLB4A0_ACR */
70 rlwinm r3,r3,0,8,6
71 mtdcr DCRN_PLB4A0_ACR,r3
72 isync
73 blr
74