2020-11-30 03:27:21

by Biwen Li (OSS)

[permalink] [raw]
Subject: [v3 01/11] irqchip: ls-extirq: Add LS1043A, LS1088A external interrupt

From: Hou Zhiqiang <[email protected]>

Add an new IRQ chip declaration for LS1043A and LS1088A
- compatible "fsl,ls1043a-extirq" for LS1043A, LS1046A.
- compatible "fsl,ls1088a-extirq" for LS1088A, LS208xA, LX216xA

Signed-off-by: Hou Zhiqiang <[email protected]>
Signed-off-by: Biwen Li <[email protected]>
---
Change in v3:
- cleanup code
- remove robust copyright

Change in v2:
- add despcription of bit reverse
- update copyright

drivers/irqchip/irq-ls-extirq.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index 4d1179fed77c..47804ce78b21 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -18,7 +18,7 @@
struct ls_extirq_data {
struct regmap *syscon;
u32 intpcr;
- bool bit_reverse;
+ bool is_ls1021a_or_ls1043a;
u32 nirq;
struct irq_fwspec map[MAXIRQ];
};
@@ -30,7 +30,7 @@ ls_extirq_set_type(struct irq_data *data, unsigned int type)
irq_hw_number_t hwirq = data->hwirq;
u32 value, mask;

- if (priv->bit_reverse)
+ if (priv->is_ls1021a_or_ls1043a)
mask = 1U << (31 - hwirq);
else
mask = 1U << hwirq;
@@ -174,14 +174,9 @@ ls_extirq_of_init(struct device_node *node, struct device_node *parent)
if (ret)
goto out;

- if (of_device_is_compatible(node, "fsl,ls1021a-extirq")) {
- u32 revcr;
-
- ret = regmap_read(priv->syscon, LS1021A_SCFGREVCR, &revcr);
- if (ret)
- goto out;
- priv->bit_reverse = (revcr != 0);
- }
+ if (of_device_is_compatible(node, "fsl,ls1021a-extirq") || \
+ of_device_is_compatible(node, "fsl,ls1043a-extirq"))
+ priv->is_ls1021a_or_ls1043a = true;

domain = irq_domain_add_hierarchy(parent_domain, 0, priv->nirq, node,
&extirq_domain_ops, priv);
@@ -195,3 +190,5 @@ ls_extirq_of_init(struct device_node *node, struct device_node *parent)
}

IRQCHIP_DECLARE(ls1021a_extirq, "fsl,ls1021a-extirq", ls_extirq_of_init);
+IRQCHIP_DECLARE(ls1043a_extirq, "fsl,ls1043a-extirq", ls_extirq_of_init);
+IRQCHIP_DECLARE(ls1088a_extirq, "fsl,ls1088a-extirq", ls_extirq_of_init);
--
2.17.1


2020-11-30 03:28:50

by Biwen Li (OSS)

[permalink] [raw]
Subject: [v3 10/11] arm64: dts: lx2160ardb: fix interrupt line for RTC node

From: Biwen Li <[email protected]>

Fix interrupt line for RTC node on lx2160ardb

Signed-off-by: Biwen Li <[email protected]>
---
Change in v3:
- none

Change in v2:
- none

arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts
index 54fe8cd3a711..f3bab76797fb 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts
@@ -2,7 +2,7 @@
//
// Device Tree file for LX2160ARDB
//
-// Copyright 2018 NXP
+// Copyright 2018-2020 NXP

/dts-v1/;

@@ -151,8 +151,8 @@
rtc@51 {
compatible = "nxp,pcf2129";
reg = <0x51>;
- // IRQ10_B
- interrupts = <0 150 0x4>;
+ /* IRQ_RTC_B -> IRQ08, active low */
+ interrupts-extended = <&extirq 8 IRQ_TYPE_LEVEL_LOW>;
};
};

--
2.17.1

2020-11-30 08:23:27

