diff options
author | Brian Ma <chma0@nuvoton.com> | 2023-05-10 09:49:35 +0300 |
---|---|---|
committer | Tim Lee <chli30@nuvoton.com> | 2023-07-04 08:37:59 +0300 |
commit | 816dbb7809f44006b99a03a4b61c75a0e6dca7dc (patch) | |
tree | 985d117db09f59942d33d6ef340f732ade6404cd | |
parent | 2a1e461a98a74229bab8decf68b9d79bb1555253 (diff) | |
download | openbmc-816dbb7809f44006b99a03a4b61c75a0e6dca7dc.tar.xz |
meta-nuvoton: Add build wic image support
We add wks file and relative config for build wic image. Now user can
build wic image by include phosphor-mmc.inc. And set WKS_RWFS_SIZE,
WKS_RWFS_SIZE to adjust eMMC parition size instead of create new wks
file for each board.
Change-Id: I1ed342658d791fd9011bd31ea6db36d4362d120b
Signed-off-by: Brian Ma <chma0@nuvoton.com>
-rw-r--r-- | meta-nuvoton/conf/machine/include/nuvoton.inc | 9 | ||||
-rw-r--r-- | meta-nuvoton/recipes-bsp/u-boot/files/u-boot-emmc.cfg | 5 | ||||
-rw-r--r-- | meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_git.bb | 4 | ||||
-rw-r--r-- | meta-nuvoton/wic/emmc-nuvoton.wks.in | 32 |
4 files changed, 49 insertions, 1 deletions
diff --git a/meta-nuvoton/conf/machine/include/nuvoton.inc b/meta-nuvoton/conf/machine/include/nuvoton.inc index 9662af9d48..2673e3b3f1 100644 --- a/meta-nuvoton/conf/machine/include/nuvoton.inc +++ b/meta-nuvoton/conf/machine/include/nuvoton.inc @@ -3,5 +3,14 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-nuvoton" PREFERRED_PROVIDER_u-boot ?= "u-boot-nuvoton" PREFERRED_PROVIDER_u-boot-fw-utils ?= "u-boot-fw-utils-nuvoton" +WKS_FILE ?= "emmc-nuvoton.wks.in" +WKS_FILE_DEPENDS ?= " \ + virtual/kernel \ +" +WKS_RWFS_SIZE ??= "256M" +WKS_ROFS_SIZE ??= "256M" +IMAGE_BOOT_FILES ?= "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE};fitImage" +IMAGE_FSTYPES:remove:df-phosphor-mmc = "mtd-static mtd-static-tar mtd-static-alltar" + MACHINEOVERRIDES .= ":nuvoton" MACHINE_EXTRA_RRECOMMENDS += "udev-nuvoton-mtd-partitions" diff --git a/meta-nuvoton/recipes-bsp/u-boot/files/u-boot-emmc.cfg b/meta-nuvoton/recipes-bsp/u-boot/files/u-boot-emmc.cfg new file mode 100644 index 0000000000..4bc6522423 --- /dev/null +++ b/meta-nuvoton/recipes-bsp/u-boot/files/u-boot-emmc.cfg @@ -0,0 +1,5 @@ +CONFIG_CMD_EXT4=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_GPT=y +CONFIG_CMD_PART=y +CONFIG_CMD_UNZIP=y diff --git a/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_git.bb b/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_git.bb index 3ecb4a457a..d4c4697509 100644 --- a/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_git.bb +++ b/meta-nuvoton/recipes-bsp/u-boot/u-boot-nuvoton_git.bb @@ -1,4 +1,4 @@ -DESCRIPTION = "U-boot for Nuvoton NPCM7xx Baseboard Management Controller" +DESCRIPTION = "U-boot for Nuvoton NPCM7xx/NPCM8xx Baseboard Management Controller" require u-boot-common-nuvoton.inc require u-boot-nuvoton.inc @@ -6,3 +6,5 @@ require u-boot-nuvoton.inc PROVIDES += "u-boot" DEPENDS += "dtc-native" + +SRC_URI:append:df-phosphor-mmc = " file://u-boot-emmc.cfg" diff --git a/meta-nuvoton/wic/emmc-nuvoton.wks.in b/meta-nuvoton/wic/emmc-nuvoton.wks.in new file mode 100644 index 0000000000..6e2e054fb1 --- /dev/null +++ b/meta-nuvoton/wic/emmc-nuvoton.wks.in @@ -0,0 +1,32 @@ +# short-description: Create an image for eMMC +# long-description: Creates an eMMC card image for the User Data Area that can +# be used with the Nuvoton SoC family. +# +# Assumes a minimum flash size of 1GB. +# Assumes U-Boot is stored elsewhere, such as an eMMC boot volume or NOR flash. +# +# --- - ---------- -------- -------- -------- -------- ------ ------- +# |GPT| | reserved | boot-a | boot-b | rofs-a | rofs-b | rwfs |GPT-sec| +# --- - ---------- -------- -------- -------- -------- ------ ------- +# ^ 1MB 64MB 64MB 256MB 256MB 256MB +# | +# 0x5000 +# +# Primary GPT size (Beginning of image): +# 512B (Protective MBR) + 512B (Primary Header) + 16KB (Primary Table) +# First partition (u-boot-env) is 4K-aligned, which puts it at offset 0x5000 +# +# Secondary GPT size (End of image): +# 16KB (Secondary Table) + 512B (Secondary Header) + +bootloader --ptable gpt + +# Hint: bootimg-partition size must be same as MMC_BOOT_PARTITION_SIZE +# Note: the partition layout above is SoC default value, it may change by user +# set WKS_ROFS_SIZE, WKS_RWFS_SIZE or MMC_BOOT_PARTITION_SIZE. +part --align 4 --fixed-size 1M +part --fstype=ext4 --fixed-size ${MMC_BOOT_PARTITION_SIZE}K --source bootimg-partition --label boot-a +part --fstype=ext4 --fixed-size ${MMC_BOOT_PARTITION_SIZE}K --source bootimg-partition --label boot-b +part --fstype=ext4 --fixed-size ${WKS_ROFS_SIZE} --source rootfs --label rofs-a +part --fstype=ext4 --fixed-size ${WKS_ROFS_SIZE} --source rootfs --label rofs-b +part --fstype=ext4 --fixed-size ${WKS_RWFS_SIZE} --label rwfs |