mbox series

[v5,00/14] PCI: Add support for Apple M1

Message ID 20210929163847.2807812-1-maz@kernel.org (mailing list archive)
Headers show
Series PCI: Add support for Apple M1 | expand

Message

Marc Zyngier Sept. 29, 2021, 4:38 p.m. UTC
This is v5 of the series adding PCIe support for the M1 SoC. Not a lot
has changed this time around, and most of what I was saying in [1] is
still valid.

Very little has changed code wise (a couple of bug fixes). The series
however now carries a bunch of DT updates so that people can actually
make use of PCIe on an M1 box (OK, not quite, you will still need [2],
or whatever version replaces it). The corresponding bindings are
either already merged, or queued for 5.16 (this is the case for the
PCI binding).

It all should be in a state that makes it mergeable (yeah, I said that
last time... I mean it this time! ;-).

As always, comments welcome.

	M.

[1] https://lore.kernel.org/r/20210922205458.358517-1-maz@kernel.org
[2] https://lore.kernel.org/r/20210921222956.40719-2-joey.gouly@arm.com

Alyssa Rosenzweig (2):
  PCI: apple: Add initial hardware bring-up
  PCI: apple: Set up reference clocks when probing

Marc Zyngier (10):
  irqdomain: Make of_phandle_args_to_fwspec generally available
  of/irq: Allow matching of an interrupt-map local to an interrupt
    controller
  PCI: of: Allow matching of an interrupt-map local to a PCI device
  PCI: apple: Add INTx and per-port interrupt support
  PCI: apple: Implement MSI support
  iommu/dart: Exclude MSI doorbell from PCIe device IOVA range
  PCI: apple: Configure RID to SID mapper on device addition
  arm64: dts: apple: t8103: Add PCIe DARTs
  arm64: dts: apple: t8103: Add root port interrupt routing
  arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address

Mark Kettenis (2):
  arm64: apple: Add pinctrl nodes
  arm64: apple: Add PCIe node

 MAINTAINERS                              |   7 +
 arch/arm64/boot/dts/apple/t8103-j274.dts |  23 +
 arch/arm64/boot/dts/apple/t8103.dtsi     | 203 ++++++
 drivers/iommu/apple-dart.c               |  27 +
 drivers/of/irq.c                         |  17 +-
 drivers/pci/controller/Kconfig           |  17 +
 drivers/pci/controller/Makefile          |   1 +
 drivers/pci/controller/pcie-apple.c      | 822 +++++++++++++++++++++++
 drivers/pci/of.c                         |  10 +-
 include/linux/irqdomain.h                |   4 +
 kernel/irq/irqdomain.c                   |   6 +-
 11 files changed, 1127 insertions(+), 10 deletions(-)
 create mode 100644 drivers/pci/controller/pcie-apple.c

Comments

