I am working to create an image for a new device - Belkin F9K1109v1. As you will see below I don't know what I am doing. This is a ramips/rt3883 and uses DTS. I am able to TFTP and openwrt runs nicely as a initramfs (no flashing). I am failing miserably on getting a squashfs image to flash and boot. I am 100% sure I am missing some fundamentals on how the MTD partitions are setup.
My main question is: do I need to set partitions for kernel, rootfs and rootfs_data in the DTS? I can see how that would make sense, but the existing DTS examples I have been looking at only have "firmware". Some other magic appears to create kernel, rootfs and rootfs_data based on the firmware?
Here is a an example with a RT-N56U which only has a "firmware" partition
Here is a boot log snippet from the RT-N56U running openwrt (not positive this is from build using the above DTS)
[ 2.200000] 4 ofpart partitions found on MTD device 1c000000.nor-flash [ 2.210000] Creating 4 MTD partitions on "1c000000.nor-flash": [ 2.220000] 0x000000000000-0x000000030000 : "u-boot" [ 2.230000] 0x000000030000-0x000000040000 : "u-boot-env" [ 2.240000] 0x000000040000-0x000000050000 : "factory" [ 2.250000] 0x000000050000-0x000000800000 : "firmware" [ 2.270000] 2 uimage-fw partitions found on MTD device firmware [ 2.280000] 0x000000050000-0x000000171408 : "kernel" [ 2.290000] 0x000000171408-0x000000800000 : "rootfs" [ 2.300000] mtd: device 5 (rootfs) set to be root filesystem [ 2.310000] 1 squashfs-split partitions found on MTD device rootfs [ 2.330000] 0x000000650000-0x000000800000 : "rootfs_data"
I think this means the kernel is using partitions from the firmware image? Note it is also setting the root fs here
Here is a bootlog from this F9K1109v1 I am working on
[ 2.354987] spi spi0.0: force spi mode3 [ 2.363529] m25p80 spi0.0: mx25l6405d (8192 Kbytes) [ 2.373358] 4 fixed-partitions partitions found on MTD device spi0.0 [ 2.386026] Creating 4 MTD partitions on "spi0.0": [ 2.395585] 0x000000000000-0x000000030000 : "uboot" [ 2.406314] 0x000000030000-0x000000040000 : "uboot-env" [ 2.417730] 0x000000040000-0x000000050000 : "factory" [ 2.428806] 0x000000050000-0x0000007f0000 : "firmware"
no other partitions created. Also no MTD is set as root fs, which causes the panic below. I know I can set the root=/dev/mtdblockX as a kernel parameter, but I haven't found many DTS-es that do that.
[ 4.861710] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 [ 4.876689] Please append a correct "root=" boot option; here are the available partitions: [ 4.893344] 1f00 192 mtdblock0 [ 4.893350] (driver?) [ 4.906379] 1f01 64 mtdblock1 [ 4.906383] (driver?) [ 4.919401] 1f02 64 mtdblock2 [ 4.919405] (driver?) [ 4.932423] 1f03 7808 mtdblock3 [ 4.932428] (driver?) [ 4.945452] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Any help is much appreciated. I can post DTS, bootlogs whatever if any of that is helpful.