Commit 96e023e7 authored by Alistair Popple's avatar Alistair Popple Committed by Michael Ellerman

powerpc/powernv: Reorder OPAL subsystem initialisation

Most of the OPAL subsystems are always compiled in for PowerNV and
many of them need to be initialised before or after other OPAL
subsystems. Rather than trying to control this ordering through
machine initcalls it is clearer and easier to control initialisation
order with explicit calls in opal_init.
Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
Cc: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 5703d2f4
......@@ -240,6 +240,9 @@ extern int opal_elog_init(void);
extern void opal_platform_dump_init(void);
extern void opal_sys_param_init(void);
extern void opal_msglog_init(void);
extern int opal_async_comp_init(void);
extern int opal_sensor_init(void);
extern int opal_hmi_handler_init(void);
extern int opal_machine_check(struct pt_regs *regs);
extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
......
......@@ -151,7 +151,7 @@ static struct notifier_block opal_async_comp_nb = {
.priority = 0,
};
static int __init opal_async_comp_init(void)
int __init opal_async_comp_init(void)
{
struct device_node *opal_node;
const __be32 *async;
......@@ -205,4 +205,3 @@ static int __init opal_async_comp_init(void)
out:
return err;
}
machine_subsys_initcall(powernv, opal_async_comp_init);
......@@ -170,7 +170,7 @@ static struct notifier_block opal_hmi_handler_nb = {
.priority = 0,
};
static int __init opal_hmi_handler_init(void)
int __init opal_hmi_handler_init(void)
{
int ret;
......@@ -186,4 +186,3 @@ static int __init opal_hmi_handler_init(void)
}
return 0;
}
machine_subsys_initcall(powernv, opal_hmi_handler_init);
......@@ -144,4 +144,4 @@ static int __init opal_mem_err_init(void)
}
return 0;
}
machine_subsys_initcall(powernv, opal_mem_err_init);
machine_device_initcall(powernv, opal_mem_err_init);
......@@ -77,7 +77,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data)
}
EXPORT_SYMBOL_GPL(opal_get_sensor_data);
static __init int opal_sensor_init(void)
int __init opal_sensor_init(void)
{
struct platform_device *pdev;
struct device_node *sensor;
......@@ -93,4 +93,3 @@ static __init int opal_sensor_init(void)
return PTR_ERR_OR_ZERO(pdev);
}
machine_subsys_initcall(powernv, opal_sensor_init);
......@@ -393,7 +393,6 @@ static int __init opal_message_init(void)
}
return 0;
}
machine_early_initcall(powernv, opal_message_init);
int opal_get_chars(uint32_t vtermno, char *buf, int count)
{
......@@ -807,6 +806,18 @@ static int __init opal_init(void)
of_node_put(consoles);
}
/* Initialise OPAL messaging system */
opal_message_init();
/* Initialise OPAL asynchronous completion interface */
opal_async_comp_init();
/* Initialise OPAL sensor interface */
opal_sensor_init();
/* Initialise OPAL hypervisor maintainence interrupt handling */
opal_hmi_handler_init();
/* Create i2c platform devices */
opal_i2c_create_devs();
......
Markdown is supported
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