Skip to contentSkip to conversation

Low Power Mode: Package TIFS Stub in BeaglePlay

PATCH Superseded Dhruva Gole 2 participants 12 messages Jul 5, 2024 – Jul 18, 2024 Arm (32-bit)

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover Low Power Mode: Package TIFS Stub in BeaglePlay

This series includes the binman related changes required to package TIFS Stub to support Low Power Modes on BeaglePlay.
It also documents the boot flow and tispl packaging details regarding the same.

Changelog:
* Add more documentation around last time's discussion[1] on packaging TIFS Stub in DM.

Link to previous series:
https://lore.kernel.org/u-boot/[email protected]/

[1] https://lore.kernel.org/u-boot/20240705151753.7v3geqkupqu673x3@ambiance/

Thanks for the explanation given in [1] Sebin,
Cc: Sebin Francis <[email protected]>

Dhruva Gole (6):
arm: dts: k3-am625-beagleplay: Package TIFS Stub
doc: beagle: am62x_beagleplay: Update the boot flow to show TIFS Stub
doc: beagle: am62x_beagleplay: Add TIFS Stub in image format
doc: ti: k3: Add TIFS Stub documentation
doc: ti: am62*: Mention TIFS Stub in img fmts and boot flow
MAINTAINERS: Include the TI docs under ARM TI

 MAINTAINERS                                  |    1 +
 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi |   33 +-
 doc/board/beagle/am62x_beagleplay.rst        |    4 +-
 doc/board/ti/am62ax_sk.rst                   |    4 +-
 doc/board/ti/am62px_sk.rst                   |    4 +-
 doc/board/ti/am62x_sk.rst                    |    4 +-
 doc/board/ti/img/boot_diagram_am62.svg       | 1983 ++++++++++++++++++
 doc/board/ti/img/tifsstub_dm_tispl.bin.svg   |  353 ++++
 doc/board/ti/k3.rst                          |   11 +
 9 files changed, 2388 insertions(+), 9 deletions(-)
 create mode 100644 doc/board/ti/img/boot_diagram_am62.svg
 create mode 100644 doc/board/ti/img/tifsstub_dm_tispl.bin.svg

base-commit: a9b3723e74aacb5197dc77c9979036dc6b3d9c03

Signature · 1 line
2.34.1
#1 lore raw

PATCH v5 1/6 arm: dts: k3-am625-beagleplay: Package TIFS Stub

Add support for packaging the TIFS Stub as it's required for basic Low Power Modes like Deep Sleep.
The reason it is packaged using binman and not inherently as part of the DM firmware is because for HS devices, customer owns the customer key and only customer has access to it.
DM is release by TI, Since TI doesn't have access to the customer key it cannot have a component that is signed by customer key. Hence, it's left as part of binman to be signed and packaged.

---
 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 33 +++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)
arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi +32 -1
index 467cac68d0f6..a067b0ba3543 100644
@@ -78,6 +78,23 @@
 		};
 	};
 
+	tifsstub-gp {
+		filename = "tifsstub.bin_gp";
+		ti-secure-rom {
+			content = <&tifsstub_gp>;
+			core = "secure";
+			load = <0x60000>;
+			sw-rev = <CONFIG_K3_X509_SWRV>;
+			keyfile = "ti-degenerate-key.pem";
+			tifsstub;
+		};
+		tifsstub_gp: tifsstub-gp.bin {
+			filename = "ti-sysfw/ti-fs-stub-firmware-am62x-gp.bin";
+			type = "blob-ext";
+			optional;
+		};
+	};
+
 	ti-spl_unsigned {
 		filename = "tispl.bin_unsigned";
 		symlink = "tispl.bin";
@@ -115,6 +132,19 @@
 					};
 				};
 
+				tifsstub-gp {
+					description = "tifsstub";
+					type = "firmware";
+					arch = "arm32";
+					compression = "none";
+					os = "tifsstub-gp";
+					load = <0x9dc00000>;
+					entry = <0x9dc00000>;
+					blob-ext {
+						filename = "tifsstub.bin_gp";
+					};
+				};
+
 				dm {
 					description = "DM binary";
 					type = "firmware";
@@ -158,7 +188,8 @@
 				conf-0 {
 					description = "k3-am625-beagleplay";
 					firmware = "atf";
-					loadables = "tee", "dm", "spl";
+					loadables = "tee", "dm", "spl",
+					"tifsstub-gp";
 					fdt = "fdt-0";
 				};
 			};

