diff mbox

[U-Boot,v2,21/23] ARM: SPL/FIT: differentiate between arm and arm64 arch properties

Message ID 1480902750-839-22-git-send-email-andre.przywara@arm.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Andre Przywara Dec. 5, 2016, 1:52 a.m. UTC
Since the SPL FIT loader can now differentiate between different
architectures, teach it how to tell arm and arm64 apart when a FIT
image is used.
We just support those two for now, as these are so far the only sensible
alternatives.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 arch/arm/lib/spl.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Tom Rini Dec. 6, 2016, 12:27 a.m. UTC | #1
On Mon, Dec 05, 2016 at 01:52:28AM +0000, Andre Przywara wrote:

> Since the SPL FIT loader can now differentiate between different
> architectures, teach it how to tell arm and arm64 apart when a FIT
> image is used.
> We just support those two for now, as these are so far the only sensible
> alternatives.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index e606d47..45d285c 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -63,3 +63,18 @@  void __noreturn jump_to_image_linux(struct spl_image_info *spl_image, void *arg)
 	image_entry(0, machid, arg);
 }
 #endif
+
+/* This overwrites the weak definition in spl_fit.c */
+u8 spl_genimg_get_arch_id(const char *arch_str)
+{
+	if (!arch_str)
+		return IH_ARCH_DEFAULT;
+
+	if (!strcmp(arch_str, "arm"))
+		return IH_ARCH_ARM;
+
+	if (!strcmp(arch_str, "arm64"))
+		return IH_ARCH_ARM64;
+
+	return IH_ARCH_DEFAULT;
+}