diff mbox

[U-Boot,V2,4/5] omap3: new SPL structure support

Message ID 1311617138-17041-5-git-send-email-simonschwarzcor@gmail.com
State Superseded
Headers show

Commit Message

Simon Schwarz July 25, 2011, 6:05 p.m. UTC
Support for the new spl structure. Using the interface defined by Aneesh V for
OMAP4
---
V1 changes:
ADD support for early console output in SPL

V2 changes:
ADD include omap_common.h in board.c
ADD implement new omap common interface omap_boot_device, omap_boot_mode and
	omap_rev_string (very basic)
CHG cosmetic
CHG Don't add ecc switch command in SPL
ADD save_boot_params stump with warning to implement it

Transition from V1 to V2 also includes that this patch is now based on
	- the new SPL layout by Aneesh V and Daniel Schwierzeck
  	- the OMAP4 SPL patches by Aneesh V

This is in some parts a anccesstor of "[U-Boot,2/5] devkit8000 nand_spl: omap3
support nand_spl boot"
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102114) in V1

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
 arch/arm/cpu/armv7/omap3/board.c            |   36 +++++++++++++++++++++++++-
 arch/arm/cpu/armv7/omap3/lowlevel_init.S    |    5 +++
 arch/arm/include/asm/arch-omap3/sys_proto.h |    1 +
 arch/arm/include/asm/omap_common.h          |    3 +-
 4 files changed, 41 insertions(+), 4 deletions(-)

Comments

Andreas Bießmann July 26, 2011, 6:11 a.m. UTC | #1
Dear Simon,

Am 25.07.2011 um 20:05 schrieb Simon Schwarz:

> Support for the new spl structure. Using the interface defined by Aneesh V for
> OMAP4
> ---
> V1 changes:
> ADD support for early console output in SPL
> 
> V2 changes:
> ADD include omap_common.h in board.c
> ADD implement new omap common interface omap_boot_device, omap_boot_mode and
> 	omap_rev_string (very basic)
> CHG cosmetic
> CHG Don't add ecc switch command in SPL
> ADD save_boot_params stump with warning to implement it
> 
> Transition from V1 to V2 also includes that this patch is now based on
> 	- the new SPL layout by Aneesh V and Daniel Schwierzeck
>  	- the OMAP4 SPL patches by Aneesh V
> 
> This is in some parts a anccesstor of "[U-Boot,2/5] devkit8000 nand_spl: omap3
> support nand_spl boot"
> (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102114) in V1
> 
> Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
> ---
> arch/arm/cpu/armv7/omap3/board.c            |   36 +++++++++++++++++++++++++-
> arch/arm/cpu/armv7/omap3/lowlevel_init.S    |    5 +++
> arch/arm/include/asm/arch-omap3/sys_proto.h |    1 +
> arch/arm/include/asm/omap_common.h          |    3 +-
> 4 files changed, 41 insertions(+), 4 deletions(-)

<snip>

> --- a/arch/arm/include/asm/omap_common.h
> +++ b/arch/arm/include/asm/omap_common.h
> @@ -49,8 +49,7 @@ void preloader_console_init(void);
> #define	MMCSD_MODE_UNDEFINED	0
> #define MMCSD_MODE_RAW		1
> #define MMCSD_MODE_FAT		2
> -#define NAND_MODE_HW		3
> -#define NAND_MODE_SW		4
> +#define NAND_MODE_HW_ECC	3

Well ... just choose this naming in Patch 2/5 ... and also change NAND_MODE_SW

> u32 omap_boot_device(void);
> u32 omap_boot_mode(void);
> -- 
> 1.7.4.1

regards

Andreas Bießmann
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 4aaf97b..2f6d01c 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -39,6 +39,7 @@ 
 #include <asm/cache.h>
 #include <asm/armv7.h>
 #include <asm/omap_gpio.h>
+#include <asm/omap_common.h>
 
 /* Declarations */
 extern omap3_sysinfo sysinfo;
@@ -56,6 +57,28 @@  static const struct gpio_bank gpio_bank_34xx[6] = {
 
 const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
 
+#ifdef CONFIG_SPL_BUILD
+/*
+* We use static variables because global data is not ready yet.
+* Initialized data is available in SPL right from the beginning.
+* We would not typically need to save these parameters in regular
+* U-Boot. This is needed only in SPL at the moment.
+*/
+u32 omap3_boot_device = BOOT_DEVICE_NAND;
+u32 omap3_boot_mode = NAND_MODE_HW_ECC;
+
+u32 omap_boot_device(void)
+{
+	return omap3_boot_device;
+}
+
+u32 omap_boot_mode(void)
+{
+	return omap3_boot_mode;
+}
+#endif /* CONFIG_SPL_BUILD */
+
+
 /******************************************************************************
  * Routine: delay
  * Description: spinning delay to use before udelay works
@@ -197,6 +220,10 @@  void s_init(void)
 
 	per_clocks_enable();
 
+#ifdef CONFIG_SPL_BUILD
+	preloader_console_init();
+#endif
+
 	if (!in_sdram)
 		mem_init();
 }
@@ -245,7 +272,7 @@  void abort(void)
 {
 }
 
-#ifdef CONFIG_NAND_OMAP_GPMC
+#if defined(CONFIG_NAND_OMAP_GPMC) & !defined(CONFIG_SPL_BUILD)
 /******************************************************************************
  * OMAP3 specific command to switch between NAND HW and SW ecc
  *****************************************************************************/
@@ -273,7 +300,7 @@  U_BOOT_CMD(
 	"[hw/sw] - Switch between NAND hardware (hw) or software (sw) ecc algorithm"
 );
 
-#endif /* CONFIG_NAND_OMAP_GPMC */
+#endif /* CONFIG_NAND_OMAP_GPMC & !CONFIG_SPL_BUILD */
 
 #ifdef CONFIG_DISPLAY_BOARDINFO
 /**
@@ -402,3 +429,8 @@  void v7_outer_cache_disable(void)
 	omap3_update_aux_cr(0, 0x2);
 }
 #endif
+
+void omap_rev_string(char *omap_rev_string)
+{
+	sprintf(omap_rev_string, "OMAP3, sorry revision detection unimplemented");
+}
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
index 67e8ceb..48a7ec6 100644
--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
@@ -35,6 +35,11 @@ 
 _TEXT_BASE:
 	.word	CONFIG_SYS_TEXT_BASE	/* sdram load addr from config.mk */
 
+.global save_boot_params
+save_boot_params:
+	#warning "Please implement save_boot_params for OMAP3"
+	bx lr
+
 .global omap3_gp_romcode_call
 omap3_gp_romcode_call:
 	PUSH {r4-r12, lr} @ Save all registers from ROM code!
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 995e7cb..7b60051 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -71,4 +71,5 @@  void power_init_r(void);
 void dieid_num_r(void);
 void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
 void omap3_gp_romcode_call(u32 service_id, u32 parameter);
+void omap_rev_string(char *omap_rev_string);
 #endif
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index ee45a33..13f6884 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -49,8 +49,7 @@  void preloader_console_init(void);
 #define	MMCSD_MODE_UNDEFINED	0
 #define MMCSD_MODE_RAW		1
 #define MMCSD_MODE_FAT		2
-#define NAND_MODE_HW		3
-#define NAND_MODE_SW		4
+#define NAND_MODE_HW_ECC	3
 
 u32 omap_boot_device(void);
 u32 omap_boot_mode(void);