mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
lx_emul: allow different irqchip declarations
To enable other irqchip declarations beyond the lx_emul generic code base, make the ARM specific initialization routine public. Ref genodelabs/genode#4651
This commit is contained in:
parent
b2189ae88b
commit
9482355c47
@ -19,6 +19,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct irq_desc;
|
||||
struct device_node;
|
||||
|
||||
void lx_emul_irq_unmask(unsigned int irq);
|
||||
|
||||
@ -32,6 +33,7 @@ extern void * lx_emul_irq_task_struct;
|
||||
|
||||
unsigned int lx_emul_irq_last(void);
|
||||
|
||||
int lx_emul_irq_init(struct device_node *node, struct device_node *parent);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -68,6 +68,12 @@ static int dde_domain_translate(struct irq_domain * d,
|
||||
unsigned long * hwirq,
|
||||
unsigned int * type)
|
||||
{
|
||||
if (fwspec->param_count == 1) {
|
||||
*hwirq = fwspec->param[0];
|
||||
*type = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_of_node(fwspec->fwnode)) {
|
||||
if (fwspec->param_count != 3 || fwspec->param[0] != 0)
|
||||
return -EINVAL;
|
||||
@ -114,17 +120,9 @@ static const struct irq_domain_ops dde_irqchip_data_domain_ops = {
|
||||
};
|
||||
|
||||
|
||||
static const struct of_device_id dde_of_match[] = {
|
||||
{ .compatible = "arm,gic-v3", .data = (const void *) 4 },
|
||||
{ .compatible = "arm,cortex-a9-gic", .data = (const void *) 4 },
|
||||
{ .compatible = "arm,gic-400", .data = (const void *) 4 },
|
||||
{ /* END */ }
|
||||
};
|
||||
|
||||
static struct irq_domain *dde_irq_domain;
|
||||
|
||||
static int __init dde_irqchip_init(struct device_node *node,
|
||||
struct device_node *parent)
|
||||
int lx_emul_irq_init(struct device_node *node, struct device_node *parent)
|
||||
{
|
||||
dde_irq_domain = irq_domain_create_tree(&node->fwnode,
|
||||
&dde_irqchip_data_domain_ops, NULL);
|
||||
@ -160,9 +158,9 @@ void lx_emul_register_of_irqchip_initcall(char const *compat, void *fn)
|
||||
}
|
||||
|
||||
|
||||
IRQCHIP_DECLARE(dde_gic_v3, "arm,gic-v3", dde_irqchip_init);
|
||||
IRQCHIP_DECLARE(dde_gic_a9, "arm,cortex-a9-gic", dde_irqchip_init);
|
||||
IRQCHIP_DECLARE(dde_gic_400, "arm,gic-400", dde_irqchip_init);
|
||||
IRQCHIP_DECLARE(dde_gic_v3, "arm,gic-v3", lx_emul_irq_init);
|
||||
IRQCHIP_DECLARE(dde_gic_a9, "arm,cortex-a9-gic", lx_emul_irq_init);
|
||||
IRQCHIP_DECLARE(dde_gic_400, "arm,gic-400", lx_emul_irq_init);
|
||||
|
||||
|
||||
int lx_emul_irq_task_function(void * data)
|
||||
|
@ -31,6 +31,12 @@ static void dde_irq_mask(struct irq_data *d)
|
||||
}
|
||||
|
||||
|
||||
int lx_emul_irq_init(struct device_node *node, struct device_node *parent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct irq_chip dde_irqchip_data_chip = {
|
||||
.name = "dde-irqs",
|
||||
.irq_mask = dde_irq_mask,
|
||||
|
Loading…
x
Reference in New Issue
Block a user