netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] net: dsa: Platform data for dsa2.c
@ 2016-06-28  0:52 Florian Fainelli
  2016-06-28  0:52 ` [PATCH net-next 1/6] net: dsa: Pass device pointer to dsa_register_switch Florian Fainelli
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Florian Fainelli @ 2016-06-28  0:52 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli

Hi all,

This patch series adds support for platform data using the new code from
net/dsa/dsa2.c. The motivation behind this is that we have a bit of in tree
platforms (ar7, bcm47xx, x86, others) that could be benefiting from the new
dsa_register_switch() API model but do not support Device Tree, nor is there a
plan to bring Device Tree to these platforms (time vs. benefits).

The approach taken here is to introduced a new set of platform data structures:
- dsa2_platform_data: per-switch platform data information
- dsa2_port_data: per-port platform data information
- dsa2_port_link: per-port link topology

The platform data is mapped as closely as possible to the Device Tree binding.
Where needed the code is looking either specifically for DT
attributes/properties, or parses the platform data, unlike net/dsa/dsa.c we do
not try to make the DT code allocate and fit within the platform data, but that
could be an option if deemed necessary.

This was tested against a "loopback" driver which is available here, and which
was built as a module and into the kernel, modprobe & rmmod were succesful and
working:

https://github.com/ffainelli/linux/blob/27024f4c9b43cf879348baa5445763c690fbc618/drivers/net/dsa/dsa_loop.c

in two configurations:

- first configuration has 4 switches connected in a cascade [1]
- second configuration is the actual binding example [2]

[1]:
https://github.com/ffainelli/linux/commit/0aa1e98c027e8e41ed2f83825da82a3d8a1c3ae2
[2]:
https://github.com/ffainelli/linux/commit/27024f4c9b43cf879348baa5445763c690fbc618

Florian Fainelli (6):
  net: dsa: Pass device pointer to dsa_register_switch
  net: dsa: Make most functions take a dsa_port argument
  net: dsa: Suffix function manipulating device_node with _dn
  net: dsa: Move ports assignment closer to error checking
  net: dsa: Export dev_to_net_device()
  net: dsa: Add support for platform data

 drivers/net/dsa/b53/b53_common.c  |   2 +-
 drivers/net/dsa/mv88e6xxx/chip.c  |   7 +-
 include/linux/platform_data/dsa.h |  61 +++++++++++
 include/net/dsa.h                 |  10 +-
 net/dsa/Kconfig                   |   1 +
 net/dsa/dsa.c                     |  58 ++++++----
 net/dsa/dsa2.c                    | 216 ++++++++++++++++++++++++++++----------
 net/dsa/dsa_priv.h                |   4 +-
 8 files changed, 273 insertions(+), 86 deletions(-)
 create mode 100644 include/linux/platform_data/dsa.h

-- 
2.7.4

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

end of thread, other threads:[~2016-07-04 22:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-28  0:52 [PATCH net-next 0/6] net: dsa: Platform data for dsa2.c Florian Fainelli
2016-06-28  0:52 ` [PATCH net-next 1/6] net: dsa: Pass device pointer to dsa_register_switch Florian Fainelli
2016-06-28  0:52 ` [PATCH net-next 2/6] net: dsa: Make most functions take a dsa_port argument Florian Fainelli
2016-06-28  0:52 ` [PATCH net-next 3/6] net: dsa: Suffix function manipulating device_node with _dn Florian Fainelli
2016-06-28  0:52 ` [PATCH net-next 4/6] net: dsa: Move ports assignment closer to error checking Florian Fainelli
2016-06-28  0:52 ` [PATCH net-next 5/6] net: dsa: Export dev_to_net_device() Florian Fainelli
2016-06-28  0:52 ` [PATCH net-next 6/6] net: dsa: Add support for platform data Florian Fainelli
2016-06-28  1:05 ` [PATCH net-next 0/6] net: dsa: Platform data for dsa2.c Andrew Lunn
2016-06-28  1:19   ` Florian Fainelli
2016-06-28 14:17     ` Andrew Lunn
2016-06-29 10:12     ` David Miller
2016-07-04 21:40       ` Florian Fainelli
2016-07-04 22:06         ` David Miller

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).