Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dmi: Add SMBIOS/DMI support

SMBIOS is important for server hardware vendors. It implements a spec for
providing descriptive information about the platform. Things like serial
numbers, physical layout of the ports, build configuration data, and the like.

Signed-off-by: Yi Li <yi.li@linaro.org>
Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

authored by

Yi Li and committed by
Ard Biesheuvel
d1ae8c00 fc430262

+55
+11
arch/arm64/Kconfig
··· 401 401 allow the kernel to be booted as an EFI application. This 402 402 is only useful on systems that have UEFI firmware. 403 403 404 + config DMI 405 + bool "Enable support for SMBIOS (DMI) tables" 406 + depends on EFI 407 + default y 408 + help 409 + This enables SMBIOS/DMI feature for systems. 410 + 411 + This option is only useful on systems that have UEFI firmware. 412 + However, even with this option, the resultant kernel should 413 + continue to boot on existing non-UEFI platforms. 414 + 404 415 endmenu 405 416 406 417 menu "Userspace binary formats"
+31
arch/arm64/include/asm/dmi.h
··· 1 + /* 2 + * arch/arm64/include/asm/dmi.h 3 + * 4 + * Copyright (C) 2013 Linaro Limited. 5 + * Written by: Yi Li (yi.li@linaro.org) 6 + * 7 + * based on arch/ia64/include/asm/dmi.h 8 + * 9 + * This file is subject to the terms and conditions of the GNU General Public 10 + * License. See the file "COPYING" in the main directory of this archive 11 + * for more details. 12 + */ 13 + 14 + #ifndef __ASM_DMI_H 15 + #define __ASM_DMI_H 16 + 17 + #include <linux/io.h> 18 + #include <linux/slab.h> 19 + 20 + /* 21 + * According to section 2.3.6 of the UEFI spec, the firmware should not 22 + * request a virtual mapping for configuration tables such as SMBIOS. 23 + * This means we have to map them before use. 24 + */ 25 + #define dmi_early_remap(x, l) ioremap_cache(x, l) 26 + #define dmi_early_unmap(x, l) iounmap(x) 27 + #define dmi_remap(x, l) ioremap_cache(x, l) 28 + #define dmi_unmap(x) iounmap(x) 29 + #define dmi_alloc(l) kzalloc(l, GFP_KERNEL) 30 + 31 + #endif
+13
arch/arm64/kernel/efi.c
··· 11 11 * 12 12 */ 13 13 14 + #include <linux/dmi.h> 14 15 #include <linux/efi.h> 15 16 #include <linux/export.h> 16 17 #include <linux/memblock.h> ··· 470 469 return -1; 471 470 } 472 471 early_initcall(arm64_enter_virtual_mode); 472 + 473 + static int __init arm64_dmi_init(void) 474 + { 475 + /* 476 + * On arm64, DMI depends on UEFI, and dmi_scan_machine() needs to 477 + * be called early because dmi_id_init(), which is an arch_initcall 478 + * itself, depends on dmi_scan_machine() having been called already. 479 + */ 480 + dmi_scan_machine(); 481 + return 0; 482 + } 483 + core_initcall(arm64_dmi_init);