Skip to content

Commit 3b89079

Browse files
mcamromrafaeljw
authored andcommitted
ACPICA: Replace TPRn Base and Limit registers
Replace TPRn Base and Limit registers with compatible bitmasks for them. Link: acpica/acpica@be91c5813936 Signed-off-by: Michal Camacho Romero <michal.camacho.romero@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1871109.TLkxdtWsSY@rafael.j.wysocki
1 parent 099b050 commit 3b89079

1 file changed

Lines changed: 72 additions & 27 deletions

File tree

include/acpi/actbl1.h

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,28 +2005,57 @@ struct acpi_tpr_aux_sr {
20052005
};
20062006

20072007
/*
2008-
* TPRn_BASE
2008+
* TPRn_BASE (ACPI_TPRN_BASE_REG)
20092009
*
20102010
* Specifies the start address of TPRn region. TPR region address and size must
20112011
* be with 1MB resolution. These bits are compared with the result of the
20122012
* TPRn_LIMIT[63:20] * applied to the incoming address, to determine if an
20132013
* access fall within the TPRn defined region.
2014+
*
2015+
* Minimal TPRn_Base resolution is 1MB.
2016+
* Applied to the incoming address, to determine if
2017+
* an access fall within the TPRn defined region.
2018+
* Width is determined by a bus width which can be
2019+
* obtained via CPUID function 0x80000008.
20142020
*/
20152021

2016-
struct acpi_tprn_base_reg {
2017-
u64 reserved0:3;
2018-
u64 rw:1; /* access: 1 == RO, 0 == RW (for TPR must be RW) */
2019-
u64 enable:1; /* 0 == range enabled, 1 == range disabled */
2020-
u64 reserved1:15;
2021-
u64 tpr_base_rw:44;
2022-
/*
2023-
* Minimal TPRn_Base resolution is 1MB.
2024-
* Applied to the incoming address, to determine if
2025-
* an access fall within the TPRn defined region.
2026-
* Width is determined by a bus width which can be
2027-
* obtained via CPUID function 0x80000008.
2028-
*/
2029-
};
2022+
typedef u64 ACPI_TPRN_BASE_REG;
2023+
2024+
/* TPRn_BASE Register Bit Masks */
2025+
2026+
/* Bit 3 - RW: access: 1 == RO, 0 == RW register (for TPR must be RW) */
2027+
#define ACPI_TPRN_BASE_RW_SHIFT 3
2028+
#define ACPI_TPRN_BASE_RW_MASK ((u64) 1 << ACPI_TPRN_BASE_RW_SHIFT)
2029+
2030+
/*
2031+
* Bit 4 - Enable: 0 – TPRn address range enabled;
2032+
* 1 – TPRn address range disabled.
2033+
*/
2034+
#define ACPI_TPRN_BASE_ENABLE_SHIFT 4
2035+
#define ACPI_TPRN_BASE_ENABLE_MASK ((u64) 1 << ACPI_TPRN_BASE_ENABLE_SHIFT)
2036+
2037+
/* Bits 63:20 - tpr_base_rw */
2038+
#define ACPI_TPRN_BASE_ADDR_SHIFT 20
2039+
#define ACPI_TPRN_BASE_ADDR_MASK ((u64) 0xFFFFFFFFFFF << \
2040+
ACPI_TPRN_BASE_ADDR_SHIFT)
2041+
2042+
/* TPRn_BASE Register Bit Handlers*/
2043+
#define GET_TPRN_BASE_RW(reg) (((u64) reg & ACPI_TPRN_BASE_RW_MASK) >> \
2044+
ACPI_TPRN_BASE_RW_SHIFT)
2045+
#define GET_TPRN_BASE_ENABLE(reg) (((u64) reg & ACPI_TPRN_BASE_ENABLE_MASK) \
2046+
>> ACPI_TPRN_BASE_ENABLE_SHIFT)
2047+
#define GET_TPRN_BASE_ADDR(reg) (((u64) reg & ACPI_TPRN_BASE_ADDR_MASK) \
2048+
>> ACPI_TPRN_BASE_ADDR_SHIFT)
2049+
2050+
#define SET_TPRN_BASE_RW(reg, val) ACPI_REGISTER_INSERT_VALUE(reg, \
2051+
ACPI_TPRN_BASE_RW_SHIFT, \
2052+
ACPI_TPRN_BASE_RW_MASK, val);
2053+
#define SET_TPRN_BASE_ENABLE(reg, val) ACPI_REGISTER_INSERT_VALUE(reg, \
2054+
ACPI_TPRN_BASE_ENABLE_SHIFT, \
2055+
ACPI_TPRN_BASE_ENABLE_MASK, val);
2056+
#define SET_TPRN_BASE_ADDR(reg, val) ACPI_REGISTER_INSERT_VALUE(reg, \
2057+
ACPI_TPRN_BASE_ADDR_SHIFT, \
2058+
ACPI_TPRN_BASE_ADDR_MASK, val);
20302059