Lorenzo Pieralisi Oct. 4, 2021, 8:38 a.m. UTC | #1
On Wed, Sep 29, 2021 at 05:38:33PM +0100, Marc Zyngier wrote:
> This is v5 of the series adding PCIe support for the M1 SoC. Not a lot
> has changed this time around, and most of what I was saying in [1] is
> still valid.
> 
> Very little has changed code wise (a couple of bug fixes). The series
> however now carries a bunch of DT updates so that people can actually
> make use of PCIe on an M1 box (OK, not quite, you will still need [2],
> or whatever version replaces it). The corresponding bindings are
> either already merged, or queued for 5.16 (this is the case for the
> PCI binding).
> 
> It all should be in a state that makes it mergeable (yeah, I said that
> last time... I mean it this time! ;-).
> 
> As always, comments welcome.
> 
> 	M.
> 
> [1] https://lore.kernel.org/r/20210922205458.358517-1-maz@kernel.org
> [2] https://lore.kernel.org/r/20210921222956.40719-2-joey.gouly@arm.com
> 
> Alyssa Rosenzweig (2):
>   PCI: apple: Add initial hardware bring-up
>   PCI: apple: Set up reference clocks when probing
> 
> Marc Zyngier (10):
>   irqdomain: Make of_phandle_args_to_fwspec generally available
>   of/irq: Allow matching of an interrupt-map local to an interrupt
>     controller
>   PCI: of: Allow matching of an interrupt-map local to a PCI device
>   PCI: apple: Add INTx and per-port interrupt support
>   PCI: apple: Implement MSI support
>   iommu/dart: Exclude MSI doorbell from PCIe device IOVA range
>   PCI: apple: Configure RID to SID mapper on device addition
>   arm64: dts: apple: t8103: Add PCIe DARTs
>   arm64: dts: apple: t8103: Add root port interrupt routing
>   arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address
> 
> Mark Kettenis (2):
>   arm64: apple: Add pinctrl nodes
>   arm64: apple: Add PCIe node
> 
>  MAINTAINERS                              |   7 +
>  arch/arm64/boot/dts/apple/t8103-j274.dts |  23 +
>  arch/arm64/boot/dts/apple/t8103.dtsi     | 203 ++++++
>  drivers/iommu/apple-dart.c               |  27 +
>  drivers/of/irq.c                         |  17 +-
>  drivers/pci/controller/Kconfig           |  17 +
>  drivers/pci/controller/Makefile          |   1 +
>  drivers/pci/controller/pcie-apple.c      | 822 +++++++++++++++++++++++
>  drivers/pci/of.c                         |  10 +-
>  include/linux/irqdomain.h                |   4 +
>  kernel/irq/irqdomain.c                   |   6 +-
>  11 files changed, 1127 insertions(+), 10 deletions(-)
>  create mode 100644 drivers/pci/controller/pcie-apple.c

I have applied (with very minor log changes) patches [1-9] to
pci/apple for v5.16, I expect the dts changes to go via the
arm-soc tree separately, please let me know if that works for you.

Thanks,
Lorenzo
Marc Zyngier Oct. 4, 2021, 9:05 a.m. UTC | #2
Hi Lorenzo,

[+LinusW, Arnd]

On Mon, 04 Oct 2021 09:38:45 +0100,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> wrote:
> 
> On Wed, Sep 29, 2021 at 05:38:33PM +0100, Marc Zyngier wrote:
> > This is v5 of the series adding PCIe support for the M1 SoC. Not a lot
> > has changed this time around, and most of what I was saying in [1] is
> > still valid.
> > 
> > Very little has changed code wise (a couple of bug fixes). The series
> > however now carries a bunch of DT updates so that people can actually
> > make use of PCIe on an M1 box (OK, not quite, you will still need [2],
> > or whatever version replaces it). The corresponding bindings are
> > either already merged, or queued for 5.16 (this is the case for the
> > PCI binding).
> > 
> > It all should be in a state that makes it mergeable (yeah, I said that
> > last time... I mean it this time! ;-).
> > 
> > As always, comments welcome.
> > 
> > 	M.
> > 
> > [1] https://lore.kernel.org/r/20210922205458.358517-1-maz@kernel.org
> > [2] https://lore.kernel.org/r/20210921222956.40719-2-joey.gouly@arm.com
> > 
> > Alyssa Rosenzweig (2):
> >   PCI: apple: Add initial hardware bring-up
> >   PCI: apple: Set up reference clocks when probing
> > 
> > Marc Zyngier (10):
> >   irqdomain: Make of_phandle_args_to_fwspec generally available
> >   of/irq: Allow matching of an interrupt-map local to an interrupt
> >     controller
> >   PCI: of: Allow matching of an interrupt-map local to a PCI device
> >   PCI: apple: Add INTx and per-port interrupt support
> >   PCI: apple: Implement MSI support
> >   iommu/dart: Exclude MSI doorbell from PCIe device IOVA range
> >   PCI: apple: Configure RID to SID mapper on device addition
> >   arm64: dts: apple: t8103: Add PCIe DARTs
> >   arm64: dts: apple: t8103: Add root port interrupt routing
> >   arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address
> > 
> > Mark Kettenis (2):
> >   arm64: apple: Add pinctrl nodes
> >   arm64: apple: Add PCIe node
> > 
> >  MAINTAINERS                              |   7 +
> >  arch/arm64/boot/dts/apple/t8103-j274.dts |  23 +
> >  arch/arm64/boot/dts/apple/t8103.dtsi     | 203 ++++++
> >  drivers/iommu/apple-dart.c               |  27 +
> >  drivers/of/irq.c                         |  17 +-
> >  drivers/pci/controller/Kconfig           |  17 +
> >  drivers/pci/controller/Makefile          |   1 +
> >  drivers/pci/controller/pcie-apple.c      | 822 +++++++++++++++++++++++
> >  drivers/pci/of.c                         |  10 +-
> >  include/linux/irqdomain.h                |   4 +
> >  kernel/irq/irqdomain.c                   |   6 +-
> >  11 files changed, 1127 insertions(+), 10 deletions(-)
> >  create mode 100644 drivers/pci/controller/pcie-apple.c
> 
> I have applied (with very minor log changes) patches [1-9] to
> pci/apple for v5.16, I expect the dts changes to go via the
> arm-soc tree separately, please let me know if that works for you.

