The patches support SMBIOS/DMI on arm system, it tested by dmidecode and lshw tools.
The first patch is wrapping remap/unmap methond for general archs, and has been posted for review to x86 and ia64, waiting the ack. The last two patches depend on booting from UEFI and SMBIOS data reported as Runtime Services Data type.
Ard Biesheuvel (1): firmware/dmi_scan: generalize for use by other archs
Yi Li (2): ARM64:DMI: Add smbios/dmi support on arm64 ARM32:DMI: Add smbios/dmi support on arm32
arch/arm/Kconfig | 13 +++++++++++++ arch/arm/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm/kernel/setup.c | 2 ++ arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ arch/ia64/include/asm/dmi.h | 10 +++++++--- arch/x86/include/asm/dmi.h | 8 ++++++-- drivers/firmware/dmi_scan.c | 20 +++++++++++--------- 9 files changed, 107 insertions(+), 14 deletions(-) create mode 100644 arch/arm/include/asm/dmi.h create mode 100644 arch/arm64/include/asm/dmi.h
From: Ard Biesheuvel ard.biesheuvel@linaro.org
This patch makes a couple of changes to the SMBIOS/DMI scanning code so it can be used on other archs (such as ARM and arm64): (a) wrap the calls to ioremap()/iounmap(), this allows the use of a flavor of ioremap() more suitable for random unaligned access; (b) allow the non-EFI fallback probe into hardcoded physical address 0xF0000 to be disabled.
Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org Signed-off-by: Yi Li yi.li@linaro.org ---
Based on original patch from Ard, a minor point is fixed in checkpatch.pl.
arch/ia64/include/asm/dmi.h | 10 +++++++--- arch/x86/include/asm/dmi.h | 8 ++++++-- drivers/firmware/dmi_scan.c | 20 +++++++++++--------- 3 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h index 185d3d1..f644b98 100644 --- a/arch/ia64/include/asm/dmi.h +++ b/arch/ia64/include/asm/dmi.h @@ -5,8 +5,12 @@ #include <asm/io.h>
/* Use normal IO mappings for DMI */ -#define dmi_ioremap ioremap -#define dmi_iounmap(x,l) iounmap(x) -#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC) +#define dmi_early_remap ioremap +#define dmi_early_unmap(x, l) iounmap(x) +#define dmi_remap ioremap +#define dmi_unmap iounmap +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC) + +#define DMI_SCAN_MACHINE_NON_EFI_FALLBACK 1
#endif diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h index fd8f9e2..bb2b572 100644 --- a/arch/x86/include/asm/dmi.h +++ b/arch/x86/include/asm/dmi.h @@ -13,7 +13,11 @@ static __always_inline __init void *dmi_alloc(unsigned len) }
/* Use early IO mappings for DMI because it's initialized early */ -#define dmi_ioremap early_ioremap -#define dmi_iounmap early_iounmap +#define dmi_early_remap early_ioremap +#define dmi_early_unmap early_iounmap +#define dmi_remap ioremap +#define dmi_unmap iounmap + +#define DMI_SCAN_MACHINE_NON_EFI_FALLBACK 1
#endif /* _ASM_X86_DMI_H */ diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index fa0affb..2c7c793 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -108,7 +108,7 @@ static int __init dmi_walk_early(void (*decode)(const struct dmi_header *, { u8 *buf;
- buf = dmi_ioremap(dmi_base, dmi_len); + buf = dmi_early_remap(dmi_base, dmi_len); if (buf == NULL) return -1;
@@ -116,7 +116,7 @@ static int __init dmi_walk_early(void (*decode)(const struct dmi_header *,
add_device_randomness(buf, dmi_len);
- dmi_iounmap(buf, dmi_len); + dmi_early_unmap(buf, dmi_len); return 0; }
@@ -483,18 +483,19 @@ void __init dmi_scan_machine(void) * needed during early boot. This also means we can * iounmap the space when we're done with it. */ - p = dmi_ioremap(efi.smbios, 32); + p = dmi_early_remap(efi.smbios, 32); if (p == NULL) goto error; memcpy_fromio(buf, p, 32); - dmi_iounmap(p, 32); + dmi_early_unmap(p, 32);
if (!dmi_present(buf)) { dmi_available = 1; goto out; } } else { - p = dmi_ioremap(0xF0000, 0x10000); +#ifdef DMI_SCAN_MACHINE_NON_EFI_FALLBACK + p = dmi_early_remap(0xF0000, 0x10000); if (p == NULL) goto error;
@@ -510,12 +511,13 @@ void __init dmi_scan_machine(void) memcpy_fromio(buf + 16, q, 16); if (!dmi_present(buf)) { dmi_available = 1; - dmi_iounmap(p, 0x10000); + dmi_early_unmap(p, 0x10000); goto out; } memcpy(buf, buf + 16, 16); } - dmi_iounmap(p, 0x10000); + dmi_early_unmap(p, 0x10000); +#endif } error: pr_info("DMI not present or invalid.\n"); @@ -787,13 +789,13 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *), if (!dmi_available) return -1;
- buf = ioremap(dmi_base, dmi_len); + buf = dmi_remap(dmi_base, dmi_len); if (buf == NULL) return -1;
dmi_table(buf, dmi_len, dmi_num, decode, private_data);
- iounmap(buf); + dmi_unmap(buf); return 0; } EXPORT_SYMBOL_GPL(dmi_walk);
Add smbios/dmi support on arm64 system, it depends on EFI boot.
Signed-off-by: Yi Li yi.li@linaro.org ---
efi_lookup_mapped_addr() isn't able to translate the address range which is reported as reserved type from UEFI. Following the UEFI spec 2.4, it descripts the SMBIOS data should be runtime service type. So it depends on a UEFI patch to convert reserved type to runtime service type for SMBIOS and a linux dmi driver patch that has been posted for review to x86 and ia64.
arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 arch/arm64/include/asm/dmi.h
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index d5aaddf..84204b0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -292,6 +292,16 @@ config EFI_STUB by EFI firmware without the use of a bootloader. See Documentation/efi-stub.txt for more information.
+config DMI + bool "Enable support for SMBIOS (DMI) tables" + depends on EFI + default y + help + This enables SMBIOS/DMI feature for systems. + + This option is only useful on systems that have UEFI firmware. + However, even with this option, the resultant kernel should + continue to boot on existing non-UEFI platforms. endmenu
menu "Userspace binary formats" diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h new file mode 100644 index 0000000..f6e6004 --- /dev/null +++ b/arch/arm64/include/asm/dmi.h @@ -0,0 +1,28 @@ +/* + * arch/arm64/include/asm/dmi.h + * + * Copyright (C) 2013 Linaro Limited. + * Written by: Yi Li (yi.li@linaro.org) + * + * based on arch/ia64/include/asm/dmi.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + + +#ifndef _ASM_DMI_H +#define _ASM_DMI_H 1 + +#include <linux/slab.h> +#include <asm/io.h> + +/* Use normal IO mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC) + +#endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 1aeaaf5..1480843 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -45,6 +45,7 @@ #ifdef CONFIG_ACPI #include <linux/acpi.h> #endif +#include <linux/dmi.h>
#include <asm/fixmap.h> #include <asm/cputype.h> @@ -312,6 +313,7 @@ static int __init arm64_device_init(void) { of_clk_init(NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + dmi_scan_machine(); return 0; } arch_initcall(arm64_device_init);
On 25 November 2013 17:44, Yi Li yi.li@linaro.org wrote:
Add smbios/dmi support on arm64 system, it depends on EFI boot.
Signed-off-by: Yi Li yi.li@linaro.org
efi_lookup_mapped_addr() isn't able to translate the address range which is reported as reserved type from UEFI. Following the UEFI spec 2.4, it descripts the SMBIOS data should be runtime service type. So it depends on a UEFI patch to convert reserved type to runtime service type for SMBIOS and a linux dmi driver patch that has been posted for review to x86 and ia64.
arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 arch/arm64/include/asm/dmi.h
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index d5aaddf..84204b0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -292,6 +292,16 @@ config EFI_STUB by EFI firmware without the use of a bootloader. See Documentation/efi-stub.txt for more information.
+config DMI
bool "Enable support for SMBIOS (DMI) tables"
depends on EFI
default y
help
This enables SMBIOS/DMI feature for systems.
This option is only useful on systems that have UEFI firmware.
However, even with this option, the resultant kernel should
continue to boot on existing non-UEFI platforms.
endmenu
The dependencies will need some tweaking here:
arch/arm64/Kconfig:263:error: recursive dependency detected! arch/arm64/Kconfig:263: symbol DMI depends on EFI arch/arm64/Kconfig:242: symbol EFI is selected by GOOGLE_SMI drivers/firmware/google/Kconfig:13: symbol GOOGLE_SMI depends on DMI
The best fix imo is changing the GOOGLE_SMI Kconfig symbol to depend on EFI rather than select it. The ARM version of this patch is undoubtedly affected by the same thing.
Regards, Ard.
menu "Userspace binary formats" diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h new file mode 100644 index 0000000..f6e6004 --- /dev/null +++ b/arch/arm64/include/asm/dmi.h @@ -0,0 +1,28 @@ +/*
- arch/arm64/include/asm/dmi.h
- Copyright (C) 2013 Linaro Limited.
- Written by: Yi Li (yi.li@linaro.org)
- based on arch/ia64/include/asm/dmi.h
- This file is subject to the terms and conditions of the GNU General Public
- License. See the file "COPYING" in the main directory of this archive
- for more details.
- */
+#ifndef _ASM_DMI_H +#define _ASM_DMI_H 1
+#include <linux/slab.h> +#include <asm/io.h>
+/* Use normal IO mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC)
+#endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 1aeaaf5..1480843 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -45,6 +45,7 @@ #ifdef CONFIG_ACPI #include <linux/acpi.h> #endif +#include <linux/dmi.h>
#include <asm/fixmap.h> #include <asm/cputype.h> @@ -312,6 +313,7 @@ static int __init arm64_device_init(void) { of_clk_init(NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
dmi_scan_machine(); return 0;
} arch_initcall(arm64_device_init); -- 1.7.9.5
On Tue, 26 Nov 2013 00:44:25 +0800, Yi Li yi.li@linaro.org wrote:
Add smbios/dmi support on arm64 system, it depends on EFI boot.
Signed-off-by: Yi Li yi.li@linaro.org
efi_lookup_mapped_addr() isn't able to translate the address range which is reported as reserved type from UEFI. Following the UEFI spec 2.4, it descripts the SMBIOS data should be runtime service type. So it depends on a UEFI patch to convert reserved type to runtime service type for SMBIOS and a linux dmi driver patch that has been posted for review to x86 and ia64.
arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 arch/arm64/include/asm/dmi.h
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index d5aaddf..84204b0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -292,6 +292,16 @@ config EFI_STUB by EFI firmware without the use of a bootloader. See Documentation/efi-stub.txt for more information. +config DMI
- bool "Enable support for SMBIOS (DMI) tables"
- depends on EFI
- default y
- help
This enables SMBIOS/DMI feature for systems.
This option is only useful on systems that have UEFI firmware.
However, even with this option, the resultant kernel should
continue to boot on existing non-UEFI platforms.
endmenu menu "Userspace binary formats" diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h new file mode 100644 index 0000000..f6e6004 --- /dev/null +++ b/arch/arm64/include/asm/dmi.h @@ -0,0 +1,28 @@ +/*
- arch/arm64/include/asm/dmi.h
- Copyright (C) 2013 Linaro Limited.
- Written by: Yi Li (yi.li@linaro.org)
- based on arch/ia64/include/asm/dmi.h
- This file is subject to the terms and conditions of the GNU General Public
- License. See the file "COPYING" in the main directory of this archive
- for more details.
- */
+#ifndef _ASM_DMI_H +#define _ASM_DMI_H 1
+#include <linux/slab.h> +#include <asm/io.h>
+/* Use normal IO mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC)
+#endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 1aeaaf5..1480843 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -45,6 +45,7 @@ #ifdef CONFIG_ACPI #include <linux/acpi.h> #endif +#include <linux/dmi.h> #include <asm/fixmap.h> #include <asm/cputype.h>
Nitpick: You dropped a blank line in this hunk. I suspect that was unintentional, but it looks sloppy.
Otherwise:
Acked-by: Grant Likely grant.likely@linaro.org
@@ -312,6 +313,7 @@ static int __init arm64_device_init(void) { of_clk_init(NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
- dmi_scan_machine(); return 0;
} arch_initcall(arm64_device_init); -- 1.7.9.5
On Wed, Nov 27, 2013 at 2:24 PM, Grant Likely grant.likely@linaro.org wrote:
On Tue, 26 Nov 2013 00:44:25 +0800, Yi Li yi.li@linaro.org wrote:
Add smbios/dmi support on arm64 system, it depends on EFI boot.
Signed-off-by: Yi Li yi.li@linaro.org
efi_lookup_mapped_addr() isn't able to translate the address range which is reported as reserved type from UEFI. Following the UEFI spec 2.4, it descripts the SMBIOS data should be runtime service type. So it depends on a UEFI patch to convert reserved type to runtime service type for SMBIOS and a linux dmi driver patch that has been posted for review to x86 and ia64.
arch/arm64/Kconfig | 10 ++++++++++ arch/arm64/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm64/kernel/setup.c | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 arch/arm64/include/asm/dmi.h
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index d5aaddf..84204b0 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -292,6 +292,16 @@ config EFI_STUB by EFI firmware without the use of a bootloader. See Documentation/efi-stub.txt for more information.
+config DMI
bool "Enable support for SMBIOS (DMI) tables"
depends on EFI
default y
help
This enables SMBIOS/DMI feature for systems.
This option is only useful on systems that have UEFI firmware.
However, even with this option, the resultant kernel should
continue to boot on existing non-UEFI platforms.
endmenu
menu "Userspace binary formats" diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h new file mode 100644 index 0000000..f6e6004 --- /dev/null +++ b/arch/arm64/include/asm/dmi.h @@ -0,0 +1,28 @@ +/*
- arch/arm64/include/asm/dmi.h
- Copyright (C) 2013 Linaro Limited.
- Written by: Yi Li (yi.li@linaro.org)
- based on arch/ia64/include/asm/dmi.h
- This file is subject to the terms and conditions of the GNU General Public
- License. See the file "COPYING" in the main directory of this archive
- for more details.
- */
+#ifndef _ASM_DMI_H +#define _ASM_DMI_H 1
+#include <linux/slab.h> +#include <asm/io.h>
+/* Use normal IO mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC)
+#endif diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 1aeaaf5..1480843 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -45,6 +45,7 @@ #ifdef CONFIG_ACPI #include <linux/acpi.h> #endif +#include <linux/dmi.h>
#include <asm/fixmap.h> #include <asm/cputype.h>
Nitpick: You dropped a blank line in this hunk. I suspect that was unintentional, but it looks sloppy.
Oops, nevermind. You haven't made a mistake here. My mailer did something silly and it looked like there was a '-' tag on the blank line.
Sorry for the noise.
g.
Otherwise:
Acked-by: Grant Likely grant.likely@linaro.org
@@ -312,6 +313,7 @@ static int __init arm64_device_init(void) { of_clk_init(NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
dmi_scan_machine(); return 0;
} arch_initcall(arm64_device_init); -- 1.7.9.5
Add smbios/dmi support on arm32 system, it depends on EFI boot.
Signed-off-by: Yi Li yi.li@linaro.org ---
efi_lookup_mapped_addr() isn't able to translate the address range which is reported as reserved type from UEFI. Following the UEFI spec 2.4, it descripts the SMBIOS data should be runtime service type. So it depends on a UEFI patch to convert reserved type to runtime service type for SMBIOS and a linux dmi driver patch that has been posted for review to x86 and ia64.
arch/arm/Kconfig | 13 +++++++++++++ arch/arm/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm/kernel/setup.c | 2 ++ 3 files changed, 43 insertions(+) create mode 100644 arch/arm/include/asm/dmi.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 11367a4..623c8c5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1910,6 +1910,17 @@ config EFI_STUB executed directly by EFI firmware. See Documentation/efi-stub.txt for more information.
+config DMI + bool "Enable support for SMBIOS (DMI) tables" + depends on EFI + default y + help + This enables SMBIOS/DMI feature for systems. + + This option is only useful on systems that have UEFI firmware. + However, even with this option, the resultant kernel should + continue to boot on existing non-UEFI platforms. + config SECCOMP bool prompt "Enable seccomp to safely compute untrusted bytecode" @@ -2348,6 +2359,8 @@ source "net/Kconfig"
source "drivers/Kconfig"
+source "drivers/firmware/Kconfig" + source "fs/Kconfig"
source "arch/arm/Kconfig.debug" diff --git a/arch/arm/include/asm/dmi.h b/arch/arm/include/asm/dmi.h new file mode 100644 index 0000000..428f32e --- /dev/null +++ b/arch/arm/include/asm/dmi.h @@ -0,0 +1,28 @@ +/* + * arch/arm/include/asm/dmi.h + * + * Copyright (C) 2013 Linaro Limited. + * Written by: Yi Li (yi.li@linaro.org) + * + * based on arch/ia64/include/asm/dmi.h + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + + +#ifndef _ASM_DMI_H +#define _ASM_DMI_H 1 + +#include <linux/slab.h> +#include <asm/io.h> + +/* Use normal IO mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC) + +#endif diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 0bde4e3..c9999ce 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -34,6 +34,7 @@ #ifdef CONFIG_ACPI #include <linux/acpi.h> #endif +#include <linux/dmi.h>
#include <asm/unified.h> #include <asm/cp15.h> @@ -771,6 +772,7 @@ static int __init customize_machine(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); #endif + dmi_scan_machine(); return 0; } arch_initcall(customize_machine);
On Tue, 26 Nov 2013 00:44:26 +0800, Yi Li yi.li@linaro.org wrote:
Add smbios/dmi support on arm32 system, it depends on EFI boot.
Signed-off-by: Yi Li yi.li@linaro.org
Acked-by: Grant Likely grant.likely@linaro.org
efi_lookup_mapped_addr() isn't able to translate the address range which is reported as reserved type from UEFI. Following the UEFI spec 2.4, it descripts the SMBIOS data should be runtime service type. So it depends on a UEFI patch to convert reserved type to runtime service type for SMBIOS and a linux dmi driver patch that has been posted for review to x86 and ia64.
arch/arm/Kconfig | 13 +++++++++++++ arch/arm/include/asm/dmi.h | 28 ++++++++++++++++++++++++++++ arch/arm/kernel/setup.c | 2 ++ 3 files changed, 43 insertions(+) create mode 100644 arch/arm/include/asm/dmi.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 11367a4..623c8c5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1910,6 +1910,17 @@ config EFI_STUB executed directly by EFI firmware. See Documentation/efi-stub.txt for more information. +config DMI
- bool "Enable support for SMBIOS (DMI) tables"
- depends on EFI
- default y
- help
This enables SMBIOS/DMI feature for systems.
This option is only useful on systems that have UEFI firmware.
However, even with this option, the resultant kernel should
continue to boot on existing non-UEFI platforms.
config SECCOMP bool prompt "Enable seccomp to safely compute untrusted bytecode" @@ -2348,6 +2359,8 @@ source "net/Kconfig" source "drivers/Kconfig" +source "drivers/firmware/Kconfig"
source "fs/Kconfig" source "arch/arm/Kconfig.debug" diff --git a/arch/arm/include/asm/dmi.h b/arch/arm/include/asm/dmi.h new file mode 100644 index 0000000..428f32e --- /dev/null +++ b/arch/arm/include/asm/dmi.h @@ -0,0 +1,28 @@ +/*
- arch/arm/include/asm/dmi.h
- Copyright (C) 2013 Linaro Limited.
- Written by: Yi Li (yi.li@linaro.org)
- based on arch/ia64/include/asm/dmi.h
- This file is subject to the terms and conditions of the GNU General Public
- License. See the file "COPYING" in the main directory of this archive
- for more details.
- */
+#ifndef _ASM_DMI_H +#define _ASM_DMI_H 1
+#include <linux/slab.h> +#include <asm/io.h>
+/* Use normal IO mappings for DMI */ +#define dmi_early_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_early_unmap(x, l) +#define dmi_remap(x, l) efi_lookup_mapped_addr(x) +#define dmi_unmap(x) +#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC)
+#endif diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 0bde4e3..c9999ce 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -34,6 +34,7 @@ #ifdef CONFIG_ACPI #include <linux/acpi.h> #endif +#include <linux/dmi.h> #include <asm/unified.h> #include <asm/cp15.h> @@ -771,6 +772,7 @@ static int __init customize_machine(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); #endif
- dmi_scan_machine(); return 0;
} arch_initcall(customize_machine); -- 1.7.9.5