Commit 498f02b6 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Matt Roper

drm/i915: split general MMIO setup from per-GT uncore init

In coming patches we'll be doing the actual tile initialization between
these two uncore init phases.
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211029032817.3747750-3-matthew.d.roper@intel.com
parent fd4d7904
...@@ -415,10 +415,14 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv) ...@@ -415,10 +415,14 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = intel_uncore_init_mmio(&dev_priv->uncore); ret = intel_uncore_setup_mmio(&dev_priv->uncore);
if (ret < 0) if (ret < 0)
goto err_bridge; goto err_bridge;
ret = intel_uncore_init_mmio(&dev_priv->uncore);
if (ret)
goto err_mmio;
/* Try to make sure MCHBAR is enabled before poking at it */ /* Try to make sure MCHBAR is enabled before poking at it */
intel_setup_mchbar(dev_priv); intel_setup_mchbar(dev_priv);
intel_device_info_runtime_init(dev_priv); intel_device_info_runtime_init(dev_priv);
...@@ -435,6 +439,8 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv) ...@@ -435,6 +439,8 @@ static int i915_driver_mmio_probe(struct drm_i915_private *dev_priv)
err_uncore: err_uncore:
intel_teardown_mchbar(dev_priv); intel_teardown_mchbar(dev_priv);
intel_uncore_fini_mmio(&dev_priv->uncore); intel_uncore_fini_mmio(&dev_priv->uncore);
err_mmio:
intel_uncore_cleanup_mmio(&dev_priv->uncore);
err_bridge: err_bridge:
pci_dev_put(dev_priv->bridge_dev); pci_dev_put(dev_priv->bridge_dev);
...@@ -449,6 +455,7 @@ static void i915_driver_mmio_release(struct drm_i915_private *dev_priv) ...@@ -449,6 +455,7 @@ static void i915_driver_mmio_release(struct drm_i915_private *dev_priv)
{ {
intel_teardown_mchbar(dev_priv); intel_teardown_mchbar(dev_priv);
intel_uncore_fini_mmio(&dev_priv->uncore); intel_uncore_fini_mmio(&dev_priv->uncore);
intel_uncore_cleanup_mmio(&dev_priv->uncore);
pci_dev_put(dev_priv->bridge_dev); pci_dev_put(dev_priv->bridge_dev);
} }
......
...@@ -2020,7 +2020,7 @@ static int i915_pmic_bus_access_notifier(struct notifier_block *nb, ...@@ -2020,7 +2020,7 @@ static int i915_pmic_bus_access_notifier(struct notifier_block *nb,
return NOTIFY_OK; return NOTIFY_OK;
} }
static int uncore_mmio_setup(struct intel_uncore *uncore) int intel_uncore_setup_mmio(struct intel_uncore *uncore)
{ {
struct drm_i915_private *i915 = uncore->i915; struct drm_i915_private *i915 = uncore->i915;
struct pci_dev *pdev = to_pci_dev(i915->drm.dev); struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
...@@ -2053,7 +2053,7 @@ static int uncore_mmio_setup(struct intel_uncore *uncore) ...@@ -2053,7 +2053,7 @@ static int uncore_mmio_setup(struct intel_uncore *uncore)
return 0; return 0;
} }
static void uncore_mmio_cleanup(struct intel_uncore *uncore) void intel_uncore_cleanup_mmio(struct intel_uncore *uncore)
{ {
struct pci_dev *pdev = to_pci_dev(uncore->i915->drm.dev); struct pci_dev *pdev = to_pci_dev(uncore->i915->drm.dev);
...@@ -2146,10 +2146,6 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore) ...@@ -2146,10 +2146,6 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore)
struct drm_i915_private *i915 = uncore->i915; struct drm_i915_private *i915 = uncore->i915;
int ret; int ret;
ret = uncore_mmio_setup(uncore);
if (ret)
return ret;
/* /*
* The boot firmware initializes local memory and assesses its health. * The boot firmware initializes local memory and assesses its health.
* If memory training fails, the punit will have been instructed to * If memory training fails, the punit will have been instructed to
...@@ -2170,7 +2166,7 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore) ...@@ -2170,7 +2166,7 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore)
} else { } else {
ret = uncore_forcewake_init(uncore); ret = uncore_forcewake_init(uncore);
if (ret) if (ret)
goto out_mmio_cleanup; return ret;
} }
/* make sure fw funcs are set if and only if we have fw*/ /* make sure fw funcs are set if and only if we have fw*/
...@@ -2192,11 +2188,6 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore) ...@@ -2192,11 +2188,6 @@ int intel_uncore_init_mmio(struct intel_uncore *uncore)
drm_dbg(&i915->drm, "unclaimed mmio detected on uncore init, clearing\n"); drm_dbg(&i915->drm, "unclaimed mmio detected on uncore init, clearing\n");
return 0; return 0;
out_mmio_cleanup:
uncore_mmio_cleanup(uncore);
return ret;
} }
/* /*
...@@ -2261,8 +2252,6 @@ void intel_uncore_fini_mmio(struct intel_uncore *uncore) ...@@ -2261,8 +2252,6 @@ void intel_uncore_fini_mmio(struct intel_uncore *uncore)
intel_uncore_fw_domains_fini(uncore); intel_uncore_fw_domains_fini(uncore);
iosf_mbi_punit_release(); iosf_mbi_punit_release();
} }
uncore_mmio_cleanup(uncore);
} }
static const struct reg_whitelist { static const struct reg_whitelist {
......
...@@ -218,11 +218,13 @@ void ...@@ -218,11 +218,13 @@ void
intel_uncore_mmio_debug_init_early(struct intel_uncore_mmio_debug *mmio_debug); intel_uncore_mmio_debug_init_early(struct intel_uncore_mmio_debug *mmio_debug);
void intel_uncore_init_early(struct intel_uncore *uncore, void intel_uncore_init_early(struct intel_uncore *uncore,
struct drm_i915_private *i915); struct drm_i915_private *i915);
int intel_uncore_setup_mmio(struct intel_uncore *uncore);
int intel_uncore_init_mmio(struct intel_uncore *uncore); int intel_uncore_init_mmio(struct intel_uncore *uncore);
void intel_uncore_prune_engine_fw_domains(struct intel_uncore *uncore, void intel_uncore_prune_engine_fw_domains(struct intel_uncore *uncore,
struct intel_gt *gt); struct intel_gt *gt);
bool intel_uncore_unclaimed_mmio(struct intel_uncore *uncore); bool intel_uncore_unclaimed_mmio(struct intel_uncore *uncore);
bool intel_uncore_arm_unclaimed_mmio_detection(struct intel_uncore *uncore); bool intel_uncore_arm_unclaimed_mmio_detection(struct intel_uncore *uncore);
void intel_uncore_cleanup_mmio(struct intel_uncore *uncore);
void intel_uncore_fini_mmio(struct intel_uncore *uncore); void intel_uncore_fini_mmio(struct intel_uncore *uncore);
void intel_uncore_suspend(struct intel_uncore *uncore); void intel_uncore_suspend(struct intel_uncore *uncore);
void intel_uncore_resume_early(struct intel_uncore *uncore); void intel_uncore_resume_early(struct intel_uncore *uncore);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment