Linutronix / elbe

Embedded Linux Build Environment
https://elbe-rfs.org
GNU General Public License v3.0
170 stars 59 forks source link

Cannot boot BBB image build by elbe #118

Closed nandra closed 7 years ago

nandra commented 7 years ago

I've build test image for BBB but it won't boot. If I insepct /boot partition of SDcard I've seen there is kernel+initrd version 4.9.3 but dtb was from 3.16 + also uEnv.txt has also 3.16 records? Any ideas? I've installed elbe from linutronix repo directly. Thanks.

manut commented 7 years ago

can you provide some bootlog? Or don't you even get an uboot prompt?

nandra commented 7 years ago

I did some small hacking on BBB to have it even booted but still no luck to boot to rootfs:

U-Boot SPL 2016.11+dfsg1-4 (Mar 27 2017 - 18:39:51)
Trying to boot from MMC1
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

reading u-boot.img
reading u-boot.img

U-Boot 2016.11+dfsg1-4 (Mar 27 2017 - 18:39:51 +0000)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net:   cpsw
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
256 bytes read in 5 ms (49.8 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc0 ...
Running uenvcmd ...
reading vmlinuz-4.9.0-3-armmp
3701544 bytes read in 240 ms (14.7 MiB/s)
reading am335x-boneblack.dtb
34184 bytes read in 13 ms (2.5 MiB/s)
reading initrd.img-4.9.0-3-armmp
16023296 bytes read in 1011 ms (15.1 MiB/s)
## Flattened Device Tree blob at 82000000
   Booting using the fdt blob at 0x82000000
   Loading Ramdisk to 90000000, end 90000000 ... OK
   Loading Device Tree to 8fff4000, end 8ffff587 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-3-armmp (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26)
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: TI AM335x BeagleBone Black
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 16 MiB at 0x9e800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] percpu: Embedded 14 pages/cpu @df946000 s27660 r8192 d21492 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129408
[    0.000000] Kernel command line: console=ttyO0,115200 root=/dev/mmcblk0p2 rootwait
[    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: 488012K/522240K available (7168K kernel code, 957K rwdata, 2208K rodata, 1024K init, 333K bss, 17844K reserved, 16384K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0800000   (8160 kB)
[    0.000000]       .init : 0xc0b00000 - 0xc0c00000   (1024 kB)
[    0.000000]       .data : 0xc0c00000 - 0xc0cef57c   ( 958 kB)
[    0.000000]        .bss : 0xc0cf1000 - 0xc0d44604   ( 334 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000014] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000035] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000047] OMAP clocksource: timer1 at 24000000 Hz
[    0.003790] clocksource_probe: no matching clocksources found
[    0.004339] Console: colour dummy device 80x30
[    0.004382] Calibrating delay loop... 997.78 BogoMIPS (lpj=2494464)
[    0.033893] pid_max: default: 32768 minimum: 301
[    0.034168] Security Framework initialized
[    0.034183] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.034225] AppArmor: AppArmor disabled by boot time parameter
[    0.034307] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.034319] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.035446] CPU: Testing write buffer coherency: ok
[    0.035522] ftrace: allocating 26690 entries in 79 pages
[    0.127920] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.128000] Setting up static identity map for 0x80100000 - 0x80100098
[    0.133372] EFI services will not be available.
[    0.133997] Brought up 1 CPUs
[    0.134015] SMP: Total of 1 processors activated (997.78 BogoMIPS).
[    0.134023] CPU: All CPU(s) started in SVC mode.
[    0.135581] devtmpfs: initialized
[    0.147407] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.147869] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
[    0.147900] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.149295] pinctrl core: initialized pinctrl subsystem
[    0.151419] NET: Registered protocol family 16
[    0.153783] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.172616] omap_hwmod: debugss: _wait_target_disable failed
[    0.233439] OMAP GPIO hardware version 0.1
[    0.252079] No ATAGs?
[    0.252107] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.252548] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[    0.252561] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[    0.253692] Serial: AMBA PL011 UART driver
[    0.271647] edma 49000000.edma: TI EDMA DMA engine driver
[    0.275221] vgaarb: loaded
[    0.276059] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    0.276118] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
[    0.276528] media: Linux media interface: v0.10
[    0.276587] Linux video capture interface: v2.00
[    0.276685] pps_core: LinuxPPS API ver. 1 registered
[    0.276693] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.276717] PTP clock support registered
[    0.277313] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.279239] clocksource: Switched to clocksource timer1
[    0.332588] VFS: Disk quotas dquot_6.6.0
[    0.332702] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.346352] NET: Registered protocol family 2
[    0.347307] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.347360] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.347420] TCP: Hash tables configured (established 4096 bind 4096)
[    0.347493] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.347516] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.347716] NET: Registered protocol family 1
[    0.348675] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.351384] audit: initializing netlink subsys (disabled)
[    0.351504] audit: type=2000 audit(0.285:1): initialized
[    0.352823] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.352973] zbud: loaded
[    0.356741] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.356988] io scheduler noop registered
[    0.357001] io scheduler deadline registered
[    0.357083] io scheduler cfq registered (default)
[    0.358370] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.366289] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.368455] Serial: AMBA driver
[    0.369410] omap_uart 44e09000.serial: no wakeirq for uart0
[    0.369743] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a OMAP UART0
[    1.016874] console [ttyO0] enabled
[    1.023851] libphy: Fixed MDIO Bus: probed
[    1.029323] mousedev: PS/2 mouse device common for all mice
[    1.037168] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[    1.048140] ledtrig-cpu: registered to indicate activity on CPUs
[    1.055437] NET: Registered protocol family 10
[    1.061402] mip6: Mobile IPv6
[    1.064643] NET: Registered protocol family 17
[    1.069329] mpls_gso: MPLS GSO support
[    1.073383] omap_voltage_late_init: Voltage driver support not added
[    1.080073] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
[    1.088548] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
[    1.097282] ThumbEE CPU extension supported.
[    1.101795] Registering SWP/SWPB emulation handler
[    1.106827] SmartReflex Class3 initialized
[    1.112067] registered taskstats version 1
[    1.116499] zswap: loaded using pool lzo/zbud
[    1.121302] ima: No TPM chip found, activating TPM-bypass!
[    1.133948] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.141785] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    1.148234] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[    1.157310] sr_init: No PMIC hook to init smartreflex
[    1.162804] sr_init: platform driver register failed for SR
[    1.169101] vmmcsd_fixed: disabling
[    1.173345] Waiting for root device /dev/mmcblk0p2...
[    9.644225] random: fast init done

