diff --git a/arch/arm64/kernel/efi-entry.S b/arch/arm64/kernel/efi-entry.S index 8ce9b05..0024d02 100644 --- a/arch/arm64/kernel/efi-entry.S +++ b/arch/arm64/kernel/efi-entry.S @@ -91,16 +91,6 @@ ENTRY(efi_stub_entry) sub x1, x1, x0 bl __flush_dcache_area - /* Turn off Dcache and MMU */ - mrs x0, CurrentEL - cmp x0, #CurrentEL_EL2 - b.ne 1f - mrs x0, sctlr_el2 - bic x0, x0, #1 << 0 // clear SCTLR.M - bic x0, x0, #1 << 2 // clear SCTLR.C - msr sctlr_el2, x0 - isb - b 2f 1: mrs x0, sctlr_el1 bic x0, x0, #1 << 0 // clear SCTLR.M diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index f07d4a6..61757ef 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -369,6 +369,7 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, efi_status_t status; int nr_files; char *str; + char Message[256] = {0}; int i, j, k; file_addr = 0; @@ -413,10 +414,14 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, } str = cmd_line; + for (i = 0; i < nr_files; i++) { struct file_info *file; efi_char16_t filename_16[256]; efi_char16_t *p; + char pram[256]; + char *token = NULL; + char *ppram; str = strstr(str, option_string); if (!str) @@ -426,6 +431,7 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, file = &files[i]; p = filename_16; + ppram = pram; /* Skip any leading slashes */ while (*str == '/' || *str == '\\') @@ -437,13 +443,41 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, if (*str == '/') { *p++ = '\\'; + *ppram++ = '\\'; str++; } else { - *p++ = *str++; + *p = *str; + *ppram = *str; + p++; + ppram++; + str++; } } *p = '\0'; + *ppram = '\0'; + + /* Check Whether Pre-load RAM Location. Format dtb=0x83000000,0x83200000 */ + ppram = pram; + token = strsep(&ppram, ","); + + if(token != NULL) + { + sscanf( (const char *)token, "%lx", &file_addr); + memset(Message, 0, sizeof(Message)); + sprintf(Message, "Preloaded dtb or initrd found. Address = 0x%lx\n", file_addr); + efi_printk(sys_table_arg, Message); + token = strsep(&ppram, ","); + + if(token != NULL) + { + sscanf( (const char *)token, "%llx", &file_size_total ); + memset(Message, 0, sizeof(Message)); + sprintf(Message, "Preloaded dtb or initrd File Size = 0x%llx\n", file_size_total); + efi_printk(sys_table_arg, Message); + break; + } + } /* Only open the volume once. */ if (!i) { @@ -460,8 +494,8 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, file_size_total += file->size; } - - if (file_size_total) { + + if (file_size_total && !file_addr) { unsigned long addr; /*