linux4sam/buildroot-at91

Waiting for root device /dev/mmcblk0p2...

Closed this issue · 6 comments

I have SAMA5D3 Xplained custom board error is very common lots of help given on internet
After 5 days tried them still error didn't solve.

I have downloaded pre-built image from below official site + also custom compile buildroot "BUILDROOT BASED DEMO" below link given.
Sama5d3XplainedMainPage

Below kernel log message given

RomBOOT


AT91Bootstrap 3.9.0 (Sat Nov 21 13:24:05 IST 2020)

SD/MMC: Image: Read file u-boot.bin to 0x26f00000
SD: Card Capacity: High or Extended
SD: Specification Version 3.0X
SD/MMC: Done to load image
<debug_uart> 

U-Boot 2019.04-linux4sam_6.2 (Nov 21 2020 - 13:25:27 +0530)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
DRAM:  256 MiB
NAND:  256 MiB
MMC:   Atmel mci: 0, Atmel mci: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@ffffee00
Out:   serial@ffffee00
Err:   serial@ffffee00
Net:   
Error: ethernet@f0028000 address not set.
eth-1: ethernet@f0028000
Error: ethernet@f802c000 address not set.
, eth-1: ethernet@f802c000
Hit any key to stop autoboot:  3  2  1  0 
49973 bytes read in 7 ms (6.8 MiB/s)
4156392 bytes read in 268 ms (14.8 MiB/s)
## Flattened Device Tree blob at 21000000
   Booting using the fdt blob at 0x21000000
   Loading Device Tree to 2fb21000, end 2fb30334 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.19.78-linux4sam-6.2 (dnk025@dnk025-PC) (gcc version 8.4.0 (Buildroot 2020.02.8)) #1 Sat Nov 21 13:29:03 IST 2020
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: SAMA5D3 Xplained
Memory policy: Data cache writeback
cma: Reserved 64 MiB at 0x28000000
CPU: All CPU(s) started in SVC mode.
random: get_random_bytes called from 0xc0a008f8 with crng_init=0
Built 1 zonelists, mobility grouping off.  Total pages: 64960
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 183088K/262144K available (7168K kernel code, 254K rwdata, 1204K rodata, 1024K init, 166K bss, 13520K reserved, 65536K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0x(ptrval) - 0x(ptrval)   (8160 kB)
      .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
      .data : 0x(ptrval) - 0x(ptrval)   ( 255 kB)
       .bss : 0x(ptrval) - 0x(ptrval)   ( 167 kB)
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
clocksource: timer@f0010000: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 115833966437 ns
sched_clock: 32 bits at 16MHz, resolution 60ns, wraps every 130150523873ns
Switching to timer-based delay loop, resolution 60ns
clocksource: pit: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 14479245754 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 33.00 BogoMIPS (lpj=165000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20100000 - 0x20100060
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
AT91: PM: standby: standby, suspend: ulp0
gpio-at91 fffff200.gpio: at address (ptrval)
gpio-at91 fffff400.gpio: at address (ptrval)
gpio-at91 fffff600.gpio: at address (ptrval)
gpio-at91 fffff800.gpio: at address (ptrval)
gpio-at91 fffffa00.gpio: at address (ptrval)
pinctrl-at91 ahb:apb:pinctrl@fffff200: initialized AT91 pinctrl driver
atmel_tcb: probe of f0010000.timer failed with error -16
at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels
at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels
AT91: Detected SoC family: sama5d3
AT91: Detected SoC: sama5d36, revision 2
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f0014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f0014000.i2c: AT91 i2c bus driver (hw version: 0x402).
at91_i2c f0018000.i2c: using dma0chan2 (tx) and dma0chan3 (rx) for DMA transfers
at91_i2c f0018000.i2c: AT91 i2c bus driver (hw version: 0x402).
at91_i2c f801c000.i2c: can't get DMA channel, continue without DMA support
at91_i2c f801c000.i2c: AT91 i2c bus driver (hw version: 0x402).
media: Linux media interface: v0.10
videodev: Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.22
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource timer@f0010000
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
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 named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Initialise system trusted keyrings
workingset: timestamp_bits=14 max_order=16 bucket_order=2
Key type asymmetric registered
Asymmetric key parser 'x509' registered
io scheduler noop registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
brd: module loaded
loop: module loaded
atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf001c000 (irq = 23, base_baud = 4125000) is a ATMEL_SERIAL
atmel_usart_serial.1.auto: ttyS2 at MMIO 0xf0020000 (irq = 24, base_baud = 4125000) is a ATMEL_SERIAL
atmel_usart_serial.2.auto: ttyS5 at MMIO 0xf0024000 (irq = 25, base_baud = 4125000) is a ATMEL_SERIAL
atmel_usart_serial.3.auto: ttyS0 at MMIO 0xffffee00 (irq = 38, base_baud = 8250000) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_spi f0004000.spi: Using dma0chan4 (tx) and dma0chan5 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller version 0x213 at 0xf0004000 (irq 20)
atmel_spi f8008000.spi: Using dma1chan0 (tx) and dma1chan1 (rx) for DMA transfers
atmel_spi f8008000.spi: Atmel SPI Controller version 0x213 at 0xf8008000 (irq 28)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
at91_can f000c000.can: device registered (reg_base=(ptrval), irq=45)
macb f0028000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Micrel KSZ9031 Gigabit PHY f0028000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=f0028000.ethernet-ffffffff:07, irq=POLL)
macb f0028000.ethernet eth0: Cadence GEM rev 0x00020119 at 0xf0028000 irq 46 (42:46:13:7d:47:54)
macb f802c000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Micrel KSZ8081 or KSZ8091 f802c000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f802c000.ethernet-ffffffff:01, irq=POLL)
macb f802c000.ethernet eth1: Cadence MACB rev 0x0001010c at 0xf802c000 irq 47 (0e:91:e4:83:49:ec)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 700000.ehci: EHCI Host Controller
atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 700000.ehci: irq 50, io mem 0x00700000
atmel-ehci 700000.ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.19.78-linux4sam-6.2 ehci_hcd
usb usb1: SerialNumber: 700000.ehci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 600000.ohci: USB Host Controller
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 600000.ohci: irq 50, io mem 0x00600000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.19
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: USB Host Controller
usb usb2: Manufacturer: Linux 4.19.78-linux4sam-6.2 ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
at91_rtc fffffeb0.rtc: registered as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
at91-reset fffffe00.rstc: Starting after wakeup
Bluetooth: HCI UART driver ver 2.3
Bluetooth: HCI UART protocol H4 registered
Bluetooth: HCI UART protocol Three-wire (H5) registered
usbcore: registered new interface driver btusb
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan6 for DMA transfers
atmel_mci f0000000.mmc: Linked as a consumer to regulator.1
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 19, 1 slots
atmel_mci f8000000.mmc: version: 0x505
atmel_mci f8000000.mmc: using dma1chan2 for DMA transfers
atmel_mci f8000000.mmc: Atmel MCI controller at 0xf8000000 irq 27, 1 slots
sdhci-pltfm: SDHCI platform and OF driver helper
ledtrig-cpu: registered to indicate activity on CPUs
atmel_aes f8038000.aes: version: 0x135
atmel_aes f8038000.aes: Atmel AES - Using dma1chan3, dma1chan4 for DMA transfers
atmel_sha f8034000.sha: version: 0x410
atmel_sha f8034000.sha: using dma1chan5 for DMA transfers
atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes f803c000.tdes: version: 0x701
atmel_tdes f803c000.tdes: using dma1chan6, dma1chan7 for DMA transfers
atmel_tdes f803c000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
nand: Micron MT29F2G08ABAEAWP
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
7 fixed-partitions partitions found on MTD device atmel_nand
Creating 7 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "at91bootstrap"
0x000000040000-0x000000100000 : "bootloader"
0x000000100000-0x000000140000 : "bootloader env redundant"
0x000000140000-0x000000180000 : "bootloader env"
0x000000180000-0x000000200000 : "device tree"
0x000000200000-0x000000800000 : "kernel"
0x000000800000-0x000010000000 : "rootfs"
iio iio:device0: Resolution used: 12 bits
iio iio:device0: ADC Touch screen is disabled.
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
Loading compiled-in X.509 certificates
input: gpio_keys as /devices/platform/gpio_keys/input/input0
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 00:00:07 UTC (1167609607)
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...
random: fast init done

