2022-11-14 12:08:26

by Liu Peibao

[permalink] [raw]
Subject: [PATCH v2 0/2] irqchip: loongarch-cpu: add DT support

This patches add the DT support for LoongArch compatible CPU interrupt
controller.

V1 -> V2: patch2/2: update commit log and remove redundant description in yaml.

Liu Peibao (2):
irqchip: loongarch-cpu: add DT support
dt-bindings: interrupt-controller: add yaml for LoongArch CPU
interrupt controller

.../loongarch,cpu-interrupt-controller.yaml | 34 +++++++++++++++++++
drivers/irqchip/irq-loongarch-cpu.c | 19 +++++++++++
2 files changed, 53 insertions(+)
create mode 100644 Documentation/devicetree/bindings/interrupt-controller/loongarch,cpu-interrupt-controller.yaml

--
2.20.1



2022-11-14 13:51:31

by Liu Peibao

[permalink] [raw]
Subject: [PATCH v2 1/2] irqchip: loongarch-cpu: add DT support

LoongArch is coming to support booting with FDT, so DT
support of this driver is desired.

Signed-off-by: Liu Peibao <[email protected]>
---
drivers/irqchip/irq-loongarch-cpu.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
index 741612ba6a52..a28b7c549654 100644
--- a/drivers/irqchip/irq-loongarch-cpu.c
+++ b/drivers/irqchip/irq-loongarch-cpu.c
@@ -92,6 +92,25 @@ static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = {
.xlate = irq_domain_xlate_onecell,
};

+#ifdef CONFIG_OF
+int __init loongarch_cpu_irq_of_init(struct device_node *of_node,
+ struct device_node *parent)
+{
+ cpuintc_handle = of_node_to_fwnode(of_node);
+
+ irq_domain = irq_domain_create_linear(cpuintc_handle, EXCCODE_INT_NUM,
+ &loongarch_cpu_intc_irq_domain_ops, NULL);
+ if (!irq_domain)
+ panic("Failed to add irqdomain for loongarch CPU");
+
+ set_handle_irq(&handle_cpu_irq);
+
+ return 0;
+}
+IRQCHIP_DECLARE(cpu_intc, "loongson,cpu-interrupt-controller",
+ loongarch_cpu_irq_of_init);
+#endif
+
static int __init
liointc_parse_madt(union acpi_subtable_headers *header,
const unsigned long end)
--
2.20.1


2022-11-26 14:09:27

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [irqchip: irq/irqchip-next] irqchip: loongarch-cpu: add DT support

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID: 855d4ca4bdb366aab3d43408b74e02ab629d1d55
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/855d4ca4bdb366aab3d43408b74e02ab629d1d55
Author: Liu Peibao <[email protected]>
AuthorDate: Mon, 14 Nov 2022 19:38:23 +08:00
Committer: Marc Zyngier <[email protected]>
CommitterDate: Sat, 26 Nov 2022 11:54:11

irqchip: loongarch-cpu: add DT support

LoongArch is coming to support booting with FDT, so DT
support of this driver is desired.

Signed-off-by: Liu Peibao <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
drivers/irqchip/irq-loongarch-cpu.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
index 741612b..a28b7c5 100644
--- a/drivers/irqchip/irq-loongarch-cpu.c
+++ b/drivers/irqchip/irq-loongarch-cpu.c
@@ -92,6 +92,25 @@ static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = {
.xlate = irq_domain_xlate_onecell,
};

+#ifdef CONFIG_OF
+int __init loongarch_cpu_irq_of_init(struct device_node *of_node,
+ struct device_node *parent)
+{
+ cpuintc_handle = of_node_to_fwnode(of_node);
+
+ irq_domain = irq_domain_create_linear(cpuintc_handle, EXCCODE_INT_NUM,
+ &loongarch_cpu_intc_irq_domain_ops, NULL);
+ if (!irq_domain)
+ panic("Failed to add irqdomain for loongarch CPU");
+
+ set_handle_irq(&handle_cpu_irq);
+
+ return 0;
+}
+IRQCHIP_DECLARE(cpu_intc, "loongson,cpu-interrupt-controller",
+ loongarch_cpu_irq_of_init);
+#endif
+
static int __init
liointc_parse_madt(union acpi_subtable_headers *header,
const unsigned long end)

2022-12-02 03:14:50

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] irqchip: loongarch-cpu: add DT support

Hi, Peibao and Marc,

I found this patch has merged but lkp report a problem, this can
simply fixed by add "static" before loongarch_cpu_irq_of_init
definition. Since Marc's next branch hasn't been tagged yet, can
Peibao send a new version and Marc rebase it?

Huacai

On Mon, Nov 14, 2022 at 7:38 PM Liu Peibao <[email protected]> wrote:
>
> LoongArch is coming to support booting with FDT, so DT
> support of this driver is desired.
>
> Signed-off-by: Liu Peibao <[email protected]>
> ---
> drivers/irqchip/irq-loongarch-cpu.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
> index 741612ba6a52..a28b7c549654 100644
> --- a/drivers/irqchip/irq-loongarch-cpu.c
> +++ b/drivers/irqchip/irq-loongarch-cpu.c
> @@ -92,6 +92,25 @@ static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = {
> .xlate = irq_domain_xlate_onecell,
> };
>
> +#ifdef CONFIG_OF
> +int __init loongarch_cpu_irq_of_init(struct device_node *of_node,
> + struct device_node *parent)
> +{
> + cpuintc_handle = of_node_to_fwnode(of_node);
> +
> + irq_domain = irq_domain_create_linear(cpuintc_handle, EXCCODE_INT_NUM,
> + &loongarch_cpu_intc_irq_domain_ops, NULL);
> + if (!irq_domain)
> + panic("Failed to add irqdomain for loongarch CPU");
> +
> + set_handle_irq(&handle_cpu_irq);
> +
> + return 0;
> +}
> +IRQCHIP_DECLARE(cpu_intc, "loongson,cpu-interrupt-controller",
> + loongarch_cpu_irq_of_init);
> +#endif
> +
> static int __init
> liointc_parse_madt(union acpi_subtable_headers *header,
> const unsigned long end)
> --
> 2.20.1
>

2022-12-02 09:25:02

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] irqchip: loongarch-cpu: add DT support

On 2022-12-02 02:07, Huacai Chen wrote:
> Hi, Peibao and Marc,
>
> I found this patch has merged but lkp report a problem, this can
> simply fixed by add "static" before loongarch_cpu_irq_of_init
> definition. Since Marc's next branch hasn't been tagged yet, can
> Peibao send a new version and Marc rebase it?

Please send in a fix on top of the existing series.

Thanks,

M.
--
Jazz is not dead. It just smells funny...

2022-12-05 05:05:01

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] irqchip: loongarch-cpu: add DT support

On Fri, Dec 2, 2022 at 4:45 PM Marc Zyngier <[email protected]> wrote:
>
> On 2022-12-02 02:07, Huacai Chen wrote:
> > Hi, Peibao and Marc,
> >
> > I found this patch has merged but lkp report a problem, this can
> > simply fixed by add "static" before loongarch_cpu_irq_of_init
> > definition. Since Marc's next branch hasn't been tagged yet, can
> > Peibao send a new version and Marc rebase it?
>
> Please send in a fix on top of the existing series.
OK, I'll send a fix later.

Huacai
>
> Thanks,
>
> M.
> --
> Jazz is not dead. It just smells funny...