mbox series

[0/2] irqchip: irq-mt58xx: Add mt58xx series interrupt

Message ID 20200803062214.24076-1-mark-pk.tsai@mediatek.com (mailing list archive)
Headers show
Series irqchip: irq-mt58xx: Add mt58xx series interrupt | expand

Message

Mark-PK Tsai (蔡沛剛) Aug. 3, 2020, 6:22 a.m. UTC
Mediatek DTV SoCs contain multiple legacy interrupt controllers that routes
interrupts to the GIC. And all the mt58xx series SoCs have this controller,
hence the name of the driver and binding.

Mark-PK Tsai (2):
  irqchip: irq-mt58xx: Add mt58xx interrupt controller support
  dt-bindings: interrupt-controller: Add MT58XX interrupt controller

 .../mediatek,mt58xx-intc.yaml                 |  70 +++++++
 drivers/irqchip/Kconfig                       |   7 +
 drivers/irqchip/Makefile                      |   1 +
 drivers/irqchip/irq-mt58xx.c                  | 196 ++++++++++++++++++
 4 files changed, 274 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/mediatek,mt58xx-intc.yaml
 create mode 100644 drivers/irqchip/irq-mt58xx.c

Comments

Daniel Palmer Aug. 6, 2020, 10:12 a.m. UTC | #1
Hi Mark-PK,

Your driver seems to be for the same interrupt controller IP that is
present in MStar's TV and camera SoCs and now SigmaStar's SoCs.
I sent a series[0] for a driver very similar to yours but for the
MStar SoCs. Do you know if it would be possible to confirm if they are
the
same thing? MediaTek bought MStar a few years ago so it seems likely
but I have no hard information.

If they are the same thing could we work on making one series that
supports both use cases?
It's also possible that if the interrupt controller is the same some
other things like the SPI NOR controller etc are also common and
working
on a single driver for those would save us both time.

[0] - https://lore.kernel.org/linux-arm-kernel/20200805110052.2655487-1-daniel@0x0f.com/
Mark-PK Tsai (蔡沛剛) Aug. 6, 2020, 2:07 p.m. UTC | #2
From: Daniel Palmer <daniel@0x0f.com>

> Hi Mark-PK,
> 
> Your driver seems to be for the same interrupt controller IP that is
> present in MStar's TV and camera SoCs and now SigmaStar's SoCs.
> I sent a series[0] for a driver very similar to yours but for the
> MStar SoCs. Do you know if it would be possible to confirm if they are
> the
> same thing? MediaTek bought MStar a few years ago so it seems likely
> but I have no hard information.
> 

Yes, it's for the same interrupt controller IP.

> If they are the same thing could we work on making one series that
> supports both use cases?

Sure, and I think the irq controller driver should support both use cases.
So how about keep the MTK version driver?
I'll send patch v2 after -rc1 as I mentioned in the previous mail,
and keep you posted.
And any suggestion is welcome. :)

> It's also possible that if the interrupt controller is the same some
> other things like the SPI NOR controller etc are also common and
> working
> on a single driver for those would save us both time.
> 

I'm not sure about that.
I'll check the patches you contributed and confirm with our driver owners.
Daniel Palmer Aug. 6, 2020, 2:58 p.m. UTC | #3
Hi Mark-PK,

On Thu, 6 Aug 2020 at 23:08, Mark-PK Tsai <mark-pk.tsai@mediatek.com> wrote:
> > Do you know if it would be possible to confirm if they are
> > the
> > same thing? MediaTek bought MStar a few years ago so it seems likely
> > but I have no hard information.
> >
>
> Yes, it's for the same interrupt controller IP.

That's good news. :)

> > If they are the same thing could we work on making one series that
> > supports both use cases?
>
> Sure, and I think the irq controller driver should support both use cases.
> So how about keep the MTK version driver?

I'm fine with that. Maybe you can push the MTK version and I can send
a small patch after that to add the small bits I need?

> I'll send patch v2 after -rc1 as I mentioned in the previous mail,
> and keep you posted.
> And any suggestion is welcome. :)

I think Marc's comments on my series apply to your driver and I think
maybe answer some of the questions you had. For example what
to do about the read-modify-write sequence for updating the registers.

> > It's also possible that if the interrupt controller is the same some
> > other things like the SPI NOR controller etc are also common and
> > working
> > on a single driver for those would save us both time.
>
> I'm not sure about that.
> I'll check the patches you contributed and confirm with our driver owners.

I have a very messy tree with support for the SPI NOR controller, SPI, i2c etc
that were used in MStar chips. If any of those are shared it'd be great to know.

Thanks,

Daniel
Marc Zyngier Aug. 6, 2020, 3:12 p.m. UTC | #4
On 2020-08-06 15:58, Daniel Palmer wrote:
> Hi Mark-PK,
> 
> On Thu, 6 Aug 2020 at 23:08, Mark-PK Tsai <mark-pk.tsai@mediatek.com> 
> wrote:
>> > Do you know if it would be possible to confirm if they are
>> > the
>> > same thing? MediaTek bought MStar a few years ago so it seems likely
>> > but I have no hard information.
>> >
>> 
>> Yes, it's for the same interrupt controller IP.
> 
> That's good news. :)
> 
>> > If they are the same thing could we work on making one series that
>> > supports both use cases?
>> 
>> Sure, and I think the irq controller driver should support both use 
>> cases.
>> So how about keep the MTK version driver?
> 
> I'm fine with that. Maybe you can push the MTK version and I can send
> a small patch after that to add the small bits I need?

In the interest of being vendor agnostic, please rename the properties
such as mediatek,irqs-map-range to something less brand-specific.
The compatible string should be enough.

Thanks,

         M.
Mark-PK Tsai (蔡沛剛) Aug. 7, 2020, 12:52 p.m. UTC | #5
From: Marc Zyngier <maz@kernel.org>

> On 2020-08-06 15:58, Daniel Palmer wrote:
> > Hi Mark-PK,
> > 
> > On Thu, 6 Aug 2020 at 23:08, Mark-PK Tsai <mark-pk.tsai@mediatek.com> 
> > wrote:
> >> > Do you know if it would be possible to confirm if they are
> >> > the
> >> > same thing? MediaTek bought MStar a few years ago so it seems likely
> >> > but I have no hard information.
> >> >
> >> 
> >> Yes, it's for the same interrupt controller IP.
> > 
> > That's good news. :)
> > 
> >> > If they are the same thing could we work on making one series that
> >> > supports both use cases?
> >> 
> >> Sure, and I think the irq controller driver should support both use 
> >> cases.
> >> So how about keep the MTK version driver?
> > 
> > I'm fine with that. Maybe you can push the MTK version and I can send
> > a small patch after that to add the small bits I need?
> 
> In the interest of being vendor agnostic, please rename the properties
> such as mediatek,irqs-map-range to something less brand-specific.
> The compatible string should be enough.

I can't find the suitable property in standard ones that match the custom
properties here.
And the vendor prefixed rule is described in [1].

The interrupt controller is first used in Mstar TV SoCs.
Now it's used in MTK TV and Sigmastar SoCs.
So I think Mstar prefixed would make more sense.
I will rename the driver into mstar-intc, and MTK will maintain this driver.

[1] https://www.kernel.org/doc/Documentation/devicetree/booting-without-of.txt