base-commit: a9b3723e74aacb5197dc77c9979036dc6b3d9c03

Signature · 1 line
2.34.1
#2 lore raw

PATCH v5 2/6 doc: beagle: am62x_beagleplay: Update the boot flow to show TIFS Stub

In reply to Dhruva Gole

Add the AM62x boot flow to show at which point the TIFS Stub actually gets loaded.

---
 doc/board/beagle/am62x_beagleplay.rst  |    2 +-
 doc/board/ti/img/boot_diagram_am62.svg | 1983 ++++++++++++++++++++++++
 2 files changed, 1984 insertions(+), 1 deletion(-)
 create mode 100644 doc/board/ti/img/boot_diagram_am62.svg
doc/board/beagle/am62x_beagleplay.rst +1 -1
index 01f04beb55aa..375f26fc5f3e 100644
@@ -23,7 +23,7 @@ Boot Flow:
 ----------
 Below is the pictorial representation of boot flow:
 
-.. image:: ../ti/img/boot_diagram_k3_current.svg
+.. image:: ../ti/img/boot_diagram_am62.svg
   :alt: Boot flow diagram
 
 - On this platform, 'TI Foundational Security' (TIFS) functions as the
doc/board/ti/img/boot_diagram_am62.svg new file +1983 -0

1,983 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw

PATCH v5 3/6 doc: beagle: am62x_beagleplay: Add TIFS Stub in image format

In reply to Dhruva Gole

Mention the TIFS Stub in the TISP image format

---
 doc/board/beagle/am62x_beagleplay.rst      |   2 +-
 doc/board/ti/img/tifsstub_dm_tispl.bin.svg | 353 +++++++++++++++++++++
 2 files changed, 354 insertions(+), 1 deletion(-)
 create mode 100644 doc/board/ti/img/tifsstub_dm_tispl.bin.svg
doc/board/beagle/am62x_beagleplay.rst +1 -1
index 375f26fc5f3e..e7347610173e 100644
@@ -86,7 +86,7 @@ Image formats
 
 - tispl.bin
 
-.. image:: ../ti/img/dm_tispl.bin.svg
+.. image:: ../ti/img/tifsstub_dm_tispl.bin.svg
   :alt: tispl.bin image format
 
 Additional hardware for U-Boot development
doc/board/ti/img/tifsstub_dm_tispl.bin.svg new file +353 -0

353 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

PATCH v5 4/6 doc: ti: k3: Add TIFS Stub documentation

In reply to Dhruva Gole

Add documentation to briefly explain the role of TIFS Stub in relevant K3 SoC's.
This also sheds light on why TIFS Stub isn't package with the DM firmware itself.

---
 doc/board/ti/k3.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)
doc/board/ti/k3.rst +11 -0
index 67b066a07d3a..c80060662074 100644
@@ -193,6 +193,17 @@ online
     device resources such as power, clock, interrupts, dma etc. This firmware
     runs on a dedicated or multi-use microcontroller outside the security
     enclave.
+  * **TIFS Stub** - A small piece of code that helps restore the remaining
+    context and resume the TIFS firmware when resuming from Low Power Modes
+    like Suspend-to-RAM/ Deep Sleep. It is loaded into the ATCM (Tightly
+    Coupled Memory 'A' of the DM R5) during DM startup. The reason it isn't
+    merged with DM is because in HS devices we need to sign the tifs-stub with
+    customer key. The DM cannot have a component signed using a customer key
+    because a HS device customer owns the customer key and only customer
+    has the access for the customer key. Since TIFS Stub signing has to happen
+    from the customer side but DM is released by TI, we need to allow binman to
+    sign the TIFS Stub and only then package it alongside other firmwares.
+    This applies only to AM62x, AM62A and AM62P based devices.
 
  OR
 
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH V5 4/6] doc: ti: k3: Add TIFS Stub documentation

Quoted 19 lines · Dhruva Gole

Add documentation to briefly explain the role of TIFS Stub in relevant K3 SoC's.
This also sheds light on why TIFS Stub isn't package with the DM firmware itself.

---
 doc/board/ti/k3.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)
