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.

change partitions in nand flash

7635.board-am335xevm.cHi guys, 

I changed the nand configuration to increase the number of partitions, archive:
                                ti-sdk-am335x-evm-05.06.00.00/board-support/linux-3.2.0-psp05.06.00.00/arch/arm/mach-omap2/board-am335xevm.c

attached is the file: board-am335xevm.c

but this modification results in the below  error:

...

VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

[ 2.723022] Please append a correct "root=" boot option; here are the available partitions:
[ 2.731781] 1f00 128 mtdblock0 (driver?)
[ 2.737060] 1f01 128 mtdblock1 (driver?)
[ 2.742340] 1f02 128 mtdblock2 (driver?)
[ 2.747589] 1f03 128 mtdblock3 (driver?)
[ 2.752899] 1f04 1920 mtdblock4 (driver?)
[ 2.758148] 1f05 128 mtdblock5 (driver?)
[ 2.763427] 1f06 5120 mtdblock6 (driver?)
[ 2.768707] 1f07 124672 mtdblock7 (driver?)
[ 2.773986] 1f08 5120 mtdblock8 (driver?)
[ 2.779266] 1f09 124672 mtdblock9 (driver?)
[ 2.784545] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

...

  • Hi Daniel,

    Have you set the mtdparts variable in U-Boot accordingly? Also the nandsrcaddr and nandroot variables?

    I see you are trying to have a dual NAND boot. Is your NAND flash size 256MB?

    If it is, then please show the whole boot log.

    You will most probably have the following error inside it:

    UBI error: vtbl_check: volume table check failed: record 0, error 9

    This means that the reserved PEBs are more than the good/available PEBs in your NAND flash.

    I believe that this is happening because the UBIFS is trying to use more NAND memory than there is available, because you have one more kernel image and one more ubi.img which take up more space (In the case with 256MB NAND flash size).

    I tried using 2 kernel images with only one UBI file system and it seems like it is working, except for the matrix browser. Perhaps with bigger NAND flash it would be possible without errors.

    These are the last 3 entries in the am335x_nand_partitions[] structure inside the board file:

        {
            .name           = "Kernel 1",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
            .size           = 40 * SZ_128K,
        },
        {
            .name           = "Kernel 2",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
            .size           = 40 * SZ_128K,
        },
        {
            .name           = "File System",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0xc80000 */
            .size           = MTDPART_SIZ_FULL,
        },

    This is how I program the NAND flash and then set the U-Boot variables:

    U-Boot# nand erase.chip

    NAND erase.chip: device 0 whole chip
    Erasing at 0xffe0000 -- 100% complete.
    OK
    U-Boot# mmc rescan
    U-Boot# fatload mmc 0 0x81000000 MLO
    reading MLO

    85861 bytes read
    U-Boot# cp.b 0x81000000 0x81020000 20000
    U-Boot# cp.b 0x81000000 0x81040000 20000
    U-Boot# cp.b 0x81000000 0x81060000 20000
    U-Boot# fatload mmc 0 0x81080000 u-boot.img
    reading u-boot.img

    355376 bytes read
    U-Boot# fatload mmc 0 0x81280000 uImage
    reading uImage

    3189720 bytes read
    U-Boot# fatload mmc 0 0x81780000 uImage
    reading uImage

    3189720 bytes read
    U-Boot# fatload mmc 0 0x81c80000 ubi.img
    reading ubi.img

    25690112 bytes read
    U-Boot# nand write 0x81000000 0x0 0x3000000

    NAND write: device 0 offset 0x0, size 0x3000000
     50331648 bytes written: OK
    U-Boot# setenv mtdparts mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel1),5m(kernel2),-(rootfs)
    U-Boot# mtdparts

    device nand0 <omap2-nand.0>, # parts = 9
     #: name        size        offset        mask_flags
     0: SPL                 0x00020000    0x00000000    0
     1: SPL.backup1         0x00020000    0x00020000    0
     2: SPL.backup2         0x00020000    0x00040000    0
     3: SPL.backup3         0x00020000    0x00060000    0
     4: u-boot              0x001e0000    0x00080000    0
     5: u-boot-env          0x00020000    0x00260000    0
     6: kernel1             0x00500000    0x00280000    0
     7: kernel2             0x00500000    0x00780000    0
     8: rootfs              0x0f380000    0x00c80000    0

    active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000

    defaults:
    mtdids  : nand0=omap2-nand.0
    mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)
    U-Boot# setenv nandsrcaddr 0x280000
    U-Boot# setenv nandroot ubi0:rootfs rw ubi.mtd=8,2048
    U-Boot# run nandboot

    Best regards,
    Miroslav

  • Hi,

    The kit has 256MB of flash size. I reviewed the proceeding, but not found mistakes. Attached is the boot log and the environment variables. The ubi image is based on ../ti-sdk-am335x-evm-05.06.00.00/filesystem/arago-base-tisdk-image-am335x-evm.tar.gz, in other words, the two filesystem images totaling more less 64MB.

    The commands used to generate ubi filesystem were:

    mkfs.ubifs -q -r base-rootfs-am335x-evm -m 2048 -e 131072 -c 1988 -o ubifs.img
    ubinize -o ubi.img -m 2048 -p 128KuB -s 512 
    
    
    please, let me know if you see the inconsistency.
    
    
    
    
    
    U-Boot# printenv
    baudrate=115200
    bootargs_defaults=setenv bootargs console=${console} ${optargs}
    bootcmd=if mmc rescan ${mmcdev}; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};r
    un importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loaduimagefat; then run mmcboot;elif run loaduima
    ge; then run mmcboot;else echo Cound not find ${bootfile} ;fi;else run nandboot;fi;
    bootdelay=3
    bootenv=uEnv.txt
    bootfile=uImage
    console=ttyO0,115200n8
    dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel part 0 7;rootfs part 0 8
    ethact=cpsw
    ethaddr=00:18:31:e0:9a:d1
    fdtaddr=0x80F80000
    filesize=1880000
    importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
    ip_method=none
    kloadaddr=0x80007fc0
    loadaddr=0x80200000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz
    loaduimage=ext2load mmc ${mmcdev}:2 ${kloadaddr} /boot/${bootfile}
    loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}
    mmcargs=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmcroot} rootfstype=${mmcrootfstype} ip=${ip_method}
    mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${kloadaddr}
    mmcdev=0
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext3 rootwait
    mtdids=nand0=omap2-nand.0
    mtdparts=mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel1),1246
    72k(File System1),5m(kernel2),124672k(File System2)
    nandargs=run bootargs_defaults;setenv bootargs ${bootargs} root=${nandroot} noinitrd rootfstype=${nandrootfstype} ip=${ip_method}
    nandboot=echo Booting from nand ...; run nandargs; nand read.i ${kloadaddr} ${nandsrcaddr} ${nandimgsize}; bootm ${kloadaddr}
    nandimgsize=0x500000
    nandroot=ubi0:rootfs rw ubi.mtd=7,2048
    nandrootfstype=ubifs rootwait=1
    nandsrcaddr=0x280000
    netargs=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run netargs; bootm ${kloadaddr}
    nfsopts=nolock
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootm ${loadaddr}
    ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
    ramrootfstype=ext2
    rdaddr=0x81000000
    rootpath=/export/rootfs
    spiargs=run bootargs_defaults;setenv bootargs ${bootargs} rootfstype=${spirootfstype} ip=${ip_method}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${kloadaddr} ${spisrcaddr} ${spiimgsize}; bootm ${kloadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0x80000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=00:18:31:e0:9a:d1
    ver=U-Boot 2012.10 (Dec 16 2012 - 13:54:10)
    
    
    
    
    
    U-Boot 2012.10 (Dec 16 2012 - 13:54:10)
    
    I2C:   ready
    DRAM:  512 MiB
    WARNING: Caches not enabled
    NAND:  256 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0 
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Peripheral mode controller at 47401000 using PIO, IRQ 0
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0 
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Host mode controller at 47401800 using PIO, IRQ 0
    Net:   cpsw, usb_ether
    Hit any key to stop autoboot:  0 
    mmc_send_cmd : timeout: No status update
    Card did not respond to voltage select!
    Booting from nand ...
    
    NAND read: device 0 offset 0x280000, size 0x500000
     5242880 bytes read: OK
    ## Booting kernel from Legacy Image at 80007fc0 ...
       Image Name:   Linux-3.2.0
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    3169240 Bytes = 3 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       XIP Kernel Image ... OK
    OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 3.2.0 (formolo@formolo-OptiPlex-755) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Mon May 27 11:35:49 BRT 
    2013
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: am335xevm
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] AM335X ES1.0 (sgx neon )
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 noinitrd rootfstype=ubifs rootwait=1 ip=none
    [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Memory: 512MB = 512MB total
    [    0.000000] Memory: 513144k/513144k available, 11144k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc05a0000   (5728 kB)
    [    0.000000]       .init : 0xc05a0000 - 0xc05de000   ( 248 kB)
    [    0.000000]       .data : 0xc05de000 - 0xc0646488   ( 418 kB)
    [    0.000000]        .bss : 0xc06464ac - 0xc0673364   ( 180 kB)
    [    0.000000] NR_IRQS:396
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] Total of 128 interrupts on 1 active controller
    [    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
    [    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
    [    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms
    [    0.000000] Console: colour dummy device 80x30
    [    0.000152] Calibrating delay loop... 718.02 BogoMIPS (lpj=3590144)
    [    0.058959] pid_max: default: 32768 minimum: 301
    [    0.059082] Security Framework initialized
    [    0.059173] Mount-cache hash table entries: 512
    [    0.059539] CPU: Testing write buffer coherency: ok
    [    0.080078] omap_hwmod: pruss: failed to hardreset
    [    0.081207] print_constraints: dummy: 
    [    0.081573] NET: Registered protocol family 16
    [    0.083740] OMAP GPIO hardware version 0.1
    [    0.086364] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.088317]  omap_i2c.1: alias fck already exists
    [    0.089263]  omap2_mcspi.1: alias fck already exists
    [    0.089508]  omap2_mcspi.2: alias fck already exists
    [    0.090423]  edma.0: alias fck already exists
    [    0.090454]  edma.0: alias fck already exists
    [    0.090454]  edma.0: alias fck already exists
    [    0.116973] bio: create slab <bio-0> at 0
    [    0.119293] SCSI subsystem initialized
    [    0.120910] usbcore: registered new interface driver usbfs
    [    0.121215] usbcore: registered new interface driver hub
    [    0.121398] usbcore: registered new device driver usb
    [    0.121551] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
    [    0.121856] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
    [    0.122955] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
    [    0.124816] tps65910 1-002d: JTAGREVNUM 0x0
    [    0.127227] print_constraints: VRTC: 
    [    0.128723] print_constraints: VIO: at 1800 mV 
    [    0.131103] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal 
    [    0.133453] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal 
    [    0.134490] print_constraints: VDD3: 5000 mV 
    [    0.135925] print_constraints: VDIG1: at 1800 mV 
    [    0.137359] print_constraints: VDIG2: at 1800 mV 
    [    0.138824] print_constraints: VPLL: at 1800 mV 
    [    0.140289] print_constraints: VDAC: at 1800 mV 
    [    0.141723] print_constraints: VAUX1: at 1800 mV 
    [    0.143188] print_constraints: VAUX2: at 3300 mV 
    [    0.144653] print_constraints: VAUX33: at 3300 mV 
    [    0.146087] print_constraints: VMMC: at 3300 mV 
    [    0.146606] tps65910 1-002d: No interrupt support, no core IRQ
    [    0.147827] Advanced Linux Sound Architecture Driver Version 1.0.24.
    [    0.148956] Switching to clocksource gp timer
    [    0.164367] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
    [    0.164550] musb-hdrc musb-hdrc.0: dma type: pio
    [    0.164886] MUSB0 controller's USBSS revision = 4ea20800
    [    0.165527] musb-hdrc musb-hdrc.0: USB OTG mode controller at e083c000 using PIO, IRQ 18
    [    0.165679] musb-hdrc musb-hdrc.1: dma type: pio
    [    0.165985] MUSB1 controller's USBSS revision = 4ea20800
    [    0.166168] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [    0.166229] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
    [    0.166381] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    0.166381] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    0.166412] usb usb1: Product: MUSB HDRC host driver
    [    0.166412] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
    [    0.166442] usb usb1: SerialNumber: musb-hdrc.1
    [    0.167205] hub 1-0:1.0: USB hub found
    [    0.167236] hub 1-0:1.0: 1 port detected
    [    0.167755] musb-hdrc musb-hdrc.1: USB Host mode controller at e083e800 using PIO, IRQ 19
    [    0.168182] NET: Registered protocol family 2
    [    0.168365] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.168701] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
    [    0.169006] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.169250] TCP: Hash tables configured (established 16384 bind 16384)
    [    0.169250] TCP reno registered
    [    0.169281] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.169281] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.169464] NET: Registered protocol family 1
    [    0.169738] RPC: Registered named UNIX socket transport module.
    [    0.169738] RPC: Registered udp transport module.
    [    0.169769] RPC: Registered tcp transport module.
    [    0.169769] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.170013] NetWinder Floating Point Emulator V0.97 (double precision)
    [    0.191284] VFS: Disk quotas dquot_6.5.2
    [    0.191345] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.191894] msgmni has been set to 1002
    [    0.195129] alg: No test for stdrng (krng)
    [    0.195800] io scheduler noop registered
    [    0.195800] io scheduler deadline registered
    [    0.195861] io scheduler cfq registered (default)
    [    0.197082] Could not set LED4 to fully on
    [    0.198852] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
    [    0.822143] console [ttyO0] enabled
    [    0.826385] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    [    0.834228] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    [    0.842041] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    [    0.849822] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    [    0.857574] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    [    0.865844] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
    [    0.882171] brd: module loaded
    [    0.890228] loop: module loaded
    [    0.893676] i2c-core: driver [tsl2550] using legacy suspend method
    [    0.900146] i2c-core: driver [tsl2550] using legacy resume method
    [    0.906585] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
    [    0.920654] Detected a daughter card on AM335x EVM..
    [    0.925659] CPLD version: CPLD1.0F
    [    0.929412] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
    [    0.944793] Board name: A33515BB
    [    0.948150] Board version: 1.2A
    [    0.951446] SKU: SKU#01
    [    0.954528] The board is general purpose EVM in profile 0
    [    0.961212]  da8xx_lcdc.0: alias fck already exists
    [    0.966705] da8xx_lcdc da8xx_lcdc.0: GLCD: Found TFC_S9700RTWV35TR_01B panel
    [    0.990386] Console: switching to colour frame buffer device 100x30
    [    1.007049] omap-gpmc omap-gpmc: GPMC revision 6.0
    [    1.012084] Registering NAND on CS0
    [    1.016448]  omap_i2c.2: alias fck already exists
    [    1.021728] omap_i2c omap_i2c.2: bus 2 rev2.4.0 at 100 kHz
    [    1.028167] tsl2550 2-0039: standard operating mode
    [    1.033996] tsl2550 2-0039: support ver. 1.2 enabled
    [    1.040008]  davinci-mcasp.1: alias fck already exists
    [    1.045837]  omap_hsmmc.0: alias fck already exists
    [    1.051300]  omap_hsmmc.2: alias fck already exists
    [    1.056701] Configure Bluetooth Enable pin...
    [    1.062683] registered am33xx_sr device
    [    1.066925] _regulator_get: 2-0018 supply Vdd not found, using dummy regulator
    [    1.074584] _regulator_get: 2-0018 supply Vdd_IO not found, using dummy regulator
    [    1.103027] lis3lv02d: 8 bits 3DLH sensor found
    [    1.199981] input: ST LIS3LV02DL Accelerometer as /devices/platform/lis3lv02d/input/input0
    [    1.211791] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.219085] omap2-nand driver initializing
    [    1.223724] ONFI flash detected
    [    1.227111] ONFI param page 0 valid
    [    1.230773] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G08ABAEAWP)
    [    1.239349] Creating 10 MTD partitions on "omap2-nand.0":
    [    1.245025] 0x000000000000-0x000000020000 : "SPL"
    [    1.251373] 0x000000020000-0x000000040000 : "SPL.backup1"
    [    1.258209] 0x000000040000-0x000000060000 : "SPL.backup2"
    [    1.265136] 0x000000060000-0x000000080000 : "SPL.backup3"
    [    1.272064] 0x000000080000-0x000000260000 : "U-Boot"
    [    1.279205] 0x000000260000-0x000000280000 : "U-Boot Env"
    [    1.286102] 0x000000280000-0x000000780000 : "Kernel1"
    [    1.294708] 0x000000780000-0x000008140000 : "File System1"
    [    1.352203] 0x000008140000-0x000008640000 : "Kernel2"
    [    1.360748] 0x000008640000-0x000010000000 : "File System2"
    [    1.418395] OneNAND driver initializing
    [    1.423187] UBI: attaching mtd7 to ubi0
    [    1.427215] UBI: physical eraseblock size:   131072 bytes (128 KiB)
    [    1.433776] UBI: logical eraseblock size:    126976 bytes
    [    1.439392] UBI: smallest flash I/O unit:    2048
    [    1.444305] UBI: VID header offset:          2048 (aligned 2048)
    [    1.450561] UBI: data offset:                4096
    [    2.492065] UBI: max. sequence number:       0
    [    2.507904] UBI error: vtbl_check: volume table check failed: record 0, error 9
    [    2.515930] UBI error: ubi_init: cannot attach mtd7
    [    2.521850] CAN device driver interface
    [    2.525848] CAN bus driver for Bosch D_CAN controller 1.0
    [    2.579711] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    [    2.586151] davinci_mdio davinci_mdio.0: detected phy mask fffffffe
    [    2.593597] davinci_mdio.0: probed
    [    2.597167] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
    [    2.604888] usbcore: registered new interface driver zd1201
    [    2.610900] usbcore: registered new interface driver cdc_ether
    [    2.617126] usbcore: registered new interface driver cdc_eem
    [    2.623199] usbcore: registered new interface driver dm9601
    [    2.629058] cdc_ncm: 04-Aug-2011
    [    2.632598] usbcore: registered new interface driver cdc_ncm
    [    2.638488] Initializing USB Mass Storage driver...
    [    2.643798] usbcore: registered new interface driver usb-storage
    [    2.650085] USB Mass Storage support registered.
    [    2.655364] mousedev: PS/2 mouse device common for all mice
    [    2.662139] input: matrix-keypad as /devices/platform/matrix-keypad/input/input1
    [    2.671142] input: ti-tsc as /devices/platform/omap/ti_tscadc/tsc/input/input2
    [    2.679748] omap_rtc am33xx-rtc: rtc core: registered am33xx-rtc as rtc0
    [    2.686920] i2c /dev entries driver
    [    2.691223] Linux video capture interface: v2.00
    [    2.696380] usbcore: registered new interface driver uvcvideo
    [    2.702392] USB Video Class driver (1.1.1)
    [    2.707550] lm75 2-0048: hwmon0: sensor 'tmp275'
    [    2.715362] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    2.724029] cpuidle: using governor ladder
    [    2.728790] cpuidle: using governor menu
    [    2.806793] omap4_aes_mod_init: loading AM33X AES driver
    [    2.812500] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
    [    2.819000] omap4_aes_probe: probe() done
    [    2.823699] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
    [    2.829833] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
    [    2.844360] mmc1: card claims to support voltages below the defined range. These will be ignored.
    [    2.854003] omap4_sham_probe: probe() done
    [    2.860931] usbcore: registered new interface driver usbhid
    [    2.866760] usbhid: USB HID core driver
    [    2.871398] usbcore: registered new interface driver snd-usb-audio
    [    2.880065] _regulator_get: 2-001b supply IOVDD not found, using dummy regulator
    [    2.887847] _regulator_get: 2-001b supply DVDD not found, using dummy regulator
    [    2.895568] _regulator_get: 2-001b supply AVDD not found, using dummy regulator
    [    2.903228] _regulator_get: 2-001b supply DRVDD not found, using dummy regulator
    [    2.913787] asoc: tlv320aic3x-hifi <-> davinci-mcasp.1 mapping ok
    [    2.921600] ALSA device list:
    [    2.924713]   #0: AM335X EVM
    [    2.927703] oprofile: hardware counters not available
    [    2.933013] oprofile: using timer interrupt.
    [    2.937469] nf_conntrack version 0.5.0 (8017 buckets, 32068 max)
    [    2.944335] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    2.950012] TCP cubic registered
    [    2.953369] NET: Registered protocol family 17
    [    2.958007] can: controller area network core (rev 20090105 abi 8)
    [    2.964569] NET: Registered protocol family 29
    [    2.969207] can: raw protocol (rev 20090105)
    [    2.973663] can: broadcast manager protocol (rev 20090105 t)
    [    2.979614] Registering the dns_resolver key type
    [    2.984619] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    2.992614] ThumbEE CPU extension supported.
    [    2.997131] mux: Failed to setup hwmod io irq -22
    [    3.002685] Power Management for AM33XX family
    [    3.007568] Trying to load am335x-pm-firmware.bin (60 secs timeout)
    [    3.014251] Copied the M3 firmware to UMEM
    [    3.018707] smartreflex smartreflex: am33xx_sr_probe: Zero NValue read from EFUSE
    [    3.026580] smartreflex: probe of smartreflex failed with error -22
    [    3.033721] sr_init: platform driver register failed
    [    3.044189] clock: disabling unused clocks to save power
    [    3.060638] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    [    3.068206] mmc1: new SDIO card at address 0001
    [    3.076690] Detected MACID=0:18:31:e0:9a:d1
    [    3.082092] cpsw: Detected MACID = 00:18:31:e0:9a:d2
    [    3.088867] input: gpio-keys as /devices/platform/gpio-keys/input/input3
    [    3.096557] omap_rtc am33xx-rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
    [    3.105834] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
    [    3.113189] Please append a correct "root=" boot option; here are the available partitions:
    [    3.121948] 1f00             128 mtdblock0  (driver?)
    [    3.127227] 1f01             128 mtdblock1  (driver?)
    [    3.132507] 1f02             128 mtdblock2  (driver?)
    [    3.137786] 1f03             128 mtdblock3  (driver?)
    [    3.143066] 1f04            1920 mtdblock4  (driver?)
    [    3.148345] 1f05             128 mtdblock5  (driver?)
    [    3.153625] 1f06            5120 mtdblock6  (driver?)
    [    3.158905] 1f07          124672 mtdblock7  (driver?)
    [    3.164184] 1f08            5120 mtdblock8  (driver?)
    [    3.169464] 1f09          124672 mtdblock9  (driver?)
    [    3.174743] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    [    3.183380] Backtrace: 
    [    3.185943] [<c0017978>] (dump_backtrace+0x0/0x110) from [<c0423c5c>] (dump_stack+0x18/0x1c)
    [    3.194763]  r6:df924000 r5:c05cf3ac r4:c06474c8 r3:c06007c8
    [    3.200683] [<c0423c44>] (dump_stack+0x0/0x1c) from [<c0423ccc>] (panic+0x6c/0x1a0)
    [    3.208679] [<c0423c60>] (panic+0x0/0x1a0) from [<c05a0cb4>] (mount_block_root+0x184/0x228)
    [    3.217407]  r3:c06007c8 r2:00000000 r1:df82df78 r0:c0500a10
    [    3.223327]  r7:00008000
    [    3.225952] [<c05a0b30>] (mount_block_root+0x0/0x228) from [<c05a0fd0>] (prepare_namespace+0xac/0x1d4)
    [    3.235687] [<c05a0f24>] (prepare_namespace+0x0/0x1d4) from [<c05a090c>] (kernel_init+0x124/0x130)
    [    3.245056]  r5:c05dd654 r4:c05dd654
    [    3.248809] [<c05a07e8>] (kernel_init+0x0/0x130) from [<c0041724>] (do_exit+0x0/0x67c)
    [    3.257049]  r5:c05a07e8 r4:00000000
    
    
    
    
    
    
  • Hi Daniel,

    You should read this and make all the calculations for your case: http://processors.wiki.ti.com/index.php/UBIFS_Support

    Best regards,
    Miroslav

  • Here is my (unfortunately unsuccessful) attempt to get it to work.

    First I added these lines to the nand_partitions structure inside the kernel board file:

        {
            .name           = "Kernel 1",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
            .size           = 40 * SZ_128K,
        },
        {
            .name           = "Kernel 2",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
            .size           = 40 * SZ_128K,
        },
        {
            .name           = "File System 1",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0xc80000 */
            .size           = SZ_64M+SZ_16M,
        },
        {
            .name           = "File System 2",
            .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x5c80000 */
            .size           = MTDPART_SIZ_FULL,
        },

    The partition table is the following: 5MB kernel1, 5MB kernel2, 80MB FS1, the rest is for FS2.

    Then I followed the UBIFS guide I mentioned to create a UBI file system for a smaller MTD device (64MB). Here are my steps and calculations:

    1) I used the filesystem archive provided in the TI SDK and extracted it to a ubifs/ folder.

    2) mkfs.ubifs -r ubifs/ -F -o ubifs.img -m 2048 -e 126976 -c 501

    -m 2048 is the minimum I/O unit = 2KB for the NAND used in the EVM
    -e 126976 is the LEB size which is PEB size minus 2 min. I/O units for overhead = 128K - 2*2K = 124K
    -c 501 is the max file system size in LEBs and it is calculated below (result is marked in red so that it is easy to spot)

    SP - PEB size = 128KB
    SL - LEB size = 124KB
    P - total PEBs on device/partition = 64MB / 128KB = 512
    B - PEBs reserved for bad PEB handling = 1% of P = ~6
    O - = SP - SL = 4KB

    UBI overhead = (B+4)*SP+O*(P-B-4) = (6+4)*128KB+4KB*(512-6-4) = 3288KB = ~26PEBs

    This leaves: 512 - 26 = 486 PEBs = 62208KB = ~61MB available data (this is to be used later in the ubinize.cfg file as vol_size)

    => 62208KB/SL = 62208KB/124KB = ~501 LEBs

    3) Create a ubinize.cfg file containing:

    [ubifs]
    mode=ubi
    image=ubifs.img
    vol_id=0
    vol_size=61MiB
    vol_type=static
    vol_name=rootfs

    vol_name is the name you will be using when setting the nandroot U-Boot variable later (I'll mark it in green.)

    4) Create ubi.img file with the following command:

    ubinize -o ubi.img -m 2048 -p 128KiB -O 2048 ubinize.cfg

    -m 2048 is the minimum flash I/O unit size (page)
    -p 128KiB is the size of one PEB
    -O 2048 is the VID header offset

    5) Execute the following commands to write your files to NAND and then set the environment:

    U-Boot# nand erase.chip

    NAND erase.chip: device 0 whole chip
    Erasing at 0xffe0000 -- 100% complete.
    OK
    U-Boot# mmc rescan
    U-Boot# fatload mmc 0 0x81000000 MLO
    reading MLO

    85861 bytes read
    U-Boot# cp.b 0x81000000 0x81020000 20000
    U-Boot# cp.b 0x81000000 0x81040000 20000
    U-Boot# cp.b 0x81000000 0x81060000 20000
    U-Boot# fatload mmc 0 0x81080000 u-boot.img
    reading u-boot.img

    355376 bytes read
    U-Boot# fatload mmc 0 0x81280000 uImage
    reading uImage

    3189816 bytes read
    U-Boot# fatload mmc 0 0x81780000 uImage
    reading uImage

    3189816 bytes read
    U-Boot# fatload mmc 0 0x81c80000 ubi.img
    reading ubi.img

    27262976 bytes read
    U-Boot# fatload mmc 0 0x86c80000 ubi.img
    reading ubi.img

    27262976 bytes read
    U-Boot# nand write 0x81000000 0x0 0xa000000

    NAND write: device 0 offset 0x0, size 0xa000000
     167772160 bytes written: OK

    U-Boot# setenv mtdparts mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel1),5m(kernel2),80m(rootfs1),-(rootfs2)

    The result of the mtdparts command should look like this:

    U-Boot# mtdparts

    device nand0 <omap2-nand.0>, # parts = 10
     #: name        size        offset        mask_flags
     0: SPL                 0x00020000    0x00000000    0
     1: SPL.backup1         0x00020000    0x00020000    0
     2: SPL.backup2         0x00020000    0x00040000    0
     3: SPL.backup3         0x00020000    0x00060000    0
     4: u-boot              0x001e0000    0x00080000    0
     5: u-boot-env          0x00020000    0x00260000    0
     6: kernel1             0x00500000    0x00280000    0
     7: kernel2             0x00500000    0x00780000    0
     8: rootfs1             0x05000000    0x00c80000    0
     9: rootfs2             0x0a380000    0x05c80000    0

    active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000

    defaults:
    mtdids  : nand0=omap2-nand.0
    mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)

    Then set these:

    U-Boot# setenv nandsrcaddr 0x780000
    U-Boot# setenv nandroot ubi0:rootfs rw ubi.mtd=8,2048

    and run nandboot:

    U-Boot# run nandboot

    The kernel failed at mounting the rootfs:

    VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

    I'm not sure why this is happening. This was an unsuccessful attempt, but I'm sure it can be done and that I'm missing something little.

    You can try creating a ubi.img containing 2 volumes inside it, similar to what is shown here: http://www.linux-mtd.infradead.org/faq/ubi.html#L_ubi_mkimg

    Best regards,
    Miroslav

  • Ok Miroslav, I followed your recommends and now it is working well. The main problem was in size definition of ubi image generation. Here is a link that complement your answer http://processors.wiki.ti.com/index.php/UBIFS_Support#Creating_UBIFS_file_system.

    thank you

  • Dear Miroslav,

    I am using 8 bit nand with 8Gb(1024MB) "MT29F8G08ABABAWP" capacity with am335x platform. I tried to port all the images and trying to run from nand. But it booting till u-boot and stopped at below:

    --------------------------------------------------------------------------------------------------

    U-Boot 2013.10-00189-g78d8ebd-dirty (Apr 23 2015 - 17:44:49)

    I2C:   ready

    DRAM:  512 MiB

    NAND:  1024 MiB

    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1

    *** Warning - bad CRC, using default environment

    Net:   <ethaddr> not set. Validating first E-fuse MAC

    Could not get PHY for cpsw: addr 0

    cpsw, usb_ether

    Hit any key to stop autoboot:  0

    ## Error: "bootcmd_mmc0" not defined

    Booting from nand ...

    Loading from nand0, offset 0x0

    ** Unknown image type

    U-Boot#

    --------------------------------------------------------------------------------------------------

    each time i have to enter the boot commands while reboots using the below command:

    setenv nandsrcaddr 0x00280000;setenv nandimgsize 0x500000;setenv bootcmd 'nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize};bootm ${loadaddr}';setenv bootargs 'console=ttyO0,115200 root=ubi0:rootfs ubi.mtd=7,2048 rootfstype=ubifs noinitrd mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(root)'

    Till kernel image it is running then it is giving UBI ECC error. each time i have to enter setenv boot command then only it is booting till this stage.

    --------------------------------------------------------------------------------------------------

    [    3.681827] UBI error: ubi_io_read:error -74 (ECC error) while reading 64 b

    [    3.700025] UBI error: ubi_io_read: error -74 (ECC error) while reading 1024

    [    3.718906] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 b

    [    3.737078] UBI error: ubi_io_read: error -74 (ECC error) while reading 1024

    --------------------------------------------------------------------------------------------------

    My selected Micron NAND flash have the following features, based on my nand configuration tell me the changes in my u-boot (am335x_evm.h, nand_base.c, nand_ids.c,nand_ecc.c) & kernel (board-am335xevm.c)

    Organization

    – Page size x8: 4320 bytes (4096 + 224 bytes)

    – Block size: 128 pages (512K +28 K bytes)

    – Plane size: 2 planes x 1024 blocks per plane

    – Device size: 8Gb: 2048 blocks

    Could you please look at my issue and give your suggestions.

    Thanks,

    Anil

  • Hi Daniel,

    I am using 8 bit nand with 8Gb(1024MB). I have tried am335x evm with 256MB it is running in evm. We have added in customixed board with 1024 MB nand and changed in my u-boot but not get sucCess. could you please send me the files what are the Changes required in u-boot & kernel. please help me.

    Regards
    Anil
  • Hi anil kumar,

    I am also facing similar issue with 16 bit nand MT29F4G16ABADAWP.
    Here is I posted e2e.ti.com/.../450860.

    Please let me know do you have any solution for the above.

    Thanks in advance.