From 98a4635d87efaf054cbd10cabcdbdee4153a5b4f Mon Sep 17 00:00:00 2001 From: Jamie Gibbons Date: Thu, 14 Aug 2025 13:16:36 +0100 Subject: [PATCH] board: microchip: mpfs_icicle: update to support production silicon With the introduction of the production silicon Icicle Kit comes the need to support multiple board device trees. The HSS puts a minimal dtb in it's payload's ancillary-data immediately after U-Boot in memory. CONFIG_OF_BOARD will use this dtb that the HSS carries with the bare minimum of nodes enabled. It allows for firmware to provide the address of the devicetree in memory using the `a1` register. Use the device tree compatible from the hart software services to essentially "detect" which board is in use and therefore select the appropiate device tree for the board. Add a fdt production node to the .its referencing the production Icicle Kit DTB with appropriate attributes. Introduce matching configuration entries to enable selection of the production Icicle kit FDT blob for the MPFS Icicle Production Silicon board. Update the configuration names to match the device tree compatibles for each board configuration. With these updates, change image node and configuration node names with more appropriate names. Signed-off-by: Jamie Gibbons Signed-off-by: Thomas Petazzoni --- board/microchip/mpfs_icicle/mpfs_icicle.its | 36 +++++++++++++++---- board/microchip/mpfs_icicle/uboot-env.txt | 21 ++++++----- .../mpfs_icicle/uboot-fragment-rootfs.config | 1 + 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.its b/board/microchip/mpfs_icicle/mpfs_icicle.its index a62b079fa1..2f89a6ee2f 100644 --- a/board/microchip/mpfs_icicle/mpfs_icicle.its +++ b/board/microchip/mpfs_icicle/mpfs_icicle.its @@ -24,7 +24,7 @@ algo = "sha256"; }; }; - base_fdt { + fdt-mpfs-icicle-kit.dtb { description = "Flattened Device Tree blob"; data = /incbin/("./mpfs-icicle-kit.dtb"); type = "flat_dt"; @@ -35,19 +35,41 @@ algo = "sha256"; }; }; + fdt-mpfs-icicle-kit-prod.dtb { + description = "Flattened Device Tree blob"; + data = /incbin/("./mpfs-icicle-kit-prod.dtb"); + type = "flat_dt"; + arch = "riscv"; + compression = "none"; + load = <0x8a000000>; + hash-1 { + algo = "sha256"; + }; + }; }; configurations { - default = "kernel_dtb"; - kernel_dtb { + default = "conf-microchip,mpfs-icicle-kit-prod"; + conf-microchip,mpfs-icicle-kit { description = "1 Linux kernel, FDT blob"; kernel = "kernel"; - fdt = "base_fdt"; + fdt = "fdt-mpfs-icicle-kit.dtb"; }; - base_dtb { + conf-microchip,mpfs-icicle-kit-prod { + description = "1 Linux kernel, FDT blob"; + kernel = "kernel"; + fdt = "fdt-mpfs-icicle-kit-prod.dtb"; + }; + + conf-microchip,fdt-mpfs-icicle-kit.dtb { description = "Base FDT blob for MPFS Icicle board"; - fdt = "base_fdt"; + fdt = "fdt-mpfs-icicle-kit.dtb"; + }; + + conf-microchip,fdt-mpfs-icicle-kit-prod.dtb { + description = "Base FDT blob for MPFS Icicle Production board"; + fdt = "fdt-mpfs-icicle-kit-prod.dtb"; }; }; -}; +}; \ No newline at end of file diff --git a/board/microchip/mpfs_icicle/uboot-env.txt b/board/microchip/mpfs_icicle/uboot-env.txt index 8a655085ed..befbfa2006 100644 --- a/board/microchip/mpfs_icicle/uboot-env.txt +++ b/board/microchip/mpfs_icicle/uboot-env.txt @@ -5,12 +5,15 @@ setenv fdt_high 0xffffffffffffffff setenv initrd_high 0xffffffffffffffff -load mmc 0:${distro_bootpart} ${scriptaddr} mpfs_icicle.itb; -bootm start ${scriptaddr}#kernel_dtb; -bootm loados ${scriptaddr}; -# Try to load a ramdisk if available inside fitImage -bootm ramdisk; -bootm prep; -fdt set /soc/ethernet@20112000 mac-address ${icicle_mac_addr0}; -fdt set /soc/ethernet@20110000 mac-address ${icicle_mac_addr1}; -bootm go; +fdt addr ${fdtcontroladdr} +fdt get value board_compatible / compatible 1 + +setenv fitconf conf-${board_compatible} + +load mmc 0:${distro_bootpart} ${scriptaddr} mpfs_icicle.itb +bootm start ${scriptaddr}#${fitconf} +bootm loados ${scriptaddr} +bootm ramdisk +bootm prep +run design_overlays +bootm go diff --git a/board/microchip/mpfs_icicle/uboot-fragment-rootfs.config b/board/microchip/mpfs_icicle/uboot-fragment-rootfs.config index e2a5eb9438..47f4c35ea4 100644 --- a/board/microchip/mpfs_icicle/uboot-fragment-rootfs.config +++ b/board/microchip/mpfs_icicle/uboot-fragment-rootfs.config @@ -1,3 +1,4 @@ CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/mmcblk0p3 rootwait uio_pdrv_genirq.of_id=generic-uio" CONFIG_MPFS_PRIORITISE_QSPI_BOOT=n +CONFIG_OF_BOARD=y