Changeset 9418


Ignore:
Timestamp:
2007-10-23T14:31:13+02:00 (10 years ago)
Author:
juhosg
Message:

[adm5120] fix flash driver, it should work on RB150 as well

Location:
trunk/target/linux/adm5120/files
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c

    r9416 r9418  
    141141        /* FIXME: untested */ 
    142142        0x41, 0x42, 0x44, 0x48, 0x50, 0x00 
     143}; 
    143144 
    144145static unsigned char rb192_vlans[6] __initdata = { 
     
    262263        adm5120_nand_data.ctrl.dev_ready = rb150_nand_ready; 
    263264 
     265        adm5120_flash0_data.window_size = 512*1024; 
     266 
    264267        rb1xx_flash_setup(); 
    265268        rb1xx_mac_setup(); 
  • trunk/target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c

    r9263 r9418  
    245245        struct adm5120_flash_platform_data *pdata = dev->dev.platform_data; 
    246246        struct flash_desc *fdesc; 
    247         u32 t; 
     247        u32 t = 0; 
    248248 
    249249        map->name = dev->dev.bus_id; 
     
    256256        fdesc = &flash_descs[dev->id]; 
    257257 
    258         /* get memory window size */ 
    259         t = SW_READ_REG(MEMCTRL) >> fdesc->srs_shift; 
    260         t &= MEMCTRL_SRS_MASK; 
    261         info->amap.window_size = flash_sizes[t]; 
     258        if (pdata) 
     259                info->amap.window_size = pdata->window_size; 
     260 
    262261        if (info->amap.window_size == 0) { 
    263                 MAP_ERR(map, "invalid flash size detected\n"); 
     262                /* get memory window size */ 
     263                t = SW_READ_REG(MEMCTRL) >> fdesc->srs_shift; 
     264                t &= MEMCTRL_SRS_MASK; 
     265                info->amap.window_size = flash_sizes[t]; 
     266        } 
     267 
     268        if (info->amap.window_size == 0) { 
     269                MAP_ERR(map, "unable to determine window size\n"); 
    264270                goto err_out; 
    265271        } 
  • trunk/target/linux/adm5120/files/include/asm-mips/mach-adm5120/adm5120_platform.h

    r9118 r9418  
    4040        void                    (*set_vpp)(struct map_info *, int); 
    4141        void                    (*switch_bank)(unsigned); 
     42        u32                     window_size; 
    4243#ifdef CONFIG_MTD_PARTITIONS 
    4344        unsigned int            nr_parts; 
Note: See TracChangeset for help on using the changeset viewer.