From 4b76d6f4bdba8ad8df34e46e941592c0a5b287b8 Mon Sep 17 00:00:00 2001 From: Josua Mayer Date: Sun, 27 Oct 2024 14:40:14 +0100 Subject: [PATCH] linux: enable optee-os support --- ...m64-dts-lx2160a-cex6-enable-optee-os.patch | 53 +++++++++++++++++++ ...dts-lx2160a-cex6-evb-enable-optee-os.patch | 41 ++++++++++++++ ...m64-dts-lx2160a-cex7-enable-optee-os.patch | 51 ++++++++++++++++++ runme.sh | 2 +- 4 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 patches/linux/0009-arm64-dts-lx2160a-cex6-enable-optee-os.patch create mode 100644 patches/linux/0009-arm64-dts-lx2160a-cex6-evb-enable-optee-os.patch create mode 100644 patches/linux/0010-arm64-dts-lx2160a-cex7-enable-optee-os.patch diff --git a/patches/linux/0009-arm64-dts-lx2160a-cex6-enable-optee-os.patch b/patches/linux/0009-arm64-dts-lx2160a-cex6-enable-optee-os.patch new file mode 100644 index 0000000..0cbcfed --- /dev/null +++ b/patches/linux/0009-arm64-dts-lx2160a-cex6-enable-optee-os.patch @@ -0,0 +1,53 @@ +From f8f241b35f9ac202f20019bfbefed3d2bb5f1d30 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 27 Oct 2024 14:21:17 +0100 +Subject: [PATCH 09/10] arm64: dts: lx2160a-cex6: enable optee-os + +Signed-off-by: Josua Mayer +--- + .../boot/dts/freescale/fsl-lx2160a-cex6.dtsi | 29 +++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi +index 1d97a25bc57f..c3174f0cab38 100644 +--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi ++++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi +@@ -4,6 +4,35 @@ + // + // Copyright 2024 SolidRun Ltd. + ++/ { ++ firmware { ++ /* ++ * This is counter-intuitive: ++ * ++ * U-Boot by default patches OS DTB adding /firmware/optee, ++ * and updates /reserved-memory/optee. ++ * ++ * When OS DTB already has /firmware/optee node however, ++ * U-Boot does nothing. ++ * ++ * Enable optee by deleting the /firmware/optee node. ++ */ ++ /delete-node/ optee; ++ }; ++ ++ reserved-memory { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ ++ optee@fc000000 { ++ reg = <0x00 0xfc000000 0x00 0x04000000>; ++ alignment = <0x200000>; ++ no-map; ++ }; ++ }; ++}; ++ + &crypto { + status = "okay"; + }; +-- +2.43.0 + diff --git a/patches/linux/0009-arm64-dts-lx2160a-cex6-evb-enable-optee-os.patch b/patches/linux/0009-arm64-dts-lx2160a-cex6-evb-enable-optee-os.patch new file mode 100644 index 0000000..640cea4 --- /dev/null +++ b/patches/linux/0009-arm64-dts-lx2160a-cex6-evb-enable-optee-os.patch @@ -0,0 +1,41 @@ +From e0ce4b795969cbdb9ca1bdd042c12b13e2fae90c Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 27 Oct 2024 14:21:17 +0100 +Subject: [PATCH 09/10] arm64: dts: lx2160a-cex6-evb: enable optee-os + +Signed-off-by: Josua Mayer +--- + .../boot/dts/freescale/fsl-lx2160a-cex6.dtsi | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi +index 1d97a25bc57f..b7cef02e5048 100644 +--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi ++++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex6.dtsi +@@ -4,6 +4,23 @@ + // + // Copyright 2024 SolidRun Ltd. + ++/ { ++ firmware { ++ /* ++ * This is counter-intuitive: ++ * ++ * U-Boot by default patches OS DTB adding /firmware/optee, ++ * and /reserved-memory/optee. ++ * ++ * When OS DTB already has /firmware/optee node however, ++ * U-Boot does nothing. ++ * ++ * Enable optee by deleting the /firmware/optee node. ++ */ ++ /delete-node/ optee; ++ }; ++}; ++ + &crypto { + status = "okay"; + }; +-- +2.43.0 + diff --git a/patches/linux/0010-arm64-dts-lx2160a-cex7-enable-optee-os.patch b/patches/linux/0010-arm64-dts-lx2160a-cex7-enable-optee-os.patch new file mode 100644 index 0000000..53e4562 --- /dev/null +++ b/patches/linux/0010-arm64-dts-lx2160a-cex7-enable-optee-os.patch @@ -0,0 +1,51 @@ +From 228a56145ce06aa5e491c4579f59cd6c7e1107b1 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 27 Oct 2024 14:22:50 +0100 +Subject: [PATCH 10/10] arm64: dts: lx2160a-cex7: enable optee-os + +Signed-off-by: Josua Mayer +--- + .../boot/dts/freescale/fsl-lx2160a-cex7.dtsi | 27 +++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi +index feb6d02494df..024a119bcb7a 100644 +--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi ++++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi +@@ -16,6 +16,33 @@ aliases { + crypto = &crypto; + }; + ++ firmware { ++ /* ++ * This is counter-intuitive: ++ * ++ * U-Boot by default patches OS DTB adding /firmware/optee, ++ * and updates /reserved-memory/optee. ++ * ++ * When OS DTB already has /firmware/optee node however, ++ * U-Boot does nothing. ++ * ++ * Enable optee by deleting the /firmware/optee node. ++ */ ++ /delete-node/ optee; ++ }; ++ ++ reserved-memory { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ ++ optee@fc000000 { ++ reg = <0x00 0xfc000000 0x00 0x04000000>; ++ alignment = <0x200000>; ++ no-map; ++ }; ++ }; ++ + sb_3v3: regulator-sb3v3 { + compatible = "regulator-fixed"; + regulator-name = "RT7290"; +-- +2.43.0 + diff --git a/runme.sh b/runme.sh index bc0e09d..dd531a2 100755 --- a/runme.sh +++ b/runme.sh @@ -492,7 +492,7 @@ test -n "$APTPROXY" && printf 'Acquire::http { Proxy "%s"; }\n' $APTPROXY | tee apt-get update env DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ - apt-get install --no-install-recommends -y apt apt-utils ethtool fdisk htop i2c-tools ifupdown iproute2 iptables iputils-ping isc-dhcp-client kmod less lm-sensors locales net-tools network-manager ntpdate openssh-server pciutils procps psmisc rng-tools sudo systemd-sysv wget + apt-get install --no-install-recommends -y apt apt-utils ethtool fdisk htop i2c-tools ifupdown iproute2 iptables iputils-ping isc-dhcp-client kmod less lm-sensors locales net-tools network-manager ntpdate openssh-server pciutils procps psmisc rng-tools sudo systemd-sysv tee-supplicant wget apt-get clean # set root password