linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] Add support for RaspberryPi RP1 PCI device using a DT overlay
@ 2024-08-20 14:36 Andrea della Porta
  2024-08-20 14:36 ` [PATCH 01/11] dt-bindings: clock: Add RaspberryPi RP1 clock bindings Andrea della Porta
                   ` (11 more replies)
  0 siblings, 12 replies; 111+ messages in thread
From: Andrea della Porta @ 2024-08-20 14:36 UTC (permalink / raw)
  To: Andrea della Porta, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
	Broadcom internal kernel review list, Linus Walleij,
	Catalin Marinas, Will Deacon, Derek Kiernan, Dragan Cvetic,
	Arnd Bergmann, Greg Kroah-Hartman, Nicolas Ferre, Claudiu Beznea,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Saravana Kannan, Bjorn Helgaas, linux-clk, devicetree,
	linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-gpio,
	netdev, linux-pci, linux-arch, Lee Jones, Andrew Lunn,
	Stefan Wahren

RP1 is an MFD chipset that acts as a south-bridge PCIe endpoint sporting
a pletora of subdevices (i.e.  Ethernet, USB host controller, I2C, PWM, 
etc.) whose registers are all reachable starting from an offset from the
BAR address.  The main point here is that while the RP1 as an endpoint
itself is discoverable via usual PCI enumeraiton, the devices it contains
are not discoverable and must be declared e.g. via the devicetree.

This patchset is an attempt to provide a minimum infrastructure to allow
the RP1 chipset to be discovered and perpherals it contains to be added
from a devictree overlay loaded during RP1 PCI endpoint enumeration.
Followup patches should add support for the several peripherals contained
in RP1.

This work is based upon dowstream drivers code and the proposal from RH
et al. (see [1] and [2]). A similar approach is also pursued in [3].

The patches are ordered as follows:

-PATCHES 1 and 2: add binding schemas for clock and gpio peripherals 
 found in RP1. They are needed to support the other peripherals, e.g.
 the ethernet mac depends on a clock generated by RP1 and the phy is
 reset though the on-board gpio controller.

-PATCHES 3, 4 and 5: preparatory patches that fix the address mapping
 translation (especially wrt dma-ranges) and permit to place the dtbo
 binary blob to be put in non transient section.

-PATCH 6 and 7: add clock and gpio device drivers.

-PATCH 8: this is the main patch to support RP1 chipset and peripherals
 enabling through dtb overlay. It contains the dtso since its intimately
 coupled with the driver and will be linked in as binary blob in the driver
 obj, but of course it can be easily split in a separate patch if the
 maintainer feels it so. The real dtso is in devicetree folder while
 the dtso in driver folder is just a placeholder to include the real dtso.
 In this way it is possible to check the dtso against dt-bindings.

-PATCH 9: add the relevant kernel CONFIG_ options to defconfig.

-PATCHES 10 and 11: these (still unpolished) patches are not intended to
 be upstreamed (yet), they serve just as a test reference to be able to
 use the ethernet MAC contained in RP1.

This patchset is also a first attempt to be more agnostic wrt hardware
description standards such as OF devicetree and ACPI, where 'agnostic'
means "using DT in coexistence with ACPI", as been alredy promoted
by e.g. AL (see [4]). Although there's currently no evidence it will also
run out of the box on purely ACPI system, it is a first step towards
that direction.

Please note that albeit this patchset has no prerequisites in order to
be applied cleanly, it still depends on Stanimir's WIP patchset for BCM2712
PCIe controller (see [5]) in order to work at runtime.

Many thanks,
Andrea della Porta

Link:
- [1]: https://lpc.events/event/17/contributions/1421/attachments/1337/2680/LPC2023%20Non-discoverable%20devices%20in%20PCI.pdf
- [2]: https://lore.kernel.org/lkml/20230419231155.GA899497-robh@kernel.org/t/
- [3]: https://lore.kernel.org/all/20240808154658.247873-1-herve.codina@bootlin.com/#t
- [4]: https://lore.kernel.org/all/73e05c77-6d53-4aae-95ac-415456ff0ae4@lunn.ch/
- [5]: https://lore.kernel.org/all/20240626104544.14233-1-svarbanov@suse.de/

