Skip to contentSkip to conversation

ARM: mxs: Receive r0 and r1 passed from BootROM

PATCH New Marek Vasut 1 participant 1 message Aug 27, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mxs: Receive r0 and r1 passed from BootROM

Make sure value in register r0 and r1 is preserved and passed to the board_init_ll() and mxs_common_spl_init() where it can be processed further. The value in r0 can be configured during the BootStream generation to arbitary value, r1 contains pointer to return value from CALL'd function.

This patch also clears the value in r0 before returning to BootROM to make sure the BootROM is not confused by this value.

Finally, this patch cleans up some comments in the start.S file.

Cc Fabio Estevam <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c     |    5 +--
 arch/arm/cpu/arm926ejs/mxs/start.S        |   50 +++++++++++++++++------------
 arch/arm/include/asm/arch-mxs/sys_proto.h |    5 +--
 board/bluegiga/apx4devkit/spl_boot.c      |    4 +--
 board/creative/xfi3/spl_boot.c            |    4 +--
 board/denx/m28evk/spl_boot.c              |    4 +--
 board/freescale/mx23evk/spl_boot.c        |    4 +--
 board/freescale/mx28evk/iomux.c           |    4 +--
 board/olimex/mx23_olinuxino/spl_boot.c    |    4 +--
 board/sandisk/sansa_fuze_plus/spl_boot.c  |    4 +--
 board/schulercontrol/sc_sps_1/spl_boot.c  |    4 +--
 11 files changed, 52 insertions(+), 40 deletions(-)

NOTE: This can be nicely used for loading Linux using BootROM
directly from the SPL.

arch/arm/cpu/arm926ejs/mxs/spl_boot.c +3 -2
index 0392afd..68c30af 100644
@@ -102,8 +102,9 @@ static uint8_t mxs_get_bootmode_index(void)
 	return i;
 }
 
-void mxs_common_spl_init(const iomux_cfg_t *iomux_setup,
-			const unsigned int iomux_size)
+void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
+			 const iomux_cfg_t *iomux_setup,
+			 const unsigned int iomux_size)
 {
 	struct mxs_spl_data *data = (struct mxs_spl_data *)
 		((CONFIG_SYS_TEXT_BASE - sizeof(struct mxs_spl_data)) & ~0xf);
arch/arm/cpu/arm926ejs/mxs/start.S +30 -20

69 lines not on this page · raw message

arch/arm/include/asm/arch-mxs/sys_proto.h +3 -2
index 1038592..43c7dd6 100644
@@ -28,8 +28,9 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int));
 #include <asm/arch/iomux-mx28.h>
 #endif
 
-void mxs_common_spl_init(const iomux_cfg_t *iomux_setup,
-			const unsigned int iomux_size);
+void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
+			 const iomux_cfg_t *iomux_setup,
+			 const unsigned int iomux_size);
 #endif
 
 struct mxs_pair {
board/bluegiga/apx4devkit/spl_boot.c +2 -2
index 3b05baa..81419f9 100644
@@ -132,9 +132,9 @@ const iomux_cfg_t iomux_setup[] = {
 	MX28_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
 };
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 
 	/* switch LED on */
 	gpio_direction_output(MX28_PAD_PWM3__GPIO_3_28, 0);
board/creative/xfi3/spl_boot.c +2 -2
index 1c700d6..af7aa0e 100644
@@ -128,7 +128,7 @@ void mxs_adjust_memory_params(uint32_t *dram_vals)
 	memcpy(dram_vals, regs, sizeof(regs));
 }
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
board/denx/m28evk/spl_boot.c +2 -2
index 525ba6a..5a1010e 100644
@@ -200,7 +200,7 @@ const iomux_cfg_t iomux_setup[] = {
 		(MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
 };
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
board/freescale/mx23evk/spl_boot.c +2 -2
index 054ca0a..603f4dc 100644
@@ -129,7 +129,7 @@ void mxs_adjust_memory_params(uint32_t *dram_vals)
 	dram_vals[HW_DRAM_CTL14] = HW_DRAM_CTL14_CONFIG;
 }
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
board/freescale/mx28evk/iomux.c +2 -2
index 6ca842b..97c2376 100644
@@ -200,7 +200,7 @@ void mxs_adjust_memory_params(uint32_t *dram_vals)
 	dram_vals[HW_DRAM_CTL29] = HW_DRAM_CTL29_CONFIG;
 }
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
board/olimex/mx23_olinuxino/spl_boot.c +2 -2
index 0a66303..5272dfa 100644
@@ -85,7 +85,7 @@ const iomux_cfg_t iomux_setup[] = {
 		(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL),
 };
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
board/sandisk/sansa_fuze_plus/spl_boot.c +2 -2
index 73fd1c2..03ba5b2 100644
@@ -137,7 +137,7 @@ void mxs_adjust_memory_params(uint32_t *dram_vals)
 	memcpy(dram_vals, regs, sizeof(regs));
 }
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
board/schulercontrol/sc_sps_1/spl_boot.c +2 -2
index 1fe9224..60195c3 100644
@@ -138,9 +138,9 @@ const iomux_cfg_t iomux_setup[] = {
 	MX28_PAD_GPMI_D06__GPIO_0_6 | MUX_CONFIG_LED,
 };
 
-void board_init_ll(void)
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
 {
-	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+	mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
 }
 
 void mxs_adjust_memory_params(uint32_t *dram_vals)
Signature · 1 line
1.7.10.4