Skip to content

Commit

Permalink
linux: enable optee-os support
Browse files Browse the repository at this point in the history
  • Loading branch information
Josua-SR committed Oct 27, 2024
1 parent 50432be commit f4443c5
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
53 changes: 53 additions & 0 deletions patches/linux/0009-arm64-dts-lx2160a-cex6-enable-optee-os.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From f8f241b35f9ac202f20019bfbefed3d2bb5f1d30 Mon Sep 17 00:00:00 2001
From: Josua Mayer <[email protected]>
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 <[email protected]>
---
.../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

51 changes: 51 additions & 0 deletions patches/linux/0010-arm64-dts-lx2160a-cex7-enable-optee-os.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 228a56145ce06aa5e491c4579f59cd6c7e1107b1 Mon Sep 17 00:00:00 2001
From: Josua Mayer <[email protected]>
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 <[email protected]>
---
.../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

2 changes: 1 addition & 1 deletion runme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4443c5

Please sign in to comment.