[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
Re: [Devel] [PATCH] ACPICA: Delete an unnecessary check before the function call "acpi_ds_delete_walk_state"
by Moore, Robert
Got it, thanks.
> -----Original Message-----
> From: SF Markus Elfring [mailto:[email protected]]
> Sent: Wednesday, June 24, 2015 4:46 AM
> To: Len Brown; Zheng, Lv; Wysocki, Rafael J; Moore, Robert; linux-
> acpi(a)vger.kernel.org; devel(a)acpica.org
> Cc: LKML; kernel-janitors(a)vger.kernel.org; Julia Lawall
> Subject: [PATCH] ACPICA: Delete an unnecessary check before the function
> call "acpi_ds_delete_walk_state"
>
> From: Markus Elfring <elfring(a)users.sourceforge.net>
> Date: Wed, 24 Jun 2015 13:33:47 +0200
>
> The acpi_ds_delete_walk_state() function tests whether its argument is
> NULL and then returns immediately. Thus the test around the call is not
> needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring(a)users.sourceforge.net>
> ---
> drivers/acpi/acpica/dsmethod.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/acpica/dsmethod.c
> b/drivers/acpi/acpica/dsmethod.c index 85bb951..188b254 100644
> --- a/drivers/acpi/acpica/dsmethod.c
> +++ b/drivers/acpi/acpica/dsmethod.c
> @@ -574,10 +574,7 @@ cleanup:
> /* On error, we must terminate the method properly */
>
> acpi_ds_terminate_control_method(obj_desc, next_walk_state);
> - if (next_walk_state) {
> - acpi_ds_delete_walk_state(next_walk_state);
> - }
> -
> + acpi_ds_delete_walk_state(next_walk_state);
> return_ACPI_STATUS(status);
> }
>
> --
> 2.4.4
7 years
ACPICA version 20150619 released
by Moore, Robert
19 June 2015. Summary of changes for version 20150619:
This release is available at https://acpica.org/downloads
Two regressions in version 20150616 have been addressed:
Fixes some problems/issues with the C library macro removal (ACPI_STRLEN, etc.) This update changes ACPICA to only use the standard headers for functions, or (optionally) the local prototypes for the local versions of the C library functions. Across the source code, this required some additional casts for some Clib invocations for portability. Moved all local prototypes to a new file, acclib.h
Fixes several problems with recent changes to the handling of the FACS table that could cause some systems not to boot.
7 years
ACPICA version 20150616 released
by Moore, Robert
16 June 2015. Summary of changes for version 20150616:
This release is available at https://acpica.org/downloads
1) ACPICA kernel-resident subsystem:
Across the entire ACPICA source code base, the various macros for the C library functions (such as ACPI_STRLEN, etc.) have been removed and replaced by the standard C library names (strlen, etc.) The original purpose for these macros is no longer applicable. This simplification reduces the number of macros used in the ACPICA source code significantly, improving readability and maintainability.
Implemented support for a new ACPI table, the OSDT. This table, the "override" SDT, can be loaded directly by the host OS at boot time. It enables the replacement of existing namespace objects that were installed via the DSDT and/or SSDTs. The primary purpose for this is to replace buggy or incorrect ASL/AML code obtained via the BIOS. The OSDT is slated for inclusion in a future version of the ACPI Specification. Lv Zheng/Bob Moore.
Added support for systems with (improperly) two FACS tables -- a "32-bit" table (via FADT 32-bit legacy field) and a "64-bit" table (via the 64-bit X field). This change will support both automatically. There continues to be systems found with this issue. This support requires a change to the AcpiSetFirmwareWakingVector interface. Also, a public global variable has been added to allow the host to select which FACS is desired (AcpiGbl_Use32BitFacsAddresses). See the ACPICA reference for more details Lv Zheng.
Added a new feature to allow for systems that do not contain an FACS. Although this is already supported on hardware-reduced platforms, the feature has been extended for all platforms. The reasoning is that we do not want to abort the entire ACPICA initialization just because the system is seriously buggy and has no FACS.
Fixed a problem where the GUID strings for NFIT tables (in acuuid.h) were not correctly transcribed from the ACPI specification in ACPICA version 20150515.
Implemented support for the _CLS object in the AcpiGetObjectInfo external interface.
Updated the definitions of the TCPA and TPM2 ACPI tables to the more recent TCG ACPI Specification, December 14, 2014. Table disassembler and compiler also updated. Note: The TCPA "server" table is not supported by the disassembler/table-compiler at this time.
ACPI 6.0: Added definitions for the new GIC version field in the MADT.
Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size.
Current Release:
Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total
Debug Version: 196.2K Code, 81.0K Data, 277.2K Total
Previous Release:
Non-Debug Version: 99.9K Code, 27.5K Data, 127.4K Total
Debug Version: 195.2K Code, 80.8K Data, 276.0K Total
2) iASL Compiler/Disassembler and Tools:
Disassembler: Fixed a problem with the new symbolic operator disassembler where incorrect ASL code could be emitted in some cases for the "non-commutative" operators -- Subtract, Divide, Modulo, ShiftLeft, and ShiftRight. The actual problem cases seem to be rather unusual in common ASL code, however. David Box.
Modified the linux version of acpidump to obtain ACPI tables from not just /dev/mem (which may not exist) and /sys/firmware/acpi/tables. Lv Zheng.
iASL: Fixed a problem where the user preprocessor output file (.i) contained extra data that was not expected. The compiler was using this file as a temporary file and passed through #line directives in order to keep compiler error messages in sync with the input file and line number across multiple include files. The (.i) is no longer a temporary file as the compiler uses a new, different file for the original purpose.
iASL: Fixed a problem where comments within the original ASL source code file were not passed through to the preprocessor output file, nor any listing files.
iASL: Fixed some issues for the handling of the "#include" preprocessor directive and the similar (but not the same) "Include" ASL operator.
iASL: Add support for the new OSDT in both the disassembler and compiler.
iASL: Fixed a problem with the constant folding support where a Buffer object could be incorrectly generated (incorrectly formed) during a conversion to a Store() operator.
AcpiHelp: Updated for new NFIT GUIDs, "External" AML opcode, and new description text for the _REV predefined name. _REV now permanently returns 2, as per the ACPI 6.0 specification.
Debugger: Enhanced the output of the Debug ASL object for references produced by the Index operator. For Buffers and strings, only output the actual byte pointed to by the index. For packages, only print the single package element decoded by the index. Previously, the entire buffer/string/package was emitted.
iASL/Table-compiler: Fixed a regression where the "generic" data types were no longer recognized, causing errors.
7 years
[PATCH] handle Linux systems without /dev/mem
by Al Stone
On arm64 systems in particular, the use of /dev/mem is not recommended. The
contents may or may not be valid depending on the memory map being used, since
they are not standardized.
The attached patch will cause arm64 (aka ARMv8 or AArch64) Linux systems to
use a new file called source/os_specific/service_layers/oslinuxtbl_nodevmem.c
(a subset of the oslinuxtbl.c code) that allows acpidump to read all ACPI
tables from /sys/firmware/acpi instead of from /dev/mem. This will help ensure
that the tables retrieved are the ones actually being used and that their
content is correct.
This patch applies on top of the 20150515 version, and I have included it in
the 20150515-2 versions of the Fedora and Debian packages. I've tried the
resulting acpidump on x86, x86_64 and arm64 systems and it seems to work well.
Signed-off-by: Al Stone <ahs3(a)redhat.com>
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------
7 years
Re: [Devel] [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list()
by Moore, Robert
I don't think this is portable across operating systems. Which is a requirement for ACPICA.
> -----Original Message-----
> From: Fabian Frederick [mailto:[email protected]]
> Sent: Wednesday, June 10, 2015 9:33 AM
> To: linux-kernel(a)vger.kernel.org
> Cc: Julia Lawall; Fabian Frederick; Moore, Robert; Zheng, Lv; Wysocki,
> Rafael J; Len Brown; linux-acpi(a)vger.kernel.org; devel(a)acpica.org
> Subject: [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list()
>
> Use kernel.h macro definition.
>
> Thanks to Julia Lawall for Coccinelle scripting support.
>
> Signed-off-by: Fabian Frederick <fabf(a)skynet.be>
> ---
> drivers/acpi/acpica/nsrepair2.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/acpica/nsrepair2.c
> b/drivers/acpi/acpica/nsrepair2.c index c30672d..7513799 100644
> --- a/drivers/acpi/acpica/nsrepair2.c
> +++ b/drivers/acpi/acpica/nsrepair2.c
> @@ -904,7 +904,6 @@ acpi_ns_sort_list(union acpi_operand_object
> **elements, {
> union acpi_operand_object *obj_desc1;
> union acpi_operand_object *obj_desc2;
> - union acpi_operand_object *temp_obj;
> u32 i;
> u32 j;
>
> @@ -920,11 +919,8 @@ acpi_ns_sort_list(union acpi_operand_object
> **elements,
> obj_desc2->integer.value))
> || ((sort_direction == ACPI_SORT_DESCENDING)
> && (obj_desc1->integer.value <
> - obj_desc2->integer.value))) {
> - temp_obj = elements[j - 1];
> - elements[j - 1] = elements[j];
> - elements[j] = temp_obj;
> - }
> + obj_desc2->integer.value)))
> + swap(elements[j - 1], elements[j]);
> }
> }
> }
> --
> 2.4.2
7 years
Re: [Devel] [PATCH v2] acpi: update ACPI tables to match TCG ACPI specification.
by Moore, Robert
We may do a quick update for the TCPA and TPM2 tables; but having two different ACPI tables with the same signature (TCPA client and TCPA server) throws a bit of a monkey wrench into some of the ACPICA stuff. Not only do we support ACPI tables in the headers, but we also support them in the table disassembler and the table template generator.
> -----Original Message-----
> From: Jarkko Sakkinen [mailto:[email protected]]
> Sent: Wednesday, June 10, 2015 5:13 AM
> To: Rafael J. Wysocki; Moore, Robert
> Cc: peterhuewe(a)gmx.de; Len Brown; Zheng, Lv; ACPI; open list:ACPI
> COMPONENT AR...; open list
> Subject: Re: [PATCH v2] acpi: update ACPI tables to match TCG ACPI
> specification.
>
> OK, thank you guys. We'll start to use it as soon as the changes get to
> the kernel tree from ACPICA.
>
> /Jarkko
>
> On 06/10/2015 01:15 AM, Rafael J. Wysocki wrote:
> > On Tuesday, June 09, 2015 07:25:25 PM Jarkko Sakkinen wrote:
> >> Updated struct acpi_table_tpm2 and struct acpi_table_tcpa to match
> >> the TCG ACPI specification.
> >>
> >> v2:
> >>
> >> - Do not remove struct acpi_tpm2_control
> >>
> >> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen(a)linux.intel.com>
> > Bob, I'm assuming that we'll be routing this one through upstream
> ACPICA.
> >
> > If that's not the case and I should apply it directly, please let me
> know.
> >
> >
> >> ---
> >> include/acpi/actbl2.h | 5 ++---
> >> include/acpi/actbl3.h | 17 +++++++++++++----
> >> 2 files changed, 15 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index
> >> cafdeb5..2f2b8a6 100644
> >> --- a/include/acpi/actbl2.h
> >> +++ b/include/acpi/actbl2.h
> >> @@ -1071,14 +1071,13 @@ enum acpi_spmi_interface_types {
> >> * TCPA - Trusted Computing Platform Alliance table
> >> * Version 1
> >> *
> >> - * Conforms to "TCG PC Specific Implementation Specification",
> >> - * Version 1.1, August 18, 2003
> >> + * Conforms to "TCG ACPI Specification for Family 1.2 and 2.0" 19
> >> + December 2014
> >> *
> >>
> >> *********************************************************************
> >> *********/
> >>
> >> struct acpi_table_tcpa {
> >> struct acpi_table_header header; /* Common ACPI table header */
> >> - u16 reserved;
> >> + u16 platform_class; /* 0 for client and 1 for server platforms.
> */
> >> u32 max_log_length; /* Maximum length for the event log area */
> >> u64 log_address; /* Address of the event log area */
> >> };
> >> diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index
> >> 440ca81..8dd625c 100644
> >> --- a/include/acpi/actbl3.h
> >> +++ b/include/acpi/actbl3.h
> >> @@ -688,15 +688,24 @@ enum acpi_rasf_status {
> >> * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
> >> * Version 3
> >> *
> >> - * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November
> >> 2011
> >> + * Conforms to "TCG ACPI Specification for Family 1.2 and 2.0" 19
> >> + December 2014
> >> *
> >>
> >> *********************************************************************
> >> *********/
> >>
> >> +/* How to notify that there is a command available for processing.
> >> +*/
> >> +
> >> +enum acpi_tpm2_start_method {
> >> + ACPI_TPM2_SM_ACPI = 2,
> >> + ACPI_TPM2_SM_CRB = 7,
> >> + ACPI_TPM2_SM_CRB_AND_ACPI = 8,
> >> +};
> >> +
> >> struct acpi_table_tpm2 {
> >> struct acpi_table_header header; /* Common ACPI table header */
> >> - u32 flags;
> >> - u64 control_address;
> >> - u32 start_method;
> >> + u16 platform_class; /* 0 for client and 1 for server platforms
> */
> >> + u16 reserved;
> >> + u64 control_address; /* Physical address of the control area */
> >> + u32 start_method; /* Method to notify to start processing */
> >> };
> >>
> >> /* Control area structure (not part of table, pointed to by
> >> control_address) */
> >>
7 years
Re: [Devel] [PATCH v2] acpi: update ACPI tables to match TCG ACPI specification.
by Moore, Robert
Yes, we will do it in ACPICA first.
> -----Original Message-----
> From: Rafael J. Wysocki [mailto:[email protected]]
> Sent: Tuesday, June 09, 2015 3:16 PM
> To: Jarkko Sakkinen; Moore, Robert
> Cc: peterhuewe(a)gmx.de; Len Brown; Zheng, Lv; open list:ACPI; open
> list:ACPI COMPONENT AR...; open list
> Subject: Re: [PATCH v2] acpi: update ACPI tables to match TCG ACPI
> specification.
>
> On Tuesday, June 09, 2015 07:25:25 PM Jarkko Sakkinen wrote:
> > Updated struct acpi_table_tpm2 and struct acpi_table_tcpa to match the
> > TCG ACPI specification.
> >
> > v2:
> >
> > - Do not remove struct acpi_tpm2_control
> >
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen(a)linux.intel.com>
>
> Bob, I'm assuming that we'll be routing this one through upstream ACPICA.
>
> If that's not the case and I should apply it directly, please let me know.
>
>
> > ---
> > include/acpi/actbl2.h | 5 ++---
> > include/acpi/actbl3.h | 17 +++++++++++++----
> > 2 files changed, 15 insertions(+), 7 deletions(-)
> >
> > diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index
> > cafdeb5..2f2b8a6 100644
> > --- a/include/acpi/actbl2.h
> > +++ b/include/acpi/actbl2.h
> > @@ -1071,14 +1071,13 @@ enum acpi_spmi_interface_types {
> > * TCPA - Trusted Computing Platform Alliance table
> > * Version 1
> > *
> > - * Conforms to "TCG PC Specific Implementation Specification",
> > - * Version 1.1, August 18, 2003
> > + * Conforms to "TCG ACPI Specification for Family 1.2 and 2.0" 19
> > + December 2014
> > *
> >
> > **********************************************************************
> > ********/
> >
> > struct acpi_table_tcpa {
> > struct acpi_table_header header; /* Common ACPI table header */
> > - u16 reserved;
> > + u16 platform_class; /* 0 for client and 1 for server platforms.
> */
> > u32 max_log_length; /* Maximum length for the event log area */
> > u64 log_address; /* Address of the event log area */
> > };
> > diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index
> > 440ca81..8dd625c 100644
> > --- a/include/acpi/actbl3.h
> > +++ b/include/acpi/actbl3.h
> > @@ -688,15 +688,24 @@ enum acpi_rasf_status {
> > * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
> > * Version 3
> > *
> > - * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November
> > 2011
> > + * Conforms to "TCG ACPI Specification for Family 1.2 and 2.0" 19
> > + December 2014
> > *
> >
> > **********************************************************************
> > ********/
> >
> > +/* How to notify that there is a command available for processing. */
> > +
> > +enum acpi_tpm2_start_method {
> > + ACPI_TPM2_SM_ACPI = 2,
> > + ACPI_TPM2_SM_CRB = 7,
> > + ACPI_TPM2_SM_CRB_AND_ACPI = 8,
> > +};
> > +
> > struct acpi_table_tpm2 {
> > struct acpi_table_header header; /* Common ACPI table header */
> > - u32 flags;
> > - u64 control_address;
> > - u32 start_method;
> > + u16 platform_class; /* 0 for client and 1 for server platforms
> */
> > + u16 reserved;
> > + u64 control_address; /* Physical address of the control area */
> > + u32 start_method; /* Method to notify to start processing */
> > };
> >
> > /* Control area structure (not part of table, pointed to by
> > control_address) */
> >
>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
7 years
Re: [Devel] [PATCH] acpi: update struct acpi_table_tpm2
by Moore, Robert
Looking at the TCG ACPI Specification today, it looks like there are major changes to the TCPA table. There is a whole bunch of new stuff after the Log Area Start Address.
Perhaps I missed or didn't get part of your proposed change.
> -----Original Message-----
> From: Jarkko Sakkinen [mailto:[email protected]]
> Sent: Tuesday, June 09, 2015 8:19 AM
> To: Moore, Robert
> Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; open list:ACPI COMPONENT
> AR...; open list:ACPI COMPONENT AR...; open list
> Subject: Re: [PATCH] acpi: update struct acpi_table_tpm2
>
> On Tue, Jun 09, 2015 at 02:21:12PM +0000, Moore, Robert wrote:
> > ACPICA usually defines any "related" data structures, just for user
> > convenience.
>
> If you want to keep it, it's fine for me but we still probably use the
> internal structure for it in tpm_crb driver (as tpm_tis uses internal
> structure for CRB).
>
> Do other updates look fine? I'm looking into migrating to tpm_crb driver
> to use actbl3.h.
>
> /Jarkko
>
> >
> > > -----Original Message-----
> > > From: Jarkko Sakkinen [mailto:[email protected]]
> > > Sent: Tuesday, June 09, 2015 2:18 AM
> > > To: Moore, Robert
> > > Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; open list:ACPI
> > > COMPONENT AR...; open list:ACPI COMPONENT AR...; open list
> > > Subject: Re: [PATCH] acpi: update struct acpi_table_tpm2
> > >
> > > On Mon, Jun 08, 2015 at 08:52:02PM +0000, Moore, Robert wrote:
> > > > It looks like there is a change to the TCPA table also.
> > >
> > > Right. I'll update that too.
> > >
> > > I strongly think that the struct acpi_tpm2_control should not be in
> > > actbl3.h. It is not defined in the TCG ACPI specification. It is
> > > defined in
> > >
> > > http://www.trustedcomputinggroup.org/resources/pc_client_platform_tp
> > > m_prof
> > > ile_ptp_specification
> > >
> > > FIFO control structures are internal for to the TPM subsystem and so
> > > should be CRB control structures (and we have already inside
> tpm_crb.c).
> > >
> > > The structure ended up there probably because it was combined with
> > > the
> > > TPM2 table in that Microsoft specification.
> > >
> > > /Jarkko
7 years
Re: [Devel] [PATCH] acpi: update struct acpi_table_tpm2
by Moore, Robert
Well, you don't have to use it. ACPICA has done this in several other places. Anyway, I'm hesitant to just remove it at this point.
> -----Original Message-----
> From: Jarkko Sakkinen [mailto:[email protected]]
> Sent: Tuesday, June 09, 2015 8:43 AM
> To: Moore, Robert
> Cc: Zheng, Lv; Wysocki, Rafael J; Len Brown; open list:ACPI COMPONENT
> AR...; open list:ACPI COMPONENT AR...; open list
> Subject: Re: [PATCH] acpi: update struct acpi_table_tpm2
>
> On Tue, Jun 09, 2015 at 06:19:19PM +0300, Jarkko Sakkinen wrote:
> > On Tue, Jun 09, 2015 at 02:21:12PM +0000, Moore, Robert wrote:
> > > ACPICA usually defines any "related" data structures, just for user
> > > convenience.
> >
> > If you want to keep it, it's fine for me but we still probably use the
> > internal structure for it in tpm_crb driver (as tpm_tis uses internal
> > structure for CRB).
>
> Let me open this a little bit. Everytime we want to do some small change
> to control area (lets say TCG adds some flag) we would have to cycle them
> through you.
>
> And the changes are not coupled with ACPI in any possible way. This is
> only adds more maintenance burden to you and also to us. This structure is
> the main control structure for the CRB driver and will be refined many
> times in the future. There is no any kind of use to its fields outside of
> the CRB driver.
>
> /Jarkko
7 years