Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

rootfs mount issue in polarfire icicle board as it always mounts initramfs with defult configuration #9

Open
govindsi opened this issue Nov 24, 2022 · 4 comments

Comments

@govindsi
Copy link

Hello ,
I am using polarfire icicle board and using 2021:11 release because of some legacy reason.
I am seeing it always mounts initramfs instead of rootfs , which is available in part3, Is there any extra configuration required to mount rootfs instead of initramfs(which is packed in the FIT image @initramfs.cpio.gz").

Boot up log:

U-Boot 2021.10 (Nov 22 2022 - 15:56:12 +0400)

CPU: rv64imafdc
Model: Microchip PolarFire-SoC Icicle Kit
DRAM: 1.7 GiB
MMC: mmc@20008000: 0
Loading Environment from nowhere... OK
In: serial@20100000
Out: serial@20100000
Err: serial@20100000
Net: eth0: ethernet@20112000
Hit any key to stop autoboot: 0
474 bytes read in 16 ms (28.3 KiB/s)

Executing script at 90000000

73880412 bytes read in 3168 ms (22.2 MiB/s)

Loading kernel from FIT Image at 90000000 ...

Using 'conf-riscvpc.dtb' configuration
Trying 'vmlinux.bin' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x900000d0
Data Size: 21968896 Bytes = 21 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x80200000
Entry Point: 0x80200000
Hash algo: sha256
Hash value: 6535b70280c1bd85b76e10333cd9178d17c74ef46088f82ad5309cd47b47c bde
Verifying Hash Integrity ... sha256+ OK

Loading ramdisk from FIT Image at 90000000 ...

Using 'conf-riscvpc.dtb' configuration
Trying 'initramfs.cpio.gz' ramdisk subimage
Description: buildroot initramfs
Type: RAMDisk Image
Compression: Unknown Compression
Data Start: 0x914f39d8
Data Size: 51896320 Bytes = 49.5 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x84000000
Entry Point: unavailable
Hash algo: sha256
Hash value: d4879fb35e85455563f80fef1bceee4feb20f386657730eccee256394ca8e 4da
Verifying Hash Integrity ... sha256+ OK
Loading ramdisk from 0x914f39d8 to 0x84000000
WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its file!

Loading fdt from FIT Image at 90000000 ...

Using 'conf-riscvpc.dtb' configuration
Trying 'riscvpc.dtb' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x94671abc
Data Size: 13098 Bytes = 12.8 KiB
Architecture: RISC-V
Load Address: 0x82200000
Hash algo: sha256
Hash value: b55d56a3afed47ba8a5d1b58ea738d0891b81967a38676fbfbfe40ae8f1059a5
Verifying Hash Integrity ... sha256+ OK
Loading fdt from 0x94671abc to 0x82200000
Booting using the fdt blob at 0x82200000
Loading Kernel Image
Loading Ramdisk to 8ce82000, end 90000000 ... OK
Loading Device Tree to 000000008ce7b000, end 000000008ce81329 ... OK
Loading Device Tree to 000000008ce71000, end 000000008ce7a329 ... OK

Starting kernel ...

[ 0.000000] Linux version 5.12.19-03920-ged4fb5b0bc51-dirty (govind@govindws) (riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP Tue Nov 22 15:56:43 +04 2022

@ConchuOD
Copy link
Member

Hello , I am using polarfire icicle board and using 2021:11 release because of some legacy reason. I am seeing it always mounts initramfs instead of rootfs , which is available in part3, Is there any extra configuration required to mount rootfs instead of initramfs(which is packed in the FIT image @initramfs.cpio.gz").

Provided the rootfs has been written to partition 3 & your kernel's CONFIG_CMDLINE contains "root=/dev/mmcblk0p3",
you should boot into the rootfs if you edit conf/osbi-fit-image.its and remove the line ramdisk = "initramfs.cpio.gz";

@govindsi
Copy link
Author

Hi Conor,

Thank you for the suggestions.
I did the changes in *.its file and overridden cmd line args using defconfig.append.
rootfs is written into p3. Now i get unknown block error.

Note: I am using 2021:11 tip

diff --git a/conf/osbi-fit-image.its b/conf/osbi-fit-image.its
index 04008a8..5a4434a 100644
--- a/conf/osbi-fit-image.its
+++ b/conf/osbi-fit-image.its
@@ -47,7 +47,6 @@
conf-riscvpc.dtb {
description = "1 Linux kernel, initramfs, FDT blob";
kernel = "vmlinux.bin";

  •            ramdisk = "initramfs.cpio.gz";
                       fdt = "riscvpc.dtb";
                       hash-1 {
                               algo = "sha256";
    

govind@govindws:~/work/polarfire/polarfire-soc-buildroot-sdk$ cat conf/icicle-kit-es/defconfig.append
CONFIG_CMDLINE="earlyprintk debug root=mmcblk0p3 uio_pdrv_genirq.of_id=generic-uio"

/dev/mmcblk0p3 on /media/govind/1f96c5cc-0ebc-42be-8267-4caa1b8e6ba5 type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)
/dev/mmcblk0p2 on /media/govind/9323-1D5D type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

govind@govindws:~/work/polarfire/polarfire-soc-buildroot-sdk$ ls /media/govind/1f96c5cc-0ebc-42be-8267-4caa1b8e6ba5/
bin dev etc lib lib64 linuxrc lost+found media mnt opt proc root run sbin sys tmp usr var

[ 8.475195] VFS: Cannot open root device "mmcblk0p3" or unknown-block(0,0): error -6
[ 8.483402] Please append a correct "root=" boot option; here are the available partitions:
[ 8.492112] DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify explicit textual name for "root=" boot option.
[ 8.502558] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 8.511118] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.12.19-03920-ged4fb5b0bc51-dirty #1
[ 8.519600] Hardware name: Microchip PolarFire-SoC Icicle Kit (DT)

@ConchuOD
Copy link
Member

Hey Govind!

govind@govindws:~/work/polarfire/polarfire-soc-buildroot-sdk$ cat conf/icicle-kit-es/defconfig.append
CONFIG_CMDLINE="earlyprintk debug root=mmcblk0p3 uio_pdrv_genirq.of_id=generic-uio"
root=mmcblk0p3

IIUC, that should be root=/dev/mmcblk0p3, similarly to what we have in the Yocto BSP: https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp/blob/master/recipes-kernel/linux/files/icicle-kit-es-amp/bsp_cmdline.cfg

@govindsi
Copy link
Author

govindsi commented Nov 24, 2022

I have modified the same as seen in kerel bootup logs

[ 0.000000] Kernel command line: earlyprintk debug root=/dev/mmcblk0p3 uio_pdrv_genirq.of_id=generic-uio
[ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)

mount error is still seen and all partition are good and tested as mount point is HOST machine.
Rootfs is flashed via CMD : "sudo make DISK=/dev/mmcblk0 DEVKIT=icicle-kit-es format-rootfs-image"

[ 8.490926] VFS: Cannot open root device "mmcblk0p3" or unknown-block(0,0): error -6
[ 8.499061] Please append a correct "root=" boot option; here are the available partitions:
[ 8.507669] musb-hdrc musb-hdrc.1.auto: Babble
[ 8.520717] DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify explicit textual name for "root=" boot option.
[ 8.531158] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 8.539716] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.12.19-03920-ged4fb5b0bc51-dirty #1
[ 8.548198] Hardware name: Microchip PolarFire-SoC Icicle Kit (DT)
[ 8.554521] Call Trace:
[ 8.557034] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000880
[ 8.566050] Oops [#1]
[ 8.568382] Modules linked in:
[ 8.571518] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.12.19-03920-ged4fb5b0bc51-dirty #1
[ 8.579985] Hardware name: Microchip PolarFire-SoC Icicle Kit (DT)
[ 8.586308] epc : walk_stackframe+0xb0/0xc6
[ 8.590634] ra : dump_backtrace+0x1c/0x24
[ 8.594851] epc : ffffffe0000048f6 ra : ffffffe000004928 sp : ffffffef7fe5fbf0
[ 8.602308] gp : ffffffe0014f2e60 tp : ffffffef7fe60000 t0 : ffffffef7fe38000
[ 8.609763] t1 : ffffffef7fe380a0 t2 : 0000000000000000 s0 : ffffffef7fe5fc40
[ 8.617223] s1 : ffffffe001052b00 a0 : 0000000000001000 a1 : 0000000000000000
[ 8.624673] a2 : ffffffe00088e756 a3 : ffffffe001052b00 a4 : 5105134c33053900
[ 8.632133] a5 : 0000000000001000 a6 : 000000000000001a a7 : ffffffe000328cec
[ 8.639585] s2 : 0000000000000000 s3 : 0000000000000000 s4 : 0000000000000000
[ 8.647034] s5 : ffffffe001052b00 s6 : ffffffe00088e756 s7 : fffffffffffffff3
[ 8.654489] s8 : ffffffe000c004c8 s9 : ffffffffffffffea s10: ffffffe000a000ac
[ 8.661947] s11: 0000000000000000 t3 : 0000000007200720 t4 : 0000000000000001
[ 8.669403] t5 : 014933f7b95ac8e6 t6 : ffffffef7fe5f998
[ 8.674835] status: 0000000200000100 badaddr: 0000000000000880 cause: 000000000000000d
[ 8.683012] [] walk_stackframe+0xb0/0xc6
[ 8.688634] [] dump_backtrace+0x1c/0x24
[ 8.694128] [] show_stack+0x2c/0x38
[ 8.699264] [] dump_stack+0x74/0x8e
[ 8.704409] [] panic+0xfc/0x2b6
[ 8.709194] [] mount_block_root+0x1c6/0x262
[ 8.715057] [] mount_root+0x114/0x13e
[ 8.720413] [] prepare_namespace+0x142/0x184
[ 8.726394] [] kernel_init_freeable+0x200/0x21c
[ 8.732588] [] kernel_init+0x12/0xf8
[ 8.737844] [] ret_from_exception+0x0/0xc
[ 8.743587] musb-hdrc musb-hdrc.1.auto: Babble

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants