[PATCH v2] Introduce AcpiOs(Read|Write)Cmos and enable these in AcpiExCmosSpaceHandler
by Adam Goode
This introduces a generic OSL interface for reading and writing
SystemCMOS spaces. It is needed on Linux for registering a generic
handler for SystemCMOS because some firmware accesses CMOS in _INI.
(The first time I sent a somewhat corrupted patch file. This one should
be better).
---
source/components/events/evhandler.c | 1 +
source/components/executer/exregion.c | 23 +++++++++
source/include/acconfig.h | 2 +-
source/include/acpiosxf.h | 18 +++++++
source/os_specific/service_layers/osunixxf.c | 64 +++++++++++++++++++++++
source/os_specific/service_layers/oswinxf.c | 64 +++++++++++++++++++++++
tests/aapits/atosxfctrl.c | 2 +
tests/aapits/atosxfctrl.h | 3 ++
tests/aapits/atosxfwrap.c | 76 ++++++++++++++++++++++++++++
tests/aapits/atosxfwrap.h | 16 ++++++
10 files changed, 268 insertions(+), 1 deletion(-)
diff --git a/source/components/events/evhandler.c b/source/components/events/evhandler.c
index d02ea53..634c18e 100644
--- a/source/components/events/evhandler.c
+++ b/source/components/events/evhandler.c
@@ -139,6 +139,7 @@ UINT8 AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES] =
ACPI_ADR_SPACE_SYSTEM_MEMORY,
ACPI_ADR_SPACE_SYSTEM_IO,
ACPI_ADR_SPACE_PCI_CONFIG,
+ ACPI_ADR_SPACE_CMOS,
ACPI_ADR_SPACE_DATA_TABLE
};
diff --git a/source/components/executer/exregion.c b/source/components/executer/exregion.c
index 31bbb60..bd9addd 100644
--- a/source/components/executer/exregion.c
+++ b/source/components/executer/exregion.c
@@ -551,6 +551,29 @@ AcpiExCmosSpaceHandler (
ACPI_FUNCTION_TRACE (ExCmosSpaceHandler);
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "System-CMOS (width %u) R/W %u Address=%8.8X%8.8X\n",
+ BitWidth, Function, ACPI_FORMAT_UINT64(Address)));
+
+ switch (Function)
+ {
+ case ACPI_READ:
+
+ *Value = 0;
+ Status = AcpiOsReadCmos(Address, Value, BitWidth);
+ break;
+
+ case ACPI_WRITE:
+
+ Status = AcpiOsWriteCmos(Address, *Value, BitWidth);
+ break;
+
+ default:
+
+ Status = AE_BAD_PARAMETER;
+ break;
+ }
+
return_ACPI_STATUS (Status);
}
diff --git a/source/include/acconfig.h b/source/include/acconfig.h
index 41fa33d..dcecfa7 100644
--- a/source/include/acconfig.h
+++ b/source/include/acconfig.h
@@ -270,7 +270,7 @@
/* Maximum SpaceIds for Operation Regions */
#define ACPI_MAX_ADDRESS_SPACE 255
-#define ACPI_NUM_DEFAULT_SPACES 4
+#define ACPI_NUM_DEFAULT_SPACES 5
/* Array sizes. Used for range checking also */
diff --git a/source/include/acpiosxf.h b/source/include/acpiosxf.h
index 68d79c7..31523ea 100644
--- a/source/include/acpiosxf.h
+++ b/source/include/acpiosxf.h
@@ -452,6 +452,24 @@ AcpiOsWritePort (
UINT32 Width);
#endif
+/*
+ * Platform and hardware-independent CMOS memory interfaces
+ */
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadCmos
+ACPI_STATUS
+AcpiOsReadCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 *Value,
+ UINT32 Width);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteCmos
+ACPI_STATUS
+AcpiOsWriteCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 Value,
+ UINT32 Width);
+#endif
/*
* Platform and hardware-independent physical memory interfaces
diff --git a/source/os_specific/service_layers/osunixxf.c b/source/os_specific/service_layers/osunixxf.c
index c48f581..b763ddc 100644
--- a/source/os_specific/service_layers/osunixxf.c
+++ b/source/os_specific/service_layers/osunixxf.c
@@ -1361,6 +1361,70 @@ AcpiOsWritePort (
}
+/*****************************************************************************
+ *
+ * FUNCTION: AcpiOsReadCmos
+ *
+ * PARAMETERS: Address - Address of CMOS memory to read
+ * Value - Where value is placed
+ * Width - Number of bits
+ *
+ * RETURN: Value read from CMOS memory
+ *
+ * DESCRIPTION: Read data from CMOS memory
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsReadCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 *Value,
+ UINT32 Width)
+{
+
+ switch (Width)
+ {
+ case 8:
+ case 16:
+ case 32:
+ case 64:
+
+ *Value = 0;
+ break;
+
+ default:
+
+ return (AE_BAD_PARAMETER);
+ }
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsWriteCmos
+ *
+ * PARAMETERS: Address - Address of CMOS memory to write
+ * Value - Value to write
+ * Width - Number of bits
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Write data to CMOS memory
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsWriteCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 Value,
+ UINT32 Width)
+{
+
+ return (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiOsReadMemory
diff --git a/source/os_specific/service_layers/oswinxf.c b/source/os_specific/service_layers/oswinxf.c
index 66ce8c8..80086fd 100644
--- a/source/os_specific/service_layers/oswinxf.c
+++ b/source/os_specific/service_layers/oswinxf.c
@@ -1356,6 +1356,70 @@ AcpiOsWritePort (
}
+/*****************************************************************************
+ *
+ * FUNCTION: AcpiOsReadCmos
+ *
+ * PARAMETERS: Address - Address of CMOS memory to read
+ * Value - Where value is placed
+ * Width - Number of bits
+ *
+ * RETURN: Value read from CMOS memory
+ *
+ * DESCRIPTION: Read data from CMOS memory
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsReadCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 *Value,
+ UINT32 Width)
+{
+
+ switch (Width)
+ {
+ case 8:
+ case 16:
+ case 32:
+ case 64:
+
+ *Value = 0;
+ break;
+
+ default:
+
+ return (AE_BAD_PARAMETER);
+ }
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsWriteCmos
+ *
+ * PARAMETERS: Address - Address of CMOS memory to write
+ * Value - Value to write
+ * Width - Number of bits
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Write data to CMOS memory
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsWriteCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 Value,
+ UINT32 Width)
+{
+
+ return (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiOsReadMemory
diff --git a/tests/aapits/atosxfctrl.c b/tests/aapits/atosxfctrl.c
index fe8b562..9a6b41c 100644
--- a/tests/aapits/atosxfctrl.c
+++ b/tests/aapits/atosxfctrl.c
@@ -160,6 +160,8 @@ const char *OsxfNames[] = {
"AcpiOsDerivePciId",
"AcpiOsReadPort",
"AcpiOsWritePort",
+ "AcpiOsReadCmos",
+ "AcpiOsWriteCmos",
"AcpiOsReadMemory",
"AcpiOsWriteMemory",
"AcpiOsSignal"};
diff --git a/tests/aapits/atosxfctrl.h b/tests/aapits/atosxfctrl.h
index 66a361d..2c8b9e5 100644
--- a/tests/aapits/atosxfctrl.h
+++ b/tests/aapits/atosxfctrl.h
@@ -162,6 +162,8 @@ typedef enum
AcpiOsDerivePciIdC,
AcpiOsReadPortC,
AcpiOsWritePortC,
+ AcpiOsReadCmosC,
+ AcpiOsWriteCmosC,
AcpiOsReadMemoryC,
AcpiOsWriteMemoryC,
AcpiOsSignalC,
@@ -229,6 +231,7 @@ typedef struct acpi_os_emul_reg
*/
#define EMUL_REG_SYS 0x01
#define EMUL_REG_IO 0x02
+#define EMUL_REG_CMOS 0x03
/*
* Fixed ACPI h/w emulated registers numbers
diff --git a/tests/aapits/atosxfwrap.c b/tests/aapits/atosxfwrap.c
index 7c5de39..0088212 100644
--- a/tests/aapits/atosxfwrap.c
+++ b/tests/aapits/atosxfwrap.c
@@ -1272,6 +1272,82 @@ AcpiOsWritePort (
}
+/*****************************************************************************
+ *
+ * FUNCTION: AcpiOsReadCmos
+ *
+ * PARAMETERS: Address - Address of CMOS memory to read
+ * Value - Where value is placed
+ * Width - Number of bits
+ *
+ * RETURN: Value read from CMOS memory
+ *
+ * DESCRIPTION: Read data from CMOS memory
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsReadCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 *Value,
+ UINT32 Width)
+{
+ AT_CTRL_DECL(AcpiOsReadCmos);
+
+ AT_CHCK_RET_STATUS(AcpiOsReadCmos);
+
+ if (!EMUL_REG_MODE) {
+ Status = AcpiOsActualReadCmos(Address, Value, Width);
+ }
+ else
+ {
+ Status = OsxfCtrlReadReg(EMUL_REG_CMOS, Address, Value, Width);
+ }
+
+ AT_CTRL_SUCCESS(AcpiOsReadCmos);
+
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsWriteCmos
+ *
+ * PARAMETERS: Address - Address of CMOS memory to write
+ * Value - Value to write
+ * Width - Number of bits
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Write data to CMOS memory
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsWriteCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 Value,
+ UINT32 Width)
+{
+ AT_CTRL_DECL(AcpiOsWriteCmos);
+
+ AT_CHCK_RET_STATUS(AcpiOsWriteCmos);
+
+ if (!EMUL_REG_MODE) {
+ Status = AcpiOsActualWriteCmos(Address, Value, Width);
+ }
+ else
+ {
+ Status = OsxfCtrlWriteReg(EMUL_REG_CMOS, Address, Value, Width);
+ }
+
+ AT_CTRL_SUCCESS(AcpiOsWriteCmos);
+
+ return (Status);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiOsReadMemory
diff --git a/tests/aapits/atosxfwrap.h b/tests/aapits/atosxfwrap.h
index 27224d0..48e2100 100644
--- a/tests/aapits/atosxfwrap.h
+++ b/tests/aapits/atosxfwrap.h
@@ -324,6 +324,22 @@ AcpiOsActualWritePort (
/*
+ * Platform and hardware-independent CMOS memory interfaces
+ */
+ACPI_STATUS
+AcpiOsActualReadCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 *Value,
+ UINT32 Width);
+
+ACPI_STATUS
+AcpiOsActualWriteCmos (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT64 Value,
+ UINT32 Width);
+
+
+/*
* Platform and hardware-independent physical memory interfaces
*/
ACPI_STATUS
--
2.3.7
6 years, 2 months
[PATCH] IORT: Add in support for the SMMUv3 subtable
by Al Stone
The most recent version of the IORT specification adds in a definition
for a subtable to describe SMMUv3 devices; there is already a subtable
for SMMUv1/v2 devices.
Add in the definition of the subtable, add in the code to compile it,
and add in a template for it.
Signed-off-by: Al Stone <ahs3(a)redhat.com>
---
source/common/dmtbdump.c | 6 ++++++
source/common/dmtbinfo.c | 19 +++++++++++++++++++
source/compiler/dttable1.c | 17 +++++++++++++++--
source/compiler/dttemplate.h | 15 +++++++++++----
source/include/acdisasm.h | 1 +
source/include/actbl2.h | 25 +++++++++++++++++++++++--
6 files changed, 75 insertions(+), 8 deletions(-)
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
index ce3b45b..bf09e58 100644
--- a/source/common/dmtbdump.c
+++ b/source/common/dmtbdump.c
@@ -1845,6 +1845,12 @@ AcpiDmDumpIort (
IortSmmu = ACPI_ADD_PTR (ACPI_IORT_SMMU, IortNode, NodeOffset);
break;
+ case ACPI_IORT_NODE_SMMU_V3:
+
+ InfoTable = AcpiDmTableInfoIort4;
+ Length = IortNode->Length - NodeOffset;
+ break;
+
default:
AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n",
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
index be95f92..5edb8d4 100644
--- a/source/common/dmtbinfo.c
+++ b/source/common/dmtbinfo.c
@@ -242,6 +242,7 @@
#define ACPI_IORT1_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_NAMED_COMPONENT,f)
#define ACPI_IORT2_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_ROOT_COMPLEX,f)
#define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f)
+#define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f)
#define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_MEMORY_ACCESS,f)
#define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
#define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_ID_MAPPING,f)
@@ -328,6 +329,7 @@
#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET
(ACPI_GTDT_TIMER_ENTRY,f,o)
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
#define ACPI_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o)
+#define ACPI_IORT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o)
#define ACPI_IORTA_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET
(ACPI_IORT_MEMORY_ACCESS,f,o)
#define ACPI_IORTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_ID_MAPPING,f,o)
#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
@@ -1633,6 +1635,23 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[] =
ACPI_DMT_TERMINATOR
};
+/* 0x04: SMMUv3 */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] =
+{
+ {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (BaseAddress), "Base
Address", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags
(decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC
Override", 0},
+ {ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU
Override", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS
Address", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (EventGsiv), "Event
GSIV", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR
GSIV", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync
GSIV", 0},
+ ACPI_DMT_TERMINATOR
+};
/*******************************************************************************
*
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index ada7fca..cacd9de 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -1315,8 +1315,8 @@ DtCompileIort (
DtInsertSubtable (ParentTable, Subtable);
/*
- * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
- * should be taken to avoid accessing ACPI_TABLE_HADER fields.
+ * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
+ * should be taken to avoid accessing ACPI_TABLE_HEADER fields.
*/
Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
@@ -1547,6 +1547,19 @@ DtCompileIort (
IortSmmu->PmuInterruptCount = PmuIrptNumber;
break;
+ case ACPI_IORT_NODE_SMMU_V3:
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort4,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ NodeLength += Subtable->Length;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index f27a77a..71f0041 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -615,11 +615,11 @@ const unsigned char TemplateHpet[] =
const unsigned char TemplateIort[] =
{
- 0x49,0x4F,0x52,0x54,0x0C,0x01,0x00,0x00, /* 00000000 "IORT...." */
- 0x00,0xBC,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x49,0x4F,0x52,0x54,0x48,0x01,0x00,0x00, /* 00000000 "IORTH..." */
+ 0x00,0x02,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x10,0x04,0x15,0x20,0x04,0x00,0x00,0x00, /* 00000020 "... ...." */
+ 0x12,0x02,0x16,0x20,0x05,0x00,0x00,0x00, /* 00000020 "... ...." */
0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */
0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0x00, /* 00000030 ".....,.." */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */
@@ -648,7 +648,14 @@ const unsigned char TemplateIort[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
- 0x00,0x00,0x00,0x00 /* 00000108 "...." */
+ 0x00,0x00,0x00,0x00,0x04,0x3C,0x00,0x00, /* 00000108 ".....<.." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
+ 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "<......." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000140 "........" */
};
const unsigned char TemplateIvrs[] =
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index f949a8b..f962370 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -391,6 +391,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[];
diff --git a/source/include/actbl2.h b/source/include/actbl2.h
index 1cac3dc..8311e7f 100644
--- a/source/include/actbl2.h
+++ b/source/include/actbl2.h
@@ -834,7 +834,7 @@ typedef struct acpi_ibft_target
* IORT - IO Remapping Table
*
* Conforms to "IO Remapping Table System Software on ARM Platforms",
- * Document number: ARM DEN 0049A, 2015
+ * Document number: ARM DEN 0049B, October 2015
*
******************************************************************************/
@@ -870,7 +870,8 @@ enum AcpiIortNodeType
ACPI_IORT_NODE_ITS_GROUP = 0x00,
ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
- ACPI_IORT_NODE_SMMU = 0x03
+ ACPI_IORT_NODE_SMMU = 0x03,
+ ACPI_IORT_NODE_SMMU_V3 = 0x04
};
@@ -979,6 +980,26 @@ typedef struct acpi_iort_smmu
#define ACPI_IORT_SMMU_COHERENT_WALK (1<<1)
+typedef struct acpi_iort_smmu_v3
+{
+ UINT64 BaseAddress; /* SMMUv3 base address */
+ UINT32 Flags;
+ UINT32 Reserved;
+ UINT64 VatosAddress;
+ UINT32 Model; /* O: generic SMMUv3 */
+ UINT32 EventGsiv;
+ UINT32 PriGsiv;
+ UINT32 GerrGsiv;
+ UINT32 SyncGsiv;
+
+} ACPI_IORT_SMMU_V3;
+
+/* Masks for Flags field above */
+
+#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
+#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1)
+
+
/*******************************************************************************
*
* IVRS - I/O Virtualization Reporting Structure
--
2.5.0
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------
6 years, 4 months
Re: [Devel] [PATCH v2 3/8] ACPI: add definitions of DBG2 subtypes
by Moore, Robert
I've got these for the next release of ACPICA
> -----Original Message-----
> From: Aleksey Makarov [mailto:aleksey.makarov@linaro.org]
> Sent: Wednesday, February 24, 2016 9:10 AM
> To: linux-acpi(a)vger.kernel.org
> Cc: linux-serial(a)vger.kernel.org; linux-kernel(a)vger.kernel.org; linux-arm-
> kernel(a)lists.infradead.org; Aleksey Makarov; Russell King; Greg Kroah-
> Hartman; Rafael J . Wysocki; Leif Lindholm; Graeme Gregory; Al Stone;
> Christopher Covington; Len Brown; Moore, Robert; Zheng, Lv;
> devel(a)acpica.org
> Subject: [PATCH v2 3/8] ACPI: add definitions of DBG2 subtypes
>
> The recent version of Microsoft Debug Port Table 2 (DBG2) [1] specifies
> additional serial debug port subtypes. These constants are also referred
> by Serial Port Console Redirection Table (SPCR) [2]
>
> Add these constants.
>
> [1] https://msdn.microsoft.com/en-
> us/library/windows/hardware/dn639131(v=vs.85).aspx
> [2] https://msdn.microsoft.com/en-
> us/library/windows/hardware/dn639132(v=vs.85).aspx
>
> Signed-off-by: Aleksey Makarov <aleksey.makarov(a)linaro.org>
> ---
> include/acpi/actbl2.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index
> a4ef625..652f747 100644
> --- a/include/acpi/actbl2.h
> +++ b/include/acpi/actbl2.h
> @@ -371,6 +371,11 @@ struct acpi_dbg2_device {
>
> #define ACPI_DBG2_16550_COMPATIBLE 0x0000
> #define ACPI_DBG2_16550_SUBSET 0x0001
> +#define ACPI_DBG2_ARM_PL011 0x0003
> +#define ACPI_DBG2_ARM_SBSA_32BIT 0x000D
> +#define ACPI_DBG2_ARM_SBSA_GENERIC 0x000E
> +#define ACPI_DBG2_ARM_DCC 0x000F
> +#define ACPI_DBG2_BCM2835 0x0010
>
> #define ACPI_DBG2_1394_STANDARD 0x0000
>
> --
> 2.7.1
6 years, 4 months
Re: [Devel] [PATCH 1/2] ACPI/NFIT: Update Control Region Structure per ACPI 6.1
by Moore, Robert
More importantly, the changes to actbl1.h need to be backported to the native ACPICA format.
> -----Original Message-----
> From: Dan Williams [mailto:dan.j.williams@intel.com]
> Sent: Friday, February 19, 2016 2:35 PM
> To: Toshi Kani
> Cc: Rafael J. Wysocki; Moore, Robert; Elliott, Robert (Persistent Memory);
> linux-nvdimm(a)lists.01.org; Linux ACPI; linux-kernel(a)vger.kernel.org;
> devel(a)acpica.org; Zheng, Lv
> Subject: Re: [PATCH 1/2] ACPI/NFIT: Update Control Region Structure per
> ACPI 6.1
>
> On Fri, Feb 19, 2016 at 3:08 PM, Toshi Kani <toshi.kani(a)hpe.com> wrote:
> > ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure as
> > follows.
> > - Valid Fields, Manufacturing Location, and Manufacturing Date
> > are added from reserved range. No change in the structure size.
> > - IDs defined as SPD values are arrays of bytes. The spec
> > clarified that they need to be represented as arrays of bytes
> > as well.
> >
> > This patch makes the following changes to support this update.
> > - Change 'struct acpi_nfit_control_region' to reflect the update.
> > SPD IDs are defined as arrays of bytes, so that they can be
> > treated in the same way regardless of CPU endianness and are
> > not miss-treated as little-endian numeric values.
> > - Change the NFIT driver to show SPD ID values as array of bytes
> > in sysfs.
> > - Change the NFIT driver to show Manufacturing Location and
> > Manufacturing Date when they are valid.
> > - Change the NFIT driver to show an NVDIMM unique ID as defined
> > in section 5.2.25.9 of the spec.
> > - Change sprintf format to use "0x" instead of "#" since "%#02x"
> > does not prepend '0' in some reason.
> >
> > link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
> > Signed-off-by: Toshi Kani <toshi.kani(a)hpe.com>
> > Cc: Rafael J. Wysocki <rjw(a)rjwysocki.net>
> > Cc: Dan Williams <dan.j.williams(a)intel.com>
> > Cc: Robert Moore <robert.moore(a)intel.com>
> > Cc: Robert Elliott <elliott(a)hpe.com>
> > Cc: <devel(a)acpica.org>
> > ---
> > drivers/acpi/nfit.c | 75
> ++++++++++++++++++++++++++++++++++++++++++-------
> > include/acpi/actbl1.h | 24 ++++++++++------
> > 2 files changed, 80 insertions(+), 19 deletions(-)
>
> Hi Toshi,
>
> I general looks good, but note that changes to include/acpi/actbl1.h need
> to go through the ACPICA project. Then their normal import process will
> bring it into the kernel. I added Lv to the cc.
>
> >
> > diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index
> > ad6d8c6..06677d9 100644
> > --- a/drivers/acpi/nfit.c
> > +++ b/drivers/acpi/nfit.c
> > @@ -722,7 +722,8 @@ static ssize_t vendor_show(struct device *dev, {
> > struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> >
> > - return sprintf(buf, "%#x\n", dcr->vendor_id);
> > + return sprintf(buf, "0x%02x%02x\n",
> > + dcr->vendor_id[0], dcr->vendor_id[1]);
> > }
> > static DEVICE_ATTR_RO(vendor);
> >
> > @@ -731,7 +732,8 @@ static ssize_t rev_id_show(struct device *dev, {
> > struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> >
> > - return sprintf(buf, "%#x\n", dcr->revision_id);
> > + return sprintf(buf, "0x%02x%02x\n",
> > + dcr->revision_id[0],
> > + dcr->revision_id[1]);
> > }
> > static DEVICE_ATTR_RO(rev_id);
> >
> > @@ -740,7 +742,8 @@ static ssize_t device_show(struct device *dev, {
> > struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> >
> > - return sprintf(buf, "%#x\n", dcr->device_id);
> > + return sprintf(buf, "0x%02x%02x\n",
> > + dcr->device_id[0], dcr->device_id[1]);
> > }
> > static DEVICE_ATTR_RO(device);
> >
> > @@ -749,7 +752,7 @@ static ssize_t format_show(struct device *dev, {
> > struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> >
> > - return sprintf(buf, "%#x\n", dcr->code);
> > + return sprintf(buf, "0x%02x%02x\n", dcr->code[0],
> > + dcr->code[1]);
> > }
> > static DEVICE_ATTR_RO(format);
> >
> > @@ -758,7 +761,9 @@ static ssize_t serial_show(struct device *dev, {
> > struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> >
> > - return sprintf(buf, "%#x\n", dcr->serial_number);
> > + return sprintf(buf, "0x%02x%02x%02x%02x\n",
> > + dcr->serial_number[0], dcr->serial_number[1],
> > + dcr->serial_number[2], dcr->serial_number[3]);
> > }
> > static DEVICE_ATTR_RO(serial);
>
> These fixups look good.
>
> Can we split the new sysfs attributes below into their own patch? One
> more comments below:
>
> >
> > @@ -776,6 +781,45 @@ static ssize_t flags_show(struct device *dev, }
> > static DEVICE_ATTR_RO(flags);
> >
> > +static ssize_t mfg_location_show(struct device *dev,
> > + struct device_attribute *attr, char *buf) {
> > + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> > +
> > + return sprintf(buf, "0x%02x\n", dcr->manufacturing_location);
> > +} static DEVICE_ATTR_RO(mfg_location);
> > +
> > +static ssize_t mfg_date_show(struct device *dev,
> > + struct device_attribute *attr, char *buf) {
> > + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> > +
> > + return sprintf(buf, "0x%02x%02x\n",
> > + dcr->manufacturing_date[0],
> > +dcr->manufacturing_date[1]); } static DEVICE_ATTR_RO(mfg_date);
> > +
> > +static ssize_t unique_id_show(struct device *dev,
> > + struct device_attribute *attr, char *buf) {
> > + struct acpi_nfit_control_region *dcr = to_nfit_dcr(dev);
> > +
> > + if (dcr->valid_fields & ACPI_NFIT_CONTROL_MFG_INFO_VALID)
> > + return sprintf(buf, "%02x%02x-%02x-%02x%02x-
> %02x%02x%02x%02x\n",
> > + dcr->vendor_id[0], dcr->vendor_id[1],
> > + dcr->manufacturing_location,
> > + dcr->manufacturing_date[0], dcr-
> >manufacturing_date[1],
> > + dcr->serial_number[0], dcr->serial_number[1],
> > + dcr->serial_number[2], dcr->serial_number[3]);
> > + else
> > + return sprintf(buf, "%02x%02x-%02x%02x%02x%02x\n",
> > + dcr->vendor_id[0], dcr->vendor_id[1],
> > + dcr->serial_number[0], dcr->serial_number[1],
> > + dcr->serial_number[2], dcr->serial_number[3]);
> > +} static DEVICE_ATTR_RO(unique_id);
>
> Let's just call it 'id' as not to confuse it with a 'uuid'. Also if the
> manufacturing info is incorporated into the id then I don't think we need
> separate 'mfg_location' and 'mfg_date' attributes. If userspace really
> wants those separately it can just dump the NFIT table.
6 years, 4 months
[PATCH] iASL/Disassembler: nullify AcpiGbl_ParseOpRoot after deleting parse tree
by Colin King
From: Colin Ian King <colin.king(a)canonical.com>
On i386 platforms with glibc 2.21 and gcc 6.0 I'm getting double
frees on the heap when disassembling with iASL using multiple
external tables. The current code deletes the parse tree from the
AcpiGbl_ParseOpRoot and not NULLifying it afterwards, causing
subsequent tree parsing to re-add existing heap objects back onto
this root node causing subsequent parse tree deletes to trip the
double free.
Interestingly, this seems to only happen in some configurations so
I believe it works on 64 bit x86 and not 32 bit because of heap
differences in the libc allocator.
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
source/common/adisasm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index 3dabe3b..520863c 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -700,6 +700,7 @@ AdDoExternalFileList (
AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
AcpiGbl_RootNode, OwnerId);
AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
+ AcpiGbl_ParseOpRoot = NULL;
ExternalListHead = ExternalListHead->Next;
}
--
2.7.0
6 years, 4 months
[PATCH] compiler: remove unnecessary zero check on Length before zero'ing it
by Colin King
From: Colin Ian King <colin.king(a)canonical.com>
Length is being checked to see if the contents is non-zero before
setting it to zero. It would be simpler to just set this to zero
without doing the non-zero check as it saves a load and a jmp
(~14 bytes in x86 object code). This also fixes a static analysis
warning in DtCompileIort:
CID 1298707 (#1 of 1): Uninitialized scalar variable (UNINIT).
uninit_use_in_call: Using uninitialized value PaddingLength
when calling DtCompileGeneric.
..since the length is not being intitialized in this code before
calling DtCompileGeneric.
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
source/compiler/dttable2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c
index b281b5c..1add6f7 100644
--- a/source/compiler/dttable2.c
+++ b/source/compiler/dttable2.c
@@ -1707,7 +1707,7 @@ DtCompileGeneric (
/* Now we can actually compile the parse tree */
- if (Length && *Length)
+ if (Length)
{
*Length = 0;
}
--
2.7.0.rc3
6 years, 4 months
Re: [Devel] [PATCH v2 6/9] ACPI: add definition of DBG2 subtypes
by Moore, Robert
OK, we'll take these for the next release of ACPICA.
Thanks,
Bob
> -----Original Message-----
> From: Aleksey Makarov [mailto:aleksey.makarov@linaro.org]
> Sent: Friday, February 12, 2016 9:44 AM
> To: linux-acpi(a)vger.kernel.org
> Cc: linux-serial(a)vger.kernel.org; linux-kernel(a)vger.kernel.org; linux-arm-
> kernel(a)lists.infradead.org; Aleksey Makarov; Russell King; Greg Kroah-
> Hartman; Rafael J . Wysocki; Leif Lindholm; Graeme Gregory; Al Stone;
> Christopher Covington; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len
> Brown; devel(a)acpica.org
> Subject: [PATCH v2 6/9] ACPI: add definition of DBG2 subtypes
>
> The recent version of Microsoft Debug Port Table 2 (DBG2) [1] specifies
> additional serial debug port subtypes. These constants are also referred
> by Serial Port Console Redirection Table (SPCR) [2]
>
> Add these constants.
>
> [1] https://msdn.microsoft.com/en-
> us/library/windows/hardware/dn639131(v=vs.85).aspx
> [2] https://msdn.microsoft.com/en-
> us/library/windows/hardware/dn639132(v=vs.85).aspx
>
> Signed-off-by: Aleksey Makarov <aleksey.makarov(a)linaro.org>
> Tested-by: Christopher Covington <cov(a)codeaurora.org>
> ---
> include/acpi/actbl2.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index
> a4ef625..e9930ab 100644
> --- a/include/acpi/actbl2.h
> +++ b/include/acpi/actbl2.h
> @@ -371,6 +371,11 @@ struct acpi_dbg2_device {
>
> #define ACPI_DBG2_16550_COMPATIBLE 0x0000
> #define ACPI_DBG2_16550_SUBSET 0x0001
> +#define ACPI_DBG2_ARM_PL011 0x0003
> +#define ACPI_DBG2_ARM_SBSA_32BIT 0x000d
> +#define ACPI_DBG2_ARM_SBSA_GENERIC 0x000e
> +#define ACPI_DBG2_ARM_DCC 0x000f
> +#define ACPI_DBG2_BCM2835 0x0010
>
> #define ACPI_DBG2_1394_STANDARD 0x0000
>
> --
> 2.7.0
6 years, 4 months
ACPICA version 20160212 released
by Moore, Robert
12 February 2016. Summary of changes for version 20160212:
This release is available at https://acpica.org/downloads
1) ACPICA kernel-resident subsystem:
Implemented full support for the ACPI 6.1 specification (released in January). This version of the specification is available at: http://www.uefi.org/specifications
Only a relatively small number of changes were required in ACPICA to support ACPI 6.1, in these areas:
- New predefined names
- New _HID values
- A new subtable for HEST
- A few other header changes for new values
Ensure \_SB_._INI is executed before any _REG methods are executed. There appears to be existing BIOS code that relies on this behavior. Lv Zheng.
Reverted a change made in version 20151218 which enabled method invocations to be targets of various ASL operators (SuperName and Target grammar elements). While the new behavior is supported by the ACPI specification, other AML interpreters do not support this behavior and never will. The ACPI specification will be updated for ACPI 6.2 to remove this support. Therefore, the change was reverted to the original ACPICA behavior.
ACPICA now supports the GCC 6 compiler.
Current Release: (Note: build changes increased sizes)
Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total
Debug Version: 200.4K Code, 82.0K Data, 282.4K Total
Previous Release:
Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total
Debug Version: 200.4K Code, 81.9K Data, 282.3K Total
2) iASL Compiler/Disassembler and Tools:
Completed full support for the ACPI 6.0 External() AML opcode. The compiler emits an external AML opcode for each ASL External statement. This opcode is used by the disassembler to assist with the disassembly of external control methods by specifying the required number of arguments for the method. AML interpreters do not use this opcode. To ensure that interpreters do not even see the opcode, a block of one or more external opcodes is surrounded by an "If(0)" construct. As this feature becomes commonly deployed in BIOS code, the ability of disassemblers to correctly disassemble AML code will be greatly improved. David Box.
iASL: Implemented support for an optional cross-reference output file. The -lx option will create a the cross-reference file with the suffix "xrf". Three different types of cross-reference are created in this file:
- List of object references made from within each control method
- Invocation (caller) list for each user-defined control method
- List of references to each non-method object in the namespace
iASL: Method invocations as ASL Target operands are now disallowed and flagged as errors in preparation for ACPI 6.2 (see the description of the problem above).
6 years, 4 months