mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Borleis <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] ARM: webasto-marvel: share the run-time setup with the ccbv2 variant
Date: Tue, 22 Feb 2022 11:48:59 +0100	[thread overview]
Message-ID: <20220222104859.44391-3-jbe@pengutronix.de> (raw)
In-Reply-To: <20220222104859.44391-1-jbe@pengutronix.de>

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
---
 arch/arm/boards/webasto-ccbv2/board.c    |  6 +++++-
 arch/arm/boards/webasto-ccbv2/lowlevel.c | 24 ++++++++++++++++++------
 images/Makefile.imx                      |  2 ++
 3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boards/webasto-ccbv2/board.c b/arch/arm/boards/webasto-ccbv2/board.c
index 4777713..fd6ea6f 100644
--- a/arch/arm/boards/webasto-ccbv2/board.c
+++ b/arch/arm/boards/webasto-ccbv2/board.c
@@ -22,7 +22,10 @@ static int ccbv2_probe(struct device_d *dev)
 	imx6_bbu_internal_mmcboot_register_handler("emmc", "/dev/mmc1",
 			BBU_HANDLER_FLAG_DEFAULT);
 
-	barebox_set_hostname("weabsto-ccbv2");
+	if (of_machine_is_compatible("webasto,imx6ul-marvel"))
+		barebox_set_hostname("webasto-marvel");
+	else
+		barebox_set_hostname("webasto-ccbv2");
 
 	if(!IS_ENABLED(CONFIG_FIRMWARE_CCBV2_OPTEE))
 		return 0;
@@ -48,6 +51,7 @@ err:
 
 static const struct of_device_id ccbv2_of_match[] = {
 	{ .compatible = "webasto,imx6ul-ccbv2" },
+	{ .compatible = "webasto,imx6ul-marvel" },
 	{ /* sentinel */ },
 };
 
diff --git a/arch/arm/boards/webasto-ccbv2/lowlevel.c b/arch/arm/boards/webasto-ccbv2/lowlevel.c
index 84de271..add51c0 100644
--- a/arch/arm/boards/webasto-ccbv2/lowlevel.c
+++ b/arch/arm/boards/webasto-ccbv2/lowlevel.c
@@ -15,8 +15,6 @@
 
 #include "ccbv2.h"
 
-extern char __dtb_z_imx6ul_webasto_ccbv2_start[];
-
 static void configure_uart(void)
 {
 	void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
@@ -32,7 +30,7 @@ static void configure_uart(void)
 
 }
 
-static void noinline start_ccbv2(u32 r0, unsigned long memSize)
+static void noinline start_ccbv2(u32 r0, unsigned long memSize, char *fdt)
 {
 	int tee_size;
 	void *tee;
@@ -56,9 +54,10 @@ static void noinline start_ccbv2(u32 r0, unsigned long memSize)
 		start_optee_early(NULL, tee);
 	}
 
-	imx6ul_barebox_entry(__dtb_z_imx6ul_webasto_ccbv2_start);
+	imx6ul_barebox_entry(fdt);
 }
 
+extern char __dtb_z_imx6ul_webasto_ccbv2_start[];
 ENTRY_FUNCTION(start_imx6ul_ccbv2_256m, r0, r1, r2)
 {
 
@@ -70,12 +69,25 @@ ENTRY_FUNCTION(start_imx6ul_ccbv2_256m, r0, r1, r2)
 	setup_c();
 	barrier();
 
-	start_ccbv2(r0, SZ_256M);
+	start_ccbv2(r0, SZ_256M, __dtb_z_imx6ul_webasto_ccbv2_start);
 }
 
 ENTRY_FUNCTION(start_imx6ul_ccbv2_512m, r0, r1, r2)
 {
+	imx6ul_cpu_lowlevel_init();
 
+	arm_setup_stack(0x00910000);
+
+	relocate_to_current_adr();
+	setup_c();
+	barrier();
+
+	start_ccbv2(r0, SZ_512M, __dtb_z_imx6ul_webasto_ccbv2_start);
+}
+
+extern char __dtb_z_imx6ul_webasto_marvel_start[];
+ENTRY_FUNCTION(start_imx6ul_marvel, r0, r1, r2)
+{
 	imx6ul_cpu_lowlevel_init();
 
 	arm_setup_stack(0x00910000);
@@ -84,5 +96,5 @@ ENTRY_FUNCTION(start_imx6ul_ccbv2_512m, r0, r1, r2)
 	setup_c();
 	barrier();
 
-	start_ccbv2(r0, SZ_512M);
+	start_ccbv2(r0, SZ_512M, __dtb_z_imx6ul_webasto_marvel_start);
 }
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 18cabbf..4b2ad6e 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -377,6 +377,8 @@ $(call build_imx_habv4img, CONFIG_MACH_WEBASTO_CCBV2, start_imx6ul_ccbv2_256m, w
 
 $(call build_imx_habv4img, CONFIG_MACH_WEBASTO_CCBV2, start_imx6ul_ccbv2_512m, webasto-ccbv2/flash-header-imx6ul-webasto-ccbv2-512, imx6ul-webasto-ccbv2-512m)
 
+$(call build_imx_habv4img, CONFIG_MACH_WEBASTO_CCBV2, start_imx6ul_marvel, webasto-ccbv2/flash-header-imx6ul-webasto-ccbv2-512, imx6ul-webasto-marvel-512m)
+
 # ----------------------- vf6xx based boards ---------------------------
 pblb-$(CONFIG_MACH_VF610_TWR) += start_vf610_twr
 CFG_start_vf610_twr.pblb.imximg = $(board)/freescale-vf610-twr/flash-header-vf610-twr.imxcfg
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2022-02-22 10:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 10:48 [PATCH 1/3] ARM: webasto-ccbv2: consider the available memory size for optee Juergen Borleis
2022-02-22 10:48 ` [PATCH 2/3] ARM: webasto-marvel: add device tree shared with the kernel Juergen Borleis
2022-02-22 10:48 ` Juergen Borleis [this message]
2022-02-22 11:19   ` [PATCH 3/3] ARM: webasto-marvel: share the run-time setup with the ccbv2 variant Ahmad Fatoum
2022-02-22 14:13     ` Oleksij Rempel
2022-02-22 11:15 ` [PATCH 1/3] ARM: webasto-ccbv2: consider the available memory size for optee Ahmad Fatoum
2022-02-23 11:36 ` Sascha Hauer

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=20220222104859.44391-3-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox