Commit 7a20b74e authored by Andrew Jones's avatar Andrew Jones
Browse files

devicetree: cpu nodes may have 64-bit regs


Reported-by: Andre Przywara's avatarAndre Przywara <andre.przywara@arm.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
parent d35482d5
......@@ -40,7 +40,7 @@ int mpidr_to_cpu(uint64_t mpidr)
return -1;
}
static void cpu_set(int fdtnode __unused, u32 regval, void *info __unused)
static void cpu_set(int fdtnode __unused, u64 regval, void *info __unused)
{
int cpu = nr_cpus++;
......
......@@ -202,13 +202,14 @@ int dt_get_memory_params(struct dt_pbus_reg *regs, int nr_regs)
return node != -FDT_ERR_NOTFOUND ? node : nr;
}
int dt_for_each_cpu_node(void (*func)(int fdtnode, u32 regval, void *info),
int dt_for_each_cpu_node(void (*func)(int fdtnode, u64 regval, void *info),
void *info)
{
const struct fdt_property *prop;
int cpus, cpu, ret, len;
struct dt_reg raw_reg;
u32 nac, nsc;
u64 regval;
cpus = fdt_path_offset(fdt, "/cpus");
if (cpus < 0)
......@@ -233,7 +234,11 @@ int dt_for_each_cpu_node(void (*func)(int fdtnode, u32 regval, void *info),
if (ret < 0)
return ret;
func(cpu, raw_reg.address_cells[0], info);
regval = raw_reg.address_cells[0];
if (nac == 2)
regval = (regval << 32) | raw_reg.address_cells[1];
func(cpu, regval, info);
}
return 0;
......
......@@ -234,7 +234,7 @@ extern int dt_get_memory_params(struct dt_pbus_reg *regs, int nr_regs);
* - zero on success
* - a negative FDT_ERR_* value on failure
*/
extern int dt_for_each_cpu_node(void (*func)(int fdtnode, u32 regval,
extern int dt_for_each_cpu_node(void (*func)(int fdtnode, u64 regval,
void *info), void *info);
#endif /* _DEVICETREE_H_ */
......@@ -40,7 +40,7 @@ struct cpu_set_params {
static char exception_stack[NR_CPUS][EXCEPTION_STACK_SIZE];
static void cpu_set(int fdtnode, u32 regval, void *info)
static void cpu_set(int fdtnode, u64 regval, void *info)
{
static bool read_common_info = false;
struct cpu_set_params *params = info;
......
......@@ -75,7 +75,7 @@ struct start_threads start_cpu(int cpu_node, secondary_entry_fn entry,
return (struct start_threads) { nr_threads, nr_started };
}
static void start_each_secondary(int fdtnode, u32 regval __unused, void *info)
static void start_each_secondary(int fdtnode, u64 regval __unused, void *info)
{
struct secondary_entry_data *datap = info;
struct start_threads ret = start_cpu(fdtnode, datap->entry, datap->r3);
......
......@@ -14,7 +14,7 @@
#include <devicetree.h>
/* Check "ibm,pa-features" property of a CPU node for the TM flag */
static void cpu_has_tm(int fdtnode, u32 regval __unused, void *ptr)
static void cpu_has_tm(int fdtnode, u64 regval __unused, void *ptr)
{
const struct fdt_property *prop;
int plen;
......
Supports Markdown
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