Skip to content
Snippets Groups Projects
Commit 51abee64 authored by Laurentiu TUDOR's avatar Laurentiu TUDOR Committed by York Sun
Browse files

powerpc/85xx: fix broken cpu "clock-frequency" property


When indexing freqProcessor[] we use the first
value in the cpu's "reg" property, which on
new e6500 cores IDs the threads.
But freqProcessor[] should be indexed with a
core index so, when fixing "the clock-frequency"
cpu node property, access the freqProcessor[]
with the core index derived from the "reg' property.
If we don't do this, last half of the "cpu" nodes
will have broken "clock-frequency" values.

Signed-off-by: default avatarLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
Cc: York Sun <yorksun@freescale.com>
parent 8f9fe660
No related branches found
No related tags found
No related merge requests found
...@@ -586,6 +586,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) ...@@ -586,6 +586,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
{ {
int off; int off;
int val; int val;
int len;
sys_info_t sysinfo; sys_info_t sysinfo;
/* delete crypto node if not on an E-processor */ /* delete crypto node if not on an E-processor */
...@@ -615,8 +616,8 @@ void ft_cpu_setup(void *blob, bd_t *bd) ...@@ -615,8 +616,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
get_sys_info(&sysinfo); get_sys_info(&sysinfo);
off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
while (off != -FDT_ERR_NOTFOUND) { while (off != -FDT_ERR_NOTFOUND) {
u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0); u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", &len);
val = cpu_to_fdt32(sysinfo.freq_processor[*reg]); val = cpu_to_fdt32(sysinfo.freq_processor[(*reg) / (len / 4)]);
fdt_setprop(blob, off, "clock-frequency", &val, 4); fdt_setprop(blob, off, "clock-frequency", &val, 4);
off = fdt_node_offset_by_prop_value(blob, off, "device_type", off = fdt_node_offset_by_prop_value(blob, off, "device_type",
"cpu", 4); "cpu", 4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment