Skip to contentSkip to conversation

drm/i915: Move MCHBAR registers to their own header

PATCH In review Matt Roper 3 participants 7 messages Feb 10, 2022 – Feb 15, 2022

Subsystems (4)
lore
Share & tools
lore

Matt Roper

author
#0 lore raw

PATCH 1/1 drm/i915: Move MCHBAR registers to their own header

Registers that exist within the MCH BAR and are mirrored into the GPU's MMIO space are a good candidate to separate out into their own header.

For reference, the mirror of the MCH BAR lives at the following locations in the graphics MMIO space:

* Pre-gen6: 0x10000 - 0x13000
* Gen6-Gen11 + RKL: 0x140000 - 0x14FFFF
* TGL, ADL: 0x140000 - 0x15FFFF

Bspec: 134, 51771

---
 drivers/gpu/drm/i915/display/intel_bw.c       |   1 +
 drivers/gpu/drm/i915/display/intel_cdclk.c    |   1 +
 .../drm/i915/display/intel_display_power.c    |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c    |   1 +
 drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c  |   1 +
 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c |   1 +
 drivers/gpu/drm/i915/gt/intel_gt_regs.h       |   7 -
 drivers/gpu/drm/i915/gt/intel_llc.c           |   1 +
 drivers/gpu/drm/i915/gt/intel_reset.c         |   1 +
 drivers/gpu/drm/i915/gt/intel_rps.c           |   1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   1 +
 drivers/gpu/drm/i915/gvt/handlers.c           |   1 +
 drivers/gpu/drm/i915/i915_debugfs.c           |   1 +
 drivers/gpu/drm/i915/i915_reg.h               | 203 ----------------
 drivers/gpu/drm/i915/intel_dram.c             |   1 +
 drivers/gpu/drm/i915/intel_mchbar_regs.h      | 221 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_pm.c               |   1 +
 17 files changed, 235 insertions(+), 210 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_mchbar_regs.h
drivers/gpu/drm/i915/display/intel_bw.c +1 -0
index 5dce3cf0ed12..b612987436cb 100644
@@ -10,6 +10,7 @@
 #include "intel_bw.h"
 #include "intel_cdclk.h"
 #include "intel_display_types.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pcode.h"
 #include "intel_pm.h"
 
drivers/gpu/drm/i915/display/intel_cdclk.c +1 -0
index 118ef391b560..8888fda8b701 100644
@@ -32,6 +32,7 @@
 #include "intel_crtc.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pci_config.h"
 #include "intel_pcode.h"
 #include "intel_psr.h"
drivers/gpu/drm/i915/display/intel_display_power.c +1 -0
index d2102cc17bb4..9ebae7ac3235 100644
@@ -16,6 +16,7 @@
 #include "intel_dpio_phy.h"
 #include "intel_dpll.h"
 #include "intel_hotplug.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pch_refclk.h"
 #include "intel_pcode.h"
 #include "intel_pm.h"
drivers/gpu/drm/i915/gem/i915_gem_stolen.c +1 -0
index 1de73a644965..b9c3196b91ca 100644
@@ -16,6 +16,7 @@
 #include "i915_gem_stolen.h"
 #include "i915_reg.h"
 #include "i915_vgpu.h"
+#include "intel_mchbar_regs.h"
 
 /*
  * The BIOS typically reserves some of the system's memory for the exclusive
drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c +1 -0
index ee4049ee1fc9..76880fb8fc19 100644
@@ -9,6 +9,7 @@
 #include "i915_pvinfo.h"
 #include "i915_vgpu.h"
 #include "intel_gt_regs.h"
+#include "intel_mchbar_regs.h"
 
 /**
  * DOC: fence register handling
drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c +1 -0
index 4e448c13a64c..37765919fe32 100644
@@ -15,6 +15,7 @@
 #include "intel_gt_pm_debugfs.h"
 #include "intel_gt_regs.h"
 #include "intel_llc.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pcode.h"
 #include "intel_rc6.h"
 #include "intel_rps.h"
drivers/gpu/drm/i915/gt/intel_gt_regs.h +0 -7
index e73c706e7f0d..210c42c69a97 100644
@@ -8,13 +8,6 @@
 
 #include "i915_reg_defs.h"
 
-#define ILK_GDSR _MMIO(MCHBAR_MIRROR_BASE + 0x2ca4)
-#define  ILK_GRDOM_FULL		(0 << 1)
-#define  ILK_GRDOM_RENDER	(1 << 1)
-#define  ILK_GRDOM_MEDIA	(3 << 1)
-#define  ILK_GRDOM_MASK		(3 << 1)
-#define  ILK_GRDOM_RESET_ENABLE (1 << 0)
-
 #define GEN6_MBCUNIT_SNPCR	_MMIO(0x900c) /* for LLC config */
 #define   GEN6_MBC_SNPCR_SHIFT	21
 #define   GEN6_MBC_SNPCR_MASK	(3 << 21)
