[PATCH i-g-t] tools/intel_reg: Fix mchbar register write

Ville Syrjala ville.syrjala at linux.intel.com
Thu Apr 18 11:26:33 UTC 2024


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

I somehow lost the write part of the mchbar register support.
Add it back so that we can also write mchbar registers without
having to remember the address of the mirror range.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tools/intel_reg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 6c37e14d127d..aae5a23956b9 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -586,6 +586,7 @@ static int write_register(struct config *config, struct reg *reg, uint32_t val)
 	}
 
 	switch (reg->port_desc.port) {
+	case PORT_MCHBAR_32:
 	case PORT_MMIO_32:
 		if (reg->engine) {
 			register_srm(config, reg, &val);
@@ -593,6 +594,7 @@ static int write_register(struct config *config, struct reg *reg, uint32_t val)
 			OUTREG(reg->mmio_offset + reg->addr, val);
 		}
 		break;
+	case PORT_MCHBAR_16:
 	case PORT_MMIO_16:
 		if (val > 0xffff) {
 			fprintf(stderr, "value 0x%08x out of range for port %s\n",
@@ -601,6 +603,7 @@ static int write_register(struct config *config, struct reg *reg, uint32_t val)
 		}
 		OUTREG16(reg->mmio_offset + reg->addr, val);
 		break;
+	case PORT_MCHBAR_8:
 	case PORT_MMIO_8:
 		if (val > 0xff) {
 			fprintf(stderr, "value 0x%08x out of range for port %s\n",
-- 
2.43.2



More information about the igt-dev mailing list