1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _SOC_INTEL_ACPI_PCR_LIB_
4 #define _SOC_INTEL_ACPI_PCR_LIB_
6 /* Port Id lives in bits 23:16 and register offset lives in 15:0 of address. */
7 #define PCR_PORTID_SHIFT 16
14 * Get PCR register base for specified Die at given PID
18 Method (GPCR, 2, NotSerialized)
20 if (Arg0 == PCH_P2SB) {
21 Local0 = CONFIG_PCR_BASE_ADDRESS;
23 if (Arg0 == IOE_P2SB) {
24 Local0 = CONFIG_IOE_PCR_BASE_ADDRESS;
26 Printf ("Invalid Die index (%o)\n", Arg0)
31 Return (Local0 + (Arg1 << PCR_PORTID_SHIFT))
35 * Read PCR register for specified Die at PID and offset
38 * Arg2 - Register Offset
40 Method (RPCR, 3, Serialized)
42 OperationRegion (PCRD, SystemMemory, GPCR (Arg0, Arg1) + Arg2, 4)
43 Field (PCRD, DWordAcc, NoLock, Preserve)
51 * Perform PCR register AND for specified Die at PID and offset
54 * Arg2 - Register Offset
57 Method (APCR, 4, Serialized)
59 OperationRegion (PCRD, SystemMemory, GPCR (Arg0, Arg1) + Arg2, 4)
60 Field (PCRD, DWordAcc, NoLock, Preserve)
67 * After every write one needs to read an innocuous register
68 * to ensure the writes are completed for certain ports. This is done
69 * for all ports so that the callers don't need the per-port knowledge
70 * for each transaction.
72 RPCR (Arg0, Arg1, Arg2)
76 * Perform PCR register OR for specified Die at PID and offset
79 * Arg2 - Register Offset
82 Method (OPCR, 4, Serialized)
84 OperationRegion (PCRD, SystemMemory, GPCR (Arg0, Arg1) + Arg2, 4)
85 Field (PCRD, DWordAcc, NoLock, Preserve)
92 * After every write one needs to read an innocuous register
93 * to ensure the writes are completed for certain ports. This is done
94 * for all ports so that the callers don't need the per-port knowledge
95 * for each transaction.
97 RPCR (Arg0, Arg1, Arg2)
100 #endif /* _SOC_INTEL_ACPI_PCR_LIB_ */