drivers/gpu/drm/i915/gt/intel_llc.c +1 -0
index 335c65758d6f..40e2e28ee6c7 100644
@@ -10,6 +10,7 @@
 #include "i915_reg.h"
 #include "intel_gt.h"
 #include "intel_llc.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pcode.h"
 
 struct ia_constants {
drivers/gpu/drm/i915/gt/intel_reset.c +1 -0
index 59beb69ff6f2..c2cb426227c2 100644
@@ -22,6 +22,7 @@
 #include "intel_gt.h"
 #include "intel_gt_pm.h"
 #include "intel_gt_requests.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pci_config.h"
 #include "intel_reset.h"
 
drivers/gpu/drm/i915/gt/intel_rps.c +1 -0
index 0cb299cdfc8f..fd95449ed46d 100644
@@ -13,6 +13,7 @@
 #include "intel_gt_irq.h"
 #include "intel_gt_pm_irq.h"
 #include "intel_gt_regs.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pcode.h"
 #include "intel_rps.h"
 #include "vlv_sideband.h"
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c +1 -0
index ddbea939b1dc..147f8799598c 100644
@@ -6,6 +6,7 @@
 #include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_guc_slpc.h"
+#include "intel_mchbar_regs.h"
 #include "gt/intel_gt.h"
 #include "gt/intel_gt_regs.h"
 
drivers/gpu/drm/i915/gvt/handlers.c +1 -0
index c2ae79092b14..5e3ae5970c6b 100644
@@ -40,6 +40,7 @@
 #include "i915_reg.h"
 #include "gvt.h"
 #include "i915_pvinfo.h"
+#include "intel_mchbar_regs.h"
 #include "display/intel_display_types.h"
 #include "display/intel_fbc.h"
 #include "gt/intel_gt_regs.h"
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
index ca52ee0742ce..ded07dc0c4a8 100644
@@ -49,6 +49,7 @@
 #include "i915_debugfs_params.h"
 #include "i915_irq.h"
 #include "i915_scheduler.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pm.h"
 
 static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
drivers/gpu/drm/i915/i915_reg.h +0 -203

224 lines not on this page · raw message

drivers/gpu/drm/i915/intel_dram.c +1 -0
index 723bd0411a0e..174c95c3e10f 100644
@@ -6,6 +6,7 @@
 #include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_dram.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pcode.h"
 
 struct dram_dimm_info {
drivers/gpu/drm/i915/intel_mchbar_regs.h new file +221 -0

221 lines not on this page · raw message

drivers/gpu/drm/i915/intel_pm.c +1 -0
index 4f2f0e80beef..aed5563f2e34 100644
@@ -50,6 +50,7 @@
 #include "i915_drv.h"
 #include "i915_fixed.h"
 #include "i915_irq.h"
+#include "intel_mchbar_regs.h"
 #include "intel_pcode.h"
 #include "intel_pm.h"
 #include "vlv_sideband.h"
Signature · 1 line
2.34.1
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Move MCHBAR registers to their own header

== Series Details ==

== Series Details ==

Series: drm/i915: Move MCHBAR registers to their own header
URL : https://patchwork.freedesktop.org/series/99998/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
312d630a44d8 drm/i915: Move MCHBAR registers to their own header
-:430: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#430: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 556 lines checked

#2 lore raw

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Move MCHBAR registers to their own header

In reply to Matt Roper
== Series Details ==

== Series Details ==

Series: drm/i915: Move MCHBAR registers to their own header
URL : https://patchwork.freedesktop.org/series/99998/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
#3 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Move MCHBAR registers to their own header

In reply to Matt Roper
== Series Details ==

== Series Details ==

Series: drm/i915: Move MCHBAR registers to their own header
URL : https://patchwork.freedesktop.org/series/99998/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11214 -> Patchwork_22248
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_22248 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_22248, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/index.html

Participating hosts (48 -> 43)
------------------------------

Additional (3): fi-kbl-soraka fi-icl-u2 fi-adl-ddr4
Missing (8): shard-tglu fi-hsw-4200u fi-bsw-cyan bat-adlp-4 fi-ctg-p8600 shard-rkl shard-dg1 fi-bdw-samus

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_22248:

### IGT changes ###

#### Possible regressions ####

* igt@gem_exec_suspend@basic-s0@smem:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-kbl-soraka/igt@gem_exec_suspend@[email protected]

* igt@i915_selftest@live@hangcheck:
- fi-icl-u2: NOTRUN -> [DMESG-FAIL][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in Patchwork_22248 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@semaphore:
- fi-hsw-4770: NOTRUN -> [SKIP][3] ([fdo#109271] / [fdo#109315]) +17 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-hsw-4770/igt@amdgpu/[email protected]

* igt@amdgpu/amd_cs_nop@fork-gfx0:
- fi-icl-u2: NOTRUN -> [SKIP][4] ([fdo#109315]) +17 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@amdgpu/[email protected]

* igt@gem_exec_fence@basic-busy@bcs0:
- fi-kbl-soraka: NOTRUN -> [SKIP][5] ([fdo#109271]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-kbl-soraka/igt@gem_exec_fence@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-icl-u2: NOTRUN -> [SKIP][6] ([i915#2190])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@[email protected]

* igt@gem_lmem_swapping@parallel-random-engines:
- fi-icl-u2: NOTRUN -> [SKIP][7] ([i915#4613]) +3 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@[email protected]

* igt@i915_selftest@live@hangcheck:
- bat-dg1-6: [PASS][8] -> [DMESG-FAIL][9] ([i915#4494] / [i915#4957])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11214/bat-dg1-6/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/bat-dg1-6/igt@i915_selftest@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-icl-u2: NOTRUN -> [SKIP][10] ([fdo#111827]) +8 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-icl-u2: NOTRUN -> [SKIP][11] ([fdo#109278]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-icl-u2: NOTRUN -> [SKIP][12] ([fdo#109285])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@[email protected]

* igt@kms_psr@primary_page_flip:
- fi-skl-6600u: [PASS][13] -> [INCOMPLETE][14] ([i915#4547] / [i915#4838])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11214/fi-skl-6600u/igt@kms_psr@primary_page_flip.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-skl-6600u/igt@kms_psr@primary_page_flip.html

* igt@prime_vgem@basic-userptr:
- fi-icl-u2: NOTRUN -> [SKIP][15] ([i915#3301])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-icl-u2/igt@[email protected]

* igt@runner@aborted:
- fi-bdw-5557u: NOTRUN -> [FAIL][16] ([i915#2426] / [i915#4312])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-bdw-5557u/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][17] ([i915#4785]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11214/fi-hsw-4770/igt@i915_selftest@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/fi-hsw-4770/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@workarounds:
- {bat-adlp-6}: [DMESG-WARN][19] ([i915#5068]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11214/bat-adlp-6/igt@i915_selftest@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/bat-adlp-6/igt@i915_selftest@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#3138]: https://gitlab.freedesktop.org/drm/intel/issues/3138
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4494]: https://gitlab.freedesktop.org/drm/intel/issues/4494
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4838]: https://gitlab.freedesktop.org/drm/intel/issues/4838
[i915#4957]: https://gitlab.freedesktop.org/drm/intel/issues/4957
[i915#5068]: https://gitlab.freedesktop.org/drm/intel/issues/5068

Build changes
-------------

* Linux: CI_DRM_11214 -> Patchwork_22248

CI-20190529: 20190529
CI_DRM_11214: b9ddf3cdcb94017765655d8d31adc1bb70b11046 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6342: 1bd167a3af9e8f6168ac89c64c64b929694d9be7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_22248: 312d630a44d868539685de89dd4530f0c4d36220 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

312d630a44d8 drm/i915: Move MCHBAR registers to their own header

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22248/index.html

#4 lore raw
In reply to Matt Roper
Quoted 7 lines · Matt Roper

Registers that exist within the MCH BAR and are mirrored into the GPU's MMIO space are a good candidate to separate out into their own header.

For reference, the mirror of the MCH BAR lives at the following locations in the graphics MMIO space:

* Pre-gen6: 0x10000 - 0x13000

Should go up to 0x14000 according to some docs I have.

Quoted 1 line

* Gen6-Gen11 + RKL: 0x140000 - 0x14FFFF

Some docs say this goes up to 0x180000, other docs have different numbers. I suppose it doesn't matter all that much really. And BXT+ clearly can't go past 0x160000 since IIRC that's where some of the PHY/PLL stuff lives.

Quoted 6 lines

* TGL, ADL: 0x140000 - 0x15FFFF

Bspec: 134, 51771

<snip>

drivers/gpu/drm/i915/i915_reg.h line 1837

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +0 -7
-#define GEN6_GT_PERF_STATUS	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5948)
-#define BXT_GT_PERF_STATUS      _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x7070)
-#define GEN6_RP_STATE_LIMITS	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5994)
-#define GEN6_RP_STATE_CAP	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998)
-#define   RP0_CAP_MASK		REG_GENMASK(7, 0)
-#define   RP1_CAP_MASK		REG_GENMASK(15, 8)
-#define   RPN_CAP_MASK		REG_GENMASK(23, 16)
 #define BXT_RP_STATE_CAP        _MMIO(0x138170)
 #define GEN9_RP_STATE_LIMITS	_MMIO(0x138148)
 #define XEHPSDV_RP_STATE_CAP	_MMIO(0x250014)

:( This is a bit unfortunate. I wonder if we should make an exception for these and keep them all together somewhere?

<snip>

drivers/gpu/drm/i915/i915_reg.h

Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +1 -2
-/* Memory latency timer register */
-#define MLTR_ILK		_MMIO(0x11222)
+#define MLTR_ILK				_MMIO(MCHBAR_MIRROR_BASE + 0x1222)

I'd prefer to see a separate patch for the s/number/MCHBAR_MIRROR_BASE/ stuff. Very hard to review those in this form.

Signature · 2 lines
Ville Syrjälä
Intel
author
#5 lore raw
Quoted 10 lines · Ville Syrjälä
Quoted 7 lines · Matt Roper

Registers that exist within the MCH BAR and are mirrored into the GPU's MMIO space are a good candidate to separate out into their own header.

For reference, the mirror of the MCH BAR lives at the following locations in the graphics MMIO space:

* Pre-gen6: 0x10000 - 0x13000

Should go up to 0x14000 according to some docs I have.

I think I was looking at a gm45 PRM for this. Given the spotty documentation on the older platforms and the number of different end points there seem to be, maybe it's a better idea to just give the starting offset in the commit message and say that the upper bound varies.

Quoted 15 lines
Quoted 2 lines

* Gen6-Gen11 + RKL: 0x140000 - 0x14FFFF

Some docs say this goes up to 0x180000, other docs have different numbers. I suppose it doesn't matter all that much really. And BXT+ clearly can't go past 0x160000 since IIRC that's where some of the PHY/PLL stuff lives.

Quoted 6 lines

* TGL, ADL: 0x140000 - 0x15FFFF

Bspec: 134, 51771

<snip>

Quoted 13 lines

drivers/gpu/drm/i915/i915_reg.h line 1837

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +0 -7
-#define GEN6_GT_PERF_STATUS	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5948)
-#define BXT_GT_PERF_STATUS      _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x7070)
-#define GEN6_RP_STATE_LIMITS	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5994)
-#define GEN6_RP_STATE_CAP	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998)
-#define   RP0_CAP_MASK		REG_GENMASK(7, 0)
-#define   RP1_CAP_MASK		REG_GENMASK(15, 8)
-#define   RPN_CAP_MASK		REG_GENMASK(23, 16)
 #define BXT_RP_STATE_CAP        _MMIO(0x138170)
 #define GEN9_RP_STATE_LIMITS	_MMIO(0x138148)
 #define XEHPSDV_RP_STATE_CAP	_MMIO(0x250014)

:( This is a bit unfortunate. I wonder if we should make an exception for these and keep them all together somewhere?

I don't really see a problem with having them in separate headers. We have other stuff like ILK_GDSR / GEN6_GDRST that also used to be in the MCHBAR and then moved to the GT proper. I believe the MCHBAR mirror is going away completely a platform or two down the road and all the important registers are migrating to non-MCHBAR offsets, so if we try to keep them all together, that defeats most of the purpose of having a separate MCHBAR header?

Quoted 8 lines

<snip>

drivers/gpu/drm/i915/i915_reg.h

Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +1 -2
-/* Memory latency timer register */
-#define MLTR_ILK		_MMIO(0x11222)
+#define MLTR_ILK				_MMIO(MCHBAR_MIRROR_BASE + 0x1222)

I'd prefer to see a separate patch for the s/number/MCHBAR_MIRROR_BASE/ stuff. Very hard to review those in this form.

Good point; I'll fix that.

Matt

Quoted 4 lines
Signature · 3 lines
-- 
Ville Syrjälä
Intel
Signature · 5 lines
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
#6 lore raw
Quoted 10 lines · Matt Roper
Quoted 9 lines · Ville Syrjälä
Quoted 7 lines · Matt Roper

Registers that exist within the MCH BAR and are mirrored into the GPU's MMIO space are a good candidate to separate out into their own header.

For reference, the mirror of the MCH BAR lives at the following locations in the graphics MMIO space:

* Pre-gen6: 0x10000 - 0x13000

Quoted 7 lines
Quoted 1 line

Should go up to 0x14000 according to some docs I have.

I think I was looking at a gm45 PRM for this. Given the spotty documentation on the older platforms and the number of different end points there seem to be, maybe it's a better idea to just give the starting offset in the commit message and say that the upper bound varies.

Sounds good.

Quoted 30 lines
Quoted 16 lines
Quoted 3 lines

* Gen6-Gen11 + RKL: 0x140000 - 0x14FFFF

Some docs say this goes up to 0x180000, other docs have different numbers. I suppose it doesn't matter all that much really. And BXT+ clearly can't go past 0x160000 since IIRC that's where some of the PHY/PLL stuff lives.

Quoted 6 lines

* TGL, ADL: 0x140000 - 0x15FFFF

Bspec: 134, 51771

<snip>

Quoted 13 lines

drivers/gpu/drm/i915/i915_reg.h line 1837

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +0 -7
-#define GEN6_GT_PERF_STATUS	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5948)
-#define BXT_GT_PERF_STATUS      _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x7070)
-#define GEN6_RP_STATE_LIMITS	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5994)
-#define GEN6_RP_STATE_CAP	_MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998)
-#define   RP0_CAP_MASK		REG_GENMASK(7, 0)
-#define   RP1_CAP_MASK		REG_GENMASK(15, 8)
-#define   RPN_CAP_MASK		REG_GENMASK(23, 16)
 #define BXT_RP_STATE_CAP        _MMIO(0x138170)
 #define GEN9_RP_STATE_LIMITS	_MMIO(0x138148)
 #define XEHPSDV_RP_STATE_CAP	_MMIO(0x250014)

:( This is a bit unfortunate. I wonder if we should make an exception for these and keep them all together somewhere?

Quoted 3 lines

I don't really see a problem with having them in separate headers. We have other stuff like ILK_GDSR / GEN6_GDRST that also used to be in the MCHBAR and then moved to the GT proper.

ILK_GDSR is not just about the GT but it can reset the display engine too. IIRC GEN6_GDRST can't do that.

Quoted 5 lines

I believe the MCHBAR mirror is
going away completely a platform or two down the road and all the important registers are migrating to non-MCHBAR offsets, so if we try to keep them all together, that defeats most of the purpose of having a separate MCHBAR header?

Not sure. Sadly there is no clear theme to some of the MCHBAR registers so I'm not sure where else we'd place them (assuming the plan is basically to hollow out i915_regs.h).

I guess we could start with what you have here and if it turns out annoying we can always come up with something different later.

Signature · 2 lines
Ville Syrjälä
Intel