700-swconfig_switch_drivers.patch 3.5 KB

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