Yes, that's absolutely fine. I hope we can resolve the issue on the
pinctrl binding pretty quickly, and get the arm-soc folks to pull the
DT changes in for 5.16 too.

This would make the Mini a usable machine with a mainline kernel.

Thanks,

	M.
Linus Walleij Oct. 4, 2021, 6:30 p.m. UTC | #3
On Mon, Oct 4, 2021 at 11:05 AM Marc Zyngier <maz@kernel.org> wrote:

> Yes, that's absolutely fine. I hope we can resolve the issue on the
> pinctrl binding pretty quickly, and get the arm-soc folks to pull the
> DT changes in for 5.16 too.

I think I ACKed a patch for apple,npins = <> yesterday.

> This would make the Mini a usable machine with a mainline kernel.

That seems useful.

Yours,
Linus Walleij
Rob Herring Oct. 4, 2021, 7:51 p.m. UTC | #4
On Mon, Oct 4, 2021 at 3:38 AM Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
>
> On Wed, Sep 29, 2021 at 05:38:33PM +0100, Marc Zyngier wrote:
> > This is v5 of the series adding PCIe support for the M1 SoC. Not a lot
> > has changed this time around, and most of what I was saying in [1] is
> > still valid.
> >
> > Very little has changed code wise (a couple of bug fixes). The series
> > however now carries a bunch of DT updates so that people can actually
> > make use of PCIe on an M1 box (OK, not quite, you will still need [2],
> > or whatever version replaces it). The corresponding bindings are
> > either already merged, or queued for 5.16 (this is the case for the
> > PCI binding).
> >
> > It all should be in a state that makes it mergeable (yeah, I said that
> > last time... I mean it this time! ;-).
> >
> > As always, comments welcome.
> >
> >       M.
> >
> > [1] https://lore.kernel.org/r/20210922205458.358517-1-maz@kernel.org
> > [2] https://lore.kernel.org/r/20210921222956.40719-2-joey.gouly@arm.com
> >
> > Alyssa Rosenzweig (2):
> >   PCI: apple: Add initial hardware bring-up
> >   PCI: apple: Set up reference clocks when probing
> >
> > Marc Zyngier (10):
> >   irqdomain: Make of_phandle_args_to_fwspec generally available
> >   of/irq: Allow matching of an interrupt-map local to an interrupt
> >     controller
> >   PCI: of: Allow matching of an interrupt-map local to a PCI device
> >   PCI: apple: Add INTx and per-port interrupt support
> >   PCI: apple: Implement MSI support
> >   iommu/dart: Exclude MSI doorbell from PCIe device IOVA range
> >   PCI: apple: Configure RID to SID mapper on device addition
> >   arm64: dts: apple: t8103: Add PCIe DARTs
> >   arm64: dts: apple: t8103: Add root port interrupt routing
> >   arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address
> >
> > Mark Kettenis (2):
> >   arm64: apple: Add pinctrl nodes
> >   arm64: apple: Add PCIe node
> >
> >  MAINTAINERS                              |   7 +
> >  arch/arm64/boot/dts/apple/t8103-j274.dts |  23 +
> >  arch/arm64/boot/dts/apple/t8103.dtsi     | 203 ++++++
> >  drivers/iommu/apple-dart.c               |  27 +
> >  drivers/of/irq.c                         |  17 +-
> >  drivers/pci/controller/Kconfig           |  17 +
> >  drivers/pci/controller/Makefile          |   1 +
> >  drivers/pci/controller/pcie-apple.c      | 822 +++++++++++++++++++++++
> >  drivers/pci/of.c                         |  10 +-
> >  include/linux/irqdomain.h                |   4 +
> >  kernel/irq/irqdomain.c                   |   6 +-
> >  11 files changed, 1127 insertions(+), 10 deletions(-)
> >  create mode 100644 drivers/pci/controller/pcie-apple.c
>
> I have applied (with very minor log changes) patches [1-9] to
> pci/apple for v5.16, I expect the dts changes to go via the
> arm-soc tree separately, please let me know if that works for you.

