// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2013, 2014 Linaro Ltd; <roy.franz@linaro.org> * * This file implements the EFI boot stub for the arm64 kernel. * Adapted from ARM version by Mark Salter <msalter@redhat.com>
*/
/* * Ampere eMAG, Altra, and Altra Max machines crash in SetTime() if * SetVirtualAddressMap() has not been called prior. Most Altra systems * can be identified by the SMCCC soc ID, which is conveniently exposed * via the type 4 SMBIOS records. Otherwise, test the processor version * field. eMAG systems all appear to have the processor version field * set to "eMAG".
*/
record = (struct efi_smbios_type4_record *)efi_get_smbios_record(4); if (!record) returnfalse;
/* * If we have 48 bits of VA space for TTBR0 mappings, we can map the * UEFI runtime regions 1:1 and so calling SetVirtualAddressMap() is * unnecessary.
*/ if (VA_BITS_MIN >= 48 && !system_needs_vamap())
efi_novamap = true;
/* UEFI mandates support for 4 KB granularity, no need to check */ if (IS_ENABLED(CONFIG_ARM64_4K_PAGES)) return EFI_SUCCESS;
tg = (read_cpuid(ID_AA64MMFR0_EL1) >> ID_AA64MMFR0_EL1_TGRAN_SHIFT) & 0xf; if (tg < ID_AA64MMFR0_EL1_TGRAN_SUPPORTED_MIN || tg > ID_AA64MMFR0_EL1_TGRAN_SUPPORTED_MAX) { if (IS_ENABLED(CONFIG_ARM64_64K_PAGES))
efi_err("This 64 KB granular kernel is not supported by your CPU\n"); else
efi_err("This 16 KB granular kernel is not supported by your CPU\n"); return EFI_UNSUPPORTED;
} return EFI_SUCCESS;
}
/* only perform the cache maintenance if needed for I/D coherency */ if (!(ctr & BIT(CTR_EL0_IDC_SHIFT))) { unsignedlong base = image_base; unsignedlong size = code_size;
do { asm("dc " DCTYPE ", %0" :: "r"(base));
base += lsize;
size -= lsize;
} while (size >= lsize);
}
unsignedlong __weak primary_entry_offset(void)
{ /* * By default, we can invoke the kernel via the branch instruction in * the image header, so offset #0. This will be overridden by the EFI * stub build that is linked into the core kernel, as in that case, the * image header may not have been loaded into memory, or may be mapped * with non-executable permissions.
*/ return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.