by Marc Zyngier

[permalink] [raw]
Subject: Re: [v3 01/11] irqchip: ls-extirq: Add LS1043A, LS1088A external interrupt

[- jason]

On 2020-11-30 03:30, Biwen Li wrote:
> From: Hou Zhiqiang <[email protected]>
>
> Add an new IRQ chip declaration for LS1043A and LS1088A
> - compatible "fsl,ls1043a-extirq" for LS1043A, LS1046A.
> - compatible "fsl,ls1088a-extirq" for LS1088A, LS208xA, LX216xA
>
> Signed-off-by: Hou Zhiqiang <[email protected]>
> Signed-off-by: Biwen Li <[email protected]>
> ---
> Change in v3:
> - cleanup code
> - remove robust copyright
>
> Change in v2:
> - add despcription of bit reverse
> - update copyright
>
> drivers/irqchip/irq-ls-extirq.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/irqchip/irq-ls-extirq.c
> b/drivers/irqchip/irq-ls-extirq.c
> index 4d1179fed77c..47804ce78b21 100644
> --- a/drivers/irqchip/irq-ls-extirq.c
> +++ b/drivers/irqchip/irq-ls-extirq.c
> @@ -18,7 +18,7 @@
> struct ls_extirq_data {
> struct regmap *syscon;
> u32 intpcr;
> - bool bit_reverse;
> + bool is_ls1021a_or_ls1043a;
> u32 nirq;
> struct irq_fwspec map[MAXIRQ];
> };
> @@ -30,7 +30,7 @@ ls_extirq_set_type(struct irq_data *data, unsigned
> int type)
> irq_hw_number_t hwirq = data->hwirq;
> u32 value, mask;
>
> - if (priv->bit_reverse)
> + if (priv->is_ls1021a_or_ls1043a)
> mask = 1U << (31 - hwirq);
> else
> mask = 1U << hwirq;
> @@ -174,14 +174,9 @@ ls_extirq_of_init(struct device_node *node,
> struct device_node *parent)
> if (ret)
> goto out;
>
> - if (of_device_is_compatible(node, "fsl,ls1021a-extirq")) {
> - u32 revcr;
> -
> - ret = regmap_read(priv->syscon, LS1021A_SCFGREVCR, &revcr);
> - if (ret)
> - goto out;
> - priv->bit_reverse = (revcr != 0);
> - }

This isn't explained in the commit message. You are changing the way
you infer some properties, and that's not innocent. Please describe
all important changes in the commit message.

> + if (of_device_is_compatible(node, "fsl,ls1021a-extirq") || \

Spurious trailing \?

> + of_device_is_compatible(node, "fsl,ls1043a-extirq"))
> + priv->is_ls1021a_or_ls1043a = true;

Which is better written as:

priv->is_ls1021a_or_ls1043a = (of_device_is_compatible(node,
"fsl,ls1021a-extirq") ||
of_device_is_compatible(node,
"fsl,ls1043a-extirq"));
>
> domain = irq_domain_add_hierarchy(parent_domain, 0, priv->nirq, node,
> &extirq_domain_ops, priv);
> @@ -195,3 +190,5 @@ ls_extirq_of_init(struct device_node *node, struct
> device_node *parent)
> }
>
> IRQCHIP_DECLARE(ls1021a_extirq, "fsl,ls1021a-extirq",
> ls_extirq_of_init);
> +IRQCHIP_DECLARE(ls1043a_extirq, "fsl,ls1043a-extirq",
> ls_extirq_of_init);
> +IRQCHIP_DECLARE(ls1088a_extirq, "fsl,ls1088a-extirq",
> ls_extirq_of_init);

Thanks,

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

2020-11-30 08:30:27

by Biwen Li

[permalink] [raw]
Subject: RE: [EXT] Re: [v3 01/11] irqchip: ls-extirq: Add LS1043A, LS1088A external interrupt

