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.
Hello everyone,
I bought a beaglebone to experiment with the AM335x platform. I've created a cape with NAND and SPI. Both are working, after i've edited the mux.c file in uboot directory.
I've written MLO+uboot to SPI : works perfectly
I've written my uImage to the nand ( partition 6 ) : loads the kernel, but panics! No sweat, I didn't write the rootfs yet.
So, i've created my UBIFS, and now i have a file called ubifs.img ( I didn't use ubinize, since that tool is only to write to the raw chip, right? ). I've downloaded that in memory ( through TFTP ), and wrote it to partition 7 on my nand. Afterwards, I've changed the bootargs to "console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 rootfstype=ubifs rootwait=1".
When I now reboot, I still get a panic. The following lines from the log are interesting:
[ 1.265045] UBI error: ubi_init: UBI error: cannot initialize UBI, error -19
[ 1.830902] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
[ 1.838348] Please append a correct "root=" boot option; here are the available partitions:
// nothing
[ 1.847198] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
My nand is at CS0. So again, from the top:
- MLO+Uboot in SPI : works
- uImage + FS in NAND : almost there
Is there a pinmux setting in the kernel that I must change? Where can I find this mux then?
Thanks in advance,
Arend
[UPDATE]
So I've fixed my assumption that I didn't need ubinize. I've created the ubinized image, but still the same error remains.
It looks as if it doesn't recognize the NAND flash ( or the UBI device for name sake ).
Hi,
1. What is the size of your NAND flash chip?
2. What is the size of the last partition (number 7) that is used for the file system?
3. What is the command sequence you use to create the ubi.img file?
4. Please post the whole kernel boot log (in an attachment). Is the following error message present?
UBI error: vtbl_check: volume table check failed: record 0, error 9
Here you can find exact steps to create an UBI file system depending on the size of the partition: http://processors.wiki.ti.com/index.php/UBIFS_Support
Best regards,
Miroslav
Thank you for your help!
1. What is the size of your NAND flash chip?
It's a 4Gb nand flash from samsung : K9F4G08U0D
2. What is the size of the last partition (number 7) that is used for the file system?
The actual size is: 39.5 MB ( this is the folder containing all the files in the rootfs, so not compiled )
The UBIFS-file is: 26.0 MB ( 27299840 bytes )
The ubinized files is: 27.1 MB (28442624 bytes)
[code]U-Boot# mtdpart
device nand0 <omap2-nand.0>, # parts = 8
#: 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: kernel 0x00500000 0x00280000 0
7: rootfs 0x1f880000 0x00780000 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)[/code]
3. What is the command sequence you use to create the ubi.img file?
sudo mkfs.ubifs -r beaglebone/ -F -o ubifs.img -m 2048 -e 126976 -c 1580
where beaglebone is the folder containing the rootfs
sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 512 -O 2048 ubinize.cfg
the ubinize.cfg
[code]
[RFS-volume]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=192MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize[/code]
Then I used the following commands from uBoot:
U-Boot# tftp ubi.img
U-boot# nand erase 0x00780000 0x1b20000
U-boot# nand write 0x80200000 0x00780000 0x1b20000
4. Please post the whole kernel boot log (in an attachment). Is the following error message present?
CCCCCC U-Boot SPL 2013.01.01 (Jul 01 2013 - 11:41:46) No AC power, disabling frequency switch 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 SF: Detected M25P32 with page size 64 KiB, total 4 MiB U-Boot 2013.01.01 (Jul 01 2013 - 11:41:46) I2C: ready DRAM: 256 MiB WARNING: Caches not enabled NAND: 512 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 U-Boot# U-Boot# setenv bootargs 'console=ttyO0,115200n8 noinitrd ip=off mem=256M rootwait=1 rw ubi.mtd=7,2048 rootfstype=ubifs root=ubi0:rootfs init=/init' U-Boot# sync Unknown command 'sync' - try 'help' U-Boot# saveenv Saving Environment to NAND... Erasing Nand... Erasing at 0x260000 -- 100% complete. Writing to Nand... done U-Boot# boot Card did not respond to voltage select! mmc0(part 0) is current device 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 80200000 ... Image Name: Linux-3.2.0 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3225464 Bytes = 3.1 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... Uncompressing Linux... done, booting the kernel. [ 0.000000] Linux version 3.2.0 (root@debian) (gcc version 4.4.5 (Debian 4.4.5-8) ) #2 Sat Apr 27 12:45:35 CEST 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: 65024 [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 rootfstype=ubifs rootwait=1 [ 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: 253180k/253180k available, 8964k 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 - 0xc05af000 (5788 kB) [ 0.000000] .init : 0xc05af000 - 0xc05eb000 ( 240 kB) [ 0.000000] .data : 0xc05ec000 - 0xc0655d60 ( 424 kB) [ 0.000000] .bss : 0xc0655d84 - 0xc06849e4 ( 188 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.000183] Calibrating delay loop... 548.86 BogoMIPS (lpj=2744320) [ 0.048339] pid_max: default: 32768 minimum: 301 [ 0.048492] Security Framework initialized [ 0.048614] Mount-cache hash table entries: 512 [ 0.049072] CPU: Testing write buffer coherency: ok [ 0.049926] devtmpfs: initialized [ 0.070983] omap_hwmod: pruss: failed to hardreset [ 0.072357] print_constraints: dummy: [ 0.072814] NET: Registered protocol family 16 [ 0.075469] OMAP GPIO hardware version 0.1 [ 0.078918] omap_mux_init: Add partition: #1: core, flags: 0 [ 0.081298] omap_i2c.1: alias fck already exists [ 0.082397] omap2_mcspi.1: alias fck already exists [ 0.082672] omap2_mcspi.2: alias fck already exists [ 0.083862] edma.0: alias fck already exists [ 0.083892] edma.0: alias fck already exists [ 0.083892] edma.0: alias fck already exists [ 0.118774] bio: create slab <bio-0> at 0 [ 0.121582] SCSI subsystem initialized [ 0.123657] usbcore: registered new interface driver usbfs [ 0.124023] usbcore: registered new interface driver hub [ 0.124298] usbcore: registered new device driver usb [ 0.124481] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3 [ 0.124847] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1 [ 0.138366] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz [ 0.140167] tps65910 1-002d: could not be detected [ 0.141845] Advanced Linux Sound Architecture Driver Version 1.0.24. [ 0.143341] Switching to clocksource gp timer [ 0.166839] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host) [ 0.167022] musb-hdrc musb-hdrc.0: dma type: pio [ 0.167449] MUSB0 controller's USBSS revision = 4ea20800 [ 0.168304] musb-hdrc musb-hdrc.0: USB OTG mode controller at d083c000 using PIO, IRQ 18 [ 0.168487] musb-hdrc musb-hdrc.1: dma type: pio [ 0.168853] MUSB1 controller's USBSS revision = 4ea20800 [ 0.169067] musb-hdrc musb-hdrc.1: MUSB HDRC host driver [ 0.169158] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 [ 0.169311] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 0.169342] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.169342] usb usb1: Product: MUSB HDRC host driver [ 0.169372] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd [ 0.169372] usb usb1: SerialNumber: musb-hdrc.1 [ 0.170593] hub 1-0:1.0: USB hub found [ 0.170623] hub 1-0:1.0: 1 port detected [ 0.171417] musb-hdrc musb-hdrc.1: USB Host mode controller at d083e800 using PIO, IRQ 19 [ 0.171936] NET: Registered protocol family 2 [ 0.172149] IP route cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.172485] TCP established hash table entries: 8192 (order: 4, 65536 bytes) [ 0.172698] TCP bind hash table entries: 8192 (order: 3, 32768 bytes) [ 0.172821] TCP: Hash tables configured (established 8192 bind 8192) [ 0.172851] TCP reno registered [ 0.172851] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.172882] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.173095] NET: Registered protocol family 1 [ 0.173492] RPC: Registered named UNIX socket transport module. [ 0.173522] RPC: Registered udp transport module. [ 0.173522] RPC: Registered tcp transport module. [ 0.173553] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.173797] NetWinder Floating Point Emulator V0.97 (double precision) [ 0.186828] VFS: Disk quotas dquot_6.5.2 [ 0.186920] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.187561] msgmni has been set to 494 [ 0.191497] alg: No test for stdrng (krng) [ 0.192352] io scheduler noop registered [ 0.192352] io scheduler deadline registered [ 0.192474] io scheduler cfq registered (default) [ 0.193939] Could not set LED4 to fully on [ 0.348510] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0 [ 0.904937] console [ttyO0] enabled [ 0.909362] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1 [ 0.917449] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2 [ 0.925506] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3 [ 0.933532] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4 [ 0.941589] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5 [ 0.950347] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00 [ 0.970367] brd: module loaded [ 0.980468] loop: module loaded [ 0.984069] i2c-core: driver [tsl2550] using legacy suspend method [ 0.990570] i2c-core: driver [tsl2550] using legacy resume method [ 0.997100] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write [ 1.063903] No daughter card found [ 1.067535] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write [ 1.082855] Board name: A335BONE [ 1.086273] Board version: 00A6 [ 1.089569] The board is a AM335x Beaglebone. [ 1.096649] tps65217 1-0024: TPS65217 ID 0xf version 1.2 [ 1.104553] print_constraints: DCDC1: 900 <--> 1800 mV at 1800 mV [ 1.113372] print_constraints: DCDC2: 900 <--> 3300 mV at 1275 mV [ 1.122222] print_constraints: DCDC3: 900 <--> 1500 mV at 1100 mV [ 1.131011] print_constraints: LDO1: 1000 <--> 3300 mV at 1800 mV [ 1.139831] print_constraints: LDO2: 900 <--> 3300 mV at 3300 mV [ 1.148529] print_constraints: LDO3: 1800 <--> 3300 mV at 3300 mV [ 1.157348] print_constraints: LDO4: 1800 <--> 3300 mV at 3300 mV [ 1.164398] Maximum current provided by the USB port is 500mA which is not sufficient [ 1.164428] when operating @OPP120 and OPPTURBO. The current requirement for some [ 1.164428] use-cases using OPP100 might also exceed the maximum current that the [ 1.164428] USB port can provide. Unless you are fully confident that the current [ 1.164459] requirements for OPP100 use-case don't exceed the USB limits, switching [ 1.164459] to AC power is recommended. [ 1.208770] omap_hsmmc.0: alias fck already exists [ 1.214447] omap_i2c.3: alias fck already exists [ 1.234008] omap_i2c omap_i2c.3: bus 3 rev2.4.0 at 100 kHz [ 1.241333] registered am33xx_sr device [ 1.247772] mtdoops: mtd device (mtddev=name/number) must be supplied [ 1.255126] omap2-nand driver initializing [ 1.259643] OneNAND driver initializing [ 1.265045] UBI error: ubi_init: UBI error: cannot initialize UBI, error -19 [ 1.273345] CAN device driver interface [ 1.277404] CAN bus driver for Bosch D_CAN controller 1.0 [ 1.333953] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6 [ 1.340484] davinci_mdio davinci_mdio.0: detected phy mask fffffffe [ 1.347869] davinci_mdio.0: probed [ 1.351470] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver SMSC LAN8710/LAN8720 [ 1.360534] usbcore: registered new interface driver zd1201 [ 1.366668] usbcore: registered new interface driver cdc_ether [ 1.373016] usbcore: registered new interface driver cdc_eem [ 1.379211] usbcore: registered new interface driver dm9601 [ 1.385131] cdc_ncm: 04-Aug-2011 [ 1.388763] usbcore: registered new interface driver cdc_ncm [ 1.394744] Initializing USB Mass Storage driver... [ 1.400146] usbcore: registered new interface driver usb-storage [ 1.406494] USB Mass Storage support registered. [ 1.412139] mousedev: PS/2 mouse device common for all mice [ 1.419464] omap_rtc am33xx-rtc: rtc core: registered am33xx-rtc as rtc0 [ 1.426605] am33xx-rtc: already running [ 1.430847] i2c /dev entries driver [ 1.435424] Linux video capture interface: v2.00 [ 1.440673] usbcore: registered new interface driver uvcvideo [ 1.446777] USB Video Class driver (1.1.1) [ 1.454528] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec [ 1.537536] cpuidle: using governor ladder [ 1.542541] cpuidle: using governor menu [ 1.549316] omap4_aes_mod_init: loading AM33X AES driver [ 1.555084] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02 [ 1.561798] omap4_aes_probe: probe() done [ 1.566375] omap4_sham_mod_init: loading AM33X SHA/MD5 driver [ 1.572570] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03 [ 1.586151] omap4_sham_probe: probe() done [ 1.593811] usbcore: registered new interface driver usbhid [ 1.599731] usbhid: USB HID core driver [ 1.605010] usbcore: registered new interface driver snd-usb-audio [ 1.613677] ALSA device list: [ 1.616851] No soundcards found. [ 1.620452] oprofile: hardware counters not available [ 1.625762] oprofile: using timer interrupt. [ 1.630279] nf_conntrack version 0.5.0 (3955 buckets, 15820 max) [ 1.637207] ip_tables: (C) 2000-2006 Netfilter Core Team [ 1.642944] TCP cubic registered [ 1.646392] NET: Registered protocol family 17 [ 1.651092] can: controller area network core (rev 20090105 abi 8) [ 1.657745] NET: Registered protocol family 29 [ 1.662414] can: raw protocol (rev 20090105) [ 1.666931] can: broadcast manager protocol (rev 20090105 t) [ 1.672912] Registering the dns_resolver key type [ 1.677947] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 [ 1.686065] ThumbEE CPU extension supported. [ 1.690612] mux: Failed to setup hwmod io irq -22 [ 1.696472] Power Management for AM33XX family [ 1.701416] Trying to load am335x-pm-firmware.bin (60 secs timeout) [ 1.708160] Copied the M3 firmware to UMEM [ 1.712554] Cortex M3 Firmware Version = 0x18 [ 1.717315] Compensating OPP0 for 0mV Orig nvalue:0x9a8bf8 New nvalue:0x9a8bf8 [ 1.725036] Compensating OPP1 for 0mV Orig nvalue:0x9a8bf7 New nvalue:0x9a8bf7 [ 1.733398] Compensating OPP0 for 0mV Orig nvalue:0x99988b New nvalue:0x99988b [ 1.741119] Compensating OPP1 for 0mV Orig nvalue:0x999080 New nvalue:0x999080 [ 1.748840] Compensating OPP2 for 0mV Orig nvalue:0xaaf9dc New nvalue:0xaaf9dc [ 1.756530] Compensating OPP3 for 0mV Orig nvalue:0xaad4bc New nvalue:0xaad4bc [ 1.764312] create_regulator: DCDC2: Failed to create debugfs directory [ 1.772033] smartreflex smartreflex: am33xx_sr_probe: Driver initialized [ 1.785156] clock: disabling unused clocks to save power [ 1.808715] Detected MACID=bc:6a:29:de:aa:4e [ 1.814544] cpsw: Detected MACID = bc:6a:29:de:aa:4f [ 1.821197] omap_rtc am33xx-rtc: setting system clock to 2000-01-01 01:19:44 UTC (946689584) [ 1.830902] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0) [ 1.838348] Please append a correct "root=" boot option; here are the available partitions: [ 1.847198] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 1.855895] Backtrace: [ 1.858520] [<c0018c00>] (dump_backtrace+0x0/0x10c) from [<c0432024>] (dump_stack+0x18/0x1c) [ 1.867401] r7:c05ddfe0 r6:00008000 r5:c0658a88 r4:c0658a88 [ 1.873382] [<c043200c>] (dump_stack+0x0/0x1c) from [<c043208c>] (panic+0x64/0x198) [ 1.881469] [<c0432028>] (panic+0x0/0x198) from [<c05afd8c>] (mount_block_root+0x174/0x228) [ 1.890258] r3:00000000 r2:00000000 r1:cf01df78 r0:c050e950 [ 1.896270] [<c05afc18>] (mount_block_root+0x0/0x228) from [<c05affa0>] (prepare_namespace+0x94/0x1cc) [ 1.906066] [<c05aff0c>] (prepare_namespace+0x0/0x1cc) from [<c05af2f8>] (kernel_init+0xf0/0x124) [ 1.915435] r5:c05ea24c r4:c0655dc0 [ 1.919219] [<c05af208>] (kernel_init+0x0/0x124) from [<c0043b6c>] (do_exit+0x0/0x69c) [ 1.927551] r5:c05af208 r4:00000000
UBI error: vtbl_check: volume table check failed: record 0, error 9
no :-(
Thank you!
When I measure on the CS0 pin ( the one connected to the NAND ), I see that the pin is being pulled low ( at a high frequency ) while the kernel is being loaded.
However, after the kernel is loaded, there is no interaction while booting... so the nand can never be detected this way.... right?
Hi,
[ 1.265045] UBI error: ubi_init: UBI error: cannot initialize UBI, error -19
error -19 means NO SUCH DEVICE.
For some reason the ubi_init() function inside drivers/mtd/ubi/build.c file cannot find the device. I cannot see any of the other error messages, so you will need to put some debug prints inside this function in order to check where exactly is the initialization failing with error -ENODEV (-19).
The other strange thing about your log is that there are no messages about the detection of the NAND device and the creation of the MTD partitions. Please check the function nand_get_flash_type() inside drivers/mtd/nand/nand_base.c and see if it actually detects the NAND device - there is a print statement at the end of the function: "NAND device: Manufacturer ID:................", which isn't printed out.
There is also a static struct mtd_partition am335x_spi_partitions[] inside the board-am335xevm.c board config file. Have you done any modifications to this structure? I suppose not, but still, it is good to know as it is needed for the partitioning of the NAND device.
Please try to provide answers to these questions in order to narrow down the possible reasons for the problem.
Best regards,
Miroslav
Hello again,
Many thanks so far! I've added some debug output, and I can determine that the function 'nand_get_flash_type' never gets called at all!:s
The function that makes UBI init fail is: 'open_mtd_device', but makes sense, since the NAND isn't even found ;-)
But I think the nand isn't even found, because it is never selected? ( CSN0/GPIO1_29 - pin V6 )... so maybe I must provide pin mux info to the kernel as well? In the code i've found the following struct:
static struct pinmux_config nand_pin_mux[] = {
{"gpmc_ad0.gpmc_ad0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad1.gpmc_ad1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad2.gpmc_ad2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad3.gpmc_ad3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad4.gpmc_ad4", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad5.gpmc_ad5", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad6.gpmc_ad6", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_ad7.gpmc_ad7", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_wait0.gpmc_wait0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_wpn.gpmc_wpn", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
{"gpmc_csn0.gpmc_csn0", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
{"gpmc_advn_ale.gpmc_advn_ale", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
{"gpmc_oen_ren.gpmc_oen_ren", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
{"gpmc_wen.gpmc_wen", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
{"gpmc_ben0_cle.gpmc_ben0_cle", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
{NULL, 0},
};
I've also placed an debug-output in evm_nand_init, which is also not called... I think we're getting close here?
I didn't change the struct you mentioned... actually I didn't change anything in the kernel code ( except for the extra logs ). I rechecked the configuration, and I didn't see anything suspicious.
I don't know why u-boot can detect the size, but not the manufacturer... i checked all the lines connected to the nand... But then again, if the NAND doens't work... I wouldn't be able to boot the uImage from it...right?
Yeay, I found it!!
I will paste the solution for others, it's quite easy once you know where to look!
look up the beaglebone_dev_cfg ( for rev >=A3 ) or beaglebone_old_dev_cfg ( for rev < A3 ), there you muse add and entry:
{evm_nand_init, DEV_ON_BASEBOARD, PROFILE_ALL},
and that's all! Recompile the uImage and you're done!
Thank you again for all your help