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

Jani Nikula jani.nikula at intel.com
Thu Apr 18 11:44:20 UTC 2024


On Thu, 18 Apr 2024, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> 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>

Reviewed-by: Jani Nikula <jani.nikula at 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",

-- 
Jani Nikula, Intel


More information about the igt-dev mailing list