doc/board/ti/k3.rst +1 -0
index 67b066a07d3a..c80060662074 100644
@@ -193,6 +193,17 @@ online
     device resources such as power, clock, interrupts, dma etc. This firmware
     runs on a dedicated or multi-use microcontroller outside the security
     enclave.
+  * **TIFS Stub** - A small piece of code that helps restore the remaining

doc/board/ti/k3.rst online · line 206

Quoted 10 lines
doc/board/ti/k3.rst +10 -0
+    context and resume the TIFS firmware when resuming from Low Power Modes
+    like Suspend-to-RAM/ Deep Sleep. It is loaded into the ATCM (Tightly
+    Coupled Memory 'A' of the DM R5) during DM startup. The reason it isn't
+    merged with DM is because in HS devices we need to sign the tifs-stub with
+    customer key. The DM cannot have a component signed using a customer key
+    because a HS device customer owns the customer key and only customer
+    has the access for the customer key. Since TIFS Stub signing has to happen
+    from the customer side but DM is released by TI, we need to allow binman to
+    sign the TIFS Stub and only then package it alongside other firmwares.
+    This applies only to AM62x, AM62A and AM62P based devices.

This implies TI is hiding DM source - we are not. TIFS stub is prop binary (the usual issues), but can you rephrase the description above? I do not want to go and explicitly list out the devices this section has either..

Futher, the way it is introduced, did you check the documentation for other SoCs? we dont want tifs stub section to punch in for other SoCs which dont matter.

Quoted 6 lines
doc/board/ti/k3.rst +0 -0
  OR
 
Signature · 1 line
2.34.1
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#6 lore raw

Re: [PATCH V5 4/6] doc: ti: k3: Add TIFS Stub documentation

Quoted 27 lines · Nishanth Menon
Quoted 26 lines · Dhruva Gole

Add documentation to briefly explain the role of TIFS Stub in relevant K3 SoC's.
This also sheds light on why TIFS Stub isn't package with the DM firmware itself.

---
 doc/board/ti/k3.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)
doc/board/ti/k3.rst +8 -0
index 67b066a07d3a..c80060662074 100644
@@ -193,6 +193,17 @@ online
     device resources such as power, clock, interrupts, dma etc. This firmware
     runs on a dedicated or multi-use microcontroller outside the security
     enclave.
+  * **TIFS Stub** - A small piece of code that helps restore the remaining
+    context and resume the TIFS firmware when resuming from Low Power Modes
+    like Suspend-to-RAM/ Deep Sleep. It is loaded into the ATCM (Tightly
+    Coupled Memory 'A' of the DM R5) during DM startup. The reason it isn't
+    merged with DM is because in HS devices we need to sign the tifs-stub with
+    customer key. The DM cannot have a component signed using a customer key
+    because a HS device customer owns the customer key and only customer
+    has the access for the customer key. Since TIFS Stub signing has to happen
Quoted 8 lines

doc/board/ti/k3.rst online · line 206

Quoted 3 lines
doc/board/ti/k3.rst +3 -0
+    from the customer side but DM is released by TI, we need to allow binman to
+    sign the TIFS Stub and only then package it alongside other firmwares.
+    This applies only to AM62x, AM62A and AM62P based devices.

This implies TI is hiding DM source - we are not. TIFS stub is prop binary (the usual issues), but can you rephrase the description above? I do not want to go and explicitly list out the devices this section has either..

OK.
I was trying to convey was the binary is provided by TI not that its hidden. But yes I will reword it to say:

.... but DM is released by TI or can be built independently by customers using the publicly available sources, we need to allow binman......

Quoted 4 lines

Futher, the way it is introduced, did you check the documentation for other SoCs? we dont want tifs stub section to punch in for other SoCs which dont matter.

Yep, it appears wherever there's include:: ../ti/k3.rst,
I will introduce few more tags between k3_rst_include_start_boot_sources and k3_rst_include_end_boot_sources to help with this. Does that make sense?

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>
#7 lore raw

Re: [PATCH V5 4/6] doc: ti: k3: Add TIFS Stub documentation

Quoted 45 lines · Dhruva Gole
Quoted 27 lines · Nishanth Menon
Quoted 26 lines · Dhruva Gole

