Lines Matching +full:arm64 +full:- +full:efi

1 // SPDX-License-Identifier: GPL-2.0-only
3 * ARM64 Specific Low-Level ACPI Boot Support
5 * Copyright (C) 2013-2014, Linaro Ltd.
16 #include <linux/arm-smccc.h>
18 #include <linux/efi.h>
19 #include <linux/efi-bgrt.h>
51 return -EINVAL; in parse_acpi()
61 return -EINVAL; /* Core will print when we return error */ in parse_acpi()
117 * acpi_fadt_sanity_check() - Check FADT presence and carry out sanity
130 * FADT is required on arm64; retrieve it to check its presence in acpi_fadt_sanity_check()
138 return -ENODEV; in acpi_fadt_sanity_check()
149 if (table->revision < 5 || in acpi_fadt_sanity_check()
150 (table->revision == 5 && fadt->minor_revision < 1)) { in acpi_fadt_sanity_check()
152 table->revision, fadt->minor_revision); in acpi_fadt_sanity_check()
154 if (!fadt->arm_boot_flags) { in acpi_fadt_sanity_check()
155 ret = -EINVAL; in acpi_fadt_sanity_check()
161 if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) { in acpi_fadt_sanity_check()
163 ret = -EINVAL; in acpi_fadt_sanity_check()
182 * We can parse ACPI boot-time tables such as MADT after
187 * - ACPI tables are initialized and sanity checks passed
188 * - acpi=force was passed in the command line and ACPI was not disabled
197 * - ACPI has been disabled explicitly (acpi=off), or in acpi_boot_table_init()
198 * - the device tree is not empty (it has more than just a /chosen node, in acpi_boot_table_init()
239 * Although UEFI specifies the use of Normal Write-through for in __acpi_get_writethrough_mem_attribute()
242 * purpose, emit a warning and use Normal Non-cacheable instead. in __acpi_get_writethrough_mem_attribute()
244 pr_warn_once("No MAIR allocation for EFI_MEMORY_WT; treating as Normal Non-cacheable\n"); in __acpi_get_writethrough_mem_attribute()
251 * According to "Table 8 Map: EFI memory types to AArch64 memory in __acpi_get_mem_attribute()
252 * types" of UEFI 2.5 section 2.3.6.1, each EFI memory type is in __acpi_get_mem_attribute()
254 * The EFI memory attribute advises all possible capabilities in __acpi_get_mem_attribute()
279 u64 end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT); in acpi_os_ioremap()
281 if (phys < md->phys_addr || phys >= end) in acpi_os_ioremap()
285 pr_warn(FW_BUG "requested region covers multiple EFI memory regions\n"); in acpi_os_ioremap()
294 * EFI memory map at all, as it only describes normal memory, and MMIO in acpi_os_ioremap()
296 * the EFI runtime services. in acpi_os_ioremap()
300 switch (region->type) { in acpi_os_ioremap()
347 if (region->attribute & EFI_MEMORY_WB) in acpi_os_ioremap()
349 else if (region->attribute & EFI_MEMORY_WC) in acpi_os_ioremap()
351 else if (region->attribute & EFI_MEMORY_WT) in acpi_os_ioremap()
366 int err = -ENOENT; in apei_claim_sea()
391 * APEI NMI-like notifications are deferred to irq_work. Unless in apei_claim_sea()
392 * we interrupted irqs-masked code, we can do that now. in apei_claim_sea()
402 err = -EINPROGRESS; in apei_claim_sea()
418 * Implements ARM64 specific callbacks to support ACPI FFH Operation Region as
439 return -EOPNOTSUPP; in acpi_ffh_address_space_arch_setup()
444 return -EOPNOTSUPP; in acpi_ffh_address_space_arch_setup()
449 return -ENOMEM; in acpi_ffh_address_space_arch_setup()
452 ffh_ctxt->invoke_ffh_fn = __arm_smccc_smc; in acpi_ffh_address_space_arch_setup()
453 ffh_ctxt->invoke_ffh64_fn = arm_smccc_1_2_smc; in acpi_ffh_address_space_arch_setup()
455 ffh_ctxt->invoke_ffh_fn = __arm_smccc_hvc; in acpi_ffh_address_space_arch_setup()
456 ffh_ctxt->invoke_ffh64_fn = arm_smccc_1_2_hvc; in acpi_ffh_address_space_arch_setup()
459 memcpy(ffh_ctxt, handler_ctxt, sizeof(ffh_ctxt->info)); in acpi_ffh_address_space_arch_setup()
481 if (ffh_ctxt->info.offset == 0) { in acpi_ffh_address_space_arch_handler()
488 ffh_ctxt->info.length > 32) { in acpi_ffh_address_space_arch_handler()
491 int idx, len = ffh_ctxt->info.length >> 2; in acpi_ffh_address_space_arch_handler()
496 ffh_ctxt->invoke_ffh_fn(a[0], a[1], a[2], a[3], a[4], in acpi_ffh_address_space_arch_handler()
501 } else if (ffh_ctxt->info.offset == 1) { in acpi_ffh_address_space_arch_handler()
505 if (!ARM_SMCCC_IS_FAST_CALL(r->a0) || !ARM_SMCCC_IS_64(r->a0) || in acpi_ffh_address_space_arch_handler()
506 !acpi_ffh_smccc_owner_allowed(r->a0) || in acpi_ffh_address_space_arch_handler()
507 ffh_ctxt->info.length > sizeof(*r)) { in acpi_ffh_address_space_arch_handler()
510 ffh_ctxt->invoke_ffh64_fn(r, r); in acpi_ffh_address_space_arch_handler()
511 memcpy(value, r, ffh_ctxt->info.length); in acpi_ffh_address_space_arch_handler()