From 52aeb078ce69479c0efa852ba9ee7c97a09dfbc7 Mon Sep 17 00:00:00 2001 From: Cliff Huang Date: Wed, 19 Nov 2025 17:50:39 -0800 Subject: [PATCH] soc/intel/common/acpi: Add IOST device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ACPI device for Intel's IO Self-Testing Software (IOST), which is an OS tool for performing electrical margining analysis on USB4 Host and Device Routers, DP2.1 displays, memory, UFS, and PCIe Gen4+ devices. This ACPI device provides the necessary P2SB access interface to enable IOST to interact with hardware registers for comprehensive IO testing and validation. The ASL file should be included in the SoC's southbridge.asl. BUG=none TEST=Build coreboot with this ASL file included in the SoC's southbridge.asl. Boot to OS and verify IOST objects appear correctly in the DSDT tables. Signed-off-by: Cliff Huang Change-Id: I9417da8322931c2afbf75aa9062bceb52b8320d6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/90128 Reviewed-by: Jérémy Compostella Tested-by: build bot (Jenkins) Reviewed-by: Alicja Michalska --- src/soc/intel/common/acpi/iost.asl | 81 ++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/soc/intel/common/acpi/iost.asl diff --git a/src/soc/intel/common/acpi/iost.asl b/src/soc/intel/common/acpi/iost.asl new file mode 100644 index 0000000000..51d934ca7a --- /dev/null +++ b/src/soc/intel/common/acpi/iost.asl @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Device: Intel's IO Self-Testing Software (IOST) + * NOTE: The IOSE Name object is used to enable IOST. It is set to 0 by default, + * and its value can be updated in the SSDT. + */ +Device (IOST) +{ + // + // Intel IO Self Testing Device + // + Name (_UID, "IOST") + Name (_HID, "IOS0001") + Name (IVER, 0x00010000) + Name (IOSE, 0x00) + Method (_STA, 0, NotSerialized) + { + If (IOSE > Zero) { + Return (0xf) + } + Return (Zero) + } + + /* + * _DSM Device Specific Method + * + * Arg0: UUID : 893f00a6-660c-494e-bcfd-3043f4fb67c0 + * Arg1: Integer Revision Level + * Arg2: Integer Function Index (0 = Return Supported Functions) + * Arg3: Package Parameters + */ + Method (_DSM, 4, Serialized) + { + If ( (IOSE > Zero) && LEqual (Arg0, ToUUID ("893f00a6-660c-494e-bcfd-3043f4fb67c0"))) + { + If (LEqual (0, ToInteger (Arg1))) + { + Switch (ToInteger (Arg2)) + { + /* Function 0: returns a buffer containing one bit for each function index, starting with zero. + * Bit 0 indicates whether there is support for any function other than function 0 + */ + Case (0) + { + Return (Buffer(){0x07}) + } + /* Function 1: P2SB Read + * Package Details + * Idx0 = PortID + * Idx1 = Offset + */ + Case (1) + { + Local0 = DeRefOf (Index (Arg3, 0)) /* PordID */ + Local1 = DeRefOf (Index (Arg3, 1)) /* offset */ + + Local3 = PCRR(Local0, Local1) + Printf ("[IOST] P2B Read: PortID: %o Offset: %o read = %o", ToHexString(Local0), ToHexString(Local1), ToHexString(Local3)) + Return(Local3) + } + /* Function 2: P2SB Write + * Package Details + * Idx0 = PortID + * Idx1 = Offset + * Idx2 = DataToWrite + */ + Case (2) + { + Local0 = DeRefOf (Index (Arg3, 0)) /* PordID */ + Local1 = DeRefOf (Index (Arg3, 1)) /* offset */ + Local2 = DeRefOf (Index (Arg3, 2)) /* data to Write */ + Printf ("[IOST] P2B Write: PortID: %o Offset: %o with %o", ToHexString(Local0), ToHexString(Local1), ToHexString(Local2)) + PCRW(Local0, Local1, Local2) + Return (0x00) + } + } + } + } + Return (Buffer () {0x00}) + } +}