forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/arch/arm64/include/asm/acpi.h
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2013-2014, Linaro Ltd.
34 * Author: Al Stone <al.stone@linaro.org>
45 * Author: Graeme Gregory <graeme.gregory@linaro.org>
56 * Author: Hanjun Guo <hanjun.guo@linaro.org>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation;
107 */
118
129 #ifndef _ASM_ACPI_H
....@@ -15,39 +12,42 @@
1512 #include <linux/efi.h>
1613 #include <linux/memblock.h>
1714 #include <linux/psci.h>
15
+#include <linux/stddef.h>
1816
1917 #include <asm/cputype.h>
2018 #include <asm/io.h>
19
+#include <asm/ptrace.h>
2120 #include <asm/smp_plat.h>
2221 #include <asm/tlbflush.h>
2322
2423 /* Macros for consistency checks of the GICC subtable of MADT */
25
-#define ACPI_MADT_GICC_LENGTH \
26
- (acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
24
+
25
+/*
26
+ * MADT GICC minimum length refers to the MADT GICC structure table length as
27
+ * defined in the earliest ACPI version supported on arm64, ie ACPI 5.1.
28
+ *
29
+ * The efficiency_class member was added to the
30
+ * struct acpi_madt_generic_interrupt to represent the MADT GICC structure
31
+ * "Processor Power Efficiency Class" field, added in ACPI 6.0 whose offset
32
+ * is therefore used to delimit the MADT GICC structure minimum length
33
+ * appropriately.
34
+ */
35
+#define ACPI_MADT_GICC_MIN_LENGTH offsetof( \
36
+ struct acpi_madt_generic_interrupt, efficiency_class)
2737
2838 #define BAD_MADT_GICC_ENTRY(entry, end) \
29
- (!(entry) || (entry)->header.length != ACPI_MADT_GICC_LENGTH || \
30
- (unsigned long)(entry) + ACPI_MADT_GICC_LENGTH > (end))
39
+ (!(entry) || (entry)->header.length < ACPI_MADT_GICC_MIN_LENGTH || \
40
+ (unsigned long)(entry) + (entry)->header.length > (end))
41
+
42
+#define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \
43
+ spe_interrupt) + sizeof(u16))
3144
3245 /* Basic configuration for ACPI */
3346 #ifdef CONFIG_ACPI
3447 pgprot_t __acpi_get_mem_attribute(phys_addr_t addr);
3548
3649 /* ACPI table mapping after acpi_permanent_mmap is set */
37
-static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
38
- acpi_size size)
39
-{
40
- /* For normal memory we already have a cacheable mapping. */
41
- if (memblock_is_map_memory(phys))
42
- return (void __iomem *)__phys_to_virt(phys);
43
-
44
- /*
45
- * We should still honor the memory's attribute here because
46
- * crash dump kernel possibly excludes some ACPI (reclaim)
47
- * regions from memblock list.
48
- */
49
- return __ioremap(phys, size, __acpi_get_mem_attribute(phys));
50
-}
50
+void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
5151 #define acpi_os_ioremap acpi_os_ioremap
5252
5353 typedef u64 phys_cpuid_t;
....@@ -99,9 +99,10 @@
9999
100100 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
101101 void __init acpi_init_cpus(void);
102
-
102
+int apei_claim_sea(struct pt_regs *regs);
103103 #else
104104 static inline void acpi_init_cpus(void) { }
105
+static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
105106 #endif /* CONFIG_ACPI */
106107
107108 #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL