[U-Boot] [PATCH] Add support for booting of INTEGRITY operating system uImages

Peter Tyser ptyser at xes-inc.com
Wed Aug 13 22:31:10 CEST 2008


Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 README             |    5 +++--
 common/cmd_bootm.c |   39 +++++++++++++++++++++++++++++++++++++++
 common/image.c     |    3 +++
 include/image.h    |    1 +
 4 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/README b/README
index d4456e5..3d9c903 100644
--- a/README
+++ b/README
@@ -3030,8 +3030,9 @@ details; basically, the header defines the following image properties:
 
 * Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
   4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
-  LynxOS, pSOS, QNX, RTEMS, ARTOS;
-  Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
+  LynxOS, pSOS, QNX, RTEMS, ARTOS, INTEGRITY;
+  Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS,
+  INTEGRITY).
 * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
   IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
   Currently supported: ARM, AVR32, Intel x86, MIPS, NIOS, PowerPC).
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 5295969..95021cc 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -106,6 +106,9 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
 static boot_os_fn do_bootm_artos;
 #endif
+#if defined(CONFIG_INTEGRITY)
+static boot_os_fn do_bootm_integrity;
+#endif
 
 ulong load_addr = CFG_LOAD_ADDR;	/* Default Load Address */
 static bootm_headers_t images;		/* pointers to os/initrd/fdt images */
@@ -356,6 +359,12 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	    do_bootm_artos (cmdtp, flag, argc, argv, &images);
 	    break;
 #endif
+
+#ifdef CONFIG_INTEGRITY
+	case IH_OS_INTEGRITY:
+		do_bootm_integrity (cmdtp, flag, argc, argv, &images);
+		break;
+#endif
 	}
 
 	show_boot_progress (-9);
@@ -1139,3 +1148,33 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
 	(*entry) (kbd, cmdline, fwenv, top);
 }
 #endif
+
+#ifdef CONFIG_INTEGRITY
+static void do_bootm_integrity (cmd_tbl_t *cmdtp, int flag,
+				int argc, char *argv[],
+				bootm_headers_t *images)
+{
+	image_header_t *hdr = &images->legacy_hdr_os_copy;
+	void (*entry_point)(void);
+
+#if defined(CONFIG_FIT)
+	if (!images->legacy_hdr_valid) {
+		fit_unsupported_reset ("INTEGRITY");
+		do_reset (cmdtp, flag, argc, argv);
+	}
+#endif
+
+	entry_point = (void (*)(void))image_get_ep (hdr);
+
+	printf ("## Transferring control to INTEGRITY (at address %08lx) ...\n",
+		(ulong)entry_point);
+
+	show_boot_progress (15);
+
+	/*
+	 * INTEGRITY Parameters:
+	 *   None
+	 */
+	(*entry_point)();
+}
+#endif
diff --git a/common/image.c b/common/image.c
index 6d2ce32..95488db 100644
--- a/common/image.c
+++ b/common/image.c
@@ -108,6 +108,9 @@ static table_entry_t uimage_os[] = {
 #if defined(CONFIG_ARTOS) || defined(USE_HOSTCC)
 	{	IH_OS_ARTOS,	"artos",	"ARTOS",		},
 #endif
+#if defined(CONFIG_INTEGRITY) || defined(USE_HOSTCC)
+	{	IH_OS_INTEGRITY,"integrity",	"INTEGRITY",		},
+#endif
 	{	IH_OS_LINUX,	"linux",	"Linux",		},
 #if defined(CONFIG_LYNXKDI) || defined(USE_HOSTCC)
 	{	IH_OS_LYNXOS,	"lynxos",	"LynxOS",		},
diff --git a/include/image.h b/include/image.h
index 4b9c582..cbf183a 100644
--- a/include/image.h
+++ b/include/image.h
@@ -85,7 +85,7 @@
 #define IH_OS_RTEMS		18	/* RTEMS	*/
 #define IH_OS_ARTOS		19	/* ARTOS	*/
 #define IH_OS_UNITY		20	/* Unity OS	*/
+#define IH_OS_INTEGRITY		21	/* INTEGRITY	*/
 
 /*
  * CPU Architecture Codes (supported by Linux)
-- 
1.5.4.3




More information about the U-Boot mailing list