>
> On 2020-11-30 03:30, Biwen Li wrote:
> > From: Hou Zhiqiang <[email protected]>
> >
> > Add an new IRQ chip declaration for LS1043A and LS1088A
> > - compatible "fsl,ls1043a-extirq" for LS1043A, LS1046A.
> > - compatible "fsl,ls1088a-extirq" for LS1088A, LS208xA, LX216xA
> >
> > Signed-off-by: Hou Zhiqiang <[email protected]>
> > Signed-off-by: Biwen Li <[email protected]>
> > ---
> > Change in v3:
> > - cleanup code
> > - remove robust copyright
> >
> > Change in v2:
> > - add despcription of bit reverse
> > - update copyright
> >
> > drivers/irqchip/irq-ls-extirq.c | 17 +++++++----------
> > 1 file changed, 7 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-ls-extirq.c
> > b/drivers/irqchip/irq-ls-extirq.c index 4d1179fed77c..47804ce78b21
> > 100644
> > --- a/drivers/irqchip/irq-ls-extirq.c
> > +++ b/drivers/irqchip/irq-ls-extirq.c
> > @@ -18,7 +18,7 @@
> > struct ls_extirq_data {
> > struct regmap *syscon;
> > u32 intpcr;
> > - bool bit_reverse;
> > + bool is_ls1021a_or_ls1043a;
> > u32 nirq;
> > struct irq_fwspec map[MAXIRQ];
> > };
> > @@ -30,7 +30,7 @@ ls_extirq_set_type(struct irq_data *data, unsigned
> > int type)
> > irq_hw_number_t hwirq = data->hwirq;
> > u32 value, mask;
> >
> > - if (priv->bit_reverse)
> > + if (priv->is_ls1021a_or_ls1043a)
> > mask = 1U << (31 - hwirq);
> > else
> > mask = 1U << hwirq;
> > @@ -174,14 +174,9 @@ ls_extirq_of_init(struct device_node *node,
> > struct device_node *parent)
> > if (ret)
> > goto out;
> >
> > - if (of_device_is_compatible(node, "fsl,ls1021a-extirq")) {
> > - u32 revcr;
> > -
> > - ret = regmap_read(priv->syscon, LS1021A_SCFGREVCR,
> &revcr);
> > - if (ret)
> > - goto out;
> > - priv->bit_reverse = (revcr != 0);
> > - }
>
> This isn't explained in the commit message. You are changing the way you infer
> some properties, and that's not innocent. Please describe all important changes
> in the commit message.
Sure, will update commit message for this.
>
> > + if (of_device_is_compatible(node, "fsl,ls1021a-extirq") || \
>
> Spurious trailing \?
Don't need it, will remove it in v4.
>
> > + of_device_is_compatible(node, "fsl,ls1043a-extirq"))
> > + priv->is_ls1021a_or_ls1043a = true;
>
> Which is better written as:
>
> priv->is_ls1021a_or_ls1043a = (of_device_is_compatible(node,
> "fsl,ls1021a-extirq") ||
>
> of_device_is_compatible(node, "fsl,ls1043a-extirq"));
Sure, np. Will update it in v4.
> >
> > domain = irq_domain_add_hierarchy(parent_domain, 0, priv->nirq,
> node,
> > &extirq_domain_ops, priv);
> @@
> > -195,3 +190,5 @@ ls_extirq_of_init(struct device_node *node, struct
> > device_node *parent) }
> >
> > IRQCHIP_DECLARE(ls1021a_extirq, "fsl,ls1021a-extirq",
> > ls_extirq_of_init);
> > +IRQCHIP_DECLARE(ls1043a_extirq, "fsl,ls1043a-extirq",
> > ls_extirq_of_init);
> > +IRQCHIP_DECLARE(ls1088a_extirq, "fsl,ls1088a-extirq",
> > ls_extirq_of_init);
>
> Thanks,
>
> M.
> --
> Jazz is not dead. It just smells funny...