[Skiboot] [PATCH v2 04/17] xive/p9: introduce an operation backend for current and new drivers
Cédric Le Goater
clg at kaod.org
Fri Sep 13 18:49:39 AEST 2019
[ ... ]
> +void xive_cpu_callin(struct cpu_thread *cpu)
> +{
This is missing an extra test :
if (!cpu->xstate)
return;
to filter the xive call being done in __secondary_cpu_entry
on all platforms.
I will wait for some more comments before sending a v3.
C.
> + return xive_ops->cpu_callin(cpu);
> +}
> +
> +void *xive_get_trigger_port(uint32_t girq)
> +{
> + return xive_ops->get_trigger_port(girq);
> +}
> +
> +void xive_register_hw_source(uint32_t base, uint32_t count, uint32_t shift,
> + void *mmio, uint32_t flags, void *data,
> + const struct irq_source_ops *ops)
> +{
> + xive_ops->register_hw(base, count, shift, mmio, flags, data, ops);
> +}
> +
> +void xive_register_ipi_source(uint32_t base, uint32_t count, void *data,
> + const struct irq_source_ops *ops)
> +{
> + xive_ops->register_ipi(base, count, data, ops);
> +}
> +
> +void xive_cpu_reset(void)
> +{
> + xive_ops->cpu_reset();
> +}
> +
> +void xive_late_init(void)
> +{
> + xive_ops->late_init();
> +}
> +
> +struct xive_ops xive_p9_ops = {
> + .name = "POWER9 Interrupt Controller (XIVE)",
> + .compat = "ibm,power9-xive-x",
> +
> + .init = xive_p9_init,
> + .late_init = xive_p9_late_init,
> + .reset = xive_p9_reset,
> + .alloc_hw_irqs = xive_p9_alloc_hw_irqs,
> + .alloc_ipi_irqs = xive_p9_alloc_ipi_irqs,
> + .get_trigger_port = xive_p9_get_trigger_port,
> + .get_notify_port = xive_p9_get_notify_port,
> + .get_notify_base = xive_p9_get_notify_base,
> + .register_hw = xive_p9_register_hw_source,
> + .register_ipi = xive_p9_register_ipi_source,
> + .cpu_reset = xive_p9_cpu_reset,
> + .cpu_callin = xive_p9_cpu_callin,
> +};
> +
> +static struct xive_ops *xive_ops_table[] = {
> + &xive_p9_ops,
> +};
> +
> +static struct xive_ops *xive_ops_match(void)
> +{
> + struct dt_node *np;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(xive_ops_table); i++) {
> + dt_for_each_compatible(dt_root, np, xive_ops_table[i]->compat)
> + return xive_ops_table[i];
> + }
> +
> + return NULL;
> +}
> +
> +void init_xive(void)
> +{
> + xive_ops = xive_ops_match();
> + if (!xive_ops) {
> + return;
> + }
> +
> + prlog(PR_INFO, "XIVE: found %s\n", xive_ops->name);
> + xive_ops->init(xive_ops->compat);
> +}
>
More information about the Skiboot
mailing list