mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: i.MX8MP: Debix: refactor lowlevel setup functions
@ 2023-07-03 23:01 Marco Felsch
  2023-07-03 23:01 ` [PATCH 2/2] ARM: i.MX8MP: Add DEBIX SOM A and SOM A I/O Board support Marco Felsch
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco Felsch @ 2023-07-03 23:01 UTC (permalink / raw)
  To: barebox

Pass the dram timing info and devicetree data as parameter instead of
hardcode them into the function. The required information is passed by
the ENTRY_FUNCTION after the relocation and the setup_c is done. This
prepares the lowlevel code for adding new boards with minimal effort.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/arm/boards/polyhex-debix/lowlevel.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/polyhex-debix/lowlevel.c b/arch/arm/boards/polyhex-debix/lowlevel.c
index 1c8be39559..bb4d6f53a0 100644
--- a/arch/arm/boards/polyhex-debix/lowlevel.c
+++ b/arch/arm/boards/polyhex-debix/lowlevel.c
@@ -83,7 +83,7 @@ static void power_init_board(void)
 
 extern struct dram_timing_info imx8mp_debix_dram_timing;
 
-static void start_atf(void)
+static void start_atf(struct dram_timing_info *dram_timing)
 {
 	/*
 	 * If we are in EL3 we are running for the first time and need to
@@ -95,7 +95,7 @@ static void start_atf(void)
 
 	power_init_board();
 
-	imx8mp_ddr_init(&imx8mp_debix_dram_timing, DRAM_TYPE_LPDDR4);
+	imx8mp_ddr_init(dram_timing, DRAM_TYPE_LPDDR4);
 
 	imx8mp_load_and_start_image_via_tfa();
 }
@@ -116,16 +116,17 @@ static void start_atf(void)
  *
  * 4. Standard barebox boot flow continues
  */
-static __noreturn noinline void imx8mp_debix_model_a_start(void)
+static __noreturn noinline void
+imx8mp_debix_start(struct dram_timing_info *dram_timing, void *dtb)
 {
 	setup_uart();
 
-	start_atf();
+	start_atf(dram_timing);
 
 	/*
 	 * Standard entry we hit once we initialized both DDR and ATF
 	 */
-	imx8mp_barebox_entry(__dtb_z_imx8mp_debix_model_a_start);
+	imx8mp_barebox_entry(dtb);
 }
 
 ENTRY_FUNCTION(start_polyhex_debix, r0, r1, r2)
@@ -135,5 +136,6 @@ ENTRY_FUNCTION(start_polyhex_debix, r0, r1, r2)
 	relocate_to_current_adr();
 	setup_c();
 
-	imx8mp_debix_model_a_start();
+	imx8mp_debix_start(&imx8mp_debix_dram_timing,
+			   __dtb_z_imx8mp_debix_model_a_start);
 }
-- 
2.39.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-04  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 23:01 [PATCH 1/2] ARM: i.MX8MP: Debix: refactor lowlevel setup functions Marco Felsch
2023-07-03 23:01 ` [PATCH 2/2] ARM: i.MX8MP: Add DEBIX SOM A and SOM A I/O Board support Marco Felsch
2023-07-04  7:34 ` [PATCH 1/2] ARM: i.MX8MP: Debix: refactor lowlevel setup functions Ahmad Fatoum
2023-07-04  7:52 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox