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.

omap-l137 kernel cannot create nand partitions

Other Parts Discussed in Thread: OMAP-L137, PCF8574, DA8XX, TSC2004

Hello,

I am trying to get a jffs file system in the nand device. I have successfully configured and flashed UBL, uboot, and kernel image to nand and these are booting up just fine. For now I am nfs mounting the file system from my development PC.

I have reached the point where I need to configure the kernel to create the nand partitions and use the nand driver for these. I have not been successful as the kernel is still using SPI flash as the main MTD device. I have run menuconfig and enabled the nand on SoC but still only get the SPI flash mtd. I.e., when I try to flash rootfs.jffs2.tar.gz I get an error because the 30M filesystem won't fit on the 2M spi flash. Also, when booting with bootargs describing the rootfs in nand the kernel panics as it cannot find the fs, I think because it is still looking in spi flash.

thanks for any help you can give!

Dan

  • Hi,

    Could you please attach your board file located at "arch/arm/mach-davinci/board-da830-evm.c" & complete bootup logs,

  • Hi Titus,

    Here is the bootup and a look at the stock fstab. The board file is attached, but is is not modified. I have found that CONFIG_DA830_UI_NAND (if that is necessary)4643.board-da830-evm.c still is not defined even after running menuconfig.

    Booting with TI UBL
    Device OPP (300MHz, 1.2V)Booting U-Boot from block 2.


    U-Boot 2009.11-svn8354 (Apr 30 2014 - 08:10:01)

    I2C:   ready
    DRAM:  64 MB
    NAND:  512 MiB
    Bad block table found at page 262080, version 0x01
    Bad block table found at page 262016, version 0x01
    nand_read_bbt: Bad block at 0x000005ea0000
    nand_read_bbt: Bad block at 0x00000a6a0000
    nand_read_bbt: Bad block at 0x00001f4e0000
    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock : 300000000 Hz
    Net:   More than one PHY detected.

    Hit any key to stop autoboot:  0

    Loading from NAND 512MiB 3,3V 8-bit, offset 0xc0000
       Image Name:   Linux-2.6.33-rc4
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1666392 Bytes =  1.6 MB
       Load Address: c0008000
       Entry Point:  c0008000
    ## Booting kernel from Legacy Image at c0700000 ...
       Image Name:   Linux-2.6.33-rc4
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1666392 Bytes =  1.6 MB
       Load Address: c0008000
       Entry Point:  c0008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    Linux version 2.6.33-rc4 (dedmondson@Hertz) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 PREEMPT Fri May 2 07:56:35 EDT 2014
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    CPU: VIVT data cache, VIVT instruction cache
    Machine: DaVinci DA830/OMAP-L137/AM17xx EVM
    Memory policy: ECC disabled, Data cache writethrough
    DaVinci da830/omap-l137 rev2.0 variant 0x9
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
    Kernel command line: mem=64M console=ttyS2,115200n8 noinitrd rw ip=192.168.2.200 root=/dev/nfs nfsroot=192.168.2.224:/home/dedmondson/fs_work/arago
    PID hash table entries: 256 (order: -2, 1024 bytes)
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Memory: 64MB = 64MB total
    Memory: 61364KB available (3136K code, 236K data, 132K 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... 149.50 BogoMIPS (lpj=747520)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    DaVinci: 128 gpio irqs
    NET: Registered protocol family 16
    bio: create slab <bio-0> at 0
    SCSI subsystem initialized
    pcf857x 1-003f: gpios 144..151 on a pcf8574
    Switching to clocksource timer0_0
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 2048 (order: 2, 16384 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    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.
    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    msgmni has been set to 119
    io scheduler noop registered (default)
    da8xx_lcdc da8xx_lcdc.0: GLCD: Found Sharp_LK043T1DG01 panel
    Console: switching to colour frame buffer device 60x34
    Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25) is a 16550A
    serial8250.0: ttyS1 at MMIO 0x1d0c000 (irq = 53) is a 16550A
    serial8250.0: ttyS2 at MMIO 0x1d0d000 (irq = 61) is a 16550A
    console [ttyS2] enabled
    brd: module loaded
    at24 1-0050: 32768 byte 24c256 EEPROM (writable)
    Read MAC addr from EEPROM: 00:0e:99:03:13:bc
    spi_davinci spi_davinci.0: DaVinci SPI driver in EDMA mode
    Using RX channel = 14 , TX channel = 15 and event queue = 1
    m25p80 spi0.0: w25x32 (4096 Kbytes)
    Creating 3 MTD partitions on "m25p80":
    0x000000000000-0x000000040000 : "U-Boot"
    0x000000040000-0x000000044000 : "U-Boot Environment"
    0x000000044000-0x000000400000 : "Linux"
    spi_davinci spi_davinci.0: Controller at 0xfec41000
    console [netcon0] enabled
    netconsole: network logging started
    input: TSC2004 Touchscreen as /devices/virtual/input/input0
    omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
    omap_rtc: RTC power up reset detected
    omap_rtc: already running
    i2c /dev entries driver
    watchdog watchdog: heartbeat 60 sec
    TCP cubic registered
    NET: Registered protocol family 17
    Clocks: disable unused mmcsd
    Clocks: disable unused spi1
    Clocks: disable unused ecap0
    Clocks: disable unused pwm0
    Clocks: disable unused eqep0
    Clocks: disable unused mcasp0
    Clocks: disable unused mcasp1
    Clocks: disable unused mcasp2
    Clocks: disable unused usb20
    Clocks: disable unused aemif
    Clocks: disable unused emac
    Clocks: disable unused i2c1
    Clocks: disable unused usb11
    emac-mii: probed
    omap_rtc omap_rtc: setting system clock to 2000-02-02 11:48:36 UTC (949492116)
    IP-Config: Guessing netmask 255.255.255.0
    IP-Config: Complete:
         device=eth0, addr=192.168.2.200, mask=255.255.255.0, gw=255.255.255.255,
         host=192.168.2.200, domain=, nis-domain=(none),
         bootserver=255.255.255.255, rootserver=192.168.2.224, rootpath=
    Looking up port of RPC 100003/2 on 192.168.2.224
    Looking up port of RPC 100005/1 on 192.168.2.224
    VFS: Mounted root (nfs filesystem) on device 0:12.
    Freeing init memory: 132K
    INIT: version 2.86 booting
    Please wait: booting...
    Starting udev
    Remounting root file system...
    Caching udev devnodes
    Populating dev cache
    ipv6: disagrees about version of symbol module_layout
    logger: mount: mount point /proc/bus/usb does not exist
    NOT configuring network interfaces: / is an NFS mount
    Mon May  3 22:32:00 UTC 2010
    INIT: Entering runlevel: 5
    Starting telnet daemon.
    Starting syslogd/klogd: ipv6: disagrees about version of symbol module_layout
    done
    Starting thttpdipv6: disagrees about version of symbol module_layout
    .
    ipv6: disagrees about version of symbol module_layout

     _____                    _____           _         _
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
                  |___|                    |___|

    Arago Project http://arago-project.org arago ttyS2

    Arago 2010.03 arago ttyS2

    arago login: root
    root@arago:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00040000 00001000 "U-Boot"
    mtd1: 00004000 00001000 "U-Boot Environment"
    mtd2: 003bc000 00001000 "Linux"
    root@arago:~# cat /etc/fstab
    # stock fstab - you probably want to override this with a machine specific one

    rootfs               /                    auto       defaults              1  1
    #/dev/mtdblock4       /                    jffs2      defaults              1  1
    proc                 /proc                proc       defaults              0  0
    devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
    usbfs                /proc/bus/usb        usbfs      defaults              0  0
    tmpfs                /var/volatile        tmpfs      defaults,size=16M     0  0
    tmpfs                /dev/shm             tmpfs      mode=0777             0  0
    tmpfs                /media/ram           tmpfs      defaults,size=16M     0  0

    # uncomment this if your device has a SD/MMC/Transflash slot
    #/dev/mmcblk0p1       /media/card          auto       defaults,sync,noauto  0  0

    root@arago:~#
    root@arago:~#

  • Hi Dan,

    I forgot to ask you that What kind of board are you using EVM or custom?

    If you are using EVM, then you need daughter board(UI) that why we have defined "CONFIG_DA830_UI_NAND"

    If custom, We need to change it accordingly.

  • Right now I'm using evm with the UI extended card (spectrum digital, rev H), which is where the nand is located. I have also disabled the MMC/SD so there is no conflict. I am using DaVinci-PSP-DSK-03.20.00.14.

    We are building a custom board based on this processor so at some point I may also need to modify the board file for the kernel.

    That bootup log is for the nfs filesystem boot. I need to use mtdblock 3 or 4 for the flash fs boot, but they obviously are not on the nand device yet. So the kernel panics when it gets to the fs mount step.

    Dan

  • Hi,

    Your log seems to be the nand support was not enabled and attach your error logs.

    I presume that you are using custom board.

    1) Enable NAND flash support in menuconfig.

    2) Disable MMC/SD support in menuconfig to avoid conflict (pinmux)

    3) Use the Attached board file.

    http://processors.wiki.ti.com/index.php/Building_03.22_PSP_release_Components_for_OMAP-L138#NAND

    3582.4643.board-da830-evm.c

    Please Let me know the status,

    If any issues, kindly attach your logs & don't text paste on thread.

  • Hi,

    What is your EVM board?

    ie LogicPD or DA830 SDI board?

    If EVM board then you no need to do code changes on board file.

    If you are using OMAPL137 EVM board, Here is the linux kernel configurations for NAND

    cd linux-source

    make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi    ---->


    System Type  --->


    TI DaVinci Implementations  --->


    Select DA830/OMAP-L137/AM17x UI board peripheral ----> [Press Enter Here]


    Select DA830/OMAP-L137/AM17x UI board peripheral (NAND flash)  --->

    Note:

    Disable the MMC/SD support.

  • Titus,

    I get a build error on the board file. The variable gpio in da830_evm_init is not defined in the call to da830_evm_init_nand. 

    It looks like da830_evm_init_nand is usually called by da830_evm_ui_expander_setup which takes gpio as an argument.


    Dan

  • Hi,

    To avoid build error,

    Change the line "da830_evm_init_nand(gpio + 6);"  to   "da830_evm_init_nand();"

    and "static inline void da830_evm_init_nand(int mux_mode)" to "static inline void da830_evm_init_nand()"

    Comment out "gpio_direction_output(mux_mode, 1);"

    0160.4643.board-da830-evm.c

  • Titus,

    I took out the argument and also commented out the call to gpio_direction_ouput in da830_evm_init_nand since there is nothing to pass in. The kernel will not boot at all.

    I commented out the call to da830_evm_init_nand and the kernel boots up.

  • Hi,

    Now, On What board are you trying to enable NAND support?

    What is your NAND bus data width?

    What is your CS no.?

    Have you disabled the MMC/SD support completely?

    1) Comment out the "da830_evm_init_mmc();" in __int call.

    2) Try to append the below function before NAND platform registration.

    static void __init da830_evm_init_nand_pre(void)
    {
        void __iomem *aemif_addr;
        u32 ce3cfg;

        aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);

        ce3cfg = 0
            | (0 << 31)    /* selectStrobe */
            | (0 << 30)    /* extWait */
            | (0 << 26)    /* writeSetup */
            | (3 << 20)    /* writeStrobe  30 ns */
            | (3 << 17)    /* writeHold    30 ns */
            | (2 << 13)    /* readSetup    20 ns */
            | (4 << 7)    /* readStrobe   40 ns */
            | (0 << 4)    /* readHold */
            | (0 << 2)    /* turnAround */
            | (0 << 0)    /* asyncSize    8-bit bus */
            ;

        writel(ce3cfg, aemif_addr + DA8XX_AEMIF_CE3CFG_OFFSET);

        iounmap(aemif_addr);
    }

    static inline void da830_evm_init_nand()
    {
        int ret;

        ret = da8xx_pinmux_setup(da830_evm_emif25_pins);
        if (ret)
            pr_warning("######### da830_evm_init: emif25 mux setup failed: %d\n",
                    ret);

        da830_evm_init_nand_pre();

        ret = platform_device_register(&da830_evm_nand_device);
        if (ret)
            pr_warning("######### da830_evm_init: NAND device not registered.\n");

    //    gpio_direction_output(mux_mode, 1);
    }

    da830_evm_init_nand();

  • Titus,

    The board is EVMAM1707 from Spectrum Digital, with the UI board that has nand, nor, and an lcd display. The bus is 8-bit and it is on AEMIF cs3. MMC/SD is disabled.

    These changes do boot up now and I see the 5 partitions named in the da830_evm_nand_partitions struct. However, they are still being created on the SPI eeprom by the spi driver, not nand.

    m25p80 spi0.0: w25x32 (4096 Kbytes)
    Creating 5 MTD partitions on "m25p80":
    0x000000000000-0x000000020000 : "u-boot env"
    0x000000020000-0x000000040000 : "UBL"
    0x000000040000-0x0000000c0000 : "u-boot"
    0x0000000c0000-0x0000002e0000 : "kernel"
    0x0000002e0000-0x0000013e0000 : "filesystem"
    mtd: partition "filesystem" extends beyond the end of device "m25p80" -- size truncated to 0x120000

  • Now it will not boot up with the changes. It looks like it is hanging up in the platform_device_register for the nand.

  • Hi,

    Have you tried  to enable the UI NAND support in your kernel configuration like this?

    cd DaVinci-PSP-SDK-03.22.00.06/src/kernel/linux-davinci

    make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    System Type  --->

    TI DaVinci Implementations  --->.

    Select DA830/OMAP-L137/AM17x UI board peripheral (LCD)  --->


    │ │                  ( ) LCD                                     │ │  
    │ │                 (X) NAND flash                          │ │  
    │ │                 ( ) DVI-VGA Display (Adapter)     │ │ 
     



    Select DA830/OMAP-L137/AM17x UI board peripheral (NAND flash)  --->

    Note:

    Disable the MMC/SD support.

    Refer the following TI wiki.

    http://processors.wiki.ti.com/index.php/Restoring/Flashing_OMAP-L137_Bootloaders#Booting_from_NAND_Flash

  • HelloTitus,

    Yes. I have selected those options and grepping shows CONFIG_DA830_UI_NAND is defined in include/config/auto.conf and in include/generated/autoconf.h.

    Under drivers/mtd/nand I see davinci_nand.o, nand_base.o,nand_bbt.o, nand_ecc.o, nand_ids.o and nand.o

    I am working on getting an emulator running vmlinux image to see if I can find out what is going on.

  • Hi Dan,

    I hope that you no need to change anything( board file changes)  If you are using SDI EVM board.

    Do not edit any "include/config/auto.conf and in include/generated/autoconf.h" files and you must to choose the option "CONFIG_DA830_UI_NAND" through "make menuconfig" only.

  • Titus,

    I am only using menuconfig to set parameters. The menu looks different that yours but I am using kernel v2.6.33-rc4.

    I started with make da830_omapl137_defconfig.

    Then, in menuconfig I am changing the following:


    System Type --->

         Ti Davinci Implementations --->

              Ti DA830/OMAP-L137/AM17xx Reference Platform  (enabled)

                   Select Da830/OMAP-L137/AM17xx UI board peripheral (NAND flash)  ---->

                        NAND flash   (enabled)

    Nand Device Support -->

         Support Nand on Davinci SoC  (enabled)

    MTD Support --->

         Command line partition table parsing  (enabled)

    Device Drivers --->

         Sound Card support (disabled)

         HID Devices               (disabled)

         USB Support              (disabled)

         MMC/SD/SDIO card support   (disabled)

    Kernel hacking --->

         Kernel Debugging     (enabled)

         Compile the kernel with debug info     (enabled)

         enable Stack unwinding support    (enabled)

         Kernel low-level debugging functions  (enabled)

              Early printk     (enabled)

    I am back to getting the kernel to boot with the changes we made to the board file. I see partitions taken from the da830_evm_nand_partitions[] data structure, but they are created on the SPI flash device. I don't see any reference to a nand.0 anywhere.

    spi_davinci spi_davinci.0: DaVinci SPI driver in EDMA mode
    Using RX channel = 14 , TX channel = 15 and event queue = 1
    m25p80 spi0.0: w25x32 (4096 Kbytes)
    Creating 5 MTD partitions on "m25p80":
    0x000000000000-0x000000020000 : "u-boot env"
    0x000000020000-0x000000040000 : "UBL"
    0x000000040000-0x0000000c0000 : "u-boot"
    0x0000000c0000-0x0000002e0000 : "kernel"
    0x0000002e0000-0x0000013e0000 : "filesystem"
    mtd: partition "filesystem" extends beyond the end of device "m25p80" -- size truncated to 0x120000
    spi_davinci spi_davinci.0: Controller at 0xfec41000
    console [netcon0] enabled

  • Titus,

    I have PSP SDK 03.20.00.14 which includes kernel v2.6.33-rc4.  Do you think it worth my time to try 03.22.00.04 SDK which has kernel v3.3.0?


    thanks, Dan

  • Titus,

    This works perfectly for me with SDK-03.22.00.06!  :-) And no changes other than the basic menuconfig we discussed.

    Creating 4 MTD partitions on "davinci_nand.1":
    0x000000000000-0x000000020000 : "bootloader"
    0x000000020000-0x000000040000 : "params"
    0x000000040000-0x000000240000 : "kernel"
    0x000000240000-0x000020000000 : "filesystem"
    davinci_nand davinci_nand.1: controller rev. 2.5
    spi_davinci spi_davinci.0: DMA: supported
    spi_davinci spi_davinci.0: DMA: RX channel: 14, TX channel: 15, event queue: 0
    m25p80 spi0.0: w25x32 (4096 Kbytes)
    Creating 5 MTD partitions on "m25p80":
    0x000000000000-0x000000002000 : "DSP-UBL"
    0x000000002000-0x000000008000 : "ARM-UBL"
    0x000000008000-0x000000040000 : "U-Boot"
    0x000000040000-0x000000044000 : "U-Boot-Environment"
    0x000000044000-0x000000400000 : "Kernel"

  • Hi Dan,

    Sounds good.

    Sorry, I forgot to ask you that what SDK are you using. And I though you are using the latest SDK (kernel 3.3)

    Anyway, Thanks for your update.