All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Vibhore Vardhan <vibhore@ti.com>,
	Neha Malcom Francis <n-francis@ti.com>,
	Kamlesh Gurudasani <kamlesh@ti.com>, Dhruva Gole <d-gole@ti.com>
Subject: [PATCH 1/2] arm: mach-k3: add support for detecting TIFSSTUB images
Date: Wed, 3 Apr 2024 17:33:09 +0530	[thread overview]
Message-ID: <20240403120309.4026170-2-d-gole@ti.com> (raw)
In-Reply-To: <20240403120309.4026170-1-d-gole@ti.com>

From: Kamlesh Gurudasani <kamlesh@ti.com>

Add support for detecting and processing TIFSSTUB images for HS, HSFS
and GP devices.

TIFSSTUB image for related device type will be loaded, rest TIFSSTUB
images will be discarded.

Example, for GP device, tifsstub-gp will be loaded, tifsstub-hs and
tifsstub-fs will be discarded.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Dhruva Gole <d-gole@ti.com>
---
 arch/arm/mach-k3/r5/common.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
index c02f8d330998..0f6c294f1eb2 100644
--- a/arch/arm/mach-k3/r5/common.c
+++ b/arch/arm/mach-k3/r5/common.c
@@ -24,6 +24,9 @@ enum {
 	IMAGE_ID_OPTEE,
 	IMAGE_ID_SPL,
 	IMAGE_ID_DM_FW,
+	IMAGE_ID_TIFSSTUB_HS,
+	IMAGE_ID_TIFSSTUB_FS,
+	IMAGE_ID_T,
 	IMAGE_AMT,
 };
 
@@ -33,6 +36,9 @@ static const char *image_os_match[IMAGE_AMT] = {
 	"tee",
 	"U-Boot",
 	"DM",
+	"tifsstub-hs",
+	"tifsstub-fs",
+	"tifsstub-gp",
 };
 #endif
 
@@ -314,6 +320,24 @@ void board_fit_image_post_process(const void *fit, int node, void **p_image,
 			break;
 		}
 	}
+
+	if (i < IMAGE_AMT && i > IMAGE_ID_DM_FW) {
+		int device_type = get_device_type();
+
+		if ((device_type == K3_DEVICE_TYPE_HS_SE &&
+		     strcmp(os, "tifsstub-hs")) ||
+		   (device_type == K3_DEVICE_TYPE_HS_FS &&
+		     strcmp(os, "tifsstub-fs")) ||
+		   (device_type == K3_DEVICE_TYPE_GP &&
+		     strcmp(os, "tifsstub-gp"))) {
+			*p_size = 0;
+		} else {
+			debug("tifsstub-type: %s\n", os);
+		}
+
+		return;
+	}
+
 	/*
 	 * Only DM and the DTBs are being authenticated here,
 	 * rest will be authenticated when A72 cluster is up
-- 
2.34.1


  reply	other threads:[~2024-04-03 12:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 12:03 [PATCH 0/2] Add TIFS Stub support in AM62x Dhruva Gole
2024-04-03 12:03 ` Dhruva Gole [this message]
2024-04-04  4:24   ` [PATCH 1/2] arm: mach-k3: add support for detecting TIFSSTUB images Neha Malcom Francis
2024-04-03 12:03 ` [PATCH 2/2] arm: dts: k3: binman: am625: add support for signing TIFSSTUB Images Dhruva Gole
2024-04-04  4:50   ` Neha Malcom Francis
2024-04-04  8:07     ` Francesco Dolcini
2024-04-04  8:22     ` Dhruva Gole
2024-04-12 14:19 ` [PATCH 0/2] Add TIFS Stub support in AM62x Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240403120309.4026170-2-d-gole@ti.com \
    --to=d-gole@ti.com \
    --cc=kamlesh@ti.com \
    --cc=n-francis@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vibhore@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.