Add documentation to briefly explain the role of TIFS Stub in relevant K3 SoC's.
This also sheds light on why TIFS Stub isn't package with the DM firmware itself.

---
 doc/board/ti/k3.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)
doc/board/ti/k3.rst +8 -0
index 67b066a07d3a..c80060662074 100644
@@ -193,6 +193,17 @@ online
     device resources such as power, clock, interrupts, dma etc. This firmware
     runs on a dedicated or multi-use microcontroller outside the security
     enclave.
+  * **TIFS Stub** - A small piece of code that helps restore the remaining
+    context and resume the TIFS firmware when resuming from Low Power Modes
+    like Suspend-to-RAM/ Deep Sleep. It is loaded into the ATCM (Tightly
+    Coupled Memory 'A' of the DM R5) during DM startup. The reason it isn't
+    merged with DM is because in HS devices we need to sign the tifs-stub with
+    customer key. The DM cannot have a component signed using a customer key
+    because a HS device customer owns the customer key and only customer
+    has the access for the customer key. Since TIFS Stub signing has to happen
Quoted 8 lines

doc/board/ti/k3.rst online · line 206

Quoted 3 lines
doc/board/ti/k3.rst +3 -0
+    from the customer side but DM is released by TI, we need to allow binman to
+    sign the TIFS Stub and only then package it alongside other firmwares.
+    This applies only to AM62x, AM62A and AM62P based devices.

This implies TI is hiding DM source - we are not. TIFS stub is prop binary (the usual issues), but can you rephrase the description above? I do not want to go and explicitly list out the devices this section has either..

OK.
I was trying to convey was the binary is provided by TI not that its hidden. But yes I will reword it to say:

.... but DM is released by TI or can be built independently by customers using the publicly available sources, we need to allow binman......

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

Futher, the way it is introduced, did you check the documentation for other SoCs? we dont want tifs stub section to punch in for other SoCs which dont matter.

Yep, it appears wherever there's include:: ../ti/k3.rst,
I will introduce few more tags between k3_rst_include_start_boot_sources and k3_rst_include_end_boot_sources to help with this. Does that make sense?

Yeah - looks like we might need more split up here. we want this to appear only on relevant platforms.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#8 lore raw

PATCH v5 5/6 doc: ti: am62*: Mention TIFS Stub in img fmts and boot flow

In reply to Dhruva Gole

Since AM62x, AM62P and AM62A all use similar boot flows and their low power mode s/w ARCH is also similar in the way that they make use of the TIFS Stub, update their documentation to show where TIFS Stub is.

---
 doc/board/ti/am62ax_sk.rst | 4 ++--
 doc/board/ti/am62px_sk.rst | 4 ++--
 doc/board/ti/am62x_sk.rst  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
doc/board/ti/am62ax_sk.rst +2 -2
index 60726b6652ce..92da6f65f9d5 100644
@@ -47,7 +47,7 @@ Boot Flow:
 ----------
 Below is the pictorial representation of boot flow:
 
-.. image:: img/boot_diagram_k3_current.svg
+.. image:: img/boot_diagram_am62.svg
   :alt: Boot flow diagram
 
 - Here TIFS acts as master and provides all the critical services. R5/A53
@@ -144,7 +144,7 @@ Image formats:
 
 - tispl.bin
 
-.. image:: img/dm_tispl.bin.svg
+.. image:: img/tifsstub_dm_tispl.bin.svg
   :alt: tispl.bin image format
 
 Switch Setting for Boot Mode
doc/board/ti/am62px_sk.rst +2 -2
index c80b50681176..3396aae471c6 100644
@@ -55,7 +55,7 @@ Boot Flow:
 The bootflow is exactly the same as all SoCs in the am62xxx extended SoC
 family. Below is the pictorial representation:
 
-.. image:: img/boot_diagram_k3_current.svg
+.. image:: img/boot_diagram_am62.svg
   :alt: Boot flow diagram
 
 - Here TIFS acts as master and provides all the critical services. R5/A53
@@ -153,7 +153,7 @@ Image formats:
 
 - tispl.bin
 
-.. image:: img/dm_tispl.bin.svg
+.. image:: img/tifsstub_dm_tispl.bin.svg
   :alt: tispl.bin image format
 
 OSPI:
