All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next: PATCH 00/12] ACPI support for DSA
@ 2022-06-20 15:02 Marcin Wojtas
  2022-06-20 15:02 ` [net-next: PATCH 01/12] net: phy: fixed_phy: switch to fwnode_ API Marcin Wojtas
                   ` (13 more replies)
  0 siblings, 14 replies; 84+ messages in thread
From: Marcin Wojtas @ 2022-06-20 15:02 UTC (permalink / raw)
  To: linux-kernel, linux-acpi, netdev
  Cc: rafael, andriy.shevchenko, lenb, andrew, vivien.didelot,
	f.fainelli, olteanv, davem, edumazet, kuba, pabeni, linux,
	hkallweit1, gjb, mw, jaz, tn, Samer.El-Haj-Mahmoud, upstream

Hi!

This patchset introduces the support for DSA in ACPI world. A couple of
words about the background and motivation behind those changes:

The DSA code is strictly dependent on the Device Tree and Open Firmware
(of_*) interface, both in the drivers and the common high-level net/dsa API.
The only alternative is to pass the information about the topology via
platform data - a legacy approach used by older systems that compiled the
board description into the kernel.

The above constraint is problematic for the embedded devices based e.g. on
x86_64 SoCs, which are described by ACPI tables - to use DSA, some tricks
and workarounds have to be applied. Addition of switch description to
DSDT/SSDT tables would help to solve many similar cases and use unmodified
kernel modules. It also enables this feature for ARM64 ACPI users.

The key enablements allowing for adding ACPI support for DSA in Linux were
NIC drivers, MDIO, PHY, and phylink modifications – the latter three merged
in 2021. I thought it would be worth to experiment with DSA, which seemed
to be a natural follow-up challenge.

It turned out that without much hassle it is possible to describe
DSA-compliant switches as child devices of the MDIO busses, which are
responsible for their enumeration based on the standard _ADR fields and
description in _DSD objects under 'device properties' UUID [1].
The vast majority of required changes were simple of_* to fwnode_*
transition, as the DT and ACPI topolgies are analogous, except for
'ports' and 'mdio' subnodes naming, as they don't conform ACPI
namespace constraints [2].

The patchset can be logically split to subsets of commits:
* Move a couple of missing routines to fwnode_ equivalents
* Rework net/dsa to use fwnode_*/device_* API
* Introduce fwnode_mdiobus_register_device() and allow MDIO device probing
  in ACPI world.
* Add necessary ACPI-related modifications to net/dsa and add Documentation
  entry.
* Shift example mv88e6xxx driver to fwnode_*/device_* and add ACPI hooks.
The changes details can be found in the commit messages.

Note that for now cascade topology remains unsupported in ACPI world
(based on "dsa" label and "link" property values). It seems to be feasible,
but would extend this patchset due to necessity of of_phandle_iterator
migration to fwnode_. Leave it as a possible future step.

Testing:
* EACH commit was tested against regression with device tree on EspressoBIN
  and SolidRun CN913x CEx7 Evaluation board. It works as expected throughout
  entire patchset.
* The latter board was used as example ACPI user of the feature - it's 1:1
  to what's available when booting with DT. Please check [3] and [4] to
  compare the DT/ACPI description.

For convenience, this patchset is also available on a public branch [5].

I am looking forward to any comments or remarks, your review will be
appreciated.

Best regards,
Marcin

