Changeset 8032


Ignore:
Timestamp:
2007-07-18T14:13:37+02:00 (11 years ago)
Author:
florian
Message:

Load the appropriate MTD driver if we were booted from NOR/NAND only, use the TRX mapping by default if bootloader unknown

Location:
trunk/target/linux/adm5120-2.6/files/drivers/mtd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c

    r7673 r8032  
    408408        int i, parsed_nr_parts = 0; 
    409409#endif 
     410 
     411        if (adm5120_nand_boot) 
     412                return -ENODEV; 
     413 
    410414        printk("adm5120 : flash init : 0x%08x 0x%08x\n", WINDOW_ADDR, adm5120_board.flash0_size); 
    411415        adm5120_map.virt = ioremap_nocache(WINDOW_ADDR, adm5120_board.flash0_size); 
     
    434438#ifdef CONFIG_MTD_PARTITIONS 
    435439 
    436         if (adm5120_boot_loader == BOOT_LOADER_CFE) 
     440        if (adm5120_boot_loader == BOOT_LOADER_CFE || adm5120_boot_loader == BOOT_LOADER_UNKNOWN) 
    437441        { 
    438442                printk(KERN_NOTICE "adm5120 : using CFE flash mapping\n"); 
  • trunk/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c

    r7673 r8032  
    1414#include <linux/mtd/partitions.h> 
    1515#include <linux/delay.h> 
     16 
    1617#include <asm/io.h> 
    1718#include <asm/irq.h> 
    1819#include <asm/bootinfo.h> 
     20#include <asm/mach-adm5120/adm5120_info.h> 
     21#include <asm/mach-adm5120/adm5120_defs.h> 
    1922 
    20 #define SMEM1_BASE 0x10000000   // from ADM5120 documentation 
    21 #define SMEM1(x) (*((volatile unsigned char *) (KSEG1ADDR(SMEM1_BASE) + x))) 
     23#define SMEM1(x) (*((volatile unsigned char *) (KSEG1ADDR(ADM5120_SRAM1_BASE) + x))) 
    2224 
    2325#define NAND_RW_REG     0x0     //data register 
     
    8789 
    8890int __init rbmips_init(void) { 
     91 
     92        if (!adm5120_nand_boot) 
     93                return -ENODEV; 
     94 
    8995        memset(&rmtd, 0, sizeof(rmtd)); 
    9096        memset(&rnand, 0, sizeof(rnand)); 
     
    94100        SMEM1(NAND_SET_SPn) = 0x01; 
    95101        SMEM1(NAND_CLR_WPn) = 0x01; 
    96         rnand.IO_ADDR_R = (unsigned char *)KSEG1ADDR(SMEM1_BASE); 
     102        rnand.IO_ADDR_R = (unsigned char *)KSEG1ADDR(ADM5120_SRAM1_BASE); 
    97103        rnand.IO_ADDR_W = rnand.IO_ADDR_R; 
    98104        rnand.cmd_ctrl = rbmips_hwcontrol100; 
    99105        rnand.dev_ready = rb100_dev_ready; 
    100         p_nand = (void __iomem *)ioremap(( unsigned long)SMEM1_BASE, 0x1000); 
     106        p_nand = (void __iomem *)ioremap(( unsigned long)ADM5120_SRAM1_BASE, 0x1000); 
    101107        if (!p_nand) { 
    102108                printk(KERN_WARNING "RB1xx nand Unable ioremap buffer\n"); 
Note: See TracChangeset for help on using the changeset viewer.