static int do_bootm_rtems(int flag, int argc, char * const argv[], bootm_headers_t *images) { void (*entry_point)(bd_t *); if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset("RTEMS"); return 1; } #endif entry_point = (void (*)(bd_t *))images->ep; printf("## Transferring control to RTEMS (at address %08lx) ...\n", (ulong)entry_point); bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* * RTEMS Parameters: * r3: ptr to board info data */ (*entry_point)(gd->bd); return 1; }
static int do_bootm_integrity (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 ("INTEGRITY"); return 1; } #endif entry_point = (void (*)(void))images->ep; printf ("## Transferring control to INTEGRITY (at address %08lx) ...\n", (ulong)entry_point); show_boot_progress (15); /* * INTEGRITY Parameters: * None */ (*entry_point)(); return 1; }
static int do_bootm_ose(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("OSE"); return 1; } #endif entry_point = (void (*)(void))images->ep; printf("## Transferring control to OSE (at address %08lx) ...\n", (ulong)entry_point); bootstage_mark(BOOTSTAGE_ID_RUN_OS); /* * OSE Parameters: * None */ (*entry_point)(); return 1; }
static int do_bootm_qnxelf(int flag, int argc, char * const argv[], bootm_headers_t *images) { char *local_args[2]; char str[16]; if (flag & BOOTM_STATE_OS_PREP) return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset("QNX"); return 1; } #endif sprintf(str, "%lx", images->ep); /* write entry-point into string */ local_args[0] = argv[0]; local_args[1] = str; /* and provide it via the arguments */ do_bootelf(NULL, 0, 2, local_args); return 1; }
static int do_bootm_plan9(int flag, int argc, char * const argv[], bootm_headers_t *images) { void (*entry_point)(void); char *s; if (flag & BOOTM_STATE_OS_PREP) return 0; 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 /* See README.plan9 */ s = getenv("confaddr"); if (s != NULL) { char *confaddr = (char *)simple_strtoul(s, NULL, 16); if (argc > 0) { copy_args(confaddr, argc, argv, '\n'); } else { s = getenv("bootargs"); if (s != NULL) strcpy(confaddr, s); } } 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; }
static int do_bootm_vxworks(int flag, int argc, char * const argv[], bootm_headers_t *images) { if (flag != BOOTM_STATE_OS_GO) return 0; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset("VxWorks"); return 1; } #endif do_bootvx_fdt(images); return 1; }
static int do_bootm_lynxkdi (int flag, int argc, char *argv[], bootm_headers_t *images) { image_header_t *hdr = &images->legacy_hdr_os_copy; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("Lynx"); return 1; } #endif lynxkdi_boot ((image_header_t *)hdr); return 1; }
static int do_bootm_vxworks (int flag, int argc, char *argv[], bootm_headers_t *images) { char str[80]; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("VxWorks"); return 1; } #endif sprintf(str, "%lx", images->ep); /* write entry-point into string */ setenv("loadaddr", str); do_bootvx(NULL, 0, 0, NULL); return 1; }
static int do_bootm_netbsd (int flag, int argc, char *argv[], bootm_headers_t *images) { void (*loader)(bd_t *, image_header_t *, char *, char *); image_header_t *os_hdr, *hdr; ulong kernel_data, kernel_len; char *consdev; char *cmdline; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("NetBSD"); return 1; } #endif hdr = images->legacy_hdr_os; /* * Booting a (NetBSD) kernel image * * This process is pretty similar to a standalone application: * The (first part of an multi-) image must be a stage-2 loader, * which in turn is responsible for loading & invoking the actual * kernel. The only differences are the parameters being passed: * besides the board info strucure, the loader expects a command * line, the name of the console device, and (optionally) the * address of the original image header. */ os_hdr = NULL; if (image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) { image_multi_getimg (hdr, 1, &kernel_data, &kernel_len); if (kernel_len) os_hdr = hdr; } consdev = ""; #if defined (CONFIG_8xx_CONS_SMC1) consdev = "smc1"; #elif defined (CONFIG_8xx_CONS_SMC2) consdev = "smc2"; #elif defined (CONFIG_8xx_CONS_SCC2) consdev = "scc2"; #elif defined (CONFIG_8xx_CONS_SCC3) consdev = "scc3"; #endif if (argc > 2) { ulong len; int i; for (i = 2, len = 0; i < argc; i += 1) len += strlen (argv[i]) + 1; cmdline = malloc (len); for (i = 2, len = 0; i < argc; i += 1) { if (i > 2) cmdline[len++] = ' '; strcpy (&cmdline[len], argv[i]); len += strlen (argv[i]); } } else if ((cmdline = getenv ("bootargs")) == NULL) { cmdline = ""; } loader = (void (*)(bd_t *, image_header_t *, char *, char *))images->ep; printf ("## Transferring control to NetBSD stage-2 loader (at address %08lx) ...\n", (ulong)loader); show_boot_progress (15); /* * NetBSD Stage-2 Loader Parameters: * r3: ptr to board info data * r4: image address * r5: console device * r6: boot args string */ (*loader) (gd->bd, os_hdr, consdev, cmdline); return 1; }