From 11123346bfba8e65631957c6c25ed1a6ca1b4ffe Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 13 Jun 2007 14:52:58 +1000 Subject: [POWERPC] Factor zImage's 44x reset code out of ebony.c The ebony_exit() function which resets the Ebony board should in fact be common to most if not all 44x boards. This moves the function out into 44x.c, renaming it, so it can be used by other 44x platforms. Signed-off-by: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/boot/ebony.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'arch/powerpc/boot/ebony.c') diff --git a/arch/powerpc/boot/ebony.c b/arch/powerpc/boot/ebony.c index b1251ee7a102..634985802006 100644 --- a/arch/powerpc/boot/ebony.c +++ b/arch/powerpc/boot/ebony.c @@ -102,26 +102,10 @@ static void ebony_fixups(void) dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); } -#define SPRN_DBCR0 0x134 -#define DBCR0_RST_SYSTEM 0x30000000 - -static void ebony_exit(void) -{ - unsigned long tmp; - - asm volatile ( - "mfspr %0,%1\n" - "oris %0,%0,%2@h\n" - "mtspr %1,%0" - : "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM) - ); - -} - void ebony_init(void *mac0, void *mac1) { platform_ops.fixups = ebony_fixups; - platform_ops.exit = ebony_exit; + platform_ops.exit = ibm44x_dbcr_reset; ebony_mac0 = mac0; ebony_mac1 = mac1; ft_init(_dtb_start, _dtb_end - _dtb_start, 32); -- cgit v1.2.2 From b2ba34f370a66d9ed4bbd440e45296ecf3e267d3 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 13 Jun 2007 14:52:59 +1000 Subject: [POWERPC] Derive ebc ranges property from EBC registers In the device tree for Ebony, the 'ranges' property in the node for the EBC bridge shows the mappings from the chip select / address lines actually used for the EBC peripherals into the address space of the OPB. At present, these mappings are hardcoded in ebony.dts for the mappings set up by the OpenBIOS firmware when it configures the EBC bridge. This replaces the hardcoded mappings with code in the zImage to read the EBC configuration registers and create an appropriate ranges property based on them. This should make the zImage and kernel more robust to changes in firmware configuration. In particular, some of the Ebony's DIP switches can change the effective address of the Flash and other peripherals in OPB space. With this patch, the kernel will be able to cope with at least some of the possible variations. Signed-off-by: David Gibson Signed-off-by: Paul Mackerras --- arch/powerpc/boot/ebony.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/powerpc/boot/ebony.c') diff --git a/arch/powerpc/boot/ebony.c b/arch/powerpc/boot/ebony.c index 634985802006..75daedafd0a4 100644 --- a/arch/powerpc/boot/ebony.c +++ b/arch/powerpc/boot/ebony.c @@ -100,6 +100,7 @@ static void ebony_fixups(void) ibm440gp_fixup_clocks(sysclk, 6 * 1843200); ibm44x_fixup_memsize(); dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); + ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); } void ebony_init(void *mac0, void *mac1) -- cgit v1.2.2