48be4400256c8d71de5b2a56c2252c65bb825ad0
[openwrt/staging/wigyori.git] / target / linux / generic / hack-5.10 / 700-swconfig_switch_drivers.patch
1 From 36e516290611e613aa92996cb4339561452695b4 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Fri, 7 Jul 2017 17:24:23 +0200
4 Subject: net: swconfig: adds openwrt switch layer
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8 drivers/net/phy/Kconfig | 83 +++++++++++++++++++++++++++++++++++++++++++++++
9 drivers/net/phy/Makefile | 15 +++++++++
10 include/uapi/linux/Kbuild | 1 +
11 3 files changed, 99 insertions(+)
12
13 --- a/drivers/net/phy/Kconfig
14 +++ b/drivers/net/phy/Kconfig
15 @@ -61,6 +61,80 @@ config SFP
16 depends on HWMON || HWMON=n
17 select MDIO_I2C
18
19 +comment "Switch configuration API + drivers"
20 +
21 +config SWCONFIG
22 + tristate "Switch configuration API"
23 + help
24 + Switch configuration API using netlink. This allows
25 + you to configure the VLAN features of certain switches.
26 +
27 +config SWCONFIG_LEDS
28 + bool "Switch LED trigger support"
29 + depends on (SWCONFIG && LEDS_TRIGGERS)
30 +
31 +config ADM6996_PHY
32 + tristate "Driver for ADM6996 switches"
33 + select SWCONFIG
34 + help
35 + Currently supports the ADM6996FC and ADM6996M switches.
36 + Support for FC is very limited.
37 +
38 +config AR8216_PHY
39 + tristate "Driver for Atheros AR8216/8327 switches"
40 + select SWCONFIG
41 + select ETHERNET_PACKET_MANGLE
42 +
43 +config AR8216_PHY_LEDS
44 + bool "Atheros AR8216 switch LED support"
45 + depends on (AR8216_PHY && LEDS_CLASS)
46 +
47 +source "drivers/net/phy/b53/Kconfig"
48 +
49 +config IP17XX_PHY
50 + tristate "Driver for IC+ IP17xx switches"
51 + select SWCONFIG
52 +
53 +config PSB6970_PHY
54 + tristate "Lantiq XWAY Tantos (PSB6970) Ethernet switch"
55 + select SWCONFIG
56 +
57 +config RTL8306_PHY
58 + tristate "Driver for Realtek RTL8306S switches"
59 + select SWCONFIG
60 +
61 +config RTL8366_SMI
62 + tristate "Driver for the RTL8366 SMI interface"
63 + depends on GPIOLIB
64 + help
65 + This module implements the SMI interface protocol which is used
66 + by some RTL8366 ethernet switch devices via the generic GPIO API.
67 +
68 +if RTL8366_SMI
69 +
70 +config RTL8366_SMI_DEBUG_FS
71 + bool "RTL8366 SMI interface debugfs support"
72 + depends on DEBUG_FS
73 + default n
74 +
75 +config RTL8366S_PHY
76 + tristate "Driver for the Realtek RTL8366S switch"
77 + select SWCONFIG
78 +
79 +config RTL8366RB_PHY
80 + tristate "Driver for the Realtek RTL8366RB switch"
81 + select SWCONFIG
82 +
83 +config RTL8367_PHY
84 + tristate "Driver for the Realtek RTL8367R/M switches"
85 + select SWCONFIG
86 +
87 +config RTL8367B_PHY
88 + tristate "Driver fot the Realtek RTL8367R-VB switch"
89 + select SWCONFIG
90 +
91 +endif # RTL8366_SMI
92 +
93 comment "MII PHY device drivers"
94
95 config AMD_PHY
96 --- a/drivers/net/phy/Makefile
97 +++ b/drivers/net/phy/Makefile
98 @@ -24,6 +24,21 @@ libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_
99 obj-$(CONFIG_PHYLINK) += phylink.o
100 obj-$(CONFIG_PHYLIB) += libphy.o
101
102 +obj-$(CONFIG_SWCONFIG) += swconfig.o
103 +obj-$(CONFIG_ADM6996_PHY) += adm6996.o
104 +obj-$(CONFIG_AR8216_PHY) += ar8xxx.o
105 +ar8xxx-y += ar8216.o
106 +ar8xxx-y += ar8327.o
107 +obj-$(CONFIG_SWCONFIG_B53) += b53/
108 +obj-$(CONFIG_IP17XX_PHY) += ip17xx.o
109 +obj-$(CONFIG_PSB6970_PHY) += psb6970.o
110 +obj-$(CONFIG_RTL8306_PHY) += rtl8306.o
111 +obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o
112 +obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o
113 +obj-$(CONFIG_RTL8366RB_PHY) += rtl8366rb.o
114 +obj-$(CONFIG_RTL8367_PHY) += rtl8367.o
115 +obj-$(CONFIG_RTL8367B_PHY) += rtl8367b.o
116 +
117 obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += mii_timestamper.o
118
119 obj-$(CONFIG_SFP) += sfp.o
120 --- a/include/linux/platform_data/b53.h
121 +++ b/include/linux/platform_data/b53.h
122 @@ -29,6 +29,9 @@ struct b53_platform_data {
123 u32 chip_id;
124 u16 enabled_ports;
125
126 + /* allow to specify an ethX alias */
127 + const char *alias;
128 +
129 /* only used by MMAP'd driver */
130 unsigned big_endian:1;
131 void __iomem *regs;