700-swconfig_switch_drivers.patch 3.7 KB

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