x86: ivybridge: Set up the thermal target correctly
This uses a non-existent node at present. It should use the first CPU node. The referenced property does not exist (the correct value is the default of 0), but this allows the follow-on init to complete. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
9d156b5725
commit
709b1902d2
|
@ -283,18 +283,13 @@ static void configure_c_states(void)
|
||||||
msr_write(MSR_PP1_CURRENT_CONFIG, msr);
|
msr_write(MSR_PP1_CURRENT_CONFIG, msr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int configure_thermal_target(void)
|
static int configure_thermal_target(struct udevice *dev)
|
||||||
{
|
{
|
||||||
int tcc_offset;
|
int tcc_offset;
|
||||||
msr_t msr;
|
msr_t msr;
|
||||||
int node;
|
|
||||||
|
|
||||||
/* Find pointer to CPU configuration */
|
tcc_offset = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "tcc-offset",
|
||||||
node = fdtdec_next_compatible(gd->fdt_blob, 0,
|
0);
|
||||||
COMPAT_INTEL_MODEL_206AX);
|
|
||||||
if (node < 0)
|
|
||||||
return -ENOENT;
|
|
||||||
tcc_offset = fdtdec_get_int(gd->fdt_blob, node, "tcc-offset", 0);
|
|
||||||
|
|
||||||
/* Set TCC activaiton offset if supported */
|
/* Set TCC activaiton offset if supported */
|
||||||
msr = msr_read(MSR_PLATFORM_INFO);
|
msr = msr_read(MSR_PLATFORM_INFO);
|
||||||
|
@ -403,7 +398,7 @@ static void configure_mca(void)
|
||||||
static unsigned ehci_debug_addr;
|
static unsigned ehci_debug_addr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int model_206ax_init(void)
|
static int model_206ax_init(struct udevice *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -445,7 +440,7 @@ static int model_206ax_init(void)
|
||||||
configure_misc();
|
configure_misc();
|
||||||
|
|
||||||
/* Thermal throttle activation offset */
|
/* Thermal throttle activation offset */
|
||||||
ret = configure_thermal_target();
|
ret = configure_thermal_target(dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("Cannot set thermal target\n");
|
debug("Cannot set thermal target\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -468,6 +463,10 @@ static int model_206ax_init(void)
|
||||||
|
|
||||||
static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info)
|
static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info)
|
||||||
{
|
{
|
||||||
|
msr_t msr;
|
||||||
|
|
||||||
|
msr = msr_read(IA32_PERF_CTL);
|
||||||
|
info->cpu_freq = ((msr.lo >> 8) & 0xff) * SANDYBRIDGE_BCLK * 1000000;
|
||||||
info->features = 1 << CPU_FEAT_L1_CACHE | 1 << CPU_FEAT_MMU;
|
info->features = 1 << CPU_FEAT_L1_CACHE | 1 << CPU_FEAT_MMU;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -481,7 +480,7 @@ static int model_206ax_get_count(struct udevice *dev)
|
||||||
static int cpu_x86_model_206ax_probe(struct udevice *dev)
|
static int cpu_x86_model_206ax_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
if (dev->seq == 0)
|
if (dev->seq == 0)
|
||||||
model_206ax_init();
|
model_206ax_init(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue