Skip to contentSkip to conversation

sh: allow board specific code in the zImage loader

PATCH New Magnus Damm 1 participant 1 message Jul 22, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: allow board specific code in the zImage loader

From: Magnus Damm <[email protected]>

This patch simply adds code to allow board specific assembly setup code in the zImage boot loader.

Boards that support this mode should allow the user to enable this by selecting SYS_SUPPORTS_ZIMAGE_BOOT_LOADER.

If SYS_SUPPORTS_ZIMAGE_BOOT_LOADER is selected then the board specific assembly file must be pointed out with ZIMAGE_BOOT_LOADER_FILE.

The user can then use CONFIG_ZIMAGE_BOOT_LOADER to enable or disable board specific code in the zImage.

---

 arch/sh/Kconfig                   |   15 +++++++++++++++
 arch/sh/boot/compressed/head_32.S |    3 +++
 2 files changed, 18 insertions(+)
arch/sh/Kconfig +15 -0
@@ -139,6 +139,9 @@ config SYS_SUPPORTS_MTU2
 config SYS_SUPPORTS_TMU
 	bool
 
+config SYS_SUPPORTS_ZIMAGE_BOOT_LOADER
+	bool
+
 config STACKTRACE_SUPPORT
 	def_bool y
 
@@ -766,6 +769,18 @@ config CMDLINE
 	depends on CMDLINE_BOOL
 	default "console=ttySC1,115200"
 
+config ZIMAGE_BOOT_LOADER_FILE
+	string
+	depends on ZIMAGE_BOOT_LOADER
+
+config ZIMAGE_BOOT_LOADER
+	bool "Use zImage as boot loader"
+	depends on SYS_SUPPORTS_ZIMAGE_BOOT_LOADER
+	help
+	  This option enables board specific code in the zImage boot loader.
+
+	  If unsure, say N.
+
 endmenu
 
 menu "Bus options"
arch/sh/boot/compressed/head_32.S +3 -0
@@ -11,6 +11,9 @@
 
 	.global	startup
 startup:
+#ifdef CONFIG_ZIMAGE_BOOT_LOADER
+#include CONFIG_ZIMAGE_BOOT_LOADER_FILE
+#endif
 	/* Load initial status register */
 	mov.l   init_sr, r1
 	ldc     r1, sr