3434#define RV_IOMMU_FCTL_WSI_BIT (0x1UL << 1)
3535#define RV_IOMMU_FCTL_DEFAULT (RV_IOMMU_FCTL_WSI_BIT)
3636
37- // Device Directory Table Pointer register
38- #define RV_IOMMU_DDTP_MODE_OFF (0ULL)
39- #define RV_IOMMU_DDTP_MODE_BARE (1ULL)
40- #define RV_IOMMU_DDTP_MODE_1LVL (2ULL)
41- #define RV_IOMMU_DDTP_MODE_2LVL (3ULL)
42- #define RV_IOMMU_DDTP_MODE_3LVL (4ULL)
43-
44- #define RV_IOMMU_DDTP_BUSY_BIT (0x1ULL << 4)
45-
4637#define RV_IOMMU_DDTP_PPN_OFF (10)
4738#define RV_IOMMU_DDTP_PPN_LEN (44)
4839#define RV_IOMMU_DDTP_PPN_MASK BIT64_MASK(RV_IOMMU_DDTP_PPN_OFF, RV_IOMMU_DDTP_PPN_LEN)
5546#define RV_IOMMU_XQCSR_EN_BIT (1ULL << 0)
5647#define RV_IOMMU_XQCSR_IE_BIT (1ULL << 1)
5748#define RV_IOMMU_XQCSR_MF_BIT (1ULL << 8)
58- #define RV_IOMMU_XQCSR_ON_BIT (1ULL << 16)
59- #define RV_IOMMU_XQCSR_BUSY_BIT (1ULL << 17)
6049
6150// FQ CSR
6251#define RV_IOMMU_FQCSR_OF_BIT (1ULL << 9)
@@ -120,7 +109,6 @@ struct riscv_iommu_regmap {
120109
121110// # RISC-V IOMMU Device Directory Table
122111#define RV_IOMMU_DC_VALID_BIT (1ULL << 0)
123- #define RV_IOMMU_DC_DTF_BIT (1ULL << 4)
124112
125113#define RV_IOMMU_DC_IOHGATP_PPN_OFF (0)
126114#define RV_IOMMU_DC_IOHGATP_PPN_LEN (44)
@@ -131,36 +119,7 @@ struct riscv_iommu_regmap {
131119#define RV_IOMMU_DC_IOHGATP_GSCID_MASK \
132120 BIT64_MASK(RV_IOMMU_DC_IOHGATP_GSCID_OFF, RV_IOMMU_DC_IOHGATP_GSCID_LEN)
133121#define RV_IOMMU_DC_IOHGATP_MODE_OFF (60)
134- #define RV_IOMMU_DC_IOHGATP_MODE_LEN (4)
135- #define RV_IOMMU_DC_IOHGATP_MODE_MASK \
136- BIT64_MASK(RV_IOMMU_DC_IOHGATP_MODE_OFF, RV_IOMMU_DC_IOHGATP_MODE_LEN)
137- #define RV_IOMMU_IOHGATP_SV39X4 (8ULL << RV_IOMMU_DC_IOHGATP_MODE_OFF)
138- #define RV_IOMMU_IOHGATP_BARE (0ULL << RV_IOMMU_DC_IOHGATP_MODE_OFF)
139-
140- #define RV_IOMMU_DC_IOHGATP_PSCID_OFF (12)
141- #define RV_IOMMU_DC_IOHGATP_PSCID_LEN (20)
142- #define RV_IOMMU_DC_IOHGATP_PSCID_MASK \
143- BIT64_MASK(RV_IOMMU_DC_IOHGATP_PSCID_OFF, RV_IOMMU_DC_IOHGATP_PSCID_LEN)
144-
145- #define RV_IOMMU_DC_FSC_PPN_OFF (0)
146- #define RV_IOMMU_DC_FSC_PPN_LEN (44)
147- #define RV_IOMMU_DC_FSC_PPN_MASK BIT64_MASK(RV_IOMMU_DC_FSC_PPN_OFF, RV_IOMMU_DC_FSC_PPN_LEN)
148- #define RV_IOMMU_DC_FSC_MODE_OFF (60)
149- #define RV_IOMMU_DC_FSC_MODE_LEN (4)
150- #define RV_IOMMU_DC_FSC_MODE_MASK BIT64_MASK(RV_IOMMU_DC_FSC_MODE_OFF, RV_IOMMU_DC_FSC_MODE_LEN)
151-
152- #define RV_IOMMU_DC_MSIPTP_PPN_OFF (0)
153- #define RV_IOMMU_DC_MSIPTP_PPN_LEN (44)
154- #define RV_IOMMU_DC_MSIPTP_PPN_MASK \
155- BIT64_MASK(RV_IOMMU_DC_MSIPTP_PPN_OFF, RV_IOMMU_DC_MSIPTP_PPN_LEN)
156- #define RV_IOMMU_DC_MSIPTP_MODE_OFF (60)
157- #define RV_IOMMU_DC_MSIPTP_MODE_LEN (4)
158- #define RV_IOMMU_DC_MSIPTP_MODE_MASK \
159- BIT64_MASK(RV_IOMMU_DC_MSIPTP_MODE_OFF, RV_IOMMU_DC_MSIPTP_MODE_LEN)
160-
161- #define RV_IOMMU_DC_MSIMASK_OFF (0)
162- #define RV_IOMMU_DC_MSIMASK_LEN (52)
163- #define RV_IOMMU_DC_MSIMASK_MASK BIT64_MASK(RV_IOMMU_DC_MSIMASK_OFF, RV_IOMMU_DC_MSIMASK_LEN)
122+ #define RV_IOMMU_IOHGATP_SV39X4 (8ULL << RV_IOMMU_DC_IOHGATP_MODE_OFF)
164123
165124struct ddt_entry {
166125 uint64_t tc ;
@@ -176,10 +135,6 @@ struct ddt_entry {
176135// # Fault Queue Record
177136#define RV_IOMMU_FQ_CAUSE_OFF (0)
178137#define RV_IOMMU_FQ_CAUSE_LEN (12)
179- #define RV_IOMMU_FQ_PID_OFF (12)
180- #define RV_IOMMU_FQ_PID_LEN (20)
181- #define RV_IOMMU_FQ_TTYP_OFF (34)
182- #define RV_IOMMU_FQ_TTYP_LEN (6)
183138#define RV_IOMMU_FQ_DID_OFF (40)
184139#define RV_IOMMU_FQ_DID_LEN (24)
185140
0 commit comments