seems that SDcard is not mouted. What I did is to update dtb to be found in uEnv script.

manut commented 7 years ago

looks good so far. Can you provide the change needed for the uEnv.txt ?

Have you tried another sdcard vendor? The card seems to be not even detected by the kernel. Can you exchange rootwait by rootdelay=10 This avoids waiting indefinitely for the RFS and printing an error instead containing the available disks and partitions.

nandra commented 7 years ago

I've changed uEnv.txt to following:

uenvcmd=setenv bootargs 'console=ttyO0,115200 root=/dev/mmcblk0p2 rootwait';load mmc 0:1 0x84000000 vmlinuz-4.9.0-3-armmp;load mmc 0:1 0x82000000 am335x-boneblack.dtb;load mmc 0:1 0x88000000 initrd.img-4.9.0-3-armmp;bootz 0x84000000 0x88000000: 0x82000000

and copy am335x-boneblack.dtb from deb package. As I already mention there si a problem that SD card is not detected and as you propose with rootdelay:

[    1.174177] Waiting 10 sec before mounting root device...
[    2.835628] random: fast init done
[   11.424854] List of all partitions:
[   11.428509] No filesystem could mount root, tried: [   11.433486] 
[   11.435076] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   11.443718] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.0-3-armmp #1 Debian 4.9.30-2+deb9u2
[   11.452621] Hardware name: Generic AM33XX (Flattened Device Tree)
[   11.459031] [<c0115178>] (unwind_backtrace) from [<c010f324>] (show_stack+0x20/0x24)
[   11.467131] [<c010f324>] (show_stack) from [<c040e27c>] (dump_stack+0x90/0xa4)
[   11.474693] [<c040e27c>] (dump_stack) from [<c026d100>] (panic+0x100/0x28c)
[   11.481982] [<c026d100>] (panic) from [<c0b01530>] (mount_block_root+0x2b4/0x30c)
[   11.489807] [<c0b01530>] (mount_block_root) from [<c0b01604>] (mount_root+0x7c/0x80)
[   11.497902] [<c0b01604>] (mount_root) from [<c0b01760>] (prepare_namespace+0x158/0x1a0)
[   11.506268] [<c0b01760>] (prepare_namespace) from [<c0b0107c>] (kernel_init_freeable+0x274/0x288)
[   11.515549] [<c0b0107c>] (kernel_init_freeable) from [<c07f3070>] (kernel_init+0x18/0x124)
[   11.524199] [<c07f3070>] (kernel_init) from [<c010a2f8>] (ret_from_fork+0x14/0x3c)
[   11.532125] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I'll try different SDcard though

nandra commented 7 years ago

Same issue with other SDcard

manut commented 7 years ago

[ 11.424854] List of all partitions:

as you see, the list is empty. So the kernel didn't detect your SDCard. This is either a problem with your hardware / sdcard or a problem of the debian kernel/devicetree. This issue can't be solved with elbe :(

manut commented 7 years ago

However we should check if another hw, sdcard is working and if not, switch the example to a HW really supported by debian.

djfun commented 7 years ago

The 4.9.0-3-armmp kernel from debian also fails to read from the sdcard on the beaglebone black which I have here. A 4.9.47 kernel compiled with omap2plus_defconfig however does work. The debian kernel might be missing some config needed for accessing the sdcard. CONFIG_MMC_OMAP_HS?

djfun commented 7 years ago

After some more testing I got it to work: My elbe xml did some cleaning of /boot which accidentally removed the initrd file. It is now included in my image and I made sure u-boot looks at the correct location for it. Comparing my boot log to the one posted above, the earliest difference I could find was that mine has [ 0.348881] Unpacking initramfs... and [ 1.431125] Freeing initrd memory: 15648K (cf0b8000 - d0000000) which I don't see in the log here.

nandra commented 7 years ago

Can you please share your findings (patch or PR). Thanks