[ppc40x] Magicbox CF driver cleanup
[openwrt.git] / target / linux / ppc40x / patches / 102-openrb-light-cf-card-fixup.patch
1 --- a/arch/powerpc/boot/cuboot-openrb-light.c
2 +++ b/arch/powerpc/boot/cuboot-openrb-light.c
3 @@ -22,8 +22,36 @@
4
5 static bd_t bd;
6
7 +static void fixup_cf_card(void)
8 +{
9 +#define DCRN_CPC0_PCI_BASE 0xf9
10 +#define CF_CS0_BASE 0xff100000
11 +#define CF_CS1_BASE 0xff200000
12 +
13 + /* Turn on PerWE instead of PCIsomething */
14 + mtdcr(DCRN_CPC0_PCI_BASE,
15 + mfdcr(DCRN_CPC0_PCI_BASE) | (0x80000000L >> 27));
16 +
17 + /* PerCS1 (CF's CS0): base 0xff100000, 16-bit, rw */
18 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B1CR);
19 + mtdcr(DCRN_EBC0_CFGDATA, CF_CS0_BASE | EBC_BXCR_BU_RW | EBC_BXCR_BW_16);
20 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B1AP);
21 + mtdcr(DCRN_EBC0_CFGDATA, 0x080bd800);
22 +
23 + /* PerCS2 (CF's CS1): base 0xff200000, 16-bit, rw */
24 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B2CR);
25 + mtdcr(DCRN_EBC0_CFGDATA, CF_CS1_BASE | EBC_BXCR_BU_RW | EBC_BXCR_BW_16);
26 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B2AP);
27 + mtdcr(DCRN_EBC0_CFGDATA, 0x080bd800);
28 +
29 +#undef DCRN_CPC0_PCI_BASE
30 +#undef CF_CS0_BASE
31 +#undef CF_CS1_BASE
32 +}
33 +
34 static void openrb_light_fixups(void)
35 {
36 + fixup_cf_card();
37 ibm405ep_fixup_clocks(33333000);
38 ibm4xx_sdram_fixup_memsize();
39 dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
This page took 0.038722 seconds and 5 git commands to generate.