Issue
I'm working with the K26 and kv260-starter-kit in preparation for a future product based on the k26 SOM (call it the m123, for example). When I bitbake with MACHINE=kv260-starter-kit
:
bitbake m123-image
I get a bootable result copying the following files to the 'boot' partition of my SD card:
- Image
- boot.scr
- boot.bin
- petalinux-initramfs...cpio.gz.u-boot
- devicetree/system-top-zynqmp-sck-kv-g-revB.dtb (as system.dtb)
The filesystem is untar'd to the 'root' partition of my SD card, as well. This bootable system works correctly.
When I change to MACHINE=m123
, and simply copy-paste the kv260-starter-kit.conf into my new m123.conf:
#@TYPE: Machine
#@NAME: M123
#@DESCRIPTION: Dev hardware for the M123
#### Preamble
MACHINEOVERRIDES =. "${@['', 'kv260-starter-kit:']['kv260-starter-kit' != '${MACHINE}']}"
MACHINEOVERRIDES =. "k26-kv:"
#### Regular settings follow
require conf/machine/starter-kit-common.inc
IMAGE_BOOT_FILES += " devicetree/system-top-zynqmp-sck-kv-g-revB.dtb;system.dtb"
#### No additional settings should be after the Postamble
#### Postamble
PACKAGE_EXTRA_ARCHS:append = "${@['', ' kv260_starter_kit']['kv260-starter-kit' != "${MACHINE}"]}"
Running the same bitbake command as above results in what look like the correct files, which are copied over from the tmp/deploy/images/m123/ folder, instead, but result in the following, paraphrased, bootup:
Hit any key to stop autoboot: 0
model=SMK-K26-XCL2G
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
2792 bytes read in 24 ms (113.3 KiB/s)
## Executing script at 20000000
Trying to load boot images from mmc1
22403584 bytes read in 1475 ms (14.5 MiB/s)
45696 bytes read in 30 ms (1.5 MiB/s)
** No boot file defined **
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
## Flattened Device Tree blob at 00100000
Booting using the fdt blob at 0x100000
Loading Device Tree to 000000000fff1000, end 000000000ffff27f ... OK
Starting kernel ...
//...
[ 4.371835] cfg80211: failed to load regulatory.db
[ 4.470245] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
//...
[ 4.750234] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
//...
[ 4.835820] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
I don't understand the OVERRIDES and MACHINEOVERRIDES mechanism properly, but I believe that the issue from the copy-pasted kv260-starter-kit.conf is the following portion(s), because, of course, MACHINE=m123
in this case:
['kv260-starter-kit' != '${MACHINE}']
I get a wholly unusable build result when I simply replace occurrences of kv260-starter-kit
with m123
in my m123.conf, I presume because there's a lot of missed OVERRIDEs for k26 and kv260 build tasks.
What do I need to change to be able to "inherit" all of the kv260 build behavior, for now, while working to append the m123.conf for any incremental changes I make while developing this product (and waiting for production hardware)?
Thanks for any help you can offer even if its just trial-and-error suggestions!
Solution
The means of "inheriting" behaviors or tasks from one machine to another isn't entirely clear to me still, but I was pointed to using the following command to search through all of my recipes for the kv260
string in order to determine what behavior might need to be copied for the m123
machine. I found that the boot.scr parameters were modified for the kv260
in meta-som/recipes-core/u-boot/u-boot-zynq-scr.bbappend.
In order to create the boot.scr for the m123
, I created /meta-proj/recipes-core/u-boot/u-boot-zynq-scr.bbappend, replacing instances of kv260-starter-kit
with m123
:
BOOTMODE:m123 = "generic"
BOOTFILE_EXT:m123 = ""
RAMDISK_IMAGE1:m123 = "${INITRAMFS_IMAGE}-m123.cpio.gz.u-boot"
KERNEL_IMAGE:m123 = "Image"
QSPI_RAMDISK_OFFSET:m123 = "0x4000000"
QSPI_FIT_IMAGE_OFFSET:m123 = "0xF40000"
NAND_RAMDISK_OFFSET:m123 = "0x7800000"
NAND_FIT_IMAGE_OFFSET:m123 = "0x4180000"
The resultant boot.scr and machine images now properly boot.
Answered By - Rich Hoffman Answer Checked By - Marilyn (WPSolving Volunteer)