Andrea della Porta (11):
  dt-bindings: clock: Add RaspberryPi RP1 clock bindings
  dt-bindings: pinctrl: Add RaspberryPi RP1 gpio/pinctrl/pinmux bindings
  PCI: of_property: Sanitize 32 bit PCI address parsed from DT
  of: address: Preserve the flags portion on 1:1 dma-ranges mapping
  vmlinux.lds.h: Preserve DTB sections from being discarded after init
  clk: rp1: Add support for clocks provided by RP1
  pinctrl: rp1: Implement RaspberryPi RP1 gpio support
  misc: rp1: RaspberryPi RP1 misc driver
  arm64: defconfig: Enable RP1 misc/clock/gpio drivers as built-in
  net: macb: Add support for RP1's MACB variant
  arm64: dts: rp1: Add support for MACB contained in RP1

 .../clock/raspberrypi,rp1-clocks.yaml         |   87 +
 .../pinctrl/raspberrypi,rp1-gpio.yaml         |  177 ++
 MAINTAINERS                                   |   12 +
 arch/arm64/boot/dts/broadcom/rp1.dtso         |  175 ++
 arch/arm64/configs/defconfig                  |    3 +
 drivers/clk/Kconfig                           |    9 +
 drivers/clk/Makefile                          |    1 +
 drivers/clk/clk-rp1.c                         | 1655 +++++++++++++++++
 drivers/misc/Kconfig                          |    1 +
 drivers/misc/Makefile                         |    1 +
 drivers/misc/rp1/Kconfig                      |   20 +
 drivers/misc/rp1/Makefile                     |    3 +
 drivers/misc/rp1/rp1-pci.c                    |  333 ++++
 drivers/misc/rp1/rp1-pci.dtso                 |    8 +
 drivers/net/ethernet/cadence/macb.h           |   25 +
 drivers/net/ethernet/cadence/macb_main.c      |  152 +-
 drivers/of/address.c                          |    3 +-
 drivers/pci/of_property.c                     |    5 +-
 drivers/pci/quirks.c                          |    1 +
 drivers/pinctrl/Kconfig                       |   10 +
 drivers/pinctrl/Makefile                      |    1 +
 drivers/pinctrl/pinctrl-rp1.c                 |  719 +++++++
 include/asm-generic/vmlinux.lds.h             |    2 +-
 include/dt-bindings/clock/rp1.h               |   56 +
 include/dt-bindings/misc/rp1.h                |  235 +++
 include/linux/pci_ids.h                       |    3 +
 26 files changed, 3692 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/raspberrypi,rp1-clocks.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/raspberrypi,rp1-gpio.yaml
 create mode 100644 arch/arm64/boot/dts/broadcom/rp1.dtso
 create mode 100644 drivers/clk/clk-rp1.c
 create mode 100644 drivers/misc/rp1/Kconfig
 create mode 100644 drivers/misc/rp1/Makefile
 create mode 100644 drivers/misc/rp1/rp1-pci.c
 create mode 100644 drivers/misc/rp1/rp1-pci.dtso
 create mode 100644 drivers/pinctrl/pinctrl-rp1.c
 create mode 100644 include/dt-bindings/clock/rp1.h
 create mode 100644 include/dt-bindings/misc/rp1.h

-- 
2.35.3


^ permalink raw reply	[flat|nested] 111+ messages in thread

end of thread, other threads:[~2024-10-19  8:46 UTC | newest]

