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.

Nand flash ECC error

Other Parts Discussed in Thread: PMP, TVP5158

Hello,

I am using DVRRDK 3.0 from UDWorks.

Nand flash is Micro MT29F2G16A(256MBytes) on our board.

I have made a jffs2 format root filesystem, and mount successful after kernel booting.

But sometimes mtd->read(0x800 bytes from 0x355f800) returned ECC error happened.

Does any configuration need to modify?

From RDK U-Boot, ECC layout is defined in GPMC_NAND_HW_BCH8_ECC_LAYOUT_DVR

In the __ti81xx_nand_switch_ecc(struct nand_chip *nand, nand_ecc_modes_t hardware, int32_t mode), i have set :

nand->ecc.steps = 8;

nand->ecc.layout = &hw_nand_oob_p4k;

I have no idea to set these parameters. Does anybody give me some clue?

Thank you very much!

Regards,

Steven



  • could you attach full log from bootup?

  • Hello, Jack

    log is below:

    NAND read: device 0 offset 0x6c0000, size 0x300000
     3145728 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
       Image Name:   Linux-2.6.37
       Created:      2013-04-22   3:35:23 UTC
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2560032 Bytes = 2.4 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Linux version 2.6.37 (steven@steven-pc) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #3 Mon Apr 22 11:35:19 CST 2013
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    Machine: ti8168_dvr
    vram size = 20971520 at 0x0
    reserved size = 20971520 at 0x0
    FB: Reserving 20971520 bytes SDRAM for VRAM
    Memory policy: ECC disabled, Data cache writeback
    OMAP chip is TI8168 2.0
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 59904
    Kernel command line: mem=256M console=ttyO2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2 vram=20M notifyk.vpssm3_sva=0xBEE00000 ip=p
    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 236MB = 236MB total
    Memory: 233892k/233892k available, 28252k reserved, 0K highmem
    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
        DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
        vmalloc : 0x90800000 - 0xf8000000   (1656 MB)
        lowmem  : 0x80000000 - 0x90000000   ( 256 MB)
        pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
        modules : 0x7f000000 - 0x7fe00000   (  14 MB)
          .init : 0x80008000 - 0x8003b000   ( 204 kB)
          .text : 0x8003b000 - 0x804d8000   (4724 kB)
          .data : 0x804d8000 - 0x80520a80   ( 291 kB)
    SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    NR_IRQS:407
    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    Total of 128 interrupts on 1 active controller
    GPMC revision 6.0
    Trying to install interrupt handler for IRQ400
    Trying to install interrupt handler for IRQ401
    Trying to install interrupt handler for IRQ402
    Trying to install interrupt handler for IRQ403
    Trying to install interrupt handler for IRQ404
    Trying to install interrupt handler for IRQ405
    Trying to install interrupt handler for IRQ406
    Trying to install type control for IRQ407
    Trying to set irq flags for IRQ407
    OMAP clockevent source: GPTIMER1 at 27000000 Hz
    Console: colour dummy device 80x30
    Calibrating delay loop... 999.42 BogoMIPS (lpj=4997120)
    pid_max: default: 32768 minimum: 301
    Security Framework initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    devtmpfs: initialized
    omap_voltage_early_init: voltage driver support not added
    regulator: core version 0.5
    regulator: dummy:
    NET: Registered protocol family 16
    omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
    omap_voltage_add_dev: VDD specified does not exist!
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    omap_mux_init: Add partition: #1: core, flags: 0
    _omap_mux_get_by_name: Could not find signal i2c2_scl.i2c2_scl
    _omap_mux_get_by_name: Could not find signal i2c2_sda.i2c2_sda
    pm_dbg_init: only OMAP3 supported
    registered ti81xx_vpss device
    registered ti81xx_vidout device
    registered ti81xx on-chip HDMI device
    registered ti81xx_fb device
    bio: create slab <bio-0> at 0
    vgaarb: loaded
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    USBSS revision 4ea20809
    registerd cppi-dma Intr @ IRQ 17
    Cppi41 Init Done
    omap_i2c omap_i2c.1: bus 1 rev4.0 at 400 kHz
    omap_i2c omap_i2c.2: bus 2 rev4.0 at 400 kHz
    Advanced Linux Sound Architecture Driver Version 1.0.23.
    Switching to clocksource gp timer
    musb-hdrc: version 6.0, host, debug=0
    musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    MUSB controller-0 revision 4ea20800
    musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: MUSB HDRC host driver
    usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
    usb usb1: SerialNumber: musb-hdrc.0
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    musb-hdrc musb-hdrc.0: USB Host mode controller at 9081e000 using DMA, IRQ 18
    musb-hdrc musb-hdrc.1: dma type: dma-cppi41
    MUSB controller-1 revision 4ea20800
    musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
    usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb2: Product: MUSB HDRC host driver
    usb usb2: Manufacturer: Linux 2.6.37 musb-hcd
    usb usb2: SerialNumber: musb-hdrc.1
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    musb-hdrc musb-hdrc.1: USB Host mode controller at 90828800 using DMA, IRQ 19
    NET: Registered protocol family 2
    IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    TCP: Hash tables configured (established 8192 bind 8192)
    TCP reno registered
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    NetWinder Floating Point Emulator V0.97 (double precision)
    PMU: registered new PMU device of type 0
    omap-iommu omap-iommu.0: ducati registered
    omap-iommu omap-iommu.1: sys registered
    JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
    msgmni has been set to 456
    io scheduler noop registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
    omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    console [ttyO2] enabled
    brd: module loaded
    loop: module loaded
    ahci ahci.0: forcing PORTS_IMPL to 0x3
    ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
    ahci ahci.0: flags: ncq sntf pm led clo only pmp pio slum part ccc
    scsi0 : ahci_platform
    scsi1 : ahci_platform
    ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16
    ata2: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x180 irq 16
    omap2-nand driver initializing
    ONFI flash detected
    ONFI param page 0 valid
    NAND device: Maf ID: 0x2c, Chip ID: 0xda (Micron, NAND 256MiB 3,3V 8-bit)
     erasesize: 0x20000, writesize: 2048, oobsize: 64
    Creating 7 MTD partitions on "omap2-nand.0":
    0x000000000000-0x000000080000 : "U-Boot"
    0x000000080000-0x0000000c0000 : "U-Boot Env"
    0x0000000c0000-0x0000006c0000 : "U-Boot Logo"
    0x0000006c0000-0x0000009c0000 : "Kernel"
    0x0000009c0000-0x0000049c0000 : "File System"
    0x0000049c0000-0x0000089c0000 : "User Var"
    0x0000089c0000-0x000010000000 : "Reserved"
    davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    davinci_mdio davinci_mdio.0: detected phy mask ffffff76
    davinci_mdio.0: probed
    davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
    davinci_mdio davinci_mdio.0: phy[3]: device 0:03, driver unknown
    davinci_mdio davinci_mdio.0: phy[7]: device 0:07, driver unknown
    usbcore: registered new interface driver cdc_ether
    usbcore: registered new interface driver dm9601
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    mice: PS/2 mouse device common for all mice
    rtc-ds1307 2-0068: rtc core: registered ds1339 as rtc0
    omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc1
    i2c /dev entries driver
    Linux video capture interface: v2.00
    usbcore: registered new interface driver uvcvideo
    USB Video Class driver (v1.0.0)
    OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    notify_init : notify drivercreated  for  remote proc id 2 at physical Address 0xbee00000
    usbcore: registered new interface driver snd-usb-audio
    Registered tvp5158 audio codec
    asoc: tlv320aic3x-hifi <-> davinci-mcasp.2 mapping ok
    asoc: HDMI-DAI-CODEC <-> hdmi-dai mapping ok
    ALSA device list:
      #0: TI81XX SOUND0
      #1: TI81XX SOUND1
    TCP cubic registered
    NET: Registered protocol family 17
    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    omap_voltage_late_init: Voltage driver support not added
    Power Management for TI81XX.
    rtc-ds1307 2-0068: setting system clock to 2013-04-10 11:51:42 UTC (1365594702)
    mmc0: new high speed SDHC card at address e624
    mmcblk0: mmc0:e624 SD08G 7.40 GiB
     mmcblk0: p1 p2
    davinci_mdio davinci_mdio.0: resetting idled controller
    net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:03, id=1cc915)
    net eth1: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:07, id=1cc915)
    Sending DHCP requests .
    ata1: SATA link down (SStatus 0 SControl 300)
    ata2: SATA link down (SStatus 0 SControl 300)
    .
    PHY: 0:03 - Link is Up - 1000/Full
    PHY: 0:07 - Link is Up - 1000/Full
    ., OK
    IP-Config: Got DHCP answer from 0.0.0.0, my address is 10.2.50.135
    IP-Config: Complete:
         device=eth0, addr=10.2.50.135, mask=255.255.255.0, gw=10.2.50.254,
         host=10.2.50.135, domain=AREC.COM, nis-domain=(none),
         bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=
    VFS: Mounted root (jffs2 filesystem) on device 31:4.
    devtmpfs: mounted
    Freeing init memory: 204K
    Starting logging: OK
    Starting mdev...
    Starting telnet daemon.
    Initializing random number generator... done.
    Starting system message bus: done
    Setting up interface eth1: net eth1: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:07, id=1cc915)
    Starting network time protocol daemon: ntpdJFFS2 notice: (54) check_node_data: wrong data CRC in data node at 0x03fa1cf0: read 0x92abec25, calcu.
    .
    Starting lighttpd: OK
    Starting DHCP server: .
    Starting watchdog daemon.
    mtd->read(0x800 bytes from 0x355b800) returned ECC error
    mtd->read(0x800 bytes from 0x355a800) returned ECC error
    mtd->read(0x800 bytes from 0x3558800) returned ECC error

    thanks in advance!

    Steven

  • Q1. nand->ecc.steps = 8;

    - flash page size = steps * ecc_bytes 

      example:

      2048 = "4" * 512,   4096 = 8 * 512,    we got a ecc value every 512 bytes

     

    Q2. nand->ecc.layout = &hw_nand_oob_p4k;

    - ecc's amount/location/... will be different for different page size of flash( such as 2k, 4k). basically it's the same in UBL, UBoot, Kernel...

     

  • But sometimes mtd->read(0x800 bytes from 0x355f800) returned ECC error happened.

    - did you mean you didn't see the messages during bootup every time?

       if you saw that every time, did you see "always the same" messages?

  • Hi , Jack,

    Sorry for late reply.

    I see the message "mtd-read(0x800 bytes from 0x355f800) return ECC error" during bootup every time.

    and the messages is the same every time.

    The page size of our nand flash is 2K bytes.

    So I have modify the nand->ecc.steps = 4 and nand->ecc.layout = &hw_nand_oob_p2k, but result is the same.

    BTW,  what effects when I execute:

    $ U-BOOT # nandecc hw 2

    Is it necessary before I flash jffs2 root filesystem to nand flash?

    Thank you very much!

    Regards,

    Steven