diff options
Diffstat (limited to 'arch/powerpc/boot/44x.c')
-rw-r--r-- | arch/powerpc/boot/44x.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/powerpc/boot/44x.c b/arch/powerpc/boot/44x.c index d51377d9024f..9f64e840bef6 100644 --- a/arch/powerpc/boot/44x.c +++ b/arch/powerpc/boot/44x.c | |||
@@ -38,3 +38,48 @@ void ibm44x_fixup_memsize(void) | |||
38 | 38 | ||
39 | dt_fixup_memory(0, memsize); | 39 | dt_fixup_memory(0, memsize); |
40 | } | 40 | } |
41 | |||
42 | #define SPRN_DBCR0 0x134 | ||
43 | #define DBCR0_RST_SYSTEM 0x30000000 | ||
44 | |||
45 | void ibm44x_dbcr_reset(void) | ||
46 | { | ||
47 | unsigned long tmp; | ||
48 | |||
49 | asm volatile ( | ||
50 | "mfspr %0,%1\n" | ||
51 | "oris %0,%0,%2@h\n" | ||
52 | "mtspr %1,%0" | ||
53 | : "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM) | ||
54 | ); | ||
55 | |||
56 | } | ||
57 | |||
58 | /* Read 4xx EBC bus bridge registers to get mappings of the peripheral | ||
59 | * banks into the OPB address space */ | ||
60 | void ibm4xx_fixup_ebc_ranges(const char *ebc) | ||
61 | { | ||
62 | void *devp; | ||
63 | u32 bxcr; | ||
64 | u32 ranges[EBC_NUM_BANKS*4]; | ||
65 | u32 *p = ranges; | ||
66 | int i; | ||
67 | |||
68 | for (i = 0; i < EBC_NUM_BANKS; i++) { | ||
69 | mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i)); | ||
70 | bxcr = mfdcr(DCRN_EBC0_CFGDATA); | ||
71 | |||
72 | if ((bxcr & EBC_BXCR_BU) != EBC_BXCR_BU_OFF) { | ||
73 | *p++ = i; | ||
74 | *p++ = 0; | ||
75 | *p++ = bxcr & EBC_BXCR_BAS; | ||
76 | *p++ = EBC_BXCR_BANK_SIZE(bxcr); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | devp = finddevice(ebc); | ||
81 | if (! devp) | ||
82 | fatal("Couldn't locate EBC node %s\n\r", ebc); | ||
83 | |||
84 | setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32)); | ||
85 | } | ||