On Thu, 05 Feb 2026, Uma Shankar <[email protected]> wrote:
> Make intel_rom.c free from including i915_reg.h.
>
> v4: Move oprom reg to separate header (Ville)
>
> v3: Update patch header
>
> v2: Use display header instead of gmd common include (Jani)
>
> Reviewed-by: Jani Nikula <[email protected]>
> Signed-off-by: Uma Shankar <[email protected]>
> ---
> .../gpu/drm/i915/display/intel_oprom_regs.h | 36 +++++++++++++++++++
> drivers/gpu/drm/i915/display/intel_rom.c | 3 +-
> drivers/gpu/drm/i915/i915_reg.h | 8 -----
> 3 files changed, 37 insertions(+), 10 deletions(-)
> create mode 100644 drivers/gpu/drm/i915/display/intel_oprom_regs.h
>
> diff --git a/drivers/gpu/drm/i915/display/intel_oprom_regs.h
> b/drivers/gpu/drm/i915/display/intel_oprom_regs.h
> new file mode 100644
> index 000000000000..2cf723aa4ab0
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/display/intel_oprom_regs.h
> @@ -0,0 +1,36 @@
> +/*
> + * Copyright © 2026 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
Please use SPDX for new files. Can be fixed while applying if there's no
other reason to resend.
> +
> +#ifndef _INTEL_OPROM_REGS_H_
> +#define _INTEL_OPROM_REGS_H_
> +
> +#define PRIMARY_SPI_TRIGGER _MMIO(0x102040)
> +#define PRIMARY_SPI_ADDRESS _MMIO(0x102080)
> +#define PRIMARY_SPI_REGIONID _MMIO(0x102084)
> +#define SPI_STATIC_REGIONS _MMIO(0x102090)
> +#define OPTIONROM_SPI_REGIONID_MASK REG_GENMASK(7, 0)
> +#define OROM_OFFSET _MMIO(0x1020c0)
> +#define OROM_OFFSET_MASK REG_GENMASK(20, 16)
> +
> +#endif
> diff --git a/drivers/gpu/drm/i915/display/intel_rom.c
> b/drivers/gpu/drm/i915/display/intel_rom.c
> index c8f615315310..024db7b1a1c6 100644
> --- a/drivers/gpu/drm/i915/display/intel_rom.c
> +++ b/drivers/gpu/drm/i915/display/intel_rom.c
> @@ -7,10 +7,9 @@
>
> #include <drm/drm_device.h>
>
> -#include "i915_reg.h"
> -
> #include "intel_rom.h"
> #include "intel_uncore.h"
> +#include "intel_oprom_regs.h"
>
> struct intel_rom {
> /* for PCI ROM */
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 2c279bd3342d..9cb753b65bc2 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -892,14 +892,6 @@
> #define SGGI_DIS REG_BIT(15)
> #define SGR_DIS REG_BIT(13)
>
> -#define PRIMARY_SPI_TRIGGER _MMIO(0x102040)
> -#define PRIMARY_SPI_ADDRESS _MMIO(0x102080)
> -#define PRIMARY_SPI_REGIONID _MMIO(0x102084)
> -#define SPI_STATIC_REGIONS _MMIO(0x102090)
> -#define OPTIONROM_SPI_REGIONID_MASK REG_GENMASK(7, 0)
> -#define OROM_OFFSET _MMIO(0x1020c0)
> -#define OROM_OFFSET_MASK REG_GENMASK(20, 16)
> -
> #define MTL_MEDIA_GSI_BASE 0x380000
>
> #endif /* _I915_REG_H_ */
--
Jani Nikula, Intel