Bootloader properly load from sd card but after rootfs can't
if i change

Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait
to 
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootdelay=3

output given in below

Waiting 3 sec before mounting root device...
VFS: Cannot open root device "mmcblk0p2" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0100            8192 ram0 
 (driver?)
0101            8192 ram1 
 (driver?)
0102            8192 ram2 
 (driver?)
0103            8192 ram3 
 (driver?)
1f00             256 mtdblock0 
 (driver?)
1f01             768 mtdblock1 
 (driver?)
1f02             256 mtdblock2 
 (driver?)
1f03             256 mtdblock3 
 (driver?)
1f04             512 mtdblock4 
 (driver?)
1f05            6144 mtdblock5 
 (driver?)
1f06          253952 mtdblock6 
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.78-linux4sam-6.2 #1
Hardware name: Atmel SAMA5
Function entered at [<c010da94>] from [<c010ac7c>]
Function entered at [<c010ac7c>] from [<c0117c24>]
Function entered at [<c0117c24>] from [<c0a0125c>]
Function entered at [<c0a0125c>] from [<c0a0156c>]
Function entered at [<c0a0156c>] from [<c0a01704>]
Function entered at [<c0a01704>] from [<c0a00e00>]
Function entered at [<c0a00e00>] from [<c07225c8>]
Function entered at [<c07225c8>] from [<c01010e8>]
Exception stack(0xc4039fb0 to 0xc4039ff8)
9fa0:                                     00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
random: fast init done
random: crng init done

Hi,
The issue is that your SD Card is not recognized by Linux: partitions are even not printed during the boot log.
The strange thing is that you boot from it. I would advice updating to latest image (2020.04) and use the SD Card flash procedure precisely. I suspect there must be an issue either while downloading the image or when flashing it with Etcher.
If you want another flashing tool, you can give this one a try:
https://www.cnx-software.com/2020/09/08/usbimager-a-lightweight-alternative-to-balenaetcher/

Thanks for your quick reply, appreciated!

I am using below image file
linux4sam-buildroot-sama5d3_xplained-headless-2020.04.img.bz2

I tried balenaetcher lightweight that you suggest but no luck.
I am not even getting mmc0 detection log

Hi,
Exactly same image works great as tested right now. I can see:

mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new SDHC card at address bfc7
mmcblk0: mmc0:bfc7 SD04G 3.69 GiB 
 mmcblk0: p1 p2
[..]
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting syslogd: OK
[..]

So, must be an issue with the SD Card used. Note, it must be bigger than 1GBytes.

Actually, we are using a custom board link > URL

can you please provide your complete log?

thanks for your time and effort.
now I wanna know how should I troubleshoot this issue.

Hi,

If you are using the linux4sam image with a custom, you may face issues. You may need to update the device tree. I'm wondering if you don't have an issue with the card detection signal which. In the case of sama5d3_xplained, it's on PE0 for mmc@f0000000 and PE1 for mmc@f8000000.

Thanks for hint problem solved.