Thread overview: 111+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 14:36 [PATCH 00/11] Add support for RaspberryPi RP1 PCI device using a DT overlay Andrea della Porta
2024-08-20 14:36 ` [PATCH 01/11] dt-bindings: clock: Add RaspberryPi RP1 clock bindings Andrea della Porta
2024-08-20 16:19   ` Conor Dooley
2024-08-20 18:25     ` Andrea della Porta
2024-08-21 11:46       ` Conor Dooley
2024-08-22  9:35         ` Andrea della Porta
2024-08-22  9:52           ` Krzysztof Kozlowski
2024-08-22 16:23             ` Conor Dooley
2024-08-23 18:21               ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 02/11] dt-bindings: pinctrl: Add RaspberryPi RP1 gpio/pinctrl/pinmux bindings Andrea della Porta
2024-08-21  8:42   ` Krzysztof Kozlowski
2024-08-30 10:22     ` Andrea della Porta
2024-08-30 11:46       ` Krzysztof Kozlowski
2024-09-02  8:44         ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 03/11] PCI: of_property: Sanitize 32 bit PCI address parsed from DT Andrea della Porta
2024-08-21 15:24   ` Bjorn Helgaas
2024-08-26 19:51     ` Andrea della Porta
2024-09-03 22:26       ` Bjorn Helgaas
2024-09-05 16:43         ` Andrea della Porta
2024-09-05 20:16           ` Bjorn Helgaas
2024-09-27  6:48             ` Andrea della Porta
2024-09-28 20:17               ` Bjorn Helgaas
2024-10-06 11:20                 ` Andrea della Porta
2024-10-08  1:08                   ` Bjorn Helgaas
2024-10-18 12:41                     ` Andrea della Porta
2024-10-18 22:28                       ` Bjorn Helgaas
2024-10-19  8:46                         ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 04/11] of: address: Preserve the flags portion on 1:1 dma-ranges mapping Andrea della Porta
2024-08-21  0:16   ` Rob Herring
2024-08-21  8:18     ` Andrea della Porta
2024-08-26 21:29       ` Rob Herring
2024-08-29 10:13         ` Andrea della Porta
2024-08-29 13:18           ` Rob Herring
2024-08-29 16:26             ` Andrea della Porta
2024-08-30 19:37               ` Rob Herring
2024-09-03  9:09                 ` Herve Codina
2024-09-03  9:33                   ` Andrea della Porta
2024-09-03 18:55                     ` Rob Herring
2024-09-03 16:15                 ` Andrea della Porta
2024-09-03 18:46                   ` Rob Herring
2024-09-04  8:33                     ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 05/11] vmlinux.lds.h: Preserve DTB sections from being discarded after init Andrea della Porta
2024-08-30 19:46   ` Stephen Boyd
2024-09-03 12:29     ` Andrea della Porta
2024-09-21 20:47       ` Stephen Boyd
2024-09-22  8:14         ` Masahiro Yamada
2024-09-23 18:13           ` Stephen Boyd
2024-09-24  2:45             ` Masahiro Yamada
2024-08-20 14:36 ` [PATCH 06/11] clk: rp1: Add support for clocks provided by RP1 Andrea della Porta
2024-08-21 13:17   ` Simon Horman
2024-08-22 10:04     ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 07/11] pinctrl: rp1: Implement RaspberryPi RP1 gpio support Andrea della Porta
2024-08-21  8:45   ` Krzysztof Kozlowski
2024-08-30 10:39     ` Andrea della Porta
2024-08-21 13:27   ` Simon Horman
2024-08-23 17:16     ` Andrea della Porta
2024-08-26  8:59   ` Linus Walleij
2024-08-28 15:24     ` Andrea della Porta
2024-09-02  8:31       ` Linus Walleij
2024-08-20 14:36 ` [PATCH 08/11] misc: rp1: RaspberryPi RP1 misc driver Andrea della Porta
2024-08-21  8:38   ` Krzysztof Kozlowski
2024-08-21 14:20     ` Krzysztof Kozlowski
2024-08-22 14:33       ` Andrea della Porta
2024-08-22 14:46         ` Krzysztof Kozlowski
2024-08-30 13:49     ` Andrea della Porta
2024-08-30 14:21       ` Andrew Lunn
2024-09-03 14:56         ` Andrea della Porta
2024-08-30 16:52       ` Krzysztof Kozlowski
2024-09-03 15:15         ` Andrea della Porta
2024-09-03 18:27           ` Krzysztof Kozlowski
2024-09-05 16:33             ` Andrea della Porta
2024-09-05 16:52               ` Krzysztof Kozlowski
2024-09-05 18:54                 ` Andrea della Porta
2024-09-05 21:20                   ` Krzysztof Kozlowski
2024-08-21 16:20   ` Stefan Wahren
2024-08-23  9:44     ` Andrea della Porta
2024-08-23 10:23       ` Stefan Wahren
2024-08-23 16:31         ` Andrea della Porta
2024-08-30 18:27           ` Rob Herring
2024-09-02  9:34             ` Andrea della Porta
2024-08-21 16:55   ` Bjorn Helgaas
2024-08-23 10:21     ` Andrea della Porta
2024-08-24  1:53   ` Greg Kroah-Hartman
2024-08-26  9:07     ` Andrea della Porta
2024-08-26  9:18       ` Greg Kroah-Hartman
2024-08-20 14:36 ` [PATCH 09/11] arm64: defconfig: Enable RP1 misc/clock/gpio drivers as built-in Andrea della Porta
2024-08-21  8:47   ` Krzysztof Kozlowski
2024-08-30 22:24     ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 10/11] net: macb: Add support for RP1's MACB variant Andrea della Porta
2024-08-20 15:13   ` Andrew Lunn
2024-08-20 18:31     ` Andrea della Porta
2024-08-21  8:49   ` Krzysztof Kozlowski
2024-08-30 22:32     ` Andrea della Porta
2024-08-21 17:01   ` Florian Fainelli
2024-08-26 20:03     ` Andrea della Porta
2024-08-20 14:36 ` [PATCH 11/11] arm64: dts: rp1: Add support for MACB contained in RP1 Andrea della Porta
2024-08-21  8:43   ` Krzysztof Kozlowski
2024-08-30 22:33     ` Andrea della Porta
2024-08-21 17:02   ` Florian Fainelli
2024-08-26 20:18     ` Andrea della Porta
2024-08-21 13:42 ` [PATCH 00/11] Add support for RaspberryPi RP1 PCI device using a DT overlay Krzysztof Kozlowski
2024-08-22  9:05   ` Andrea della Porta
2024-08-22  9:50     ` Krzysztof Kozlowski
2024-08-29 13:11       ` Andrea della Porta
2024-08-22 13:04     ` Andrew Lunn
2024-08-29 12:01       ` Andrea della Porta
2024-08-29 13:04         ` Andrew Lunn
2024-08-29 13:13           ` Andrea della Porta
2024-08-30  5:21           ` Andrea della Porta
2024-08-30 14:10             ` Andrew Lunn
2024-09-02  9:21               ` Andrea della Porta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).