This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Cannot access MTD device after booting from NAND.

Other Parts Discussed in Thread: TVP7002, THS7303, TVP5146, THS7353

I am loading the DM365 filesystem from SD Card, and updating the kernel in the NAND flash using flash utils.  The u-boot and kernel can load from NAND, but then I cannot access the MTD device to write a new kernel or boot environment. The error is /dev/mtd0: no such file or directory. When I look in /dev there are no mtd* entries, and the kernel boot log contains no NAND initialization messages.  When I run tftpboot and nboot, the mtd* entries are created. If I press Reset on my DM365 board and type bootm (without nboot), mtd is still available. Can you tell me why mtd is not created in these conditions?

 

Robert Mellen

  • 1. Have you configured linux MTD module.

    2. Did kernel detect the nand and mtd module.

    . Could you post the Kernel Boot log(dmesg).

     

    Regards

    Gururaja

  • My kernel config file contains the following entries:

    CONFIG_MTD=y
    # CONFIG_MTD_DEBUG is not set
    # CONFIG_MTD_TESTS is not set
    # CONFIG_MTD_CONCAT is not set
    CONFIG_MTD_PARTITIONS=y
    # CONFIG_MTD_REDBOOT_PARTS is not set
    CONFIG_MTD_CMDLINE_PARTS=y
    # CONFIG_MTD_AFS_PARTS is not set
    # CONFIG_MTD_AR7_PARTS is not set

    CONFIG_MTD_CHAR=y
    CONFIG_MTD_BLKDEVS=y
    CONFIG_MTD_BLOCK=y
    CONFIG_MTD_NAND=y
    # CONFIG_MTD_NAND_VERIFY_WRITE is not set
    # CONFIG_MTD_NAND_ECC_SMC is not set
    # CONFIG_MTD_NAND_MUSEUM_IDS is not set
    # CONFIG_MTD_NAND_GPIO is not set
    CONFIG_MTD_NAND_IDS=y
    # CONFIG_MTD_NAND_DISKONCHIP is not set
    # CONFIG_MTD_NAND_NANDSIM is not set
    # CONFIG_MTD_NAND_PLATFORM is not set

    # CONFIG_MTD_ALAUDA is not set
    CONFIG_MTD_NAND_DAVINCI=y
    # CONFIG_MTD_ONENAND is not set

    The kernel boot log contains only one reference to NAND/MTD - trying to access a JFFS2 ROMFS.

    # Restarting system.
    DM36x initialization passed!
    TI UBL Version: 1.50
    Booting Catalog Boot Loader
    BootMode = NAND
    Starting NAND Copy...
    Valid magicnum, 0xA1ACED66, found in block 0x00000019.
       DONE
    Jumping to entry point at 0x81080000.


    U-Boot 1.3.4 (May 22 2009 - 11:25:39)

    I2C:   ready
    DRAM:  128 MB
    NAND:  NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Bad block table written to 0x3ffe0000, version 0x01
    Bad block table written to 0x3ffc0000, version 0x01
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Bad block table written to 0x3ffe0000, version 0x01
    Bad block table written to 0x3ffc0000, version 0x01
    2048 MiB
    In:    serial
    Out:   serial
    Err:   serial
    Ethernet PHY: GENERIC @ 0x00
    Hit any key to stop autoboot:  0

    Loading from NAND 1GiB 3,3V 8-bit, offset 0x400000
       Image Name:   Linux-2.6.32-ts-armv5l
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2057764 Bytes =  2 MB
       Load Address: 80008000
       Entry Point:  80008000
    ## Booting kernel from Legacy Image at 80700000 ...
       Image Name:   Linux-2.6.32-ts-armv5l
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2057764 Bytes =  2 MB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux............................................................................
    ........................................................ done, booting the kernel.
    Linux version 2.6.32-ts-armv5l (bgreat@LapHP) (gcc version 4.4.5 (GCC) ) #109 PREEMPT Fri Mar 1
    8 08:20:06 EDT 2011
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    CPU: VIVT data cache, VIVT instruction cache
    Machine: DaVinci DM365 EVM
    Memory policy: ECC disabled, Data cache writeback
    DaVinci dm365_rev1.2 variant 0x8
    Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 19304
    Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait rw rootfstype=ext3 ip=
    off video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K mem=76M davinci_capture.device_type
    =4 spidev.bufsiz=131072
    PID hash table entries: 512 (order: -1, 2048 bytes)
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 76MB = 76MB total
    Memory: 72732KB available (3824K code, 291K data, 140K init, 0K highmem)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:245
    Console: colour dummy device 80x30
    Calibrating delay loop... 147.86 BogoMIPS (lpj=739328)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    DaVinci: 8 gpio irqs
    NET: Registered protocol family 16
    MUX: Setting register INT_EDMA_CC
               INTMUX (0x00000018) = 0x00000000 -> 0x00000004
    MUX: Setting register INT_EDMA_TC0_ERR
               INTMUX (0x00000018) = 0x00000004 -> 0x00000004
    MUX: Setting register INT_EDMA_TC3_ERR
               INTMUX (0x00000018) = 0x00000004 -> 0x00800004
    davinci_serial_init:97: failed to get UART2 clock
    MUX: Setting register PWM2_G88
               PINMUX1 (0x00000004) = 0x00145555 -> 0x00145455
    MUX: Setting register PWM2_G89
               PINMUX1 (0x00000004) = 0x00145455 -> 0x00145415
    MUX: Setting register PWM2_G90
               PINMUX1 (0x00000004) = 0x00145415 -> 0x00145405
    MUX: Setting register INT_EMAC_RXTHRESH
               INTMUX (0x00000018) = 0x00800004 -> 0x00804004
    MUX: Setting register INT_EMAC_RXPULSE
               INTMUX (0x00000018) = 0x00804004 -> 0x0080c004
    MUX: Setting register INT_EMAC_TXPULSE
               INTMUX (0x00000018) = 0x0080c004 -> 0x0081c004
    MUX: Setting register INT_EMAC_MISCPULSE
               INTMUX (0x00000018) = 0x0081c004 -> 0x0083c004
    MUX: Setting register GPIO33
               PINMUX4 (0x00000010) = 0x55555555 -> 0x55554555
    EVM: tvp7002 HD video input
    MUX: Setting register INT_PRTCSS
               INTMUX (0x00000018) = 0x0083c004 -> 0x0083c404
    MUX: Setting register SPI2_SCLK
               PINMUX4 (0x00000010) = 0x55554555 -> 0x55554555
    MUX: Setting register SPI2_SDI
               PINMUX4 (0x00000010) = 0x55554555 -> 0x55554555
    MUX: Setting register SPI2_SDO
               PINMUX4 (0x00000010) = 0x55554555 -> 0x55554555
    MUX: Setting register SPI2_SDENA0
               PINMUX4 (0x00000010) = 0x55554555 -> 0x55555555
    edma edma.0: DMA REG BASE ADDR=fec00000
    bio: create slab <bio-0> at 0
    DM365 IPIPE initialized in Single Shot mode
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    vpss vpss: dm365_vpss vpss probed
    vpss vpss: dm365_vpss vpss probe success
    dm365_afew_hw_init
    ch0 default output "COMPOSITE", mode "NTSC"
    VPBE Encoder Initialized
    LogicPD encoder initialized
    Registered led device: dm365evm::ds2
    Registered led device: dm365evm::ds3
    Registered led device: dm365evm::ds4
    Registered led device: dm365evm::ds5
    Registered led device: dm365evm::ds6
    Registered led device: dm365evm::ds7
    Registered led device: dm365evm::ds8
    Registered led device: dm365evm::ds9
    Switching to clocksource timer0_1
    Slow work thread pool: Starting up
    Slow work thread pool: Ready
    FS-Cache: Loaded
    musb_hdrc: version 6.0, cppi-dma, host, debug=0
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    TCP reno registered
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
    JFFS2 version 2.2. (NAND) .. 2001-2006 Red Hat, Inc.
    ROMFS MTD (C) 2007 Red Hat, Inc.
    msgmni has been set to 142
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    davincifb davincifb.0: dm_osd0_fb: Initial window configuration is invalid.
    davincifb davincifb.0: dm_osd0_fb: 720x576x16@0,0 with framebuffer size 4050KB
    davincifb davincifb.0: dm_vid0_fb: 0x0x16@0,0 with framebuffer size 1020KB
    davincifb davincifb.0: dm_osd1_fb: 720x480x4@0,0 with framebuffer size 675KB
    davincifb davincifb.0: dm_vid1_fb: 0x0x16@0,0 with framebuffer size 1020KB
    DM365 IPIPEIF probed
    imp serializer initialized
    davinci_previewer initialized
    davinci_resizer initialized
    Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    console [ttyS0] enabled
    brd: module loaded
    at24 1-0050: 32768 byte 24c256 EEPROM (writable)
    Read MAC addr from EEPROM: 00:0e:99:02:cf:13
    spi_davinci spi_davinci.2: DaVinci SPI driver in EDMA mode
    Using RX channel = 11 , TX channel = 10 and event queue = 3 IRQ = 19
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new interface driver usbtest
    input: DM365 EVM Controls as /devices/platform/i2c_davinci.1/i2c-1/1-0025/input/input0
    i2c /dev entries driver
    Linux video capture interface: v2.00
    ths7303 1-002c: chip found @ 0x58 (DaVinci I2C adapter)
    vpfe_init
    vpfe-capture: vpss clock vpss_master enabled
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    MUX: Setting register GPIO40
               PINMUX4 (0x00000010) = 0x55555555 -> 0x51555555
    EVM: switch to tvp5146 SD video input
    tvp514x 1-005d: tvp514x 1-005d decoder driver registered !!
    vpfe-capture vpfe-capture: v4l2 sub device tvp5146 registered
    EVM: switch to tvp7002 HD video input
    tvp7002 1-005c: tvp7002 1-005c decoder driver registered !!
    vpfe-capture vpfe-capture: v4l2 sub device tvp7002 registered
    ths7353 1-002e: chip found @ 0x5c (DaVinci I2C adapter)
    ths7353 1-002e: No platform data!!
    vpfe-capture vpfe-capture: v4l2 sub device ths7353 registered
    vpfe_register_ccdc_device: DM365 ISIF
    DM365 ISIF is registered with vpfe.
    af major#: 252, minor# 0
    AF Driver initialized
    aew major#: 251, minor# 0
    AEW Driver initialized
    Trying to register davinci display video device.
    layer=c37f8400,layer->video_dev=c37f8564
    Trying to register davinci display video device.
    layer=c37f8600,layer->video_dev=c37f8764
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    watchdog watchdog: heartbeat 60 sec
    davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    davinci_mmc davinci_mmc.1: Using DMA, 4-bit mode
    usbcore: registered new interface driver usbhid
    usbhid: v2.6:USB HID core driver
    TCP cubic registered
    NET: Registered protocol family 17
    Clocks: disable unused spi0
    Clocks: disable unused spi1
    Clocks: disable unused spi3
    Clocks: disable unused spi4
    Clocks: disable unused pwm0
    Clocks: disable unused pwm1
    Clocks: disable unused pwm2
    Clocks: disable unused pwm3
    Clocks: disable unused timer1
    Clocks: disable unused timer3
    Clocks: disable unused usb
    Clocks: disable unused emac
    Clocks: disable unused voice_codec
    Clocks: disable unused asp0
    Clocks: disable unused rto
    Clocks: disable unused mjcp
    emac-mii: probed
    Waiting for root device /dev/mmcblk0p2...
    mmc0: new SD card at address aaaa
    mmcblk0: mmc0:aaaa SD02G 1.84 GiB
     mmcblk0: p1 p2
    kjournald starting.  Commit interval 5 seconds
    EXT3 FS on mmcblk0p2, internal journal
    EXT3-fs: recovery complete.
    EXT3-fs: mounted filesystem with writeback data mode.
    VFS: Mounted root (ext3 filesystem) on device 179:2.
    Freeing init memory: 140K
    udev: starting version 143
    eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, id=221613)
    CMEMK module: built on Mar 18 2011 at 09:32:58

    When I boot using tftpboot (same kernel file), I see the list of bad NAND blocks and the following:

    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)
    2 NAND chips detected
    Bad block table not found for chip 0
    Bad block table not found for chip 1
    Bad block table not found for chip 0
    Bad block table not found for chip 1
    Scanning device for bad blocks

    ...

    davinci_nand davinci_nand.0: controller rev. 2.3

    Thanks,

    Robert