From 0b6234d8e386b0d6b475f8d0124d12fad845e99a Mon Sep 17 00:00:00 2001 From: Mathieu Dubois-Briand Date: Tue, 24 Mar 2026 11:51:44 +0100 Subject: [PATCH 1/2] meta-mchp-mpu-bsp: Add sama5d2-xplained-optee-sd machine Signed-off-by: Mathieu Dubois-Briand --- meta-mchp-mpu/README.md | 1 + .../conf/templates/default/conf-notes.txt | 1 + .../packagegroup-mchp-security.bbappend | 6 +++++ .../machine/sama5d2-xplained-optee-sd.conf | 26 ++++++++++++++++++ .../at91bootstrap/at91bootstrap.inc | 1 + .../files/envs/sama5d2-xplained-optee-sd.txt | 23 ++++++++++++++++ .../sama5-linux-optee.cfg | 27 +++++++++++++++++++ ...-sama5d2_xplained-include-optee-dtsi.patch | 26 ++++++++++++++++++ .../sama5-linux-optee.cfg | 27 +++++++++++++++++++ ...-sama5d2_xplained-include-optee-dtsi.patch | 26 ++++++++++++++++++ .../sama5-linux-optee.cfg | 27 +++++++++++++++++++ ...-sama5d2_xplained-include-optee-dtsi.patch | 26 ++++++++++++++++++ .../linux/linux-mchp_6.%.bbappend | 4 +++ .../recipes-security/optee/optee-%.bbappend | 2 +- .../optee/optee-client_%.bbappend | 1 + .../optee/optee-examples_%.bbappend | 1 + .../optee/optee-os-mchp-overrides.inc | 1 + .../optee/optee-os-tadevkit_%.bbappend | 2 ++ .../optee/optee-os_%.bbappend | 2 ++ .../optee/optee-test_%.bbappend | 1 + 20 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/conf/machine/sama5d2-xplained-optee-sd.conf create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/envs/sama5d2-xplained-optee-sd.txt create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch diff --git a/meta-mchp-mpu/README.md b/meta-mchp-mpu/README.md index 2bb95f7..7d4eb55 100644 --- a/meta-mchp-mpu/README.md +++ b/meta-mchp-mpu/README.md @@ -15,6 +15,7 @@ Collection of OpenEmbedded/Yocto Project layers for MPU SoC. | **SAMA5D2** | sama5d2-icp-sd | N/A | N/A | | | sama5d2-ptc-ek-sd | sama5d2-ptc-ek | N/A | | | sama5d2-xplained-sd | sama5d2-xplained | sama5d2-xplained-emmc | +| | sama5d2-xplained-optee-sd | N/A | N/A | | **SAMA5D27** | sama5d27-som1-ek-sd | N/A | N/A | | | sama5d27-som1-ek-optee-sd | N/A | N/A | | | sama5d27-wlsom1-ek-sd | N/A | N/A | diff --git a/meta-mchp-mpu/meta-mchp-mpu-apps/conf/templates/default/conf-notes.txt b/meta-mchp-mpu/meta-mchp-mpu-apps/conf/templates/default/conf-notes.txt index 9a01b75..f9c1f74 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-apps/conf/templates/default/conf-notes.txt +++ b/meta-mchp-mpu/meta-mchp-mpu-apps/conf/templates/default/conf-notes.txt @@ -11,6 +11,7 @@ Microchip supported machines are: | **SAMA5D2** | sama5d2-icp-sd | N/A | N/A | | | sama5d2-ptc-ek-sd | sama5d2-ptc-ek | N/A | | | sama5d2-xplained-sd | sama5d2-xplained | sama5d2-xplained-emmc | +| | sama5d2-xplained-optee-sd | N/A | N/A | | **SAMA5D27** | sama5d27-som1-ek-sd | N/A | N/A | | | sama5d27-som1-ek-optee-sd | N/A | N/A | | | sama5d27-wlsom1-ek-sd | N/A | N/A | diff --git a/meta-mchp-mpu/meta-mchp-mpu-apps/recipes-mchp/packagegroups/packagegroup-mchp-security.bbappend b/meta-mchp-mpu/meta-mchp-mpu-apps/recipes-mchp/packagegroups/packagegroup-mchp-security.bbappend index 89d3f67..fa5d369 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-apps/recipes-mchp/packagegroups/packagegroup-mchp-security.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-apps/recipes-mchp/packagegroups/packagegroup-mchp-security.bbappend @@ -14,3 +14,9 @@ RDEPENDS:packagegroup-mchp-security:append:sama5d27-som1-ek-optee-sd = "\ optee-os \ optee-test \ " + +RDEPENDS:packagegroup-mchp-security:append:sama5d2-xplained-optee-sd = "\ + optee-examples \ + optee-os \ + optee-test \ +" diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/conf/machine/sama5d2-xplained-optee-sd.conf b/meta-mchp-mpu/meta-mchp-mpu-bsp/conf/machine/sama5d2-xplained-optee-sd.conf new file mode 100644 index 0000000..1746148 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/conf/machine/sama5d2-xplained-optee-sd.conf @@ -0,0 +1,26 @@ +#@TYPE: Machine +#@Name: MICROCHIP SAMA5D2 Xplained SD +#@DESCRIPTION: Machine configuration for Microchip SAMA5D2 xplained sd board + +require include/sama5d2.inc + +KERNEL_DEVICETREE = "microchip/at91-sama5d2_xplained.dtb" +DT_MACHINE ?= "sama5d2_xplained" + +IMAGE_FSTYPES += " tar.gz wic" + +WKS_FILE = "sdimage-bootpart.wks" +IMAGE_BOOT_FILES = "BOOT.BIN u-boot.bin uboot.env sama5d2_xplained.itb tee.bin" + +UBOOT_MACHINE ?= "sama5d2_xplained_mmc_optee_defconfig" +UBOOT_ENTRYPOINT = "0x24000000" +UBOOT_LOADADDRESS = "0x24000000" +UBOOT_ENV_SIZE = "0x1000" + +MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " dt-overlay-mchp" + +# Add deploy functions to the wic image dependency +do_image_wic[depends] += " u-boot-mchp:do_deploy" +do_image_wic[depends] += " dt-overlay-mchp:do_deploy" + +MACHINEOVERRIDES =. "mpuall:sama5d2_xplained:" diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/at91bootstrap/at91bootstrap.inc b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/at91bootstrap/at91bootstrap.inc index 37e1771..a7792b1 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/at91bootstrap/at91bootstrap.inc +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/at91bootstrap/at91bootstrap.inc @@ -25,6 +25,7 @@ AT91BOOTSTRAP_CONFIG:sama5d4-xplained ??= "${AT91BOOTSTRAP_MACHINE}nf_uboot_secu AT91BOOTSTRAP_CONFIG:sama5d4-xplained-sd ??= "${AT91BOOTSTRAP_MACHINE}sd_uboot_secure" AT91BOOTSTRAP_CONFIG:sama5d2-xplained ??= "${AT91BOOTSTRAP_MACHINE}-bsrdf_uboot" AT91BOOTSTRAP_CONFIG:sama5d2-xplained-emmc ??= "${AT91BOOTSTRAP_MACHINE}emmc_uboot" +AT91BOOTSTRAP_CONFIG:sama5d2-xplained-optee-sd ??= "${AT91BOOTSTRAP_MACHINE}-opteesd_uboot" AT91BOOTSTRAP_CONFIG:sama5d2-xplained-sd ??= "${AT91BOOTSTRAP_MACHINE}-bsrsd_uboot" AT91BOOTSTRAP_CONFIG:sama5d2-ptc-ek-sd ??= "${AT91BOOTSTRAP_MACHINE}sd_uboot" AT91BOOTSTRAP_CONFIG:sama5d27-som1-ek ??= "${AT91BOOTSTRAP_MACHINE}qspi_uboot" diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/envs/sama5d2-xplained-optee-sd.txt b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/envs/sama5d2-xplained-optee-sd.txt new file mode 100644 index 0000000..2943c89 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/envs/sama5d2-xplained-optee-sd.txt @@ -0,0 +1,23 @@ +video_mode_pda4=Unknown-1:480x272-16 +video_mode_pda5=Unknown-1:800x480-16 +video_mode_pda7=Unknown-1:800x480-16 +video_mode_pda7b=Unknown-1:800x480-16 +at91_pda_detect=run pda4300test; run pda7000test; run pda7000btest; run pda5000test; run pda4301test; run pda4301btest; +pda7000btest=test -n $display && test $display = 7000B && setenv display_var 'pda7b' && setenv video_mode ${video_mode_pda7b} +at91_set_display=test -n $pda && setenv display $pda +pda4300test=test -n $display && test $display = 4300 && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} +pda4301test=test -n $display && test $display = 4301 && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} +pda4301btest=test -n $display && test $display = 4301B && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} +at91_prepare_bootargs=test -n $display_var && setenv bootargs ${bootargs} ${at91_video_bootargs} +at91_prepare_video_bootargs=test -n $display_var && setenv at91_video_bootargs video=${video_mode} +pda7000test=test -n $display && test $display = 7000 && setenv display_var 'pda7' && setenv video_mode ${video_mode_pda7} +at91_prepare_overlays_config=test -n $display_var && setenv at91_overlays_config '#'${display_var} +bootcmd=run at91_set_display; run at91_pda_detect; run at91_prepare_video_bootargs; run at91_prepare_bootargs; run at91_prepare_overlays_config; run bootcmd_boot; +pda5000test=test -n $display && test $display = 5000 && setenv display_var 'pda5' && setenv video_mode ${video_mode_pda5} +bootargs=console=ttyS0,115200 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait atmel.pm_modes=standby,ulp1 +bootcmd_boot=fatload mmc 1:1 0x24000000 sama5d2_xplained.itb; bootm 0x24000000#kernel_dtb${at91_overlays_config} +bootdelay=1 +ethact=gmac0 +stderr=serial +stdin=serial +stdout=serial diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg new file mode 100644 index 0000000..d18716d --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg @@ -0,0 +1,27 @@ +CONFIG_TEE=y +CONFIG_OPTEE=y +CONFIG_ARM_PSCI=y +CONFIG_ARM_PSCI_FW=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y +CONFIG_ARM_SMCCC_SOC_ID=y +CONFIG_REGMAP_SMCCC=y +CONFIG_MAILBOX=y +CONFIG_ARM_SCMI_PROTOCOL=y +# CONFIG_ARM_SCMI_POWER_DOMAIN is not set +CONFIG_COMMON_CLK_SCMI=y +CONFIG_CPU_IDLE=y +CONFIG_ARM_PSCI_CPUIDLE=y +# CONFIG_ARM_PSCI_CPUIDLE_DOMAIN is not set +# CONFIG_ARM_AT91_CPUIDLE is not set +# CONFIG_ATMEL_PM is not set +CONFIG_ATMEL_SECURE_PM=y +# CONFIG_HW_RANDOM_ATMEL is not set +CONFIG_HW_RANDOM_OPTEE=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_AT91_SAMA5D2_UART0=y +CONFIG_EARLY_PRINTK=y +# CONFIG_SAMA5D4_WATCHDOG is not set +CONFIG_ARM_SMC_WATCHDOG=y +# CONFIG_RTC_DRV_AT91RM9200 is not set +CONFIG_RTC_DRV_OPTEE=y diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch new file mode 100644 index 0000000..5f3fc85 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.12.48/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch @@ -0,0 +1,26 @@ +From 87454ffaf249476c849dbb2fc5ae9b637ff7d7ba Mon Sep 17 00:00:00 2001 +From: Mathieu Dubois-Briand +Date: Tue, 24 Mar 2026 10:13:45 +0100 +Subject: [PATCH] at91-sama5d2_xplained: include optee dtsi + +Upstream-Status: Inappropriate [only specific to optee configuration] +Signed-off-by: Mathieu Dubois-Briand +--- + arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts +index 5389f203eebe..7f6ac2256348 100644 +--- a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts ++++ b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + #include "sama5d2.dtsi" + #include "sama5d2-pinfunc.h" ++#include "sama5d2-optee.dtsi" + #include + #include + #include +-- +2.47.3 + diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg new file mode 100644 index 0000000..d18716d --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg @@ -0,0 +1,27 @@ +CONFIG_TEE=y +CONFIG_OPTEE=y +CONFIG_ARM_PSCI=y +CONFIG_ARM_PSCI_FW=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y +CONFIG_ARM_SMCCC_SOC_ID=y +CONFIG_REGMAP_SMCCC=y +CONFIG_MAILBOX=y +CONFIG_ARM_SCMI_PROTOCOL=y +# CONFIG_ARM_SCMI_POWER_DOMAIN is not set +CONFIG_COMMON_CLK_SCMI=y +CONFIG_CPU_IDLE=y +CONFIG_ARM_PSCI_CPUIDLE=y +# CONFIG_ARM_PSCI_CPUIDLE_DOMAIN is not set +# CONFIG_ARM_AT91_CPUIDLE is not set +# CONFIG_ATMEL_PM is not set +CONFIG_ATMEL_SECURE_PM=y +# CONFIG_HW_RANDOM_ATMEL is not set +CONFIG_HW_RANDOM_OPTEE=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_AT91_SAMA5D2_UART0=y +CONFIG_EARLY_PRINTK=y +# CONFIG_SAMA5D4_WATCHDOG is not set +CONFIG_ARM_SMC_WATCHDOG=y +# CONFIG_RTC_DRV_AT91RM9200 is not set +CONFIG_RTC_DRV_OPTEE=y diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch new file mode 100644 index 0000000..ef0d411 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.18.17/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch @@ -0,0 +1,26 @@ +From 00639b33c3cf473f2542d9398c220db23622de3c Mon Sep 17 00:00:00 2001 +From: Mathieu Dubois-Briand +Date: Tue, 24 Mar 2026 10:13:45 +0100 +Subject: [PATCH 1/2] at91-sama5d2_xplained: include optee dtsi + +Upstream-Status: Inappropriate [only specific to optee configuration] +Signed-off-by: Mathieu Dubois-Briand +--- + arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts +index 0c8f9b4357cb..bc858176884d 100644 +--- a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts ++++ b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + #include "sama5d2.dtsi" + #include "sama5d2-pinfunc.h" ++#include "sama5d2-optee.dtsi" + #include + #include + #include +-- +2.47.3 + diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg new file mode 100644 index 0000000..d18716d --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2-xplained-optee-sd/sama5-linux-optee.cfg @@ -0,0 +1,27 @@ +CONFIG_TEE=y +CONFIG_OPTEE=y +CONFIG_ARM_PSCI=y +CONFIG_ARM_PSCI_FW=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y +CONFIG_ARM_SMCCC_SOC_ID=y +CONFIG_REGMAP_SMCCC=y +CONFIG_MAILBOX=y +CONFIG_ARM_SCMI_PROTOCOL=y +# CONFIG_ARM_SCMI_POWER_DOMAIN is not set +CONFIG_COMMON_CLK_SCMI=y +CONFIG_CPU_IDLE=y +CONFIG_ARM_PSCI_CPUIDLE=y +# CONFIG_ARM_PSCI_CPUIDLE_DOMAIN is not set +# CONFIG_ARM_AT91_CPUIDLE is not set +# CONFIG_ATMEL_PM is not set +CONFIG_ATMEL_SECURE_PM=y +# CONFIG_HW_RANDOM_ATMEL is not set +CONFIG_HW_RANDOM_OPTEE=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_AT91_SAMA5D2_UART0=y +CONFIG_EARLY_PRINTK=y +# CONFIG_SAMA5D4_WATCHDOG is not set +CONFIG_ARM_SMC_WATCHDOG=y +# CONFIG_RTC_DRV_AT91RM9200 is not set +CONFIG_RTC_DRV_OPTEE=y diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch new file mode 100644 index 0000000..f5c9d38 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp-6.6.64/sama5d2/0001-at91-sama5d2_xplained-include-optee-dtsi.patch @@ -0,0 +1,26 @@ +From 24d5c07a1108bec6d10f193b51b1393f77eb8ef1 Mon Sep 17 00:00:00 2001 +From: Mathieu Dubois-Briand +Date: Tue, 24 Mar 2026 10:13:45 +0100 +Subject: [PATCH] at91-sama5d2_xplained: include optee dtsi + +Upstream-Status: Inappropriate [only specific to optee configuration] +Signed-off-by: Mathieu Dubois-Briand +--- + arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts +index a651be749291..1ab76ce98e8b 100644 +--- a/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts ++++ b/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + #include "sama5d2.dtsi" + #include "sama5d2-pinfunc.h" ++#include "sama5d2-optee.dtsi" + #include + #include + #include +-- +2.47.3 + diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp_6.%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp_6.%.bbappend index 2ad83e5..7b2d08c 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp_6.%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-kernel/linux/linux-mchp_6.%.bbappend @@ -12,6 +12,10 @@ SRC_URI:append:\ sama5d27-som1-ek-optee-sd = " file://sama5-linux-optee.cfg \ file://sama5d2/0001-dts-include-optee-dtsi.patch \ " +SRC_URI:append:\ +sama5d2-xplained-optee-sd = " file://sama5-linux-optee.cfg \ + file://0001-at91-sama5d2_xplained-include-optee-dtsi.patch \ + " SRC_URI:append:sam9x60 = " file://at91_dt.cfg" SRC_URI:append:\ sama7g5ek-optee-sd = " file://sama7g5ek-linux-optee.cfg \ diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-%.bbappend index 59b3262..f2cd453 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-%.bbappend @@ -1 +1 @@ -COMPATIBLE_MACHINE:append = " |sama5d27-som1-ek-optee-sd|sama7g5ek-optee-sd" +COMPATIBLE_MACHINE:append = " |sama5d27-som1-ek-optee-sd|sama7g5ek-optee-sd|sama5d2-xplained-optee-sd" diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-client_%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-client_%.bbappend index a48ab46..25b0d5e 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-client_%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-client_%.bbappend @@ -1,6 +1,7 @@ OPTEE_MCHP_VERSION = "" OPTEE_MCHP_VERSION:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-version.inc" OPTEE_MCHP_VERSION:sama7g5ek-optee-sd = "${BPN}-mchp-version.inc" +OPTEE_MCHP_VERSION:sama5d2-xplained-optee-sd = "${BPN}-mchp-version.inc" require ${OPTEE_MCHP_VERSION} diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-examples_%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-examples_%.bbappend index 11bcdcc..8aa92a2 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-examples_%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-examples_%.bbappend @@ -1,5 +1,6 @@ OPTEE_MCHP_VERSION = "" OPTEE_MCHP_VERSION:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-version.inc" OPTEE_MCHP_VERSION:sama7g5ek-optee-sd = "${BPN}-mchp-version.inc" +OPTEE_MCHP_VERSION:sama5d2-xplained-optee-sd = "${BPN}-mchp-version.inc" require ${OPTEE_MCHP_VERSION} diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-mchp-overrides.inc b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-mchp-overrides.inc index 2834d70..574bc18 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-mchp-overrides.inc +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-mchp-overrides.inc @@ -7,6 +7,7 @@ OPTEE_SYMLINK ?= "tee-${MACHINE}.${OPTEE_SUFFIX}" OPTEE_PLATFORM_FLAVOR:sama5d27-som1-ek-optee-sd ??="sama5d27_som1_ek" OPTEE_PLATFORM_FLAVOR:sama7g5ek-optee-sd ??="sama7g54_ek" +OPTEE_PLATFORM_FLAVOR:sama5d2-xplained-optee-sd ??="sama5d2_xplained" EXTRA_OEMAKE += " PLATFORM_FLAVOR=${OPTEE_PLATFORM_FLAVOR} \ CFG_NVMEM_HUK=n \ diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-tadevkit_%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-tadevkit_%.bbappend index 7c3ab43..16b3ac4 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-tadevkit_%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os-tadevkit_%.bbappend @@ -1,11 +1,13 @@ OPTEE_MCHP_VERSION = "" OPTEE_MCHP_VERSION:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-version.inc" OPTEE_MCHP_VERSION:sama7g5ek-optee-sd = "${BPN}-mchp-version.inc" +OPTEE_MCHP_VERSION:sama5d2-xplained-optee-sd = "${BPN}-mchp-version.inc" require ${OPTEE_MCHP_VERSION} OPTEE_MCHP_OVERRIDES = "" OPTEE_MCHP_OVERRIDES:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-overrides.inc" OPTEE_MCHP_OVERRIDES:sama7g5ek-optee-sd = "${BPN}-mchp-overrides.inc" +OPTEE_MCHP_OVERRIDES:sama5d2-xplained-optee-sd = "${BPN}-mchp-overrides.inc" require ${OPTEE_MCHP_OVERRIDES} diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os_%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os_%.bbappend index 7c3ab43..16b3ac4 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os_%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-os_%.bbappend @@ -1,11 +1,13 @@ OPTEE_MCHP_VERSION = "" OPTEE_MCHP_VERSION:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-version.inc" OPTEE_MCHP_VERSION:sama7g5ek-optee-sd = "${BPN}-mchp-version.inc" +OPTEE_MCHP_VERSION:sama5d2-xplained-optee-sd = "${BPN}-mchp-version.inc" require ${OPTEE_MCHP_VERSION} OPTEE_MCHP_OVERRIDES = "" OPTEE_MCHP_OVERRIDES:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-overrides.inc" OPTEE_MCHP_OVERRIDES:sama7g5ek-optee-sd = "${BPN}-mchp-overrides.inc" +OPTEE_MCHP_OVERRIDES:sama5d2-xplained-optee-sd = "${BPN}-mchp-overrides.inc" require ${OPTEE_MCHP_OVERRIDES} diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-test_%.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-test_%.bbappend index 11bcdcc..8aa92a2 100644 --- a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-test_%.bbappend +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-security/optee/optee-test_%.bbappend @@ -1,5 +1,6 @@ OPTEE_MCHP_VERSION = "" OPTEE_MCHP_VERSION:sama5d27-som1-ek-optee-sd = "${BPN}-mchp-version.inc" OPTEE_MCHP_VERSION:sama7g5ek-optee-sd = "${BPN}-mchp-version.inc" +OPTEE_MCHP_VERSION:sama5d2-xplained-optee-sd = "${BPN}-mchp-version.inc" require ${OPTEE_MCHP_VERSION} From 56399566c4b938ca1c6b272e6d130c6117808ce7 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois-Briand Date: Thu, 16 Apr 2026 14:27:48 +0200 Subject: [PATCH 2/2] meta-mchp-mpu-bsp: u-boot-mchp: Fix sama5d2_xplained memory with OP-TEE Signed-off-by: Mathieu Dubois-Briand --- ...a5d2_xplained-Fix-memory-when-OP-TEE.patch | 36 +++++++++++++++++++ .../u-boot/u-boot-mchp_2025.07.bbappend | 1 + 2 files changed, 37 insertions(+) create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/0001-ARM-dts-at91-sama5d2_xplained-Fix-memory-when-OP-TEE.patch create mode 100644 meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/u-boot-mchp_2025.07.bbappend diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/0001-ARM-dts-at91-sama5d2_xplained-Fix-memory-when-OP-TEE.patch b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/0001-ARM-dts-at91-sama5d2_xplained-Fix-memory-when-OP-TEE.patch new file mode 100644 index 0000000..5a28ff7 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/files/0001-ARM-dts-at91-sama5d2_xplained-Fix-memory-when-OP-TEE.patch @@ -0,0 +1,36 @@ +From 2a2ffef78fd7c0f13819d3f6e50c26688cc4a1d3 Mon Sep 17 00:00:00 2001 +From: Mathieu Dubois-Briand +Date: Wed, 8 Apr 2026 16:12:33 +0200 +Subject: [PATCH] ARM: dts: at91: sama5d2_xplained: Fix memory when OP-TEE is + used + +The RAM mapping is overridden by sama5d2-optee.dtsi, as the first 32MB +are reserved for OP-TEE. But the RAM size specified in the dtsi is +incorrect for sama5d2_xplained, so we have to set it back to correct +values. + +Upstream-Status: [Submitted https://github.com/linux4microchip/u-boot-mchp/pull/3] +Signed-off-by: Mathieu Dubois-Briand +--- + arch/arm/dts/at91-sama5d2_xplained.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm/dts/at91-sama5d2_xplained.dts b/arch/arm/dts/at91-sama5d2_xplained.dts +index 265d2d87afce..9bc0a3c7428b 100644 +--- a/arch/arm/dts/at91-sama5d2_xplained.dts ++++ b/arch/arm/dts/at91-sama5d2_xplained.dts +@@ -16,7 +16,11 @@ + }; + + memory { ++#ifdef CONFIG_CLK_SCMI ++ reg = <0x22000000 0x1E000000>; ++#else + reg = <0x20000000 0x20000000>; ++#endif + }; + + clocks { +-- +2.47.3 + diff --git a/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/u-boot-mchp_2025.07.bbappend b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/u-boot-mchp_2025.07.bbappend new file mode 100644 index 0000000..e827309 --- /dev/null +++ b/meta-mchp-mpu/meta-mchp-mpu-bsp/recipes-bsp/u-boot/u-boot-mchp_2025.07.bbappend @@ -0,0 +1 @@ +SRC_URI:append:sama5d2-xplained-optee-sd = " file://0001-ARM-dts-at91-sama5d2_xplained-Fix-memory-when-OP-TEE.patch"