X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fbootm_os.c;h=6e463c317e84356e1c4b0cab9336f3b35abd9a8a;hb=e9eb0cb20a12f4ef55e229555efa6e726274dfdc;hp=f7769ac853b7a49ed142316fd803c23f24425b8a;hpb=01a3647abdca096245c6b1d0c32e348efc07c67d;p=oweals%2Fu-boot.git diff --git a/common/bootm_os.c b/common/bootm_os.c index f7769ac853..6e463c317e 100644 --- a/common/bootm_os.c +++ b/common/bootm_os.c @@ -288,6 +288,8 @@ void do_bootvx_fdt(bootm_headers_t *images) if (ret) return; + fdt_fixup_ethernet(*of_flat_tree); + ret = fdt_add_subnode(*of_flat_tree, 0, "chosen"); if ((ret >= 0 || ret == -FDT_ERR_EXISTS)) { bootline = getenv("bootargs"); @@ -351,6 +353,7 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[], { char *local_args[2]; char str[16]; + int dcache; if (flag != BOOTM_STATE_OS_GO) return 0; @@ -365,8 +368,19 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[], 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 */ + + /* + * QNX images require the data cache is disabled. + */ + dcache = dcache_status(); + if (dcache) + dcache_disable(); + do_bootelf(NULL, 0, 2, local_args); + if (dcache) + dcache_enable(); + return 1; } #endif @@ -404,6 +418,32 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[], } #endif +#ifdef CONFIG_BOOTM_OPENRTOS +static int do_bootm_openrtos(int flag, int argc, char * const argv[], + bootm_headers_t *images) +{ + void (*entry_point)(void); + + if (flag != BOOTM_STATE_OS_GO) + return 0; + + entry_point = (void (*)(void))images->ep; + + printf("## Transferring control to OpenRTOS (at address %08lx) ...\n", + (ulong)entry_point); + + bootstage_mark(BOOTSTAGE_ID_RUN_OS); + + /* + * OpenRTOS Parameters: + * None + */ + (*entry_point)(); + + return 1; +} +#endif + static boot_os_fn *boot_os[] = { [IH_OS_U_BOOT] = do_bootm_standalone, #ifdef CONFIG_BOOTM_LINUX @@ -434,14 +474,16 @@ static boot_os_fn *boot_os[] = { #ifdef CONFIG_INTEGRITY [IH_OS_INTEGRITY] = do_bootm_integrity, #endif +#ifdef CONFIG_BOOTM_OPENRTOS + [IH_OS_OPENRTOS] = do_bootm_openrtos, +#endif }; /* Allow for arch specific config before we boot */ -static void __arch_preboot_os(void) +__weak void arch_preboot_os(void) { /* please define platform specific arch_preboot_os() */ } -void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os"))); int boot_selected_os(int argc, char * const argv[], int state, bootm_headers_t *images, boot_os_fn *boot_fn) @@ -451,12 +493,12 @@ int boot_selected_os(int argc, char * const argv[], int state, /* Stand-alone may return when 'autostart' is 'no' */ if (images->os.type == IH_TYPE_STANDALONE || + IS_ENABLED(CONFIG_SANDBOX) || state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */ return 0; bootstage_error(BOOTSTAGE_ID_BOOT_OS_RETURNED); -#ifdef DEBUG - puts("\n## Control returned to monitor - resetting...\n"); -#endif + debug("\n## Control returned to monitor - resetting...\n"); + return BOOTM_ERR_RESET; }