diff options
author | Steven Stallion <sstallion@gmail.com> | 2013-03-20 06:31:35 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-03-27 15:30:11 -0400 |
commit | 04d414090c71f986b54838f791430fabaa57ca7c (patch) | |
tree | fe69b4900781f006bbe92f855995b41ab863e20a | |
parent | 0171d52c410cbaa9290b1b214e695697c835bfe5 (diff) | |
download | u-boot-04d414090c71f986b54838f791430fabaa57ca7c.zip u-boot-04d414090c71f986b54838f791430fabaa57ca7c.tar.gz u-boot-04d414090c71f986b54838f791430fabaa57ca7c.tar.bz2 |
image: Add support for Plan 9
Signed-off-by: Steven Stallion <sstallion@gmail.com>
Cc: Tom Rini <trini@ti.com>
Reviewed-by: Tom Rini <trini@ti.com>
-rw-r--r-- | common/cmd_bootm.c | 39 | ||||
-rw-r--r-- | common/image.c | 1 | ||||
-rw-r--r-- | include/config_defaults.h | 1 | ||||
-rw-r--r-- | include/image.h | 1 |
4 files changed, 42 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 5d2ce00..7438469 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -128,6 +128,9 @@ static boot_os_fn do_bootm_rtems; #if defined(CONFIG_BOOTM_OSE) static boot_os_fn do_bootm_ose; #endif +#if defined(CONFIG_BOOTM_PLAN9) +static boot_os_fn do_bootm_plan9; +#endif #if defined(CONFIG_CMD_ELF) static boot_os_fn do_bootm_vxworks; static boot_os_fn do_bootm_qnxelf; @@ -154,6 +157,9 @@ static boot_os_fn *boot_os[] = { #if defined(CONFIG_BOOTM_OSE) [IH_OS_OSE] = do_bootm_ose, #endif +#if defined(CONFIG_BOOTM_PLAN9) + [IH_OS_PLAN9] = do_bootm_plan9, +#endif #if defined(CONFIG_CMD_ELF) [IH_OS_VXWORKS] = do_bootm_vxworks, [IH_OS_QNX] = do_bootm_qnxelf, @@ -1628,6 +1634,39 @@ static int do_bootm_ose(int flag, int argc, char * const argv[], } #endif /* CONFIG_BOOTM_OSE */ +#if defined(CONFIG_BOOTM_PLAN9) +static int do_bootm_plan9(int flag, int argc, char * const argv[], + bootm_headers_t *images) +{ + void (*entry_point)(void); + + if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) + return 1; + +#if defined(CONFIG_FIT) + if (!images->legacy_hdr_valid) { + fit_unsupported_reset("Plan 9"); + return 1; + } +#endif + + entry_point = (void (*)(void))images->ep; + + printf("## Transferring control to Plan 9 (at address %08lx) ...\n", + (ulong)entry_point); + + bootstage_mark(BOOTSTAGE_ID_RUN_OS); + + /* + * Plan 9 Parameters: + * None + */ + (*entry_point)(); + + return 1; +} +#endif /* CONFIG_BOOTM_PLAN9 */ + #if defined(CONFIG_CMD_ELF) static int do_bootm_vxworks(int flag, int argc, char * const argv[], bootm_headers_t *images) diff --git a/common/image.c b/common/image.c index 6afbb40..60c2127 100644 --- a/common/image.c +++ b/common/image.c @@ -108,6 +108,7 @@ static const table_entry_t uimage_os[] = { #endif { IH_OS_NETBSD, "netbsd", "NetBSD", }, { IH_OS_OSE, "ose", "Enea OSE", }, + { IH_OS_PLAN9, "plan9", "Plan 9", }, { IH_OS_RTEMS, "rtems", "RTEMS", }, { IH_OS_U_BOOT, "u-boot", "U-Boot", }, #if defined(CONFIG_CMD_ELF) || defined(USE_HOSTCC) diff --git a/include/config_defaults.h b/include/config_defaults.h index d023c63..567b46c 100644 --- a/include/config_defaults.h +++ b/include/config_defaults.h @@ -12,6 +12,7 @@ /* Support bootm-ing different OSes */ #define CONFIG_BOOTM_LINUX 1 #define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_PLAN9 1 #define CONFIG_BOOTM_RTEMS 1 #define CONFIG_GZIP 1 diff --git a/include/image.h b/include/image.h index 8e285f9..4ad0e6b 100644 --- a/include/image.h +++ b/include/image.h @@ -84,6 +84,7 @@ #define IH_OS_UNITY 20 /* Unity OS */ #define IH_OS_INTEGRITY 21 /* INTEGRITY */ #define IH_OS_OSE 22 /* OSE */ +#define IH_OS_PLAN9 23 /* Plan 9 */ /* * CPU Architecture Codes (supported by Linux) |