From 05f52a8dd7c7e402896e049fd24f83d56b70aff4 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 1 Sep 2014 14:18:06 +1000 Subject: core: Setup the OPAL DT node before platform probe The platform probe code might want to add things to it. While at it, make add_cpu_idle_state_properties() local to slw.c and call it from slw_init() instead of from add_opal_node(). Signed-off-by: Benjamin Herrenschmidt --- core/init.c | 6 +++--- core/opal.c | 1 - hw/slw.c | 4 +++- include/skiboot.h | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/init.c b/core/init.c index 03af34e..092b633 100644 --- a/core/init.c +++ b/core/init.c @@ -566,6 +566,9 @@ void __noreturn main_cpu_entry(const void *fdt, u32 master_cpu) /* Initialize host services. */ hservices_init(); + /* Add the /opal node to the device-tree */ + add_opal_node(); + /* * We probe the platform now. This means the platform probe gets * the opportunity to reserve additional areas of memory if needed. @@ -577,9 +580,6 @@ void __noreturn main_cpu_entry(const void *fdt, u32 master_cpu) /* Initialize the rest of the cpu thread structs */ init_all_cpus(); - /* Add the /opal node to the device-tree */ - add_opal_node(); - /* Allocate our split trace buffers now. Depends add_opal_node() */ init_trace_buffers(); diff --git a/core/opal.c b/core/opal.c index 502cb0a..fd5d008 100644 --- a/core/opal.c +++ b/core/opal.c @@ -147,7 +147,6 @@ void add_opal_node(void) add_opal_firmware_node(); add_associativity_ref_point(); memcons_add_properties(); - add_cpu_idle_state_properties(); } void opal_update_pending_evt(uint64_t evt_mask, uint64_t evt_values) diff --git a/hw/slw.c b/hw/slw.c index d709901..c0983ba 100644 --- a/hw/slw.c +++ b/hw/slw.c @@ -506,7 +506,7 @@ static struct cpu_idle_states power8_cpu_idle_states[] = { }; /* Add device tree properties to describe idle states */ -void add_cpu_idle_state_properties(void) +static void add_cpu_idle_state_properties(void) { struct dt_node *power_mgt; struct cpu_idle_states *states; @@ -940,6 +940,8 @@ void slw_init(void) for_each_chip(chip) slw_init_chip(chip); + + add_cpu_idle_state_properties(); } /* Workarounds while entering fast-sleep */ diff --git a/include/skiboot.h b/include/skiboot.h index 70fc99e..7ded831 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -192,7 +192,6 @@ extern void probe_p7ioc(void); extern void probe_phb3(void); extern void uart_init(bool enable_interrupt); extern void homer_init(void); -extern void add_cpu_idle_state_properties(void); extern void occ_pstates_init(void); extern void slw_init(void); extern void occ_fsp_init(void); -- cgit v1.1