20312060
/*
20322061
* TPRn_LIMIT
@@ -2035,20 +2064,36 @@ struct acpi_tprn_base_reg {
20352064
* to prohibit certain system agents from accessing memory. When an agent
20362065
* sends a request upstream, whether snooped or not, a TPR prevents that
20372066
* transaction from changing the state of memory.
2067+
*
2068+
* Minimal TPRn_Limit resolution is 1MB.
2069+
* Width is determined by a bus width
20382070
*/
20392071

2040-
struct acpi_tprn_limit_reg {
2041-
u64 reserved0:3;
2042-
u64 rw:1; /* access: 1 == RO, 0 == RW (for TPR must be RW) */
2043-
u64 enable:1; /* 0 == range enabled, 1 == range disabled */
2044-
u64 reserved1:15;
2045-
u64 tpr_limit_rw:44;
2046-
/*
2047-
* Minimal TPRn_Limit resolution is 1MB.
2048-
* These bits define TPR limit address.
2049-
* Width is determined by a bus width.
2050-
*/
2051-
};
2072+
typedef u64 ACPI_TPRN_LIMIT_REG;
2073+
2074+
/* TPRn_LIMIT Register Bit Masks */
2075+
2076+
/* Bit 3 - RW: access: 1 == RO, 0 == RW register (for TPR must be RW) */
2077+
#define ACPI_TPRN_LIMIT_RW_SHIFT 3
2078+
#define ACPI_TPRN_LIMIT_RW_MASK ((u64) 1 << ACPI_TPRN_LIMIT_RW_SHIFT)
2079+
2080+
/* Bits 63:20 - tpr_limit_rw */
2081+
#define ACPI_TPRN_LIMIT_ADDR_SHIFT 20
2082+
#define ACPI_TPRN_LIMIT_ADDR_MASK ((u64) 0xFFFFFFFFFFF << \
2083+
ACPI_TPRN_LIMIT_ADDR_SHIFT)
2084+
2085+
/* TPRn_LIMIT Register Bit Handlers*/
2086+
#define GET_TPRN_LIMIT_RW(reg) (((u64) reg & ACPI_TPRN_LIMIT_RW_MASK) \
2087+
>> ACPI_TPRN_LIMIT_RW_SHIFT)
2088+
#define GET_TPRN_LIMIT_ADDR(reg) (((u64) reg & ACPI_TPRN_LIMIT_ADDR_MASK) \
2089+
>> ACPI_TPRN_LIMIT_ADDR_SHIFT)
2090+
2091+
#define SET_TPRN_LIMIT_RW(reg, val) ACPI_REGISTER_INSERT_VALUE(reg, \
2092+
ACPI_TPRN_LIMIT_RW_SHIFT, \
2093+
ACPI_TPRN_LIMIT_RW_MASK, val);
2094+
#define SET_TPRN_LIMIT_ADDR(reg, val) ACPI_REGISTER_INSERT_VALUE(reg, \
2095+
ACPI_TPRN_LIMIT_ADDR_SHIFT, \
2096+
ACPI_TPRN_LIMIT_ADDR_MASK, val);
20522097

20532098
/*
20542099
* SERIALIZE_REQUEST

0 commit comments

Comments
 (0)