From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, andrew@lunn.ch,
vivien.didelot@savoirfairelinux.com,
Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net-next 0/6] net: dsa: Platform data for dsa2.c
Date: Mon, 27 Jun 2016 17:52:37 -0700 [thread overview]
Message-ID: <1467075163-15890-1-git-send-email-f.fainelli@gmail.com> (raw)
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
next reply other threads:[~2016-06-28 0:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 0:52 Florian Fainelli [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467075163-15890-1-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).