Skip to contentSkip to conversation

Add address translation interface using ACPI DSM

PATCH New Luck, Tony 1 participant 1 message Oct 15, 2018

Subsystems (2)
lore
Share & tools
lore

Luck, Tony

author maintainer
#0 lore raw

PATCH v4 1/1 Add address translation interface using ACPI DSM

Some new servers provide an interface so that the OS can ask the BIOS to translate a system physical address to a memory address (socket, memory controller, channel, rank, dimm, etc.). This is useful for EDAC drivers that want to take the address of an error reported in a machine check bank and let the user know which DIMM may need to be replaced.

Specification for this interface is available at:

    https://cdrdv2.intel.com/v1/dl/getContent/603354

[Based on earlier code by Qiuxu Zhuo <[email protected]>]

---

v4: Now with *all* the bits from v2 and v3.

Also fixes include/linux/adxl.h ... it shouldn't have the stubs any more. A driver that does #include <linux/adxl.h> should also have a "select ACPI_ADXL". It makes no sense to wait until driver module load time to tell the user they missed a step.

 drivers/acpi/Kconfig     |   3 +
 drivers/acpi/Makefile    |   3 +
 drivers/acpi/acpi_adxl.c | 192 +++++++++++++++++++++++++++++++++++++++
 include/linux/adxl.h     |  13 +++
 4 files changed, 211 insertions(+)
 create mode 100644 drivers/acpi/acpi_adxl.c
 create mode 100644 include/linux/adxl.h
drivers/acpi/Kconfig +3 -0
index dd1eea90f67f..09991cc91b89 100644
@@ -498,6 +498,9 @@ config ACPI_EXTLOG
 	  driver adds support for that functionality with corresponding
 	  tracepoint which carries that information to userspace.
 
+config ACPI_ADXL
+	bool
+
 menuconfig PMIC_OPREGION
 	bool "PMIC (Power Management Integrated Circuit) operation region support"
 	help
drivers/acpi/Makefile +3 -0
index 6d59aa109a91..edc039313cd6 100644
@@ -61,6 +61,9 @@ acpi-$(CONFIG_ACPI_LPIT)	+= acpi_lpit.o
 acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o
 acpi-$(CONFIG_ACPI_WATCHDOG)	+= acpi_watchdog.o
 
+# Address translation
+acpi-$(CONFIG_ACPI_ADXL)	+= acpi_adxl.o
+
 # These are (potentially) separate modules
 
 # IPMI may be used by other drivers, so it has to initialise before them
drivers/acpi/acpi_adxl.c new file +192 -0

192 lines not on this page · raw message

include/linux/adxl.h new file +13 -0
new file mode 100644
index 000000000000..2a629acb4c3f
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Address translation interface via ACPI DSM.
+ * Copyright (C) 2018 Intel Corporation
+ */
+
+#ifndef _LINUX_ADXL_H
+#define _LINUX_ADXL_H
+
+const char * const *adxl_get_component_names(void);
+int adxl_decode(u64 addr, u64 component_values[]);
+
+#endif /* _LINUX_ADXL_H */