Re: [PATCH v9 1/6] misc: Add support for LAN966x PCI device
From: Michal Kubecek
Date: Thu Nov 28 2024 - 14:43:10 EST
On Thu, Oct 10, 2024 at 08:36:01AM +0200, Herve Codina wrote:
> Add a PCI driver that handles the LAN966x PCI device using a device-tree
> overlay. This overlay is applied to the PCI device DT node and allows to
> describe components that are present in the device.
>
> The memory from the device-tree is remapped to the BAR memory thanks to
> "ranges" properties computed at runtime by the PCI core during the PCI
> enumeration.
>
> The PCI device itself acts as an interrupt controller and is used as the
> parent of the internal LAN966x interrupt controller to route the
> interrupts to the assigned PCI INTx interrupt.
>
> Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
> Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Acked-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> # quirks.c
> ---
> drivers/misc/Kconfig | 24 ++++
> drivers/misc/Makefile | 3 +
> drivers/misc/lan966x_pci.c | 215 ++++++++++++++++++++++++++++++++++
> drivers/misc/lan966x_pci.dtso | 167 ++++++++++++++++++++++++++
> drivers/pci/quirks.c | 1 +
> 5 files changed, 410 insertions(+)
> create mode 100644 drivers/misc/lan966x_pci.c
> create mode 100644 drivers/misc/lan966x_pci.dtso
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 3fe7e2a9bd29..8e5b06ac9b6f 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -610,6 +610,30 @@ config MARVELL_CN10K_DPI
> To compile this driver as a module, choose M here: the module
> will be called mrvl_cn10k_dpi.
>
> +config MCHP_LAN966X_PCI
> + tristate "Microchip LAN966x PCIe Support"
> + depends on PCI
> + select OF
> + select OF_OVERLAY
Are these "select" statements what we want? When configuring current
mainline snapshot, I accidentally enabled this driver and ended up
flooded with an enormous amount of new config options, most of which
didn't make much sense on x86_64. It took quite long to investigate why.
Couldn't we rather use
depends on PCI && OF && OF_OVERLAY
like other drivers?
Michal
> + select IRQ_DOMAIN
> + help
> + This enables the support for the LAN966x PCIe device.
> + This is used to drive the LAN966x PCIe device from the host system
> + to which it is connected.
> +
> + This driver uses an overlay to load other drivers to support for
> + LAN966x internal components.
> + Even if this driver does not depend on these other drivers, in order
> + to have a fully functional board, the following drivers are needed:
> + - fixed-clock (COMMON_CLK)
> + - lan966x-oic (LAN966X_OIC)
> + - lan966x-cpu-syscon (MFD_SYSCON)
> + - lan966x-switch-reset (RESET_MCHP_SPARX5)
> + - lan966x-pinctrl (PINCTRL_OCELOT)
> + - lan966x-serdes (PHY_LAN966X_SERDES)
> + - lan966x-miim (MDIO_MSCC_MIIM)
> + - lan966x-switch (LAN966X_SWITCH)
> +
> source "drivers/misc/c2port/Kconfig"
> source "drivers/misc/eeprom/Kconfig"
> source "drivers/misc/cb710/Kconfig"
[...]
Attachment:
signature.asc
Description: PGP signature