Long story short: I use the mkfs.jffs2 + sumtool to generate the JFFS2 image and the U-Boot to flash it into my NAND. When I turn my board on it boots, but not without displaying a few error messages... Oh, and sometimes it crashes showing (null): : bad variable name.
Does anyone knows what's going on and how can I solve this?
Here the full version...
I'm using a EVM board with the AM3359 processor, which has a 256M NAND.
The first thing I did was change the kernel in order for it to be able to use a JFFS2 filesystem (http://processors.wiki.ti.com/index.php/Filesystem_in_NOR_or_NAND#JFFS2).
Then I use the following to generate the JFFS2 image I use:
mkfs.jffs2 -e 128KiB --no-cleanmarkers -r rootfs/ -o rootfs-jffs2.img
sumtool -n -e 128KiB -i rootfs-jffs2.img -o rootfs-jffs2-summed.img
Note that I don't use the -p option.
Finally, U-Boot flashes the image via a SD-Card:
mmc rescan
nandecc hw 2
nand erase 0x00780000 0x0F880000
fatload mmc 0 0x81000000 rootfs-jffs2.img
nand write.trimffs 0x81000000 0x00780000 0x00A50000
And I use 0x00A50000 because it's greater then the image size. I also use nand write.trimffs instead of nand write.jffs2 because of this: http://processors.wiki.ti.com/index.php/Put_JFFS2_Image_to_Flash#NAND_Flash
So, after all that is done, I try to boot the kernel. The thing is that it does boot, but nevertheless it shows some error messages before it shows the login. At times, it crashes with the message :
(null): : bad variable name
I'm copying the log here if anyone wishes to see whats going on. Thanks a lot!
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 3.2.0 (davi@ubuntu) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Tue Nov 6 11:31:15 BRST 2012
[ 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: 65024
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mtdblock7 rw rootfstype=jffs2 ip=none
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 256MB = 256MB total
[ 0.000000] Memory: 254412k/254412k available, 7732k 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 : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0496914 (4667 kB)
[ 0.000000] .init : 0xc0497000 - 0xc04cb000 ( 208 kB)
[ 0.000000] .data : 0xc04cc000 - 0xc05145d8 ( 290 kB)
[ 0.000000] .bss : 0xc05145fc - 0xc0550d5c ( 242 kB)
[ 0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:396 nr_irqs:396 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.000091] Calibrating delay loop... 718.02 BogoMIPS (lpj=3590144)
[ 0.058929] pid_max: default: 32768 minimum: 301
[ 0.059082] Security Framework initialized
[ 0.059204] Mount-cache hash table entries: 512
[ 0.059570] CPU: Testing write buffer coherency: ok
[ 0.078948] omap_hwmod: pruss: failed to hardreset
[ 0.080047] print_constraints: dummy:
[ 0.080352] NET: Registered protocol family 16
[ 0.082427] OMAP GPIO hardware version 0.1
[ 0.084625] omap_mux_init: Add partition: #1: core, flags: 0
[ 0.086822] omap_i2c.1: alias fck already exists
[ 0.087646] omap2_mcspi.1: alias fck already exists
[ 0.087860] omap2_mcspi.2: alias fck already exists
[ 0.088104] edma.0: alias fck already exists
[ 0.088134] edma.0: alias fck already exists
[ 0.088134] edma.0: alias fck already exists
[ 0.104705] bio: create slab <bio-0> at 0
[ 0.106811] SCSI subsystem initialized
[ 0.108367] usbcore: registered new interface driver usbfs
[ 0.108642] usbcore: registered new interface driver hub
[ 0.108856] usbcore: registered new device driver usb
[ 0.109039] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
[ 0.109313] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
[ 0.128997] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
[ 0.130798] tps65910 1-002d: JTAGREVNUM 0x0
[ 0.133209] print_constraints: VRTC:
[ 0.134643] print_constraints: VIO: at 1800 mV
[ 0.136993] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal
[ 0.139343] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal
[ 0.140350] print_constraints: VDD3: 5000 mV
[ 0.141784] print_constraints: VDIG1: at 1800 mV
[ 0.143218] print_constraints: VDIG2: at 1800 mV
[ 0.144653] print_constraints: VPLL: at 1800 mV
[ 0.146087] print_constraints: VDAC: at 1800 mV
[ 0.147521] print_constraints: VAUX1: at 1800 mV
[ 0.148986] print_constraints: VAUX2: at 3300 mV
[ 0.150421] print_constraints: VAUX33: at 3300 mV
[ 0.151855] print_constraints: VMMC: at 3300 mV
[ 0.152343] tps65910 1-002d: No interrupt support, no core IRQ
[ 0.153961] Switching to clocksource gp timer
[ 0.169006] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[ 0.169189] musb-hdrc musb-hdrc.0: dma type: pio
[ 0.169525] MUSB0 controller's USBSS revision = 4ea20800
[ 0.170074] musb-hdrc musb-hdrc.0: USB OTG mode controller at d083c000 using PIO, IRQ 18
[ 0.170257] musb-hdrc musb-hdrc.1: dma type: pio
[ 0.170532] MUSB1 controller's USBSS revision = 4ea20800
[ 0.170654] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[ 0.170715] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
[ 0.170837] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.170867] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.170867] usb usb1: Product: MUSB HDRC host driver
[ 0.170867] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
[ 0.170898] usb usb1: SerialNumber: musb-hdrc.1
[ 0.171661] hub 1-0:1.0: USB hub found
[ 0.171691] hub 1-0:1.0: 1 port detected
[ 0.172180] musb-hdrc musb-hdrc.1: USB Host mode controller at d083e800 using PIO, IRQ 19
[ 0.172576] NET: Registered protocol family 2
[ 0.172729] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.172973] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.173126] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.173217] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.173248] TCP reno registered
[ 0.173248] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.173278] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.173461] NET: Registered protocol family 1
[ 0.173706] RPC: Registered named UNIX socket transport module.
[ 0.173706] RPC: Registered udp transport module.
[ 0.173736] RPC: Registered tcp transport module.
[ 0.173736] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.174041] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.197174] VFS: Disk quotas dquot_6.5.2
[ 0.197540] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.200286] JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[ 0.200988] msgmni has been set to 496
[ 0.202178] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 0.202178] io scheduler noop registered
[ 0.202209] io scheduler deadline registered
[ 0.202239] io scheduler cfq registered (default)
[ 0.203277] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[ 0.829864] console [ttyO0] enabled
[ 0.834136] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[ 0.841949] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[ 0.849700] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[ 0.857452] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[ 0.865203] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[ 0.882049] brd: module loaded
[ 0.890167] loop: module loaded
[ 0.893524] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.907623] Detected a daughter card on AM335x EVM..
[ 0.912628] CPLD version: CPLD1.0F
[ 0.916412] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.931762] Board name: A33515BB
[ 0.935150] Board version: 1.4A
[ 0.938415] SKU: SKU#01
[ 0.941497] The board is general purpose EVM in profile 0
[ 0.947631] da8xx_lcdc.0: alias fck already exists
[ 0.953216] da8xx_lcdc da8xx_lcdc.0: GLCD: Found TFC_S9700RTWV35TR_01B panel
[ 0.976776] Console: switching to colour frame buffer device 100x30
[ 0.994262] omap-gpmc omap-gpmc: GPMC revision 6.0
[ 0.999298] Registering NAND on CS0
[ 1.003601] omap_i2c.2: alias fck already exists
[ 1.024597] omap_i2c omap_i2c.2: bus 2 rev2.4.0 at 100 kHz
[ 1.031616] omap_hsmmc.0: alias fck already exists
[ 1.037048] omap_hsmmc.2: alias fck already exists
[ 1.042419] Configure Bluetooth Enable pin...
[ 1.048278] registered am33xx_sr device
[ 1.053649] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.060974] omap2-nand driver initializing
[ 1.065582] ONFI flash detected
[ 1.068969] ONFI param page 0 valid
[ 1.072631] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G08ABAEAWP)
[ 1.081207] Creating 8 MTD partitions on "omap2-nand.0":
[ 1.086791] 0x000000000000-0x000000020000 : "SPL"
[ 1.093170] 0x000000020000-0x000000040000 : "SPL.backup1"
[ 1.100128] 0x000000040000-0x000000060000 : "SPL.backup2"
[ 1.107055] 0x000000060000-0x000000080000 : "SPL.backup3"
[ 1.113922] 0x000000080000-0x000000260000 : "U-Boot"
[ 1.121063] 0x000000260000-0x000000280000 : "U-Boot Env"
[ 1.127838] 0x000000280000-0x000000780000 : "Kernel"
[ 1.136260] 0x000000780000-0x000010000000 : "File System"
[ 1.245788] OneNAND driver initializing
[ 1.251281] CAN device driver interface
[ 1.255340] CAN bus driver for Bosch D_CAN controller 1.0
[ 1.304595] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[ 1.311065] davinci_mdio davinci_mdio.0: detected phy mask fffffffe
[ 1.318481] davinci_mdio.0: probed
[ 1.322021] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
[ 1.329742] usbcore: registered new interface driver zd1201
[ 1.335723] usbcore: registered new interface driver cdc_ether
[ 1.341949] usbcore: registered new interface driver cdc_eem
[ 1.348022] usbcore: registered new interface driver dm9601
[ 1.353881] cdc_ncm: 04-Aug-2011
[ 1.357391] usbcore: registered new interface driver cdc_ncm
[ 1.363311] Initializing USB Mass Storage driver...
[ 1.368652] usbcore: registered new interface driver usb-storage
[ 1.374938] USB Mass Storage support registered.
[ 1.380004] mousedev: PS/2 mouse device common for all mice
[ 1.386505] input: matrix-keypad as /devices/platform/matrix-keypad/input/input0
[ 1.395172] omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
[ 1.402008] i2c /dev entries driver
[ 1.407043] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[ 1.415618] cpuidle: using governor ladder
[ 1.420349] cpuidle: using governor menu
[ 1.500213] usbcore: registered new interface driver usbhid
[ 1.506072] usbhid: USB HID core driver
[ 1.510101] nf_conntrack version 0.5.0 (3975 buckets, 15900 max)
[ 1.517120] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 1.522796] TCP cubic registered
[ 1.526184] NET: Registered protocol family 17
[ 1.530822] can: controller area network core (rev 20090105 abi 8)
[ 1.537384] NET: Registered protocol family 29
[ 1.542022] can: raw protocol (rev 20090105)
[ 1.546478] can: broadcast manager protocol (rev 20090105 t)
[ 1.552429] Registering the dns_resolver key type
[ 1.557403] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 1.565429] ThumbEE CPU extension supported.
[ 1.569946] mux: Failed to setup hwmod io irq -22
[ 1.575500] Power Management for AM33XX family
[ 1.580352] Trying to load am335x-pm-firmware.bin (60 secs timeout)
[ 1.587036] Copied the M3 firmware to UMEM
[ 1.591461] smartreflex smartreflex: am33xx_sr_probe: Zero NValue read from EFUSE
[ 1.599334] smartreflex: probe of smartreflex failed with error -22
[ 1.606597] sr_init: platform driver register failed
[ 1.616271] clock: disabling unused clocks to save power
[ 1.623138] Detected MACID=0:18:31:8f:3:e6
[ 1.628509] cpsw: Detected MACID = 00:18:31:8f:03:e7
[ 1.638488] input: gpio-keys as /devices/platform/gpio-keys/input/input1
[ 1.645690] mmc1: card claims to support voltages below the defined range. These will be ignored.
[ 1.655395] omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[ 2.283569] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
[ 2.419982] mmc1: new SDIO card at address 0001
[ 4.351226] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a328fc: 0x0724 instead
[ 4.360534] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32900: 0x0100 instead
[ 4.369873] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32904: 0x801c instead
[ 4.379150] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32908: 0x62dc instead
[ 4.388427] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a3290c: 0xd86a instead
[ 4.397705] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32910: 0x0004 instead
[ 4.406951] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32914: 0x8550 instead
[ 4.416229] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32918: 0x4003 instead
[ 4.425506] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a3291c: 0x03d1 instead
[ 4.434753] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32920: 0x0818 instead
[ 4.444000] Further such events for this erase block will not be printed
[ 6.192871] VFS: Mounted root (jffs2 filesystem) on device 31:7.
[ 6.199554] Freeing init memory: 208K
INIT: version 2.86 booting
Please wait: booting...
Starting udev
Remounting root file system...
Caching udev devnodes
Fri Jul 27 10:38:00 UTC 2012
INIT: Entering runlevel: 5
Starting syslogd/klogd: done
Login:
___________________________________________________________________________
Now with the error before the kernel crashes:
(...)
[ 2.287628] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
[ 2.423980] mmc1: new SDIO card at address 0001
[ 4.354614] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a328fc: 0x0724 instead
[ 4.363922] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32900: 0x0100 instead
[ 4.373260] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32904: 0x801c instead
[ 4.382537] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32908: 0x62dc instead
[ 4.391784] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a3290c: 0xd86a instead
[ 4.401062] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32910: 0x0004 instead
[ 4.410308] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32914: 0x8550 instead
[ 4.419586] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32918: 0x4003 instead
[ 4.428833] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a3291c: 0x03d1 instead
[ 4.438110] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a32920: 0x0818 instead
[ 4.447357] Further such events for this erase block will not be printed
[ 6.201110] VFS: Mounted root (jffs2 filesystem) on device 31:7.
[ 6.207824] Freeing init memory: 208K
INIT: version 2.86 booting
[ 7.087097] JFFS2 notice: (633) check_node_data: wrong data CRC in data node at 0x0005e3c4: read 0xf950c031, calculated 0x2cbcc84c.
INIT: Entering runlevel: 5
(null): : bad variable name