diff --git a/conf/machine/stm32mp15-disco.conf b/conf/machine/stm32mp15-disco.conf index aacbe54..2845612 100644 --- a/conf/machine/stm32mp15-disco.conf +++ b/conf/machine/stm32mp15-disco.conf @@ -102,4 +102,4 @@ OPTEE_WIC_FILE = "${@bb.utils.contains('ST_VENDORFS','1','sdcard-stm32mp157c-dk2 # for generated a WIC file, please uncomment the 2 following lines or add them to local.conf #WKS_IMAGE_FSTYPES += "wic wic.bz2 wic.bmap" -#WKS_FILE += "${@bb.utils.contains('BOOTSCHEME_LABELS', 'optee', '${OPTEE_WIC_FILE}', '${TRUSTED_WIC_FILE}', d)}" +#WKS_FILE += "${@bb.utils.contains('BOOTSCHEME_LABELS', 'optee', '${OPTEE_WIC_FILE}', '${TRUSTED_WIC_FILE}', d)}" \ No newline at end of file diff --git a/conf/machine/stm32mp15-eval.conf b/conf/machine/stm32mp15-eval.conf index f75fce9..d15465c 100644 --- a/conf/machine/stm32mp15-eval.conf +++ b/conf/machine/stm32mp15-eval.conf @@ -88,3 +88,20 @@ M4_BOARDS = "STM32MP157C-EV1" # As example, modify the default boot config for each target to M4 config #UBOOT_EXTLINUX_DEFAULT_LABEL_stm32mp157c-ev1 = "stm32mp157c-ev1-m4-examples" +# ========================================================================= +# WIC for sdcard raw image +# ========================================================================= +WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" +WKS_FILE_DEPENDS ?= " \ + virtual/bootloader \ + virtual/trusted-firmware-a \ + ${@bb.utils.contains('BOOTSCHEME_LABELS', 'optee', 'virtual/optee-os', '', d)} \ + st-image-bootfs \ + ${@bb.utils.contains('ST_VENDORFS','1','st-image-vendorfs', '', d)} \ + st-image-userfs \ +" +TRUSTED_WIC_FILE = "${@bb.utils.contains('ST_VENDORFS','1','sdcard-stm32mp157c-ev1-trusted-vendorfs-1GB.wks.in','sdcard-stm32mp157c-ev1-trusted-1GB.wks.in',d)}" + +# for generated a WIC file, please uncomment the 2 following lines or add them to local.conf +#WKS_IMAGE_FSTYPES += "wic wic.bz2 wic.bmap" +#WKS_FILE += "${TRUSTED_WIC_FILE}" \ No newline at end of file diff --git a/wic/sdcard-stm32mp157c-ev1-trusted-1GB.wks.in b/wic/sdcard-stm32mp157c-ev1-trusted-1GB.wks.in new file mode 100644 index 0000000..9c68042 --- /dev/null +++ b/wic/sdcard-stm32mp157c-ev1-trusted-1GB.wks.in @@ -0,0 +1,28 @@ +# short-description: Create SD card image with a boot partition (1GB) +# long-description: Creates a partitioned SD card image (1GB) +# +# - ----- --------- -------------- ----------------------------------------------------- +# | | TFA | u-boot | teeh | teed | teex | bootfs | vendorfs | rootfs | userfs | +# - ----- --------- -------------- ----------------------------------------------------- +# ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ +# | | | | | | | | | | | +# 0 17kB 529kB 2.5MB 2.8MB 3MB 3.3MB 67.3MiB 83.3MB 851.3Mb 1024MB +# +# Warning: the first stage of boot (here fsbl1, fsbl2, fip) MUST be on GPT partition to be detected. +# + +part fsbl1 --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fsbl1 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/tf-a-stm32mp157c-ev1-trusted.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K --align 17 +part fsbl2 --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fsbl2 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/tf-a-stm32mp157c-ev1-trusted.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K +part ssbl --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=ssbl --sourceparams="file=${DEPLOY_DIR_IMAGE}/u-boot/u-boot-stm32mp157c-ev1-trusted.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 2048K + +## Please uncomment the 3 following lines if you use an OPTEE config +#part teeh --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=teeh --sourceparams="file=${DEPLOY_DIR_IMAGE}/optee/tee-header_v2-stm32mp157c-ev1-optee.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K +#part teed --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=teed --sourceparams="file=${DEPLOY_DIR_IMAGE}/optee/tee-pageable_v2-stm32mp157c-ev1-optee.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 512K +#part teex --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=teex --sourceparams="file=${DEPLOY_DIR_IMAGE}/optee/tee-pager_v2-stm32mp157c-ev1-optee.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K + + +part bootfs --source rawcopy --sourceparams="file=st-image-bootfs-${DISTRO}-${MACHINE}.ext4" --ondisk mmcblk --fstype=ext4 --label bootfs --active --fixed-size 64M +part / --source rootfs --ondisk mmcblk --fstype=ext4 --label rootfs --fixed-size 768M --uuid e91c4e10-16e6-4c0e-bd0e-77becf4a3582 +part usrfs --source rawcopy --sourceparams="file=st-image-userfs-${DISTRO}-${MACHINE}.ext4" --ondisk mmcblk --fstype=ext4 --label userfs --active --fixed-size 172M + +bootloader --ptable gpt \ No newline at end of file diff --git a/wic/sdcard-stm32mp157c-ev1-trusted-vendorfs-1GB.wks.in b/wic/sdcard-stm32mp157c-ev1-trusted-vendorfs-1GB.wks.in new file mode 100644 index 0000000..0324d83 --- /dev/null +++ b/wic/sdcard-stm32mp157c-ev1-trusted-vendorfs-1GB.wks.in @@ -0,0 +1,28 @@ +# short-description: Create SD card image with a boot partition (1GB) +# long-description: Creates a partitioned SD card image (1GB) +# +# - ----- --------- -------------- ----------------------------------------------------- +# | | TFA | u-boot | teeh | teed | teex | bootfs | vendorfs | rootfs | userfs | +# - ----- --------- -------------- ----------------------------------------------------- +# ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ +# | | | | | | | | | | | +# 0 17kB 529kB 2.5MB 2.8MB 3MB 3.3MB 67.3MiB 83.3MB 851.3Mb 1024MB +# +# Warning: the first stage of boot (here fsbl1, fsbl2, fip) MUST be on GPT partition to be detected. +# + +part fsbl1 --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fsbl1 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/tf-a-stm32mp157c-ev1-trusted.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K --align 17 +part fsbl2 --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fsbl2 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/tf-a-stm32mp157c-ev1-trusted.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K +part ssbl --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=ssbl --sourceparams="file=${DEPLOY_DIR_IMAGE}/u-boot/u-boot-stm32mp157c-ev1-trusted.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 2048K + +## Please uncomment the 3 following lines if you use an OPTEE config +#part teeh --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=teeh --sourceparams="file=${DEPLOY_DIR_IMAGE}/optee/tee-header_v2-stm32mp157c-ev1-optee.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K +#part teed --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=teed --sourceparams="file=${DEPLOY_DIR_IMAGE}/optee/tee-pageable_v2-stm32mp157c-ev1-optee.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 512K +#part teex --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=teex --sourceparams="file=${DEPLOY_DIR_IMAGE}/optee/tee-pager_v2-stm32mp157c-ev1-optee.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K + +part bootfs --source rawcopy --sourceparams="file=st-image-bootfs-${DISTRO}-${MACHINE}.ext4" --ondisk mmcblk --fstype=ext4 --label bootfs --active --fixed-size 64M +part vendorfs --source rawcopy --sourceparams="file=st-image-vendorfs-${DISTRO}-${MACHINE}.ext4" --ondisk mmcblk --fstype=ext4 --label vendorfs --active --fixed-size 16M +part / --source rootfs --ondisk mmcblk --fstype=ext4 --label rootfs --fixed-size 768M --uuid e91c4e10-16e6-4c0e-bd0e-77becf4a3582 +part usrfs --source rawcopy --sourceparams="file=st-image-userfs-${DISTRO}-${MACHINE}.ext4" --ondisk mmcblk --fstype=ext4 --label userfs --active --fixed-size 172M + +bootloader --ptable gpt \ No newline at end of file