kernel: add module to support SFP cages
authorRené van Dorst <opensource@vdorst.com>
Tue, 7 Apr 2020 21:50:31 +0000 (23:50 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Sat, 25 Apr 2020 21:45:16 +0000 (23:45 +0200)
Enables kernel SFP case support.

Signed-off-by: René van Dorst <opensource@vdorst.com>
package/kernel/linux/modules/netdevices.mk
target/linux/ramips/image/mt7621.mk

index bb92447780662d5b5037b15981a72771d05a40e4..81b23f98df6edef4b498ff641a1b7075aa044dc1 100644 (file)
@@ -1141,3 +1141,23 @@ define KernelPackage/mlx5-core/description
 endef
 
 $(eval $(call KernelPackage,mlx5-core))
 endef
 
 $(eval $(call KernelPackage,mlx5-core))
+
+
+define KernelPackage/sfp
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=SFP cage support
+  DEPENDS:=+kmod-i2c-core +kmod-hwmon-core
+  KCONFIG:= \
+       CONFIG_SFP=m \
+       CONFIG_MDIO_I2C=m
+  FILES:= \
+       $(LINUX_DIR)/drivers/net/phy/sfp.ko \
+       $(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko
+  AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp)
+endef
+
+define KernelPackage/SFP/description
+ Kernel module to support SFP cages
+endef
+
+$(eval $(call KernelPackage,sfp))
index 739655f8370106031c9398b3ee808b31b09ed299..d5527cd98ddb89b66363ef34b7b0ed7b05f84afc 100644 (file)
@@ -820,7 +820,7 @@ TARGET_DEVICES += ubnt_edgerouter-x
 define Device/ubnt_edgerouter-x-sfp
   $(Device/ubnt_edgerouter_common)
   DEVICE_MODEL := EdgeRouter X SFP
 define Device/ubnt_edgerouter-x-sfp
   $(Device/ubnt_edgerouter_common)
   DEVICE_MODEL := EdgeRouter X SFP
-  DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x
+  DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-sfp
   SUPPORTED_DEVICES += ubnt-erx-sfp ubiquiti,edgerouterx-sfp
 endef
 TARGET_DEVICES += ubnt_edgerouter-x-sfp
   SUPPORTED_DEVICES += ubnt-erx-sfp ubiquiti,edgerouterx-sfp
 endef
 TARGET_DEVICES += ubnt_edgerouter-x-sfp