summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorYi Li <yi.li@linaro.org>2014-07-11 12:46:50 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2014-07-21 10:22:21 +0100
commita28e3f4b90543f7c249a956e3ca518e243a04618 (patch)
treebeb5616e53df9b843da764572a2284609b9317db /arch/arm64/include
parentd7a49086f263164a2c4c178eb76412d48cd671d7 (diff)
downloadlinux-a28e3f4b90543f7c249a956e3ca518e243a04618.tar.bz2
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. This has been tested by dmidecode and lshw tools. Signed-off-by: Yi Li <yi.li@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/dmi.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/dmi.h b/arch/arm64/include/asm/dmi.h
new file mode 100644
index 000000000000..b0882a8620e1
--- /dev/null
+++ b/arch/arm64/include/asm/dmi.h
@@ -0,0 +1,41 @@
+/*
+ * 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
+
+#include <linux/slab.h>
+#include <linux/efi.h>
+
+static inline void __iomem *dmi_remap(u64 phys, u64 size)
+{
+ void __iomem *p = efi_lookup_mapped_addr(phys);
+
+ /*
+ * If the mapping spans multiple pages, do a minimal check to ensure
+ * that the mapping returned by efi_lookup_mapped_addr() covers the
+ * whole requested range (but ignore potential holes)
+ */
+ if ((phys & ~PAGE_MASK) + size > PAGE_SIZE
+ && (p + size - 1) != efi_lookup_mapped_addr(phys + size - 1))
+ return NULL;
+ return p;
+}
+
+/* Reuse existing UEFI mappings for DMI */
+#define dmi_alloc(l) kzalloc(l, GFP_KERNEL)
+#define dmi_early_remap(x, l) dmi_remap(x, l)
+#define dmi_early_unmap(x, l)
+#define dmi_unmap(x)
+
+#endif