source: trunk/target/linux/ppc40x/patches-2.6.30/102-openrb-light-cf-card-fixup.patch @ 16910

Last change on this file since 16910 was 16910, checked in by juhosg, 7 years ago

[ppc40x] add driver for the CF slot of the Magicbox v2/OpenRB boards

File size: 1.1 KB
  • arch/powerpc/boot/cuboot-openrb-light.c

    a b  
    2222 
    2323static bd_t bd; 
    2424 
     25static void fixup_cf_card(void) 
     26{ 
     27#define DCRN_CPC0_PCI_BASE      0xf9 
     28#define CF_CS0_BASE             0xff100000 
     29#define CF_CS1_BASE             0xff200000 
     30 
     31        /* Turn on PerWE instead of PCIsomething */ 
     32        mtdcr(DCRN_CPC0_PCI_BASE, 
     33              mfdcr(DCRN_CPC0_PCI_BASE) | (0x80000000L >> 27)); 
     34 
     35        /* PerCS1 (CF's CS0): base 0xff100000, 16-bit, rw */ 
     36        mtdcr(DCRN_EBC0_CFGADDR, EBC_B1CR); 
     37        mtdcr(DCRN_EBC0_CFGDATA, CF_CS0_BASE | EBC_BXCR_BU_RW | EBC_BXCR_BW_16); 
     38        mtdcr(DCRN_EBC0_CFGADDR, EBC_B1AP); 
     39        mtdcr(DCRN_EBC0_CFGDATA, 0x080bd800); 
     40 
     41        /* PerCS2 (CF's CS1): base 0xff200000, 16-bit, rw */ 
     42        mtdcr(DCRN_EBC0_CFGADDR, EBC_B2CR); 
     43        mtdcr(DCRN_EBC0_CFGDATA, CF_CS1_BASE | EBC_BXCR_BU_RW | EBC_BXCR_BW_16); 
     44        mtdcr(DCRN_EBC0_CFGADDR, EBC_B2AP); 
     45        mtdcr(DCRN_EBC0_CFGDATA, 0x080bd800); 
     46 
     47#undef DCRN_CPC0_PCI_BASE 
     48#undef CF_CS0_BASE 
     49#undef CF_CS1_BASE 
     50} 
     51 
    2552static void openrb_light_fixups(void) 
    2653{ 
     54        fixup_cf_card(); 
    2755        ibm405ep_fixup_clocks(33333000); 
    2856        ibm4xx_sdram_fixup_memsize(); 
    2957        dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr); 
Note: See TracBrowser for help on using the repository browser.