[1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
[2] https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#acpi-namespace
[3] https://github.com/semihalf-wojtas-marcin/edk2-platforms/commit/6368ee09a232c1348e19729f21c05e9c5410cdb9
[4] https://github.com/tianocore/edk2-non-osi/blob/master/Silicon/Marvell/OcteonTx/DeviceTree/T91/cn9130-cex7.dts#L252
[5] https://github.com/semihalf-wojtas-marcin/Linux-Kernel/commits/dsa-acpi-v1

Marcin Wojtas (12):
  net: phy: fixed_phy: switch to fwnode_ API
  net: mdio: switch fixed-link PHYs API to fwnode_
  net: dsa: switch to device_/fwnode_ APIs
  net: mvpp2: initialize port fwnode pointer
  net: core: switch to fwnode_find_net_device_by_node()
  net: mdio: introduce fwnode_mdiobus_register_device()
  net: mdio: allow registering non-PHY devices in ACPI world
  ACPI: scan: prevent double enumeration of MDIO bus children
  Documentation: ACPI: DSD: introduce DSA description
  net: dsa: add ACPI support
  net: dsa: mv88e6xxx: switch to device_/fwnode_ APIs
  net: dsa: mv88e6xxx: add ACPI support

 include/linux/etherdevice.h                     |   1 +
 include/linux/fwnode_mdio.h                     |  22 ++
 include/linux/of_net.h                          |   6 -
 include/linux/phy_fixed.h                       |   4 +-
 include/net/dsa.h                               |   1 +
 drivers/acpi/scan.c                             |  15 +
 drivers/net/dsa/mv88e6xxx/chip.c                |  76 +++--
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c |   1 +
 drivers/net/mdio/acpi_mdio.c                    |  40 ++-
 drivers/net/mdio/fwnode_mdio.c                  | 129 +++++++
 drivers/net/mdio/of_mdio.c                      | 105 +-----
 drivers/net/phy/fixed_phy.c                     |  37 +-
 drivers/net/phy/mdio_bus.c                      |   4 +
 net/core/net-sysfs.c                            |  18 +-
 net/dsa/dsa2.c                                  | 104 ++++--
 net/dsa/port.c                                  |  54 ++-
 net/dsa/slave.c                                 |   6 +-
 Documentation/firmware-guide/acpi/dsd/dsa.rst   | 359 ++++++++++++++++++++
 Documentation/firmware-guide/acpi/index.rst     |   1 +
 19 files changed, 748 insertions(+), 235 deletions(-)
 create mode 100644 Documentation/firmware-guide/acpi/dsd/dsa.rst

-- 
2.29.0


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

end of thread, other threads:[~2022-06-25  2:56 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20 15:02 [net-next: PATCH 00/12] ACPI support for DSA Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 01/12] net: phy: fixed_phy: switch to fwnode_ API Marcin Wojtas
2022-06-20 17:25   ` Andy Shevchenko
2022-06-20 17:59   ` Andrew Lunn
2022-06-21  9:56     ` Marcin Wojtas
2022-06-21 10:01       ` Russell King (Oracle)
2022-06-20 15:02 ` [net-next: PATCH 02/12] net: mdio: switch fixed-link PHYs API to fwnode_ Marcin Wojtas
2022-06-20 17:32   ` Andy Shevchenko
2022-06-21  9:22     ` Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 03/12] net: dsa: switch to device_/fwnode_ APIs Marcin Wojtas
2022-06-20 17:41   ` Andy Shevchenko
2022-06-21  9:27     ` Marcin Wojtas
2022-06-21 11:02       ` Andy Shevchenko
2022-06-22 16:09         ` Florian Fainelli
2022-06-20 15:02 ` [net-next: PATCH 04/12] net: mvpp2: initialize port fwnode pointer Marcin Wojtas
2022-06-20 17:43   ` Andy Shevchenko
2022-06-20 17:44     ` Andy Shevchenko
2022-06-21  9:28       ` Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 05/12] net: core: switch to fwnode_find_net_device_by_node() Marcin Wojtas
2022-06-20 17:46   ` Andy Shevchenko
2022-06-20 23:15     ` Marcin Wojtas
2022-06-20 22:30   ` kernel test robot
2022-06-20 15:02 ` [net-next: PATCH 06/12] net: mdio: introduce fwnode_mdiobus_register_device() Marcin Wojtas
2022-06-20 17:48   ` Andy Shevchenko
2022-06-21  9:33     ` Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 07/12] net: mdio: allow registering non-PHY devices in ACPI world Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 08/12] ACPI: scan: prevent double enumeration of MDIO bus children Marcin Wojtas
2022-06-20 17:53   ` Andy Shevchenko
2022-06-20 23:04     ` Marcin Wojtas
2022-06-22 12:09       ` Rafael J. Wysocki
2022-06-22 15:05         ` Marcin Wojtas
2022-06-20 19:08   ` Andrew Lunn
2022-06-22 12:05     ` Rafael J. Wysocki
2022-06-22 16:12       ` Florian Fainelli
2022-06-22 16:21         ` Rafael J. Wysocki
2022-06-23  7:41           ` Andrew Lunn
2022-06-23 23:07             ` Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 09/12] Documentation: ACPI: DSD: introduce DSA description Marcin Wojtas
2022-06-20 18:19   ` Andrew Lunn
2022-06-20 23:21     ` Marcin Wojtas
2022-06-20 19:47   ` Andrew Lunn
2022-06-20 23:25     ` Marcin Wojtas
2022-06-21 11:09     ` Andy Shevchenko
2022-06-21 11:18       ` Andrew Lunn
2022-06-21 11:42         ` Andy Shevchenko
2022-06-22  9:08           ` Marcin Wojtas
2022-06-22  9:24             ` Andrew Lunn
2022-06-22 10:22               ` Marcin Wojtas
2022-06-22 10:37                 ` Andrew Lunn
2022-06-22 11:08                   ` Andy Shevchenko
2022-06-22 11:04               ` Andy Shevchenko
2022-06-22 11:03             ` Andy Shevchenko
2022-06-22 11:22               ` Andrew Lunn
2022-06-22 14:20                 ` Andy Shevchenko
2022-06-22 15:00                   ` Marcin Wojtas
2022-06-21  9:45   ` Sudeep Holla
2022-06-21 11:15     ` Andy Shevchenko
2022-06-21 11:24       ` Andrew Lunn
2022-06-21 11:46         ` Andy Shevchenko
2022-06-21 11:57           ` Andrew Lunn
2022-06-21 13:28         ` Sudeep Holla
2022-06-21 15:23           ` Rafael J. Wysocki
2022-06-21 15:37             ` Sudeep Holla
2022-06-21 16:00               ` Rafael J. Wysocki
2022-06-21 18:11                 ` Sudeep Holla
2022-06-20 15:02 ` [net-next: PATCH 10/12] net: dsa: add ACPI support Marcin Wojtas
2022-06-20 18:32   ` Andrew Lunn
2022-06-20 23:31     ` Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 11/12] net: dsa: mv88e6xxx: switch to device_/fwnode_ APIs Marcin Wojtas
2022-06-20 18:00   ` Andy Shevchenko
2022-06-21  9:14     ` Marcin Wojtas
2022-06-20 18:04   ` Andy Shevchenko
2022-06-21  9:15     ` Marcin Wojtas
2022-06-20 15:02 ` [net-next: PATCH 12/12] net: dsa: mv88e6xxx: add ACPI support Marcin Wojtas
2022-06-25  2:54   ` kernel test robot
2022-06-20 17:21 ` [net-next: PATCH 00/12] ACPI support for DSA Andy Shevchenko
2022-06-21 10:02   ` Marcin Wojtas
2022-06-20 17:55 ` Andrew Lunn
2022-06-20 18:07   ` Andy Shevchenko
2022-06-20 18:45     ` Andrew Lunn
2022-06-21 10:46       ` Marcin Wojtas
2022-06-22 15:40         ` Marcin Wojtas
2022-06-22 16:14           ` Andy Shevchenko
2022-06-21 10:16   ` Marcin Wojtas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.