/* * Note that this only reads the state of the FSB * straps, not the actual FSB frequency. Some BIOSen * let you configure each independently. Ideally we'd * read out the actual FSB frequency but sadly we * don't know which registers have that information, * and all the relevant docs have gone to bit heaven :(
*/
fsb = intel_uncore_read(&i915->uncore, CLKCFG) & CLKCFG_FSB_MASK;
if (IS_PINEVIEW(i915) || IS_MOBILE(i915)) { switch (fsb) { case CLKCFG_FSB_400: return 400000; case CLKCFG_FSB_533: return 533333; case CLKCFG_FSB_667: return 666667; case CLKCFG_FSB_800: return 800000; case CLKCFG_FSB_1067: return 1066667; case CLKCFG_FSB_1333: return 1333333; default:
MISSING_CASE(fsb); return 1333333;
}
} else { switch (fsb) { case CLKCFG_FSB_400_ALT: return 400000; case CLKCFG_FSB_533: return 533333; case CLKCFG_FSB_667: return 666667; case CLKCFG_FSB_800: return 800000; case CLKCFG_FSB_1067_ALT: return 1066667; case CLKCFG_FSB_1333_ALT: return 1333333; case CLKCFG_FSB_1600_ALT: return 1600000; default:
MISSING_CASE(fsb); return 1333333;
}
}
}
val = intel_uncore_read(&i915->uncore,
SKL_MAD_DIMM_CH0_0_0_0_MCHBAR_MCMAIN);
ret = skl_dram_get_channel_info(i915, &ch0, 0, val); if (ret == 0)
dram_info->num_channels++;
val = intel_uncore_read(&i915->uncore,
SKL_MAD_DIMM_CH1_0_0_0_MCHBAR_MCMAIN);
ret = skl_dram_get_channel_info(i915, &ch1, 1, val); if (ret == 0)
dram_info->num_channels++;
if (dram_info->num_channels == 0) {
drm_info(&i915->drm, "Number of memory channels is zero\n"); return -EINVAL;
}
if (ch0.ranks == 0 && ch1.ranks == 0) {
drm_info(&i915->drm, "couldn't get memory rank information\n"); return -EINVAL;
}
/* * 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);
}
/* * Now read each DUNIT8/9/10/11 to check the rank of each dimms.
*/ for (i = BXT_D_CR_DRP0_DUNIT_START; i <= BXT_D_CR_DRP0_DUNIT_END; i++) { struct dram_dimm_info dimm; enum intel_dram_type type;
val = intel_uncore_read(&i915->uncore, BXT_D_CR_DRP0_DUNIT(i)); if (val == 0xFFFFFFFF) continue;
dram_info->num_channels++;
bxt_get_dimm_info(&dimm, val);
type = bxt_get_dimm_type(val);
switch (REG_FIELD_GET(MTL_DDR_TYPE_MASK, val)) { case 0:
dram_info->type = INTEL_DRAM_DDR4; break; case 1:
dram_info->type = INTEL_DRAM_DDR5; break; case 2:
dram_info->type = INTEL_DRAM_LPDDR5; break; case 3:
dram_info->type = INTEL_DRAM_LPDDR4; break; case 4:
dram_info->type = INTEL_DRAM_DDR3; break; case 5:
dram_info->type = INTEL_DRAM_LPDDR3; break; case 8:
drm_WARN_ON(&i915->drm, !IS_DGFX(i915));
dram_info->type = INTEL_DRAM_GDDR; break; case 9:
drm_WARN_ON(&i915->drm, !IS_DGFX(i915));
dram_info->type = INTEL_DRAM_GDDR_ECC; break; default:
MISSING_CASE(val); return -EINVAL;
}
dram_info->num_channels = REG_FIELD_GET(MTL_N_OF_POPULATED_CH_MASK, val);
dram_info->num_qgv_points = REG_FIELD_GET(MTL_N_OF_ENABLED_QGV_POINTS_MASK, val); /* PSF GV points not supported in D14+ */
return 0;
}
int intel_dram_detect(struct drm_i915_private *i915)
{ struct dram_info *dram_info; int ret;
detect_fsb_freq(i915);
detect_mem_freq(i915);
if (GRAPHICS_VER(i915) < 9 || IS_DG2(i915) || !HAS_DISPLAY(i915)) return 0;
dram_info = drmm_kzalloc(&i915->drm, sizeof(*dram_info), GFP_KERNEL); if (!dram_info) return -ENOMEM;
i915->dram_info = dram_info;
/* * Assume level 0 watermark latency adjustment is needed until proven * otherwise, this w/a is not needed by bxt/glk.
*/
dram_info->wm_lv_0_adjust_needed = !IS_BROXTON(i915) && !IS_GEMINILAKE(i915);
if (DISPLAY_VER(i915) >= 14)
ret = xelpdp_get_dram_info(i915, dram_info); elseif (GRAPHICS_VER(i915) >= 12)
ret = gen12_get_dram_info(i915, dram_info); elseif (GRAPHICS_VER(i915) >= 11)
ret = gen11_get_dram_info(i915, dram_info); elseif (IS_BROXTON(i915) || IS_GEMINILAKE(i915))
ret = bxt_get_dram_info(i915, dram_info); else
ret = skl_get_dram_info(i915, dram_info);
/* * Returns NULL for platforms that don't have dram info. Avoid overzealous NULL * checks, and prefer not dereferencing on platforms that shouldn't look at dram * info, to catch accidental and incorrect dram info checks.
*/ conststruct dram_info *intel_dram_info(struct drm_device *drm)
{ struct drm_i915_private *i915 = to_i915(drm);
/* NB: We can't write IDICR yet because we don't have gt funcs set up */
if (!(edram_cap & EDRAM_ENABLED)) return;
/* * The needed capability bits for size calculation are not there with * pre gen9 so return 128MB always.
*/ if (GRAPHICS_VER(i915) < 9)
i915->edram_size_mb = 128; else
i915->edram_size_mb = gen9_edram_size_mb(i915, edram_cap);
drm_info(&i915->drm, "Found %uMB of eDRAM\n", i915->edram_size_mb);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.28 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.