FYI, I pushed patches 1-3 to kernelCI and didn't see any regressions.
I am a bit worried about changes to the DT interrupt parsing and
ancient platforms (such as PowerMacs). Most likely there wouldn't be
any report until -rc1 or months later on those old systems.

Rob
Linus Walleij Oct. 4, 2021, 8:42 p.m. UTC | #5
On Mon, Oct 4, 2021 at 9:52 PM Rob Herring <robh+dt@kernel.org> wrote:

> FYI, I pushed patches 1-3 to kernelCI and didn't see any regressions.
> I am a bit worried about changes to the DT interrupt parsing and
> ancient platforms (such as PowerMacs). Most likely there wouldn't be
> any report until -rc1 or months later on those old systems.

Lets page the PPC lists to see if someone can test on some powermac.

Linus Walleij
Marc Zyngier Oct. 5, 2021, 9:57 a.m. UTC | #6
On Mon, 04 Oct 2021 21:42:45 +0100,
Linus Walleij <linus.walleij@linaro.org> wrote:
> 
> On Mon, Oct 4, 2021 at 9:52 PM Rob Herring <robh+dt@kernel.org> wrote:
> 
> > FYI, I pushed patches 1-3 to kernelCI and didn't see any regressions.
> > I am a bit worried about changes to the DT interrupt parsing and
> > ancient platforms (such as PowerMacs). Most likely there wouldn't be
> > any report until -rc1 or months later on those old systems.
> 
> Lets page the PPC lists to see if someone can test on some powermac.

/me eyes the XServe-G5 that hasn't been powered on in 10 years. What
could possibly go wrong?

	M.
Michael Ellerman Oct. 6, 2021, 5:56 a.m. UTC | #7
Linus Walleij <linus.walleij@linaro.org> writes:
> On Mon, Oct 4, 2021 at 9:52 PM Rob Herring <robh+dt@kernel.org> wrote:
>
>> FYI, I pushed patches 1-3 to kernelCI and didn't see any regressions.
>> I am a bit worried about changes to the DT interrupt parsing and
>> ancient platforms (such as PowerMacs). Most likely there wouldn't be
>> any report until -rc1 or months later on those old systems.
>
> Lets page the PPC lists to see if someone can test on some powermac.

It boots and everything seems fine on an iMac-G5 of mine.

I don't have access to any other powermac hardware at the moment due to
the lockdown here.

cheers
Hector Martin Oct. 7, 2021, 3:43 p.m. UTC | #8
On 05/10/2021 03.30, Linus Walleij wrote:
> On Mon, Oct 4, 2021 at 11:05 AM Marc Zyngier <maz@kernel.org> wrote:
> 
>> Yes, that's absolutely fine. I hope we can resolve the issue on the
>> pinctrl binding pretty quickly, and get the arm-soc folks to pull the
>> DT changes in for 5.16 too.
> 
> I think I ACKed a patch for apple,npins = <> yesterday.

You reviewed it :)

It still needs some fixes to pass the schema linter though.