From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 05/12] drm/i915: Fix DRAM size reporting for BXT
Date: Wed, 6 Mar 2019 22:35:44 +0200 [thread overview]
Message-ID: <20190306203551.24592-6-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190306203551.24592-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The BXT DUNIT register tells us the size of each DRAM device
in Gb. We want to report the size of the whole DIMM in GB, so
that it matches how we report it for non-LP platforms.
v2: Deobfuscate the math (Chris)
s/GB/GBIT/ in the register bit definitions (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 17 +++++++++++------
drivers/gpu/drm/i915/i915_reg.h | 10 +++++-----
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index bba051d9f21d..a3cf74a00b3f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1242,15 +1242,15 @@ skl_get_dram_info(struct drm_i915_private *dev_priv)
static int bxt_get_dimm_size(u32 val)
{
switch (val & BXT_DRAM_SIZE_MASK) {
- case BXT_DRAM_SIZE_4GB:
+ case BXT_DRAM_SIZE_4GBIT:
return 4;
- case BXT_DRAM_SIZE_6GB:
+ case BXT_DRAM_SIZE_6GBIT:
return 6;
- case BXT_DRAM_SIZE_8GB:
+ case BXT_DRAM_SIZE_8GBIT:
return 8;
- case BXT_DRAM_SIZE_12GB:
+ case BXT_DRAM_SIZE_12GBIT:
return 12;
- case BXT_DRAM_SIZE_16GB:
+ case BXT_DRAM_SIZE_16GBIT:
return 16;
default:
MISSING_CASE(val);
@@ -1287,9 +1287,14 @@ static int bxt_get_dimm_ranks(u32 val)
static void bxt_get_dimm_info(struct dram_dimm_info *dimm,
u32 val)
{
- dimm->size = bxt_get_dimm_size(val);
dimm->width = bxt_get_dimm_width(val);
dimm->ranks = bxt_get_dimm_ranks(val);
+
+ /*
+ * Size in register is Gb per DRAM device. Convert to total
+ * GB to match the way we report this for non-LP platforms.
+ */
+ dimm->size = bxt_get_dimm_size(val) * intel_dimm_num_devices(dimm) / 8;
}
static int
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 16ce9c609c65..75236b4f0daf 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -9856,11 +9856,11 @@ enum skl_power_gate {
#define BXT_DRAM_WIDTH_X64 (0x3 << 4)
#define BXT_DRAM_SIZE_MASK (0x7 << 6)
#define BXT_DRAM_SIZE_SHIFT 6
-#define BXT_DRAM_SIZE_4GB (0x0 << 6)
-#define BXT_DRAM_SIZE_6GB (0x1 << 6)
-#define BXT_DRAM_SIZE_8GB (0x2 << 6)
-#define BXT_DRAM_SIZE_12GB (0x3 << 6)
-#define BXT_DRAM_SIZE_16GB (0x4 << 6)
+#define BXT_DRAM_SIZE_4GBIT (0x0 << 6)
+#define BXT_DRAM_SIZE_6GBIT (0x1 << 6)
+#define BXT_DRAM_SIZE_8GBIT (0x2 << 6)
+#define BXT_DRAM_SIZE_12GBIT (0x3 << 6)
+#define BXT_DRAM_SIZE_16GBIT (0x4 << 6)
#define SKL_MEMORY_FREQ_MULTIPLIER_HZ 266666666
#define SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5E04)
--
2.19.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-03-06 20:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 20:35 [PATCH v2 00/12] Polish DRAM information readout code Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 01/12] drm/i915: Store DIMM rank information as a number Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 02/12] drm/i915: Extract functions to derive SKL+ DIMM info Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 03/12] drm/i915: Polish skl_is_16gb_dimm() Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 04/12] drm/i915: Extract BXT DIMM helpers Ville Syrjala
2019-03-06 20:35 ` Ville Syrjala [this message]
2019-03-06 20:35 ` [PATCH v2 06/12] drm/i915: Extract DIMM info on GLK too Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 07/12] drm/i915: Use dram_dimm_info more Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 08/12] drm/i915: Generalize intel_is_dram_symmetric() Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 09/12] drm/i914: s/l_info/dimm_l/ etc Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 10/12] drm/i915: Clean up intel_get_dram_info() a bit Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 11/12] drm/i915: Extract DIMM info on cnl+ Ville Syrjala
2019-03-06 20:35 ` [PATCH v2 12/12] drm/i915: Read out memory type Ville Syrjala
2019-03-06 20:57 ` ✗ Fi.CI.CHECKPATCH: warning for Polish DRAM information readout code (rev6) Patchwork
2019-03-06 21:02 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-06 21:21 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-06 23:51 ` ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2019-02-25 20:29 [PATCH 05/12] drm/i915: Fix DRAM size reporting for BXT Ville Syrjala
2019-02-26 15:27 ` [PATCH v2 " Ville Syrjala
2019-03-04 18:56 ` Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190306203551.24592-6-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox