Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 95b7d4df in mainline for boot/arch/arm64/src/main.c


Ignore:
Timestamp:
2021-08-22T17:05:13Z (8 weeks ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
06f10ac
Parents:
99589a9
Message:

Improve boot loader versatility

Add support for booting from EL3 and EL2, make sure instruction and
data caches are coherent on real hardware.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm64/src/main.c

    r99589a9 r95b7d4df  
    116116{
    117117        efi_status_t status;
    118         uint64_t current_el;
    119118        uint64_t memmap = 0;
    120119        sysarg_t memmap_size;
     
    143142        printf(" %p|%p: UEFI system table\n", efi_system_table_in,
    144143            efi_system_table_in);
    145 
    146         /* Validate the exception level. */
    147         current_el = CurrentEL_read();
    148         if (current_el != CURRENT_EL_EL1) {
    149                 printf("Error: Unexpected CurrentEL value %0#18" PRIx64 ".\n",
    150                     current_el);
    151                 status = EFI_UNSUPPORTED;
    152                 goto fail;
    153         }
    154144
    155145        /* Obtain memory map. */
     
    187177
    188178        /*
    189          * Check that everything is aligned on a 4kB boundary and the kernel can
     179         * Check that everything is aligned on a 4 KiB boundary and the kernel can
    190180         * be placed by the decompression code at a correct address.
    191181         */
     
    199189         * Dynamically check the memory base. The condition should be always
    200190         * true because UEFI guarantees each physical/virtual address in the
    201          * memory map is aligned on a 4kB boundary.
     191         * memory map is aligned on a 4 KiB boundary.
    202192         */
    203193        if (!IS_ALIGNED(memory_base, PAGE_SIZE)) {
    204194                printf("Error: Start of usable RAM (%p) is not aligned on a "
    205                     "4kB boundary.\n", (void *) memory_base);
     195                    "4 KiB boundary.\n", (void *) memory_base);
    206196                status = EFI_UNSUPPORTED;
    207197                goto fail;
     
    243233
    244234        extract_payload(&bootinfo->taskmap, kernel_dest, ram_end,
    245             (uintptr_t) kernel_dest, ensure_visibility);
     235            (uintptr_t) kernel_dest, smc_coherence);
    246236
    247237        /* Get final memory map. */
     
    301291        bootinfo->memmap.cnt = cnt;
    302292
     293        /* Flush the data cache containing bootinfo. */
     294        dcache_flush(bootinfo, sizeof(*bootinfo));
     295
    303296        uintptr_t entry = check_kernel_translated((void *) decompress_base,
    304297            BOOT_OFFSET);
Note: See TracChangeset for help on using the changeset viewer.