doc/board/ti/am62x_sk.rst +2 -2
index 2a25e84f6c97..68ddd2ac94ff 100644
@@ -46,7 +46,7 @@ Boot Flow:
 ----------
 Below is the pictorial representation of boot flow:
 
-.. image:: img/boot_diagram_k3_current.svg
+.. image:: img/boot_diagram_am62.svg
   :alt: Boot flow diagram
 
 - Here TIFS acts as master and provides all the critical services. R5/A53
@@ -161,7 +161,7 @@ Image formats:
 
 - tispl.bin
 
-.. image:: img/dm_tispl.bin.svg
+.. image:: img/tifsstub_dm_tispl.bin.svg
   :alt: tispl.bin image format
 
 OSPI:
Signature · 1 line
2.34.1
#9 lore raw

PATCH v5 6/6 MAINTAINERS: Include the TI docs under ARM TI

In reply to Dhruva Gole

Add entry for the TI boards documentation under ARM TI

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 6b32a6d94644..da730c6e4840 100644
@@ -733,6 +733,7 @@ F:	arch/arm/mach-omap2/
 F:	arch/arm/include/asm/arch-omap*/
 F:	arch/arm/include/asm/ti-common/
 F:	board/ti/
+F:	doc/board/ti/
 F:	drivers/dma/ti*
 F:	drivers/dma/ti*/
 F:	drivers/firmware/ti_sci.*
Signature · 1 line
2.34.1
#10 lore raw
In reply to Dhruva Gole
Quoted 17 lines · Dhruva Gole

This series includes the binman related changes required to package TIFS Stub to support Low Power Modes on BeaglePlay.
It also documents the boot flow and tispl packaging details regarding the same.

Changelog:
* Add more documentation around last time's discussion[1] on packaging TIFS Stub in DM.

Link to previous series:
https://lore.kernel.org/u-boot/[email protected]/

[1] https://lore.kernel.org/u-boot/20240705151753.7v3geqkupqu673x3@ambiance/

Thanks for the explanation given in [1] Sebin,
Cc: Sebin Francis <[email protected]>

Quoted 7 lines

Dhruva Gole (6):
arm: dts: k3-am625-beagleplay: Package TIFS Stub
doc: beagle: am62x_beagleplay: Update the boot flow to show TIFS Stub
doc: beagle: am62x_beagleplay: Add TIFS Stub in image format
doc: ti: k3: Add TIFS Stub documentation
doc: ti: am62*: Mention TIFS Stub in img fmts and boot flow

Please change the ordering of the patches:

MAINTAINERS: Include the TI docs under ARM TI
doc: ti: k3: Add TIFS Stub documentation
doc: ti: am62*: Mention TIFS Stub in img fmts and boot flow

then do the stuff for beagleplay - first fix, then add new stuff, NOT the other way around - yes, i claim that a feature added without documentation is a bug.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#11 lore raw
Quoted 27 lines · Nishanth Menon
Quoted 17 lines · Dhruva Gole

This series includes the binman related changes required to package TIFS Stub to support Low Power Modes on BeaglePlay.
It also documents the boot flow and tispl packaging details regarding the same.

Changelog:
* Add more documentation around last time's discussion[1] on packaging TIFS Stub in DM.

Link to previous series:
https://lore.kernel.org/u-boot/[email protected]/

[1] https://lore.kernel.org/u-boot/20240705151753.7v3geqkupqu673x3@ambiance/

Thanks for the explanation given in [1] Sebin,
Cc: Sebin Francis <[email protected]>

Quoted 7 lines

Dhruva Gole (6):
arm: dts: k3-am625-beagleplay: Package TIFS Stub
doc: beagle: am62x_beagleplay: Update the boot flow to show TIFS Stub
doc: beagle: am62x_beagleplay: Add TIFS Stub in image format
doc: ti: k3: Add TIFS Stub documentation
doc: ti: am62*: Mention TIFS Stub in img fmts and boot flow

Please change the ordering of the patches:

Quoted 7 lines

MAINTAINERS: Include the TI docs under ARM TI
doc: ti: k3: Add TIFS Stub documentation
doc: ti: am62*: Mention TIFS Stub in img fmts and boot flow

then do the stuff for beagleplay - first fix, then add new stuff, NOT the other way around - yes, i claim that a feature added without documentation is a bug.

Understood, Will reorder and address other concerns in next revision.

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>