Merge Mainline
This commit is contained in:
commit
f2d673e645
@ -8,11 +8,11 @@ endif
|
||||
|
||||
LINUX_VERSION-4.14 = .193
|
||||
LINUX_VERSION-4.19 = .138
|
||||
LINUX_VERSION-5.4 = .58
|
||||
LINUX_VERSION-5.4 = .59
|
||||
|
||||
LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03
|
||||
LINUX_KERNEL_HASH-4.19.138 = d15c27d05f6c527269b75b30cc72972748e55720e7e00ad8abbaa4fe3b1d5e02
|
||||
LINUX_KERNEL_HASH-5.4.58 = 702fe2af119375387b314481b603d8ce71e71b4e5bae4cb70a980e0951b21647
|
||||
LINUX_KERNEL_HASH-5.4.59 = 9bcb9db2e4435f2e5948375862baf0973f1d7860ebe3d750383e5a6deac4b2fd
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=7
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -25,27 +25,30 @@ proto_map_setup() {
|
||||
local iface="$2"
|
||||
local link="map-$cfg"
|
||||
|
||||
local type legacymap mtu ttl tunlink zone encaplimit
|
||||
local maptype type legacymap mtu ttl tunlink zone encaplimit
|
||||
local rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset
|
||||
json_get_vars type legacymap mtu ttl tunlink zone encaplimit
|
||||
json_get_vars maptype type legacymap mtu ttl tunlink zone encaplimit
|
||||
json_get_vars rule ipaddr ip4prefixlen ip6prefix ip6prefixlen peeraddr ealen psidlen psid offset
|
||||
|
||||
[ "$zone" = "-" ] && zone=""
|
||||
[ -z "$type" ] && type="map-e"
|
||||
|
||||
# Compatibility with older config: use $type if $maptype is missing
|
||||
[ -z "$maptype" ] && maptype="$type"
|
||||
[ -z "$maptype" ] && maptype="map-e"
|
||||
[ -z "$ip4prefixlen" ] && ip4prefixlen=32
|
||||
|
||||
( proto_add_host_dependency "$cfg" "::" "$tunlink" )
|
||||
|
||||
# fixme: handle RA/DHCPv6 address race for LW
|
||||
[ "$type" = lw4o6 ] && sleep 5
|
||||
[ "$maptype" = lw4o6 ] && sleep 5
|
||||
|
||||
if [ -z "$rule" ]; then
|
||||
rule="type=$type,ipv6prefix=$ip6prefix,prefix6len=$ip6prefixlen,ipv4prefix=$ipaddr,prefix4len=$ip4prefixlen"
|
||||
rule="type=$maptype,ipv6prefix=$ip6prefix,prefix6len=$ip6prefixlen,ipv4prefix=$ipaddr,prefix4len=$ip4prefixlen"
|
||||
[ -n "$psid" ] && rule="$rule,psid=$psid"
|
||||
[ -n "$psidlen" ] && rule="$rule,psidlen=$psidlen"
|
||||
[ -n "$offset" ] && rule="$rule,offset=$offset"
|
||||
[ -n "$ealen" ] && rule="$rule,ealen=$ealen"
|
||||
if [ "$type" = "map-t" ]; then
|
||||
if [ "$maptype" = "map-t" ]; then
|
||||
rule="$rule,dmr=$peeraddr"
|
||||
else
|
||||
rule="$rule,br=$peeraddr"
|
||||
@ -70,7 +73,7 @@ proto_map_setup() {
|
||||
fi
|
||||
|
||||
k=$RULE_BMR
|
||||
if [ "$type" = "lw4o6" -o "$type" = "map-e" ]; then
|
||||
if [ "$maptype" = "lw4o6" -o "$maptype" = "map-e" ]; then
|
||||
proto_init_update "$link" 1
|
||||
proto_add_ipv4_address $(eval "echo \$RULE_${k}_IPV4ADDR") "" "" ""
|
||||
|
||||
@ -83,7 +86,7 @@ proto_map_setup() {
|
||||
json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE")
|
||||
json_add_object "data"
|
||||
[ -n "$encaplimit" ] && json_add_string encaplimit "$encaplimit"
|
||||
if [ "$type" = "map-e" ]; then
|
||||
if [ "$maptype" = "map-e" ]; then
|
||||
json_add_array "fmrs"
|
||||
for i in $(seq $RULE_COUNT); do
|
||||
[ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue
|
||||
@ -100,7 +103,7 @@ proto_map_setup() {
|
||||
|
||||
|
||||
proto_close_tunnel
|
||||
elif [ "$type" = "map-t" -a -f "/proc/net/nat46/control" ]; then
|
||||
elif [ "$maptype" = "map-t" -a -f "/proc/net/nat46/control" ]; then
|
||||
proto_init_update "$link" 1
|
||||
local style="MAP"
|
||||
[ "$legacymap" = 1 ] && style="MAP0"
|
||||
@ -151,7 +154,7 @@ proto_map_setup() {
|
||||
done
|
||||
done
|
||||
fi
|
||||
if [ "$type" = "map-t" ]; then
|
||||
if [ "$maptype" = "map-t" ]; then
|
||||
[ -z "$zone" ] && zone=$(fw3 -q network $iface 2>/dev/null)
|
||||
|
||||
[ -n "$zone" ] && {
|
||||
@ -183,7 +186,7 @@ proto_map_setup() {
|
||||
|
||||
proto_send_update "$cfg"
|
||||
|
||||
if [ "$type" = "lw4o6" -o "$type" = "map-e" ]; then
|
||||
if [ "$maptype" = "lw4o6" -o "$maptype" = "map-e" ]; then
|
||||
json_init
|
||||
json_add_string name "${cfg}_"
|
||||
json_add_string ifname "@$(eval "echo \$RULE_${k}_PD6IFACE")"
|
||||
@ -202,9 +205,10 @@ proto_map_teardown() {
|
||||
|
||||
json_get_var type type
|
||||
|
||||
[ -z "$type" ] && type="map-e"
|
||||
[ -z "$maptype" ] && maptype="$type"
|
||||
[ -z "$maptype" ] && maptype="map-e"
|
||||
|
||||
case "$type" in
|
||||
case "$maptype" in
|
||||
"map-e"|"lw4o6") ifdown "${cfg}_" ;;
|
||||
"map-t") [ -f "/proc/net/nat46/control" ] && echo del $link > /proc/net/nat46/control ;;
|
||||
esac
|
||||
@ -216,6 +220,7 @@ proto_map_init_config() {
|
||||
no_device=1
|
||||
available=1
|
||||
|
||||
proto_config_add_string "maptype"
|
||||
proto_config_add_string "rule"
|
||||
proto_config_add_string "ipaddr"
|
||||
proto_config_add_int "ip4prefixlen"
|
||||
|
||||
@ -6,7 +6,7 @@ endef
|
||||
define Device/wd_mybooklive
|
||||
DEVICE_VENDOR := Western Digital
|
||||
DEVICE_MODEL := My Book Live Series (Single + Duo)
|
||||
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic
|
||||
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += mbl wd,mybooklive-duo
|
||||
BLOCKSIZE := 1k
|
||||
DTB_SIZE := 16384
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
BOARDNAME:=Devices with NAND flash (Routers)
|
||||
FEATURES += nand pcie ramdisk squashfs usb
|
||||
|
||||
DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic
|
||||
DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for APM821XX boards with NAND flash.
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
define Profile/Default
|
||||
NAME:=Default Profile
|
||||
PRIORITY:=1
|
||||
PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic
|
||||
PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-wolfssl
|
||||
endef
|
||||
|
||||
define Profile/Default/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Default
|
||||
NAME:=Default Profile (all drivers)
|
||||
PACKAGES:= kmod-usb-ohci kmod-usb2 kmod-ath9k-htc wpad-basic
|
||||
PACKAGES:= kmod-usb-ohci kmod-usb2 kmod-ath9k-htc wpad-basic-wolfssl
|
||||
endef
|
||||
|
||||
define Profile/Default/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Default
|
||||
NAME:=Default Profile (all drivers)
|
||||
PACKAGES:= kmod-usb2 kmod-ath9k-htc wpad-basic
|
||||
PACKAGES:= kmod-usb2 kmod-ath9k-htc wpad-basic-wolfssl
|
||||
endef
|
||||
|
||||
define Profile/Default/Description
|
||||
|
||||
@ -19,6 +19,6 @@ endef
|
||||
|
||||
include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
DEFAULT_PACKAGES += wpad-mini kmod-ath5k swconfig kmod-gpio-button-hotplug
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl kmod-ath5k swconfig kmod-gpio-button-hotplug
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
BOARDNAME:=Generic
|
||||
FEATURES += squashfs
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards.
|
||||
|
||||
@ -287,7 +287,7 @@ endef
|
||||
TARGET_DEVICES += ubnt_rocket-m
|
||||
|
||||
define Device/ubnt_routerstation_common
|
||||
DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \
|
||||
DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
|
||||
kmod-usb2 fconfig
|
||||
DEVICE_VENDOR := Ubiquiti
|
||||
SOC := ar7161
|
||||
|
||||
@ -938,7 +938,7 @@ define Device/iodata_etg3-r
|
||||
DEVICE_VENDOR := I-O DATA
|
||||
DEVICE_MODEL := ETG3-R
|
||||
IMAGE_SIZE := 7680k
|
||||
DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic
|
||||
DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic-wolfssl
|
||||
endef
|
||||
TARGET_DEVICES += iodata_etg3-r
|
||||
|
||||
@ -998,7 +998,7 @@ define Device/jjplus_ja76pf2
|
||||
SOC := ar7161
|
||||
DEVICE_VENDOR := jjPlus
|
||||
DEVICE_MODEL := JA76PF2
|
||||
DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-mini -uboot-envtools fconfig
|
||||
DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig
|
||||
IMAGES := kernel.bin rootfs.bin
|
||||
IMAGE/kernel.bin := append-kernel
|
||||
IMAGE/rootfs.bin := append-rootfs | pad-rootfs
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
BOARDNAME := MikroTik devices
|
||||
FEATURES += minor nand squashfs
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for MikroTik devices based on Qualcomm Atheros
|
||||
|
||||
@ -2,7 +2,7 @@ BOARDNAME := Generic devices with NAND flash
|
||||
|
||||
FEATURES += squashfs nand
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Firmware for boards using Qualcomm Atheros, MIPS-based SoCs
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
BOARDNAME:=Devices with small flash
|
||||
FEATURES += squashfs small_flash
|
||||
|
||||
DEFAULT_PACKAGES += wpad-mini
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small flash
|
||||
|
||||
@ -79,7 +79,7 @@ define Device/rpi
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43430-sdio \
|
||||
cypress-nvram-43430-sdio-rpi-zero-w \
|
||||
kmod-brcmfmac wpad-basic
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
endef
|
||||
ifeq ($(SUBTARGET),bcm2708)
|
||||
TARGET_DEVICES += rpi
|
||||
@ -103,7 +103,7 @@ define Device/rpi-2
|
||||
cypress-nvram-43430-sdio-rpi-3b \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-3b-plus cypress-nvram-43455-sdio-rpi-4b \
|
||||
kmod-brcmfmac wpad-basic
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip
|
||||
endef
|
||||
@ -128,7 +128,7 @@ define Device/rpi-3
|
||||
cypress-nvram-43430-sdio-rpi-3b \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-3b-plus \
|
||||
kmod-brcmfmac wpad-basic
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
endef
|
||||
ifeq ($(SUBTARGET),bcm2710)
|
||||
TARGET_DEVICES += rpi-3
|
||||
@ -143,7 +143,7 @@ define Device/rpi-4
|
||||
DEVICE_PACKAGES := \
|
||||
cypress-firmware-43455-sdio \
|
||||
cypress-nvram-43455-sdio-rpi-4b \
|
||||
kmod-brcmfmac wpad-basic
|
||||
kmod-brcmfmac wpad-basic-wolfssl
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | boot-2711 | sdcard-img | gzip
|
||||
endef
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -729,7 +729,7 @@ static int spidev_probe(struct spi_devic
|
||||
@@ -734,7 +734,7 @@ static int spidev_probe(struct spi_devic
|
||||
* compatible string, it is a Linux implementation thing
|
||||
* rather than a description of the hardware.
|
||||
*/
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Dom Cobley <dom@raspberrypi.com>
|
||||
|
||||
--- a/drivers/cpufreq/Kconfig.arm
|
||||
+++ b/drivers/cpufreq/Kconfig.arm
|
||||
@@ -300,6 +300,15 @@ config ARM_TANGO_CPUFREQ
|
||||
@@ -301,6 +301,15 @@ config ARM_TANGO_CPUFREQ
|
||||
depends on CPUFREQ_DT && ARCH_TANGO
|
||||
default y
|
||||
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From 7ba7db27d18d141973ad7eaf1f339218d81a31a4 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Date: Sat, 13 Oct 2018 20:51:23 +0200
|
||||
Subject: [PATCH] staging: vchiq_arm: Fix platform device
|
||||
unregistration
|
||||
|
||||
In error case platform_device_register_data would return an ERR_PTR
|
||||
instead of NULL. So we better check this before unregistration.
|
||||
|
||||
Fixes: 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.")
|
||||
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
---
|
||||
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
|
||||
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
|
||||
@@ -3258,7 +3258,8 @@ failed_platform_init:
|
||||
|
||||
static int vchiq_remove(struct platform_device *pdev)
|
||||
{
|
||||
- platform_device_unregister(bcm2835_camera);
|
||||
+ if (!IS_ERR(bcm2835_camera))
|
||||
+ platform_device_unregister(bcm2835_camera);
|
||||
vchiq_debugfs_deinit();
|
||||
device_destroy(vchiq_class, vchiq_devid);
|
||||
cdev_del(&vchiq_cdev);
|
||||
@ -32,8 +32,8 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
@@ -3266,6 +3268,7 @@ static int vchiq_remove(struct platform_
|
||||
{
|
||||
if (!IS_ERR(bcm2835_camera))
|
||||
platform_device_unregister(bcm2835_camera);
|
||||
platform_device_unregister(bcm2835_audio);
|
||||
platform_device_unregister(bcm2835_camera);
|
||||
+ platform_device_unregister(vcsm_cma);
|
||||
vchiq_debugfs_deinit();
|
||||
device_destroy(vchiq_class, vchiq_devid);
|
||||
|
||||
@ -32,8 +32,8 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
@@ -3268,6 +3270,7 @@ static int vchiq_remove(struct platform_
|
||||
{
|
||||
if (!IS_ERR(bcm2835_camera))
|
||||
platform_device_unregister(bcm2835_camera);
|
||||
platform_device_unregister(bcm2835_audio);
|
||||
platform_device_unregister(bcm2835_camera);
|
||||
+ platform_device_unregister(bcm2835_codec);
|
||||
platform_device_unregister(vcsm_cma);
|
||||
vchiq_debugfs_deinit();
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
From 91da858c9327352c17a1f20ec10e78113ed45c82 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 6 Nov 2019 13:58:18 +0000
|
||||
Subject: [PATCH] staging: vchiq_arm: Unify the unload handling of
|
||||
platform devs
|
||||
|
||||
A helper function vchiq_register_child was added to deal with
|
||||
adding the platform devices. This returns NULL on failure, and
|
||||
that is assigned to the struct platform_device. There is
|
||||
therefore no way for remove to encounter an error pointer, so
|
||||
checking for IS_ERR() is redundant.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
|
||||
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
|
||||
@@ -3268,8 +3268,7 @@ failed_platform_init:
|
||||
|
||||
static int vchiq_remove(struct platform_device *pdev)
|
||||
{
|
||||
- if (!IS_ERR(bcm2835_camera))
|
||||
- platform_device_unregister(bcm2835_camera);
|
||||
+ platform_device_unregister(bcm2835_camera);
|
||||
platform_device_unregister(bcm2835_codec);
|
||||
platform_device_unregister(vcsm_cma);
|
||||
vchiq_debugfs_deinit();
|
||||
@ -1,25 +0,0 @@
|
||||
From 79a2c3013a3b2a4304f953a4a55c49c1bc85202b Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 3 Feb 2020 17:33:01 +0000
|
||||
Subject: [PATCH] staging: vchiq_arm: Add a matching unregister call
|
||||
|
||||
All the registered children of vchiq have a corresponding call to
|
||||
platform_device_unregister except bcm2835_audio. Fix that.
|
||||
|
||||
Fixes: 25c7597af20d ("staging: vchiq_arm: Register a platform device for audio")
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
|
||||
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
|
||||
@@ -3293,6 +3293,7 @@ failed_platform_init:
|
||||
|
||||
static int vchiq_remove(struct platform_device *pdev)
|
||||
{
|
||||
+ platform_device_unregister(bcm2835_audio);
|
||||
platform_device_unregister(bcm2835_camera);
|
||||
platform_device_unregister(bcm2835_codec);
|
||||
platform_device_unregister(vcsm_cma);
|
||||
@ -174,7 +174,7 @@ Cc: linux-rockchip@lists.infradead.org
|
||||
return ret;
|
||||
--- a/drivers/pci/controller/pcie-cadence-host.c
|
||||
+++ b/drivers/pci/controller/pcie-cadence-host.c
|
||||
@@ -211,7 +211,7 @@ static int cdns_pcie_host_init(struct de
|
||||
@@ -216,7 +216,7 @@ static int cdns_pcie_host_init(struct de
|
||||
int err;
|
||||
|
||||
/* Parse our PCI ranges and request their resources */
|
||||
|
||||
@ -11,7 +11,7 @@ This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28.
|
||||
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -394,7 +394,6 @@ spidev_ioctl(struct file *filp, unsigned
|
||||
@@ -399,7 +399,6 @@ spidev_ioctl(struct file *filp, unsigned
|
||||
else
|
||||
retval = get_user(tmp, (u32 __user *)arg);
|
||||
if (retval == 0) {
|
||||
@ -19,7 +19,7 @@ This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28.
|
||||
u32 save = spi->mode;
|
||||
|
||||
if (tmp & ~SPI_MODE_MASK) {
|
||||
@@ -402,10 +401,6 @@ spidev_ioctl(struct file *filp, unsigned
|
||||
@@ -407,10 +406,6 @@ spidev_ioctl(struct file *filp, unsigned
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-wl
|
||||
NAME:=Broadcom SoC, all Ethernet, BCM43xx WiFi (wl, proprietary)
|
||||
PACKAGES:=-wpad-basic kmod-b44 kmod-tg3 kmod-bgmac kmod-brcm-wl wlc nas
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-tg3 kmod-bgmac kmod-brcm-wl wlc nas
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-wl/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-none
|
||||
NAME:=Broadcom SoC, all Ethernet, No WiFi
|
||||
PACKAGES:=-wpad-basic kmod-b44 kmod-tg3 kmod-bgmac
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-tg3 kmod-bgmac
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-none/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-b44-wl
|
||||
NAME:=Broadcom SoC, b44 Ethernet, BCM43xx WiFi (wl, proprietary)
|
||||
PACKAGES:=-wpad-basic kmod-b44 kmod-brcm-wl wlc nas
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-brcm-wl wlc nas
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-b44-wl/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-b44-none
|
||||
NAME:=Broadcom SoC, b44 Ethernet, No WiFi
|
||||
PACKAGES:=-wpad-basic kmod-b44
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-b44
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-b44-none/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-tg3-wl
|
||||
NAME:=Broadcom SoC, tg3 Ethernet, BCM43xx WiFi (wl, proprietary)
|
||||
PACKAGES:=-wpad-basic kmod-brcm-wl wlc nas kmod-tg3
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl wlc nas kmod-tg3
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-tg3-wl/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-tg3-none
|
||||
NAME:=Broadcom SoC, tg3 Ethernet, no WiFi
|
||||
PACKAGES:=-wpad-basic kmod-tg3
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-tg3
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-tg3-none/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-bgmac-wl
|
||||
NAME:=Broadcom SoC, bgmac Ethernet, BCM43xx WiFi (wl, proprietary)
|
||||
PACKAGES:=-wpad-basic kmod-bgmac kmod-brcm-wl wlc nas
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-bgmac kmod-brcm-wl wlc nas
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-bgmac-wl/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-bgmac-none
|
||||
NAME:=Broadcom SoC, bgmac Ethernet, No WiFi
|
||||
PACKAGES:=-wpad-basic kmod-bgmac
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-bgmac
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-bgmac-none/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Ps1208mfg
|
||||
NAME:=Edimax PS-1208MFG
|
||||
PACKAGES:=-firewall -dropbear -dnsmasq -mtd -ppp -wpad-basic kmod-b44 block-mount kmod-usb-storage kmod-usb2 kmod-usb-ohci -iptables -swconfig kmod-fs-ext4
|
||||
PACKAGES:=-firewall -dropbear -dnsmasq -mtd -ppp -wpad-basic-wolfssl kmod-b44 block-mount kmod-usb-storage kmod-usb2 kmod-usb-ohci -iptables -swconfig kmod-fs-ext4
|
||||
endef
|
||||
|
||||
define Profile/Ps1208mfg/Description
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
BOARDNAME:=Generic
|
||||
FEATURES+=pcmcia
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build generic firmware for all Broadcom BCM47xx and BCM53xx MIPS
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-wl
|
||||
NAME:=Broadcom SoC, all Ethernet, BCM43xx WiFi (wl, proprietary)
|
||||
PACKAGES:=-wpad-mini kmod-brcm-wl-mini wlc nas
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl-mini wlc nas
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-wl/Description
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
FEATURES += low_mem pcmcia small_flash
|
||||
BOARDNAME:=Legacy (BMIPS3300)
|
||||
|
||||
DEFAULT_PACKAGES += wpad-mini
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build firmware for Broadcom BCM47xx and BCM53xx devices with
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-mips74k-wl
|
||||
NAME:=Broadcom SoC, BCM43xx WiFi (proprietary wl)
|
||||
PACKAGES:=-wpad-basic kmod-brcm-wl wlc nas
|
||||
PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl wlc nas
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-mips74k-wl/Description
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Broadcom-mips74k-none
|
||||
NAME:=Broadcom SoC, No WiFi
|
||||
PACKAGES:=-wpad-basic
|
||||
PACKAGES:=-wpad-basic-wolfssl
|
||||
endef
|
||||
|
||||
define Profile/Broadcom-mips74k-none/Description
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
BOARDNAME:=MIPS 74K
|
||||
CPU_TYPE:=74kc
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic
|
||||
DEFAULT_PACKAGES += wpad-basic-wolfssl
|
||||
|
||||
define Target/Description
|
||||
Build firmware for Broadcom BCM47xx and BCM53xx devices with
|
||||
|
||||
@ -113,7 +113,7 @@ DEVICE_VARS += SIGNATURE
|
||||
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION TPLINK_BOARD
|
||||
DEVICE_VARS += LUXUL_BOARD
|
||||
|
||||
IEEE8021X := wpad-basic
|
||||
IEEE8021X := wpad-basic-wolfssl
|
||||
B43 := $(IEEE8021X) kmod-b43
|
||||
BRCMFMAC_43602A1 := $(IEEE8021X) kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
|
||||
BRCMFMAC_4366B1 := $(IEEE8021X) kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
|
||||
|
||||
@ -311,12 +311,12 @@ define Device/Default
|
||||
endef
|
||||
DEVICE_VARS += CHIP_ID DEVICE_LOADADDR
|
||||
|
||||
ATH5K_PACKAGES := kmod-ath5k wpad-basic
|
||||
ATH9K_PACKAGES := kmod-ath9k wpad-basic
|
||||
B43_PACKAGES := kmod-b43 wpad-basic
|
||||
ATH5K_PACKAGES := kmod-ath5k wpad-basic-wolfssl
|
||||
ATH9K_PACKAGES := kmod-ath9k wpad-basic-wolfssl
|
||||
B43_PACKAGES := kmod-b43 wpad-basic-wolfssl
|
||||
BRCMWL_PACKAGES := kmod-brcm-wl nas wlc
|
||||
RT28_PACKAGES := kmod-rt2800-pci wpad-basic
|
||||
RT61_PACKAGES := kmod-rt61-pci wpad-basic
|
||||
RT28_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl
|
||||
RT61_PACKAGES := kmod-rt61-pci wpad-basic-wolfssl
|
||||
USB1_PACKAGES := kmod-usb-ohci kmod-usb-ledtrig-usbport
|
||||
USB2_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Default
|
||||
NAME:=Default Profile
|
||||
PACKAGES:=kmod-b43 wpad-basic
|
||||
PACKAGES:=kmod-b43 wpad-basic-wolfssl
|
||||
PRIORITY:=1
|
||||
endef
|
||||
|
||||
|
||||
@ -23,6 +23,6 @@ include $(INCLUDE_DIR)/target.mk
|
||||
|
||||
KERNELNAME:=zImage
|
||||
|
||||
DEFAULT_PACKAGES += kmod-ath9k kmod-usb2 wpad-basic
|
||||
DEFAULT_PACKAGES += kmod-ath9k kmod-usb2 wpad-basic-wolfssl
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4921,6 +4921,80 @@ static int mv88e6xxx_port_mdb_del(struct
|
||||
@@ -4920,6 +4920,80 @@ static int mv88e6xxx_port_mdb_del(struct
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port,
|
||||
bool unicast, bool multicast)
|
||||
{
|
||||
@@ -4975,6 +5049,8 @@ static const struct dsa_switch_ops mv88e
|
||||
@@ -4974,6 +5048,8 @@ static const struct dsa_switch_ops mv88e
|
||||
.port_mdb_prepare = mv88e6xxx_port_mdb_prepare,
|
||||
.port_mdb_add = mv88e6xxx_port_mdb_add,
|
||||
.port_mdb_del = mv88e6xxx_port_mdb_del,
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -4988,7 +4988,7 @@ static void mv88e6xxx_port_mirror_del(st
|
||||
@@ -4987,7 +4987,7 @@ static void mv88e6xxx_port_mirror_del(st
|
||||
if (chip->info->ops->set_egress_port(chip,
|
||||
direction,
|
||||
dsa_upstream_port(ds,
|
||||
|
||||
@ -22,7 +22,7 @@ Signed-off-by: Pavel Machek <pavel@ucw.cz>
|
||||
#include "leds.h"
|
||||
|
||||
static struct class *leds_class;
|
||||
@@ -276,8 +277,10 @@ int led_classdev_register_ext(struct dev
|
||||
@@ -277,8 +278,10 @@ int led_classdev_register_ext(struct dev
|
||||
mutex_unlock(&led_cdev->led_access);
|
||||
return PTR_ERR(led_cdev->dev);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
/* Align . to a 8 byte boundary equals to maximum function alignment. */
|
||||
#define ALIGN_FUNCTION() . = ALIGN(8)
|
||||
|
||||
@@ -406,14 +416,14 @@
|
||||
@@ -407,14 +417,14 @@
|
||||
/* Kernel symbol table: Normal symbols */ \
|
||||
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
|
||||
__start___ksymtab = .; \
|
||||
@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
__stop___ksymtab_gpl = .; \
|
||||
} \
|
||||
\
|
||||
@@ -475,7 +485,7 @@
|
||||
@@ -476,7 +486,7 @@
|
||||
\
|
||||
/* Kernel symbol table: strings */ \
|
||||
__ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
|
||||
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
} \
|
||||
\
|
||||
/* __*init sections */ \
|
||||
@@ -884,6 +894,8 @@
|
||||
@@ -885,6 +895,8 @@
|
||||
EXIT_TEXT \
|
||||
EXIT_DATA \
|
||||
EXIT_CALL \
|
||||
|
||||
@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -3608,6 +3608,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -3613,6 +3613,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
||||
@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+MODULE_LICENSE("GPL");
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -2668,6 +2668,7 @@ int wake_up_state(struct task_struct *p,
|
||||
@@ -2679,6 +2679,7 @@ int wake_up_state(struct task_struct *p,
|
||||
{
|
||||
return try_to_wake_up(p, state, 0);
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
|
||||
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -673,6 +673,7 @@ static const struct of_device_id spidev_
|
||||
@@ -678,6 +678,7 @@ static const struct of_device_id spidev_
|
||||
{ .compatible = "lwn,bk4" },
|
||||
{ .compatible = "dh,dhcom-board" },
|
||||
{ .compatible = "menlo,m53cpld" },
|
||||
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#define PACKET_FANOUT_LB 1
|
||||
--- a/net/packet/af_packet.c
|
||||
+++ b/net/packet/af_packet.c
|
||||
@@ -1795,6 +1795,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
@@ -1797,6 +1797,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
{
|
||||
struct sock *sk;
|
||||
struct sockaddr_pkt *spkt;
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/*
|
||||
* When we registered the protocol we saved the socket in the data
|
||||
@@ -1802,6 +1803,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
@@ -1804,6 +1805,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
*/
|
||||
|
||||
sk = pt->af_packet_priv;
|
||||
@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/*
|
||||
* Yank back the headers [hope the device set this
|
||||
@@ -1814,7 +1816,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
@@ -1816,7 +1818,7 @@ static int packet_rcv_spkt(struct sk_buf
|
||||
* so that this procedure is noop.
|
||||
*/
|
||||
|
||||
@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
goto out;
|
||||
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
@@ -2052,12 +2054,12 @@ static int packet_rcv(struct sk_buff *sk
|
||||
@@ -2054,12 +2056,12 @@ static int packet_rcv(struct sk_buff *sk
|
||||
unsigned int snaplen, res;
|
||||
bool is_drop_n_account = false;
|
||||
|
||||
@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
goto drop;
|
||||
|
||||
@@ -2182,12 +2184,12 @@ static int tpacket_rcv(struct sk_buff *s
|
||||
@@ -2184,12 +2186,12 @@ static int tpacket_rcv(struct sk_buff *s
|
||||
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
|
||||
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
|
||||
|
||||
@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
goto drop;
|
||||
|
||||
@@ -3279,6 +3281,7 @@ static int packet_create(struct net *net
|
||||
@@ -3284,6 +3286,7 @@ static int packet_create(struct net *net
|
||||
mutex_init(&po->pg_vec_lock);
|
||||
po->rollover = NULL;
|
||||
po->prot_hook.func = packet_rcv;
|
||||
@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (sock->type == SOCK_PACKET)
|
||||
po->prot_hook.func = packet_rcv_spkt;
|
||||
@@ -3912,6 +3915,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
@@ -3917,6 +3920,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
|
||||
return 0;
|
||||
}
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
}
|
||||
@@ -3968,6 +3981,13 @@ static int packet_getsockopt(struct sock
|
||||
@@ -3973,6 +3986,13 @@ static int packet_getsockopt(struct sock
|
||||
case PACKET_VNET_HDR:
|
||||
val = po->has_vnet_hdr;
|
||||
break;
|
||||
|
||||
@ -20,7 +20,7 @@ DEFAULT_PACKAGES += \
|
||||
kmod-ata-ahci kmod-ata-ahci-platform \
|
||||
kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
|
||||
kmod-phy-qcom-ipq806x-usb kmod-usb3 kmod-usb-dwc3-qcom \
|
||||
kmod-ath10k-ct wpad-basic \
|
||||
kmod-ath10k-ct wpad-basic-wolfssl \
|
||||
uboot-envtools
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
|
||||
--------------------
|
||||
--- a/drivers/cpufreq/Kconfig.arm
|
||||
+++ b/drivers/cpufreq/Kconfig.arm
|
||||
@@ -134,7 +134,7 @@ config ARM_OMAP2PLUS_CPUFREQ
|
||||
@@ -135,7 +135,7 @@ config ARM_OMAP2PLUS_CPUFREQ
|
||||
|
||||
config ARM_QCOM_CPUFREQ_NVMEM
|
||||
tristate "Qualcomm nvmem based CPUFreq"
|
||||
|
||||
@ -38,7 +38,7 @@ define Device/checkpoint_l-50
|
||||
DEVICE_VENDOR := Check Point
|
||||
DEVICE_MODEL := L-50
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \
|
||||
kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic
|
||||
kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-wolfssl
|
||||
IMAGES := sysupgrade.bin
|
||||
endef
|
||||
TARGET_DEVICES += checkpoint_l-50
|
||||
@ -100,7 +100,7 @@ TARGET_DEVICES += iom_ix2-200
|
||||
|
||||
define Device/linksys
|
||||
DEVICE_VENDOR := Linksys
|
||||
DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug
|
||||
DEVICE_PACKAGES := kmod-mwl8k wpad-basic-wolfssl kmod-gpio-button-hotplug
|
||||
KERNEL_IN_UBI :=
|
||||
UBINIZE_OPTS := -E 5
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
define Profile/Default
|
||||
NAME:=Default Profile
|
||||
PACKAGES:=kmod-mwl8k wpad-basic
|
||||
PACKAGES:=kmod-mwl8k wpad-basic-wolfssl
|
||||
PRIORITY:=1
|
||||
endef
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ define Device/avm_fritz7312
|
||||
DEVICE_MODEL := FRITZ!Box 7312
|
||||
SOC := ar9
|
||||
IMAGE_SIZE := 15744k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic \
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
@ -18,7 +18,7 @@ define Device/avm_fritz7320
|
||||
DEVICE_ALT0_MODEL := HomeServer
|
||||
SOC := ar9
|
||||
IMAGE_SIZE := 15744k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic \
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
@ -39,7 +39,7 @@ define Device/bt_homehub-v3a
|
||||
kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
|
||||
kmod-ltq-deu-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
|
||||
uboot-envtools
|
||||
SUPPORTED_DEVICES += BTHOMEHUBV3A
|
||||
endef
|
||||
@ -56,7 +56,7 @@ define Device/buffalo_wbmr-hp-g300h-a
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h
|
||||
endef
|
||||
TARGET_DEVICES += buffalo_wbmr-hp-g300h-a
|
||||
@ -72,7 +72,7 @@ define Device/buffalo_wbmr-hp-g300h-b
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h
|
||||
endef
|
||||
TARGET_DEVICES += buffalo_wbmr-hp-g300h-b
|
||||
@ -102,7 +102,7 @@ define Device/netgear_dgn3500
|
||||
dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "WW" | pad-rootfs | \
|
||||
check-size 16320k | pad-to 16384k
|
||||
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
@ -125,7 +125,7 @@ define Device/netgear_dgn3500b
|
||||
dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "DE" | pad-rootfs | \
|
||||
check-size 16320k | pad-to 16384k
|
||||
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
@ -139,7 +139,7 @@ define Device/zte_h201l
|
||||
DEVICE_MODEL := H201L
|
||||
IMAGE_SIZE := 7808k
|
||||
SOC := ar9
|
||||
DEVICE_PACKAGES := kmod-ath9k-htc wpad-basic \
|
||||
DEVICE_PACKAGES := kmod-ath9k-htc wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoe \
|
||||
@ -155,7 +155,7 @@ define Device/zyxel_p-2601hn
|
||||
DEVICE_VARIANT := F1/F3
|
||||
IMAGE_SIZE := 15616k
|
||||
SOC := ar9
|
||||
DEVICE_PACKAGES := kmod-rt2800-usb wpad-basic \
|
||||
DEVICE_PACKAGES := kmod-rt2800-usb wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
|
||||
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
|
||||
ltq-adsl-app ppp-mod-pppoe \
|
||||
|
||||
@ -10,7 +10,7 @@ define Device/arcadyan_arv4510pw
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ltq-tapi kmod-ltq-vmmc \
|
||||
kmod-rt2800-pci kmod-ath5k wpad-basic
|
||||
kmod-rt2800-pci kmod-ath5k wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV4510PW
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv4510pw
|
||||
@ -43,7 +43,7 @@ define Device/arcadyan_arv7506pw11
|
||||
DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-rt2800-pci wpad-basic
|
||||
kmod-rt2800-pci wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV7506PW11
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv7506pw11
|
||||
@ -60,7 +60,7 @@ define Device/arcadyan_arv7510pw22
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ltq-tapi kmod-ltq-vmmc \
|
||||
kmod-rt2800-pci wpad-basic \
|
||||
kmod-rt2800-pci wpad-basic-wolfssl \
|
||||
kmod-usb-uhci kmod-usb2 kmod-usb2-pci
|
||||
SUPPORTED_DEVICES += ARV7510PW22
|
||||
endef
|
||||
@ -77,7 +77,7 @@ define Device/arcadyan_arv7518pw
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV7518PW
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv7518pw
|
||||
@ -93,7 +93,7 @@ define Device/arcadyan_arv7519pw
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-rt2800-pci wpad-basic
|
||||
kmod-rt2800-pci wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV7519PW
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv7519pw
|
||||
@ -106,7 +106,7 @@ define Device/arcadyan_arv7525pw
|
||||
DEVICE_ALT0_VARIANT := Typ A
|
||||
IMAGE_SIZE := 3776k
|
||||
SOC := danube
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic \
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa -swconfig
|
||||
@ -127,7 +127,7 @@ define Device/arcadyan_arv752dpw
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ltq-tapi kmod-ltq-vmmc \
|
||||
kmod-rt2800-pci wpad-basic
|
||||
kmod-rt2800-pci wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV752DPW
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv752dpw
|
||||
@ -144,7 +144,7 @@ define Device/arcadyan_arv752dpw22
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ltq-tapi kmod-ltq-vmmc \
|
||||
kmod-rt2800-pci wpad-basic
|
||||
kmod-rt2800-pci wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV752DPW22
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv752dpw22
|
||||
@ -160,7 +160,7 @@ define Device/arcadyan_arv8539pw22
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV8539PW22
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_arv8539pw22
|
||||
@ -176,7 +176,7 @@ define Device/audiocodes_mp-252
|
||||
kmod-usb-ledtrig-usbport kmod-usb-dwc2 \
|
||||
kmod-rt2800-pci \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
wpad-basic
|
||||
wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ACMP252
|
||||
endef
|
||||
TARGET_DEVICES += audiocodes_mp-252
|
||||
@ -193,7 +193,7 @@ define Device/bt_homehub-v2b
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
kmod-ltq-deu-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath9k kmod-owl-loader wpad-basic
|
||||
kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += BTHOMEHUBV2B
|
||||
endef
|
||||
TARGET_DEVICES += bt_homehub-v2b
|
||||
@ -216,7 +216,7 @@ define Device/siemens_gigaset-sx76x
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoe \
|
||||
kmod-ath5k wpad-basic
|
||||
kmod-ath5k wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += GIGASX76X
|
||||
endef
|
||||
TARGET_DEVICES += siemens_gigaset-sx76x
|
||||
|
||||
@ -20,7 +20,7 @@ define Device/tplink_tdw8970
|
||||
TPLINK_HWID := 0x89700001
|
||||
TPLINK_HWREV := 1
|
||||
IMAGE_SIZE := 7680k
|
||||
DEVICE_PACKAGES:= kmod-ath9k wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
DEVICE_PACKAGES:= kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
SUPPORTED_DEVICES += TDW8970
|
||||
endef
|
||||
TARGET_DEVICES += tplink_tdw8970
|
||||
@ -33,7 +33,7 @@ define Device/tplink_tdw8980
|
||||
TPLINK_HWID := 0x89800001
|
||||
TPLINK_HWREV := 14
|
||||
IMAGE_SIZE := 7680k
|
||||
DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
SUPPORTED_DEVICES += TDW8980
|
||||
endef
|
||||
TARGET_DEVICES += tplink_tdw8980
|
||||
@ -46,7 +46,7 @@ define Device/tplink_vr200
|
||||
TPLINK_HWID := 0x63e64801
|
||||
TPLINK_HWREV := 0x53
|
||||
IMAGE_SIZE := 15808k
|
||||
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
SUPPORTED_DEVICES += VR200
|
||||
endef
|
||||
TARGET_DEVICES += tplink_vr200
|
||||
@ -59,7 +59,7 @@ define Device/tplink_vr200v
|
||||
TPLINK_HWID := 0x73b70801
|
||||
TPLINK_HWREV := 0x2f
|
||||
IMAGE_SIZE := 15808k
|
||||
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc
|
||||
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc
|
||||
SUPPORTED_DEVICES += VR200v
|
||||
endef
|
||||
TARGET_DEVICES += tplink_vr200v
|
||||
|
||||
@ -43,7 +43,7 @@ define Device/arcadyan_vgv7510kw22-brn
|
||||
SIGNATURE := BRNDA6431
|
||||
MAGIC := 0x12345678
|
||||
CRC32_POLY := 0x04c11db7
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
SUPPORTED_DEVICES += VGV7510KW22BRN
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_vgv7510kw22-brn
|
||||
@ -56,7 +56,7 @@ define Device/arcadyan_vgv7510kw22-nor
|
||||
DEVICE_ALT0_MODEL := Box 6431
|
||||
DEVICE_ALT0_VARIANT := NOR
|
||||
IMAGE_SIZE := 15232k
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
SUPPORTED_DEVICES += VGV7510KW22NOR
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_vgv7510kw22-nor
|
||||
@ -73,7 +73,7 @@ define Device/arcadyan_vgv7519-brn
|
||||
SIGNATURE := 5D00008000
|
||||
MAGIC := 0x12345678
|
||||
CRC32_POLY := 0x2083b8ed
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
SUPPORTED_DEVICES += VGV7519BRN
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_vgv7519-brn
|
||||
@ -86,7 +86,7 @@ define Device/arcadyan_vgv7519-nor
|
||||
DEVICE_ALT0_MODEL := Experiabox 8
|
||||
DEVICE_ALT0_VARIANT := NOR
|
||||
IMAGE_SIZE := 15360k
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
|
||||
SUPPORTED_DEVICES += VGV7519NOR
|
||||
endef
|
||||
TARGET_DEVICES += arcadyan_vgv7519-nor
|
||||
@ -101,7 +101,7 @@ define Device/avm_fritz3370
|
||||
IMAGES += eva-kernel.bin eva-filesystem.bin
|
||||
IMAGE/eva-kernel.bin := append-kernel
|
||||
IMAGE/eva-filesystem.bin := append-ubi
|
||||
DEVICE_PACKAGES := kmod-ath9k wpad-basic kmod-usb-dwc2 fritz-tffs
|
||||
DEVICE_PACKAGES := kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 fritz-tffs
|
||||
endef
|
||||
|
||||
define Device/avm_fritz3370-rev2-hynix
|
||||
@ -122,7 +122,7 @@ define Device/avm_fritz7360sl
|
||||
$(Device/AVM)
|
||||
DEVICE_MODEL := FRITZ!Box 7360 SL
|
||||
IMAGE_SIZE := 15744k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2
|
||||
SUPPORTED_DEVICES += FRITZ7360SL
|
||||
endef
|
||||
TARGET_DEVICES += avm_fritz7360sl
|
||||
@ -132,7 +132,7 @@ define Device/avm_fritz7360-v2
|
||||
DEVICE_MODEL := FRITZ!Box 7360
|
||||
DEVICE_VARIANT := v2
|
||||
IMAGE_SIZE := 32128k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2
|
||||
endef
|
||||
TARGET_DEVICES += avm_fritz7360-v2
|
||||
|
||||
@ -142,7 +142,7 @@ define Device/avm_fritz7362sl
|
||||
DEVICE_MODEL := FRITZ!Box 7362 SL
|
||||
KERNEL_SIZE := 4096k
|
||||
IMAGE_SIZE := 49152k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 fritz-tffs
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 fritz-tffs
|
||||
endef
|
||||
TARGET_DEVICES += avm_fritz7362sl
|
||||
|
||||
@ -153,7 +153,7 @@ define Device/avm_fritz7412
|
||||
BOARD_NAME := FRITZ7412
|
||||
KERNEL_SIZE := 4096k
|
||||
IMAGE_SIZE := 49152k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic fritz-tffs-nand fritz-caldata
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl fritz-tffs-nand fritz-caldata
|
||||
endef
|
||||
TARGET_DEVICES += avm_fritz7412
|
||||
|
||||
@ -164,7 +164,7 @@ define Device/bt_homehub-v5a
|
||||
DEVICE_VARIANT := Type A
|
||||
BOARD_NAME := BTHOMEHUBV5A
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader \
|
||||
kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic kmod-usb-dwc2
|
||||
kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic-wolfssl kmod-usb-dwc2
|
||||
SUPPORTED_DEVICES += BTHOMEHUBV5A
|
||||
endef
|
||||
TARGET_DEVICES += bt_homehub-v5a
|
||||
@ -173,7 +173,7 @@ define Device/buffalo_wbmr-300hpd
|
||||
DEVICE_VENDOR := Buffalo
|
||||
DEVICE_MODEL := WBMR-300HPD
|
||||
IMAGE_SIZE := 15616k
|
||||
DEVICE_PACKAGES := kmod-mt7603 wpad-basic kmod-usb-dwc2
|
||||
DEVICE_PACKAGES := kmod-mt7603 wpad-basic-wolfssl kmod-usb-dwc2
|
||||
SUPPORTED_DEVICES += WBMR300
|
||||
endef
|
||||
TARGET_DEVICES += buffalo_wbmr-300hpd
|
||||
@ -184,7 +184,7 @@ define Device/lantiq_easy80920-nand
|
||||
DEVICE_MODEL := VR9 EASY80920
|
||||
DEVICE_VARIANT := NAND
|
||||
IMAGE_SIZE := 64512k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
endef
|
||||
TARGET_DEVICES += lantiq_easy80920-nand
|
||||
|
||||
@ -193,7 +193,7 @@ define Device/lantiq_easy80920-nor
|
||||
DEVICE_MODEL := VR9 EASY80920
|
||||
DEVICE_VARIANT := NOR
|
||||
IMAGE_SIZE := 7936k
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
endef
|
||||
TARGET_DEVICES += lantiq_easy80920-nor
|
||||
|
||||
@ -218,7 +218,7 @@ define Device/zyxel_p-2812hnu-f1
|
||||
DEVICE_MODEL := P-2812HNU
|
||||
DEVICE_VARIANT := F1
|
||||
BOARD_NAME := P2812HNUF1
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
|
||||
KERNEL_SIZE := 3072k
|
||||
SUPPORTED_DEVICES += P2812HNUF1
|
||||
endef
|
||||
@ -230,7 +230,7 @@ define Device/zyxel_p-2812hnu-f3
|
||||
DEVICE_MODEL := P-2812HNU
|
||||
DEVICE_VARIANT := F3
|
||||
BOARD_NAME := P2812HNUF3
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2
|
||||
DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2
|
||||
SUPPORTED_DEVICES += P2812HNUF3
|
||||
endef
|
||||
TARGET_DEVICES += zyxel_p-2812hnu-f3
|
||||
|
||||
@ -6,7 +6,7 @@ define Device/arcadyan_arv4518pwr01
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath5k wpad-mini
|
||||
kmod-ath5k wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV4518PWR01
|
||||
DEFAULT := n
|
||||
endef
|
||||
@ -20,7 +20,7 @@ define Device/arcadyan_arv4518pwr01a
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-ath5k wpad-basic
|
||||
kmod-ath5k wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV4518PWR01A
|
||||
DEFAULT := n
|
||||
endef
|
||||
@ -38,7 +38,7 @@ define Device/arcadyan_arv4520pw
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa \
|
||||
kmod-rt61-pci wpad-mini
|
||||
kmod-rt61-pci wpad-basic-wolfssl
|
||||
SUPPORTED_DEVICES += ARV4520PW
|
||||
DEFAULT := n
|
||||
endef
|
||||
@ -51,7 +51,7 @@ define Device/arcadyan_arv4525pw
|
||||
DEVICE_ALT0_MODEL := Speedport W502V
|
||||
DEVICE_ALT0_VARIANT := Typ A
|
||||
IMAGE_SIZE := 3776k
|
||||
DEVICE_PACKAGES := kmod-ath5k wpad-mini \
|
||||
DEVICE_PACKAGES := kmod-ath5k wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa -swconfig
|
||||
@ -67,7 +67,7 @@ define Device/arcadyan_arv452cqw
|
||||
DEVICE_ALT0_MODEL := Easybox 801
|
||||
IMAGE_SIZE := 3776k
|
||||
DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
|
||||
kmod-ath5k wpad-mini \
|
||||
kmod-ath5k wpad-basic-wolfssl \
|
||||
kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
|
||||
kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
|
||||
ltq-adsl-app ppp-mod-pppoa
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From 907137d9ef048e7d0282c28e47b32aa4084ad395 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Mon, 6 Jul 2020 00:05:12 +0200
|
||||
Subject: [PATCH v2] spi: lantiq-ssc: Fix warning by using WQ_MEM_RECLAIM
|
||||
|
||||
The lantiq-ssc driver uses internally an own workqueue to wait till the
|
||||
data is not only written out of the FIFO but really written to the wire.
|
||||
This workqueue is flushed while the SPI subsystem is working in some
|
||||
other system workqueue.
|
||||
|
||||
The system workqueue is marked as WQ_MEM_RECLAIM, but the workqueue in
|
||||
the lantiq-ssc driver does not use WQ_MEM_RECLAIM for now. Add this flag
|
||||
too to prevent this warning.
|
||||
|
||||
This fixes the following warning:
|
||||
[ 2.975956] WARNING: CPU: 1 PID: 17 at kernel/workqueue.c:2614 check_flush_dependency+0x168/0x184
|
||||
[ 2.984752] workqueue: WQ_MEM_RECLAIM kblockd:blk_mq_run_work_fn is flushing !WQ_MEM_RECLAIM 1e100800.spi:0x0
|
||||
|
||||
Fixes: 891b7c5fbf61 ("mtd_blkdevs: convert to blk-mq")
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
drivers/spi/spi-lantiq-ssc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spi-lantiq-ssc.c
|
||||
+++ b/drivers/spi/spi-lantiq-ssc.c
|
||||
@@ -907,7 +907,7 @@ static int lantiq_ssc_probe(struct platf
|
||||
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 8) |
|
||||
SPI_BPW_MASK(16) | SPI_BPW_MASK(32);
|
||||
|
||||
- spi->wq = alloc_ordered_workqueue(dev_name(dev), 0);
|
||||
+ spi->wq = alloc_ordered_workqueue(dev_name(dev), WQ_MEM_RECLAIM);
|
||||
if (!spi->wq) {
|
||||
err = -ENOMEM;
|
||||
goto err_clk_put;
|
||||
@ -1,51 +0,0 @@
|
||||
From 3dc3a4c6ac9e8a0940a9974b8fe2da7641bfa3dd Mon Sep 17 00:00:00 2001
|
||||
From: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
Date: Thu, 22 Aug 2019 12:47:12 +0300
|
||||
Subject: [PATCH] arm64: dts: LS1028a-rdb: use Ethernet PHY interrupt
|
||||
|
||||
Use the PHY interrupt wired to GPIO pins as part of MDIO WA performance
|
||||
impact mitigation.
|
||||
|
||||
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
|
||||
---
|
||||
arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
|
||||
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
|
||||
@@ -202,6 +202,8 @@
|
||||
#size-cells = <0>;
|
||||
sgmii_phy0: ethernet-phy@2 {
|
||||
reg = <0x2>;
|
||||
+ interrupt-parent = <&gpio1>;
|
||||
+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -213,18 +215,26 @@
|
||||
&enetc_mdio_pf3 {
|
||||
qsgmii_phy1: ethernet-phy@4 {
|
||||
reg = <0x10>;
|
||||
+ interrupt-parent = <&gpio1>;
|
||||
+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
|
||||
qsgmii_phy2: ethernet-phy@5 {
|
||||
reg = <0x11>;
|
||||
+ interrupt-parent = <&gpio1>;
|
||||
+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
|
||||
qsgmii_phy3: ethernet-phy@6 {
|
||||
reg = <0x12>;
|
||||
+ interrupt-parent = <&gpio1>;
|
||||
+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
|
||||
qsgmii_phy4: ethernet-phy@7 {
|
||||
reg = <0x13>;
|
||||
+ interrupt-parent = <&gpio1>;
|
||||
+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -32,7 +32,7 @@ Signed-off-by: Wen He <wen.he_1@nxp.com>
|
||||
|
||||
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
|
||||
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
|
||||
@@ -272,13 +272,6 @@
|
||||
@@ -262,13 +262,6 @@
|
||||
};
|
||||
|
||||
&hdptx0 {
|
||||
|
||||
@ -1,85 +0,0 @@
|
||||
From c57a0efc17627d0077408544ded02674aefdecae Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 16:59:02 +0200
|
||||
Subject: [PATCH] Revert "arm64: dts: LS1028a-rdb: use Ethernet PHY interrupt"
|
||||
|
||||
This reverts commit 841edb98671cfc4d6f010393ac429c78082ec4bd.
|
||||
|
||||
There are 2 separate issues with interrupts on the LS1028A-RDB board:
|
||||
|
||||
1. The GPIO1_DAT25 interrupt line is shared, so there is a real risk of
|
||||
race conditions if used in edge-triggered mode, as we currently do.
|
||||
This can be illustrated in the following setup:
|
||||
- Take 2 LS1028A-RDB boards
|
||||
- Connect swp0 to swp0, swp1 to swp1, swp2 to swp2
|
||||
- Plug/unplug the power to board 2, 10 times in a row. This will make
|
||||
the PHYs lose link simultaneously.
|
||||
- Notice that at one point, the net devices on board 1 remain in a
|
||||
state where not all the links are down (visible in "ip link"):
|
||||
|
||||
5: swp0: <BROADCAST,MULTICAST,UP> mtu 1468 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
|
||||
link/ether be:97:36:d3:3d:70 brd ff:ff:ff:ff:ff:ff
|
||||
6: swp1: <BROADCAST,MULTICAST,UP> mtu 1468 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
|
||||
link/ether be:97:36:d3:3d:71 brd ff:ff:ff:ff:ff:ff
|
||||
7: swp2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 qdisc pfifo_fast master br0 state DOWN mode DEFAULT group default qlen 1000
|
||||
link/ether be:97:36:d3:3d:72 brd ff:ff:ff:ff:ff:ff
|
||||
|
||||
This cannot be solved by making the interrupts level-triggered,
|
||||
because the gpio-mpc8xxx controller only supports generating
|
||||
edge-triggered interrupts. So the effective reality is that we
|
||||
cannot not use shared interrupts connected to the gpio1
|
||||
interrupt-parent.
|
||||
|
||||
2. The uBUS1 and uBUS2 slots that share this interrupt line with the
|
||||
Ethernet PHYs are not pulled up by default, they are left floating on
|
||||
current revisions of the LS1028A-RDB boards. So sufficient electrical
|
||||
noise on these lines will make the CPLD think there's an interrupt
|
||||
request, so it asserts the GPIO1_DAT25 signal and leaves it asserted.
|
||||
This means that the PHYs on those boards will never have link when
|
||||
used in interrupt mode, because their IRQ will be masked by the uBUS
|
||||
line that is erroneously kept asserted. In poll mode this issue does
|
||||
not occur.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
|
||||
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
|
||||
@@ -206,8 +206,6 @@
|
||||
#size-cells = <0>;
|
||||
sgmii_phy0: ethernet-phy@2 {
|
||||
reg = <0x2>;
|
||||
- interrupt-parent = <&gpio1>;
|
||||
- interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -219,26 +217,18 @@
|
||||
&enetc_mdio_pf3 {
|
||||
qsgmii_phy1: ethernet-phy@4 {
|
||||
reg = <0x10>;
|
||||
- interrupt-parent = <&gpio1>;
|
||||
- interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
|
||||
qsgmii_phy2: ethernet-phy@5 {
|
||||
reg = <0x11>;
|
||||
- interrupt-parent = <&gpio1>;
|
||||
- interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
|
||||
qsgmii_phy3: ethernet-phy@6 {
|
||||
reg = <0x12>;
|
||||
- interrupt-parent = <&gpio1>;
|
||||
- interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
|
||||
qsgmii_phy4: ethernet-phy@7 {
|
||||
reg = <0x13>;
|
||||
- interrupt-parent = <&gpio1>;
|
||||
- interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -56,7 +56,7 @@ Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
|
||||
static void enable_rams_ecc(struct fman_fpm_regs __iomem *fpm_rg)
|
||||
{
|
||||
@@ -1919,7 +1941,10 @@ _return:
|
||||
@@ -1918,7 +1940,10 @@ _return:
|
||||
static int fman_init(struct fman *fman)
|
||||
{
|
||||
struct fman_cfg *cfg = NULL;
|
||||
@ -68,7 +68,7 @@ Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
|
||||
if (is_init_done(fman->cfg))
|
||||
return -EINVAL;
|
||||
@@ -1939,6 +1964,7 @@ static int fman_init(struct fman *fman)
|
||||
@@ -1938,6 +1963,7 @@ static int fman_init(struct fman *fman)
|
||||
memset_io((void __iomem *)(fman->base_addr + CGP_OFFSET), 0,
|
||||
fman->state->fm_port_num_of_cg);
|
||||
|
||||
@ -76,7 +76,7 @@ Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
/* Save LIODN info before FMan reset
|
||||
* Skipping non-existent port 0 (i = 1)
|
||||
*/
|
||||
@@ -1958,6 +1984,9 @@ static int fman_init(struct fman *fman)
|
||||
@@ -1957,6 +1983,9 @@ static int fman_init(struct fman *fman)
|
||||
}
|
||||
fman->liodn_base[i] = liodn_base;
|
||||
}
|
||||
@ -86,7 +86,7 @@ Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
|
||||
err = fman_reset(fman);
|
||||
if (err)
|
||||
@@ -2186,8 +2215,12 @@ int fman_set_port_params(struct fman *fm
|
||||
@@ -2185,8 +2214,12 @@ int fman_set_port_params(struct fman *fm
|
||||
if (err)
|
||||
goto return_err;
|
||||
|
||||
|
||||
@ -1,117 +0,0 @@
|
||||
From bc447c21304c1297f340d3daaf69915ebbc1f882 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 30 Sep 2019 19:20:26 +0300
|
||||
Subject: [PATCH] mii: Add helpers for parsing SGMII auto-negotiation
|
||||
|
||||
Typically a MAC PCS auto-configures itself after it receives the
|
||||
negotiated link settings from the PHY, but some MAC devices are more
|
||||
special and need manual manipulation of the SGMII AN result.
|
||||
|
||||
Therefore, add the bit definitions for the SGMII registers 4 and 5
|
||||
(local device ability, link partner ability), as well as a link_mode
|
||||
conversion helper that can be used to feed the AN results into
|
||||
phy_resolve_aneg_linkmode.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
include/linux/mii.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
include/uapi/linux/mii.h | 10 ++++++++++
|
||||
2 files changed, 60 insertions(+)
|
||||
|
||||
--- a/include/linux/mii.h
|
||||
+++ b/include/linux/mii.h
|
||||
@@ -373,6 +373,56 @@ static inline u32 mii_lpa_to_ethtool_lpa
|
||||
}
|
||||
|
||||
/**
|
||||
+ * mii_lpa_mod_linkmode_adv_sgmii
|
||||
+ * @lp_advertising: pointer to destination link mode.
|
||||
+ * @lpa: value of the MII_LPA register
|
||||
+ *
|
||||
+ * A small helper function that translates MII_LPA bits to
|
||||
+ * linkmode advertisement settings for SGMII.
|
||||
+ * Leaves other bits unchanged.
|
||||
+ */
|
||||
+static inline void
|
||||
+mii_lpa_mod_linkmode_lpa_sgmii(unsigned long *lp_advertising, u32 lpa)
|
||||
+{
|
||||
+ u32 speed_duplex = lpa & LPA_SGMII_DPX_SPD_MASK;
|
||||
+
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, lp_advertising,
|
||||
+ speed_duplex == LPA_SGMII_1000HALF);
|
||||
+
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, lp_advertising,
|
||||
+ speed_duplex == LPA_SGMII_1000FULL);
|
||||
+
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, lp_advertising,
|
||||
+ speed_duplex == LPA_SGMII_100HALF);
|
||||
+
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, lp_advertising,
|
||||
+ speed_duplex == LPA_SGMII_100FULL);
|
||||
+
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, lp_advertising,
|
||||
+ speed_duplex == LPA_SGMII_10HALF);
|
||||
+
|
||||
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, lp_advertising,
|
||||
+ speed_duplex == LPA_SGMII_10FULL);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * mii_lpa_to_linkmode_adv_sgmii
|
||||
+ * @advertising: pointer to destination link mode.
|
||||
+ * @lpa: value of the MII_LPA register
|
||||
+ *
|
||||
+ * A small helper function that translates MII_ADVERTISE bits
|
||||
+ * to linkmode advertisement settings when in SGMII mode.
|
||||
+ * Clears the old value of advertising.
|
||||
+ */
|
||||
+static inline void mii_lpa_to_linkmode_lpa_sgmii(unsigned long *lp_advertising,
|
||||
+ u32 lpa)
|
||||
+{
|
||||
+ linkmode_zero(lp_advertising);
|
||||
+
|
||||
+ mii_lpa_mod_linkmode_lpa_sgmii(lp_advertising, lpa);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* mii_adv_mod_linkmode_adv_t
|
||||
* @advertising:pointer to destination link mode.
|
||||
* @adv: value of the MII_ADVERTISE register
|
||||
--- a/include/uapi/linux/mii.h
|
||||
+++ b/include/uapi/linux/mii.h
|
||||
@@ -71,6 +71,7 @@
|
||||
/* Advertisement control register. */
|
||||
#define ADVERTISE_SLCT 0x001f /* Selector bits */
|
||||
#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
|
||||
+#define ADVERTISE_SGMII 0x0001 /* Can do SGMII */
|
||||
#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
|
||||
#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
|
||||
#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
|
||||
@@ -94,6 +95,7 @@
|
||||
|
||||
/* Link partner ability register. */
|
||||
#define LPA_SLCT 0x001f /* Same as advertise selector */
|
||||
+#define LPA_SGMII 0x0001 /* Can do SGMII */
|
||||
#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
|
||||
#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
|
||||
#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
|
||||
@@ -104,11 +106,19 @@
|
||||
#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
|
||||
#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
|
||||
#define LPA_PAUSE_CAP 0x0400 /* Can pause */
|
||||
+#define LPA_SGMII_DPX_SPD_MASK 0x1C00 /* SGMII duplex and speed bits */
|
||||
+#define LPA_SGMII_10HALF 0x0000 /* Can do SGMII 10mbps half-duplex */
|
||||
+#define LPA_SGMII_10FULL 0x1000 /* Can do SGMII 10mbps full-duplex */
|
||||
+#define LPA_SGMII_100HALF 0x0400 /* Can do SGMII 100mbps half-duplex */
|
||||
+#define LPA_SGMII_100FULL 0x1400 /* Can do SGMII 100mbps full-duplex */
|
||||
#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
|
||||
+#define LPA_SGMII_1000HALF 0x0800 /* Can do SGMII 1000mbps half-duplex */
|
||||
+#define LPA_SGMII_1000FULL 0x1800 /* Can do SGMII 1000mbps full-duplex */
|
||||
#define LPA_RESV 0x1000 /* Unused... */
|
||||
#define LPA_RFAULT 0x2000 /* Link partner faulted */
|
||||
#define LPA_LPACK 0x4000 /* Link partner acked us */
|
||||
#define LPA_NPAGE 0x8000 /* Next page bit */
|
||||
+#define LPA_SGMII_LINK 0x8000 /* Link partner has link */
|
||||
|
||||
#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
|
||||
#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
|
||||
@ -1,26 +0,0 @@
|
||||
From 4446e9789e662fe53dfcfe34551b5b74a013086c Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Fri, 22 Nov 2019 13:46:46 +0200
|
||||
Subject: [PATCH] net: phylink: make QSGMII a valid PHY mode for in-band AN
|
||||
|
||||
QSGMII is just SGMII clocked at a higher frequency (5 Gbaud vs 1.25
|
||||
Gbaud). Logically it is just 4 SGMII interfaces multiplexed onto the
|
||||
same physical lanes. Each MAC PCS has its own in-band AN process with
|
||||
the system side of the QSGMII PHY, which is identical to the regular
|
||||
SGMII AN process. So allow QSGMII as a valid in-band AN mode.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/phy/phylink.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/net/phy/phylink.c
|
||||
+++ b/drivers/net/phy/phylink.c
|
||||
@@ -283,6 +283,7 @@ static int phylink_parse_mode(struct phy
|
||||
|
||||
switch (pl->link_config.interface) {
|
||||
case PHY_INTERFACE_MODE_SGMII:
|
||||
+ case PHY_INTERFACE_MODE_QSGMII:
|
||||
phylink_set(pl->supported, 10baseT_Half);
|
||||
phylink_set(pl->supported, 10baseT_Full);
|
||||
phylink_set(pl->supported, 100baseT_Half);
|
||||
@ -1,29 +0,0 @@
|
||||
From d526228a8159d136c914c8f71d5944cda2f93d9a Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Thu, 28 Nov 2019 03:21:53 +0200
|
||||
Subject: [PATCH] net: phylink: call mac_an_restart for SGMII/QSGMII inband
|
||||
interfaces too
|
||||
|
||||
It doesn't quite make sense why restarting the AN process should be
|
||||
unique to 802.3z (1000Base-X) modes. It is valid to put an SGMII PCS in
|
||||
in-band AN mode, therefore also make PHYLINK re-trigger an
|
||||
auto-negotiation if needed.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/phy/phylink.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/phy/phylink.c
|
||||
+++ b/drivers/net/phy/phylink.c
|
||||
@@ -360,7 +360,9 @@ static void phylink_mac_config_up(struct
|
||||
static void phylink_mac_an_restart(struct phylink *pl)
|
||||
{
|
||||
if (pl->link_config.an_enabled &&
|
||||
- phy_interface_mode_is_8023z(pl->link_config.interface))
|
||||
+ (phy_interface_mode_is_8023z(pl->link_config.interface) ||
|
||||
+ pl->link_config.interface == PHY_INTERFACE_MODE_SGMII ||
|
||||
+ pl->link_config.interface == PHY_INTERFACE_MODE_QSGMII))
|
||||
pl->ops->mac_an_restart(pl->config);
|
||||
}
|
||||
|
||||
@ -1,192 +0,0 @@
|
||||
From 210fde07cd9e3f2dc826f538ccec4e90b54eb7e5 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Fri, 22 Nov 2019 17:47:56 +0200
|
||||
Subject: [PATCH] enetc: export enetc_mdio definitionns to include/linux/fsl
|
||||
|
||||
The Felix DSA switch has an internal MDIO bus that has the same register
|
||||
map as the ENETC one, so the accessors can be reused.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 18 +++++++++-
|
||||
drivers/net/ethernet/freescale/enetc/enetc_mdio.h | 12 -------
|
||||
.../net/ethernet/freescale/enetc/enetc_pci_mdio.c | 41 +++++++++++++---------
|
||||
include/linux/fsl/enetc_mdio.h | 21 +++++++++++
|
||||
4 files changed, 62 insertions(+), 30 deletions(-)
|
||||
delete mode 100644 drivers/net/ethernet/freescale/enetc/enetc_mdio.h
|
||||
create mode 100644 include/linux/fsl/enetc_mdio.h
|
||||
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/* Copyright 2019 NXP */
|
||||
|
||||
+#include <linux/fsl/enetc_mdio.h>
|
||||
#include <linux/mdio.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#include "enetc_pf.h"
|
||||
-#include "enetc_mdio.h"
|
||||
|
||||
#define ENETC_MDIO_CFG 0x0 /* MDIO configuration and status */
|
||||
#define ENETC_MDIO_CTL 0x4 /* MDIO control */
|
||||
@@ -99,6 +99,7 @@ int enetc_mdio_write(struct mii_bus *bus
|
||||
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(enetc_mdio_write);
|
||||
|
||||
int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
|
||||
{
|
||||
@@ -154,6 +155,21 @@ int enetc_mdio_read(struct mii_bus *bus,
|
||||
|
||||
return value;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(enetc_mdio_read);
|
||||
+
|
||||
+struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs)
|
||||
+{
|
||||
+ struct enetc_hw *hw;
|
||||
+
|
||||
+ hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL);
|
||||
+ if (!hw)
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
+
|
||||
+ hw->port = port_regs;
|
||||
+
|
||||
+ return hw;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(enetc_hw_alloc);
|
||||
|
||||
int enetc_mdio_probe(struct enetc_pf *pf)
|
||||
{
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.h
|
||||
+++ /dev/null
|
||||
@@ -1,12 +0,0 @@
|
||||
-/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
|
||||
-/* Copyright 2019 NXP */
|
||||
-
|
||||
-#include <linux/phy.h>
|
||||
-
|
||||
-struct enetc_mdio_priv {
|
||||
- struct enetc_hw *hw;
|
||||
- int mdio_base;
|
||||
-};
|
||||
-
|
||||
-int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value);
|
||||
-int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum);
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
|
||||
@@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/* Copyright 2019 NXP */
|
||||
+#include <linux/fsl/enetc_mdio.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include "enetc_pf.h"
|
||||
-#include "enetc_mdio.h"
|
||||
|
||||
#define ENETC_MDIO_DEV_ID 0xee01
|
||||
#define ENETC_MDIO_DEV_NAME "FSL PCIe IE Central MDIO"
|
||||
@@ -14,17 +14,29 @@ static int enetc_pci_mdio_probe(struct p
|
||||
{
|
||||
struct enetc_mdio_priv *mdio_priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
+ void __iomem *port_regs;
|
||||
struct enetc_hw *hw;
|
||||
struct mii_bus *bus;
|
||||
int err;
|
||||
|
||||
- hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL);
|
||||
- if (!hw)
|
||||
- return -ENOMEM;
|
||||
+ port_regs = pci_iomap(pdev, 0, 0);
|
||||
+ if (!port_regs) {
|
||||
+ dev_err(dev, "iomap failed\n");
|
||||
+ err = -ENXIO;
|
||||
+ goto err_ioremap;
|
||||
+ }
|
||||
+
|
||||
+ hw = enetc_hw_alloc(dev, port_regs);
|
||||
+ if (IS_ERR(enetc_hw_alloc)) {
|
||||
+ err = PTR_ERR(hw);
|
||||
+ goto err_hw_alloc;
|
||||
+ }
|
||||
|
||||
bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv));
|
||||
- if (!bus)
|
||||
- return -ENOMEM;
|
||||
+ if (!bus) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto err_mdiobus_alloc;
|
||||
+ }
|
||||
|
||||
bus->name = ENETC_MDIO_BUS_NAME;
|
||||
bus->read = enetc_mdio_read;
|
||||
@@ -39,7 +51,7 @@ static int enetc_pci_mdio_probe(struct p
|
||||
err = pci_enable_device_mem(pdev);
|
||||
if (err) {
|
||||
dev_err(dev, "device enable failed\n");
|
||||
- return err;
|
||||
+ goto err_pci_enable;
|
||||
}
|
||||
|
||||
err = pci_request_region(pdev, 0, KBUILD_MODNAME);
|
||||
@@ -48,13 +60,6 @@ static int enetc_pci_mdio_probe(struct p
|
||||
goto err_pci_mem_reg;
|
||||
}
|
||||
|
||||
- hw->port = pci_iomap(pdev, 0, 0);
|
||||
- if (!hw->port) {
|
||||
- err = -ENXIO;
|
||||
- dev_err(dev, "iomap failed\n");
|
||||
- goto err_ioremap;
|
||||
- }
|
||||
-
|
||||
err = of_mdiobus_register(bus, dev->of_node);
|
||||
if (err)
|
||||
goto err_mdiobus_reg;
|
||||
@@ -64,12 +69,14 @@ static int enetc_pci_mdio_probe(struct p
|
||||
return 0;
|
||||
|
||||
err_mdiobus_reg:
|
||||
- iounmap(mdio_priv->hw->port);
|
||||
-err_ioremap:
|
||||
pci_release_mem_regions(pdev);
|
||||
err_pci_mem_reg:
|
||||
pci_disable_device(pdev);
|
||||
-
|
||||
+err_pci_enable:
|
||||
+err_mdiobus_alloc:
|
||||
+ iounmap(port_regs);
|
||||
+err_hw_alloc:
|
||||
+err_ioremap:
|
||||
return err;
|
||||
}
|
||||
|
||||
--- /dev/null
|
||||
+++ b/include/linux/fsl/enetc_mdio.h
|
||||
@@ -0,0 +1,21 @@
|
||||
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
|
||||
+/* Copyright 2019 NXP */
|
||||
+
|
||||
+#include <linux/phy.h>
|
||||
+
|
||||
+/* PCS registers */
|
||||
+#define ENETC_PCS_LINK_TIMER1 0x12
|
||||
+#define ENETC_PCS_LINK_TIMER1_VAL 0x06a0
|
||||
+#define ENETC_PCS_LINK_TIMER2 0x13
|
||||
+#define ENETC_PCS_LINK_TIMER2_VAL 0x0003
|
||||
+#define ENETC_PCS_IF_MODE 0x14
|
||||
+#define ENETC_PCS_IF_MODE_SGMII_AN 0x0003
|
||||
+
|
||||
+struct enetc_mdio_priv {
|
||||
+ struct enetc_hw *hw;
|
||||
+ int mdio_base;
|
||||
+};
|
||||
+
|
||||
+int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value);
|
||||
+int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum);
|
||||
+struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs);
|
||||
@ -1,58 +0,0 @@
|
||||
From 5961ca6738507031a64f8580ceb8ab0b630d47a5 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Wed, 27 Nov 2019 19:21:13 +0200
|
||||
Subject: [PATCH] enetc: Set MDIO_CFG_HOLD to the recommended value of 2
|
||||
|
||||
This increases the MDIO hold time to 5 enet_clk cycles from the previous
|
||||
value of 0. This is actually the out-of-reset value, that the driver was
|
||||
previously overwriting with 0. Zero worked for the external MDIO, but
|
||||
breaks communication with the internal MDIO buses on which the PCS of
|
||||
ENETC SI's and Felix switch are found.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
@@ -31,15 +31,19 @@ static inline void _enetc_mdio_wr(struct
|
||||
_enetc_mdio_wr(mdio_priv, ENETC_##off, val)
|
||||
#define enetc_mdio_rd_reg(off) enetc_mdio_rd(mdio_priv, off)
|
||||
|
||||
-#define ENETC_MDC_DIV 258
|
||||
-
|
||||
#define MDIO_CFG_CLKDIV(x) ((((x) >> 1) & 0xff) << 8)
|
||||
#define MDIO_CFG_BSY BIT(0)
|
||||
#define MDIO_CFG_RD_ER BIT(1)
|
||||
+#define MDIO_CFG_HOLD(x) (((x) << 2) & GENMASK(4, 2))
|
||||
#define MDIO_CFG_ENC45 BIT(6)
|
||||
/* external MDIO only - driven on neg MDC edge */
|
||||
#define MDIO_CFG_NEG BIT(23)
|
||||
|
||||
+#define ENETC_EMDIO_CFG \
|
||||
+ (MDIO_CFG_HOLD(2) | \
|
||||
+ MDIO_CFG_CLKDIV(258) | \
|
||||
+ MDIO_CFG_NEG)
|
||||
+
|
||||
#define MDIO_CTL_DEV_ADDR(x) ((x) & 0x1f)
|
||||
#define MDIO_CTL_PORT_ADDR(x) (((x) & 0x1f) << 5)
|
||||
#define MDIO_CTL_READ BIT(15)
|
||||
@@ -61,7 +65,7 @@ int enetc_mdio_write(struct mii_bus *bus
|
||||
u16 dev_addr;
|
||||
int ret;
|
||||
|
||||
- mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG;
|
||||
+ mdio_cfg = ENETC_EMDIO_CFG;
|
||||
if (regnum & MII_ADDR_C45) {
|
||||
dev_addr = (regnum >> 16) & 0x1f;
|
||||
mdio_cfg |= MDIO_CFG_ENC45;
|
||||
@@ -108,7 +112,7 @@ int enetc_mdio_read(struct mii_bus *bus,
|
||||
u16 dev_addr, value;
|
||||
int ret;
|
||||
|
||||
- mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG;
|
||||
+ mdio_cfg = ENETC_EMDIO_CFG;
|
||||
if (regnum & MII_ADDR_C45) {
|
||||
dev_addr = (regnum >> 16) & 0x1f;
|
||||
mdio_cfg |= MDIO_CFG_ENC45;
|
||||
@ -1,154 +0,0 @@
|
||||
From 4ba6e00c2f45bf4189ec6a8ef71b45346ae804f2 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Thu, 28 Nov 2019 15:36:10 +0200
|
||||
Subject: [PATCH] net: mscc: ocelot: do not force Felix MACs at lower speeds
|
||||
than gigabit
|
||||
|
||||
In the LS1028A, the VSC9959 switch was integrated with an NXP PCS which
|
||||
performs SGMII AN and rate adaptation autonomously. The MAC does not
|
||||
need to know about this, and forcing the MAC speed to something else,
|
||||
when connected to a 10/100 link partner, actually breaks the GMII
|
||||
internal link between the MAC and the PCS.
|
||||
|
||||
Add a quirk system in the ocelot driver, and a first quirk called "PCS
|
||||
performs rate adaptation", to distinguish the VSC7514 from the VSC9959
|
||||
regarding this behavior.
|
||||
|
||||
Signed-off-by: Catalin Horghidan <catalin.horghidan@nxp.com>
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/dsa/ocelot/felix.c | 1 +
|
||||
drivers/net/dsa/ocelot/felix.h | 1 +
|
||||
drivers/net/dsa/ocelot/felix_vsc9959.c | 1 +
|
||||
drivers/net/ethernet/mscc/ocelot.c | 32 ++++++++++++++++++--------------
|
||||
include/soc/mscc/ocelot.h | 7 +++++++
|
||||
5 files changed, 28 insertions(+), 14 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -249,6 +249,7 @@ static int felix_init_structs(struct fel
|
||||
ocelot->num_stats = felix->info->num_stats;
|
||||
ocelot->shared_queue_sz = felix->info->shared_queue_sz;
|
||||
ocelot->ops = felix->info->ops;
|
||||
+ ocelot->quirks = felix->info->quirks;
|
||||
|
||||
base = pci_resource_start(felix->pdev, felix->info->pci_bar);
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.h
|
||||
+++ b/drivers/net/dsa/ocelot/felix.h
|
||||
@@ -18,6 +18,7 @@ struct felix_info {
|
||||
unsigned int num_stats;
|
||||
int num_ports;
|
||||
int pci_bar;
|
||||
+ unsigned long quirks;
|
||||
};
|
||||
|
||||
extern struct felix_info felix_info_vsc9959;
|
||||
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
@@ -584,4 +584,5 @@ struct felix_info felix_info_vsc9959 = {
|
||||
.shared_queue_sz = 128 * 1024,
|
||||
.num_ports = 6,
|
||||
.pci_bar = 4,
|
||||
+ .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION,
|
||||
};
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -409,27 +409,32 @@ static u16 ocelot_wm_enc(u16 value)
|
||||
void ocelot_adjust_link(struct ocelot *ocelot, int port,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
+ int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA;
|
||||
struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
- int speed, mode = 0;
|
||||
|
||||
- switch (phydev->speed) {
|
||||
+ if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION)
|
||||
+ speed = SPEED_1000;
|
||||
+ else
|
||||
+ speed = phydev->speed;
|
||||
+
|
||||
+ switch (speed) {
|
||||
case SPEED_10:
|
||||
- speed = OCELOT_SPEED_10;
|
||||
+ mac_speed = OCELOT_SPEED_10;
|
||||
break;
|
||||
case SPEED_100:
|
||||
- speed = OCELOT_SPEED_100;
|
||||
+ mac_speed = OCELOT_SPEED_100;
|
||||
break;
|
||||
case SPEED_1000:
|
||||
- speed = OCELOT_SPEED_1000;
|
||||
- mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
+ mac_speed = OCELOT_SPEED_1000;
|
||||
+ mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
break;
|
||||
case SPEED_2500:
|
||||
- speed = OCELOT_SPEED_2500;
|
||||
- mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
+ mac_speed = OCELOT_SPEED_2500;
|
||||
+ mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
break;
|
||||
default:
|
||||
dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n",
|
||||
- port, phydev->speed);
|
||||
+ port, speed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -439,8 +444,7 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
return;
|
||||
|
||||
/* Only full duplex supported for now */
|
||||
- ocelot_port_writel(ocelot_port, DEV_MAC_MODE_CFG_FDX_ENA |
|
||||
- mode, DEV_MAC_MODE_CFG);
|
||||
+ ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
|
||||
|
||||
if (ocelot->ops->pcs_init)
|
||||
ocelot->ops->pcs_init(ocelot, port);
|
||||
@@ -451,11 +455,11 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
|
||||
/* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of
|
||||
* reset */
|
||||
- ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed),
|
||||
+ ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(mac_speed),
|
||||
DEV_CLOCK_CFG);
|
||||
|
||||
/* No PFC */
|
||||
- ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(speed),
|
||||
+ ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(mac_speed),
|
||||
ANA_PFC_PFC_CFG, port);
|
||||
|
||||
/* Core: Enable port for frame transfer */
|
||||
@@ -469,7 +473,7 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA |
|
||||
SYS_MAC_FC_CFG_ZERO_PAUSE_ENA |
|
||||
SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
|
||||
- SYS_MAC_FC_CFG_FC_LINK_SPEED(speed),
|
||||
+ SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed),
|
||||
SYS_MAC_FC_CFG, port);
|
||||
ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port);
|
||||
}
|
||||
--- a/include/soc/mscc/ocelot.h
|
||||
+++ b/include/soc/mscc/ocelot.h
|
||||
@@ -404,6 +404,11 @@ enum ocelot_tag_prefix {
|
||||
OCELOT_TAG_PREFIX_LONG,
|
||||
};
|
||||
|
||||
+/* Hardware quirks (differences between switch instantiations) */
|
||||
+enum {
|
||||
+ OCELOT_PCS_PERFORMS_RATE_ADAPTATION = BIT(0),
|
||||
+};
|
||||
+
|
||||
struct ocelot;
|
||||
|
||||
struct ocelot_ops {
|
||||
@@ -464,6 +469,8 @@ struct ocelot {
|
||||
struct delayed_work stats_work;
|
||||
struct workqueue_struct *stats_queue;
|
||||
|
||||
+ unsigned long quirks;
|
||||
+
|
||||
u8 ptp:1;
|
||||
struct ptp_clock *ptp_clock;
|
||||
struct ptp_clock_info ptp_info;
|
||||
@ -1,689 +0,0 @@
|
||||
From 0a2b7489bf60d24a54e16147b416f339ebe4f511 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 18 Nov 2019 18:05:01 +0200
|
||||
Subject: [PATCH] net: mscc: ocelot: convert to PHYLINK
|
||||
|
||||
This patch reworks ocelot_board.c (aka the MIPS on the VSC7514) to
|
||||
register a PHYLINK instance for each port. The registration code is
|
||||
local to the VSC7514, but the PHYLINK callback implementation is common
|
||||
so that the Felix DSA front-end can use it as well (but DSA does its own
|
||||
registration).
|
||||
|
||||
Now Felix can use native PHYLINK callbacks instead of the PHYLIB
|
||||
adaptation layer in DSA, which had issues supporting fixed-link slave
|
||||
ports (no struct phy_device to pass to the adjust_link callback), as
|
||||
well as fixed-link CPU port at 2.5Gbps.
|
||||
|
||||
The old code from ocelot_port_enable and ocelot_port_disable has been
|
||||
moved into ocelot_phylink_mac_link_up and ocelot_phylink_mac_link_down.
|
||||
|
||||
The PHY connect operation has been moved from ocelot_port_open to
|
||||
mscc_ocelot_probe in ocelot_board.c.
|
||||
|
||||
The phy_set_mode_ext() call for the SerDes PHY has also been moved into
|
||||
mscc_ocelot_probe from ocelot_port_open, and since that was the only
|
||||
reason why a reference to it was kept in ocelot_port_private, that
|
||||
reference was removed.
|
||||
|
||||
Again, the usage of phy_interface_t phy_mode is now local to
|
||||
mscc_ocelot_probe only, after moving the PHY connect operation.
|
||||
So it was also removed from ocelot_port_private.
|
||||
*Maybe* in the future, it can be added back to the common struct
|
||||
ocelot_port, with the purpose of validating mismatches between
|
||||
state->phy_interface and ocelot_port->phy_mode in PHYLINK callbacks.
|
||||
But at the moment that is not critical, since other DSA drivers are not
|
||||
doing that either. No SFP+ modules are in use with Felix/Ocelot yet, to
|
||||
my knowledge.
|
||||
|
||||
In-band AN is not yet supported, due to the fact that this is a mostly
|
||||
mechanical patch for the moment. The mac_an_restart PHYLINK operation
|
||||
needs to be implemented, as well as mac_link_state. Both are SerDes
|
||||
specific, and Felix does not have its PCS configured yet (it works just
|
||||
by virtue of U-Boot initialization at the moment).
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/dsa/ocelot/felix.c | 65 +++++++++----
|
||||
drivers/net/ethernet/mscc/Kconfig | 2 +-
|
||||
drivers/net/ethernet/mscc/ocelot.c | 150 ++++++++++++++++--------------
|
||||
drivers/net/ethernet/mscc/ocelot.h | 13 +--
|
||||
drivers/net/ethernet/mscc/ocelot_board.c | 154 +++++++++++++++++++++++++++----
|
||||
include/soc/mscc/ocelot.h | 22 ++++-
|
||||
6 files changed, 289 insertions(+), 117 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -58,14 +58,6 @@ static int felix_set_ageing_time(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void felix_adjust_link(struct dsa_switch *ds, int port,
|
||||
- struct phy_device *phydev)
|
||||
-{
|
||||
- struct ocelot *ocelot = ds->priv;
|
||||
-
|
||||
- ocelot_adjust_link(ocelot, port, phydev);
|
||||
-}
|
||||
-
|
||||
static int felix_fdb_dump(struct dsa_switch *ds, int port,
|
||||
dsa_fdb_dump_cb_t *cb, void *data)
|
||||
{
|
||||
@@ -185,21 +177,59 @@ static int felix_tsn_enable(struct dsa_p
|
||||
}
|
||||
#endif
|
||||
|
||||
-static int felix_port_enable(struct dsa_switch *ds, int port,
|
||||
- struct phy_device *phy)
|
||||
+static void felix_phylink_validate(struct dsa_switch *ds, int port,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
- ocelot_port_enable(ocelot, port, phy);
|
||||
+ ocelot_phylink_validate(ocelot, port, supported, state);
|
||||
+}
|
||||
+
|
||||
+static int felix_phylink_mac_pcs_get_state(struct dsa_switch *ds, int port,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct ocelot *ocelot = ds->priv;
|
||||
+
|
||||
+ ocelot_phylink_mac_pcs_get_state(ocelot, port, state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void felix_port_disable(struct dsa_switch *ds, int port)
|
||||
+static void felix_phylink_mac_config(struct dsa_switch *ds, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct ocelot *ocelot = ds->priv;
|
||||
+
|
||||
+ ocelot_phylink_mac_config(ocelot, port, link_an_mode, state);
|
||||
+}
|
||||
+
|
||||
+static void felix_phylink_mac_an_restart(struct dsa_switch *ds, int port)
|
||||
+{
|
||||
+ struct ocelot *ocelot = ds->priv;
|
||||
+
|
||||
+ ocelot_phylink_mac_an_restart(ocelot, port);
|
||||
+}
|
||||
+
|
||||
+static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface)
|
||||
+{
|
||||
+ struct ocelot *ocelot = ds->priv;
|
||||
+
|
||||
+ ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface);
|
||||
+}
|
||||
+
|
||||
+static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface,
|
||||
+ struct phy_device *phydev)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
- return ocelot_port_disable(ocelot, port);
|
||||
+ ocelot_phylink_mac_link_up(ocelot, port, link_an_mode, interface,
|
||||
+ phydev);
|
||||
}
|
||||
|
||||
static void felix_get_strings(struct dsa_switch *ds, int port,
|
||||
@@ -417,9 +447,12 @@ static const struct dsa_switch_ops felix
|
||||
.get_ethtool_stats = felix_get_ethtool_stats,
|
||||
.get_sset_count = felix_get_sset_count,
|
||||
.get_ts_info = felix_get_ts_info,
|
||||
- .adjust_link = felix_adjust_link,
|
||||
- .port_enable = felix_port_enable,
|
||||
- .port_disable = felix_port_disable,
|
||||
+ .phylink_validate = felix_phylink_validate,
|
||||
+ .phylink_mac_link_state = felix_phylink_mac_pcs_get_state,
|
||||
+ .phylink_mac_config = felix_phylink_mac_config,
|
||||
+ .phylink_mac_an_restart = felix_phylink_mac_an_restart,
|
||||
+ .phylink_mac_link_down = felix_phylink_mac_link_down,
|
||||
+ .phylink_mac_link_up = felix_phylink_mac_link_up,
|
||||
.port_fdb_dump = felix_fdb_dump,
|
||||
.port_fdb_add = felix_fdb_add,
|
||||
.port_fdb_del = felix_fdb_del,
|
||||
--- a/drivers/net/ethernet/mscc/Kconfig
|
||||
+++ b/drivers/net/ethernet/mscc/Kconfig
|
||||
@@ -15,7 +15,7 @@ config MSCC_OCELOT_SWITCH
|
||||
tristate "Ocelot switch driver"
|
||||
depends on NET_SWITCHDEV
|
||||
depends on HAS_IOMEM
|
||||
- select PHYLIB
|
||||
+ select PHYLINK
|
||||
select REGMAP_MMIO
|
||||
help
|
||||
This driver supports the Ocelot network switch device.
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/netdevice.h>
|
||||
-#include <linux/phy.h>
|
||||
+#include <linux/phylink.h>
|
||||
#include <linux/ptp_clock_kernel.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/iopoll.h>
|
||||
@@ -406,18 +406,66 @@ static u16 ocelot_wm_enc(u16 value)
|
||||
return value;
|
||||
}
|
||||
|
||||
-void ocelot_adjust_link(struct ocelot *ocelot, int port,
|
||||
- struct phy_device *phydev)
|
||||
+void ocelot_phylink_validate(struct ocelot *ocelot, int port,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
+
|
||||
+ if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_QSGMII) {
|
||||
+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* No half-duplex. */
|
||||
+ phylink_set_port_modes(mask);
|
||||
+ phylink_set(mask, Autoneg);
|
||||
+ phylink_set(mask, Pause);
|
||||
+ phylink_set(mask, Asym_Pause);
|
||||
+ phylink_set(mask, 10baseT_Full);
|
||||
+ phylink_set(mask, 100baseT_Full);
|
||||
+ phylink_set(mask, 1000baseT_Full);
|
||||
+ phylink_set(mask, 2500baseT_Full);
|
||||
+
|
||||
+ bitmap_and(supported, supported, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ bitmap_and(state->advertising, state->advertising, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+}
|
||||
+EXPORT_SYMBOL(ocelot_phylink_validate);
|
||||
+
|
||||
+void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ state->link = 1;
|
||||
+}
|
||||
+EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state);
|
||||
+
|
||||
+void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port)
|
||||
+{
|
||||
+ /* Not supported */
|
||||
+}
|
||||
+EXPORT_SYMBOL(ocelot_phylink_mac_an_restart);
|
||||
+
|
||||
+void ocelot_phylink_mac_config(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
{
|
||||
int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA;
|
||||
struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
+ u32 mac_fc_cfg;
|
||||
|
||||
if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION)
|
||||
speed = SPEED_1000;
|
||||
else
|
||||
- speed = phydev->speed;
|
||||
+ speed = state->speed;
|
||||
|
||||
switch (speed) {
|
||||
+ case SPEED_UNKNOWN:
|
||||
+ return;
|
||||
case SPEED_10:
|
||||
mac_speed = OCELOT_SPEED_10;
|
||||
break;
|
||||
@@ -433,16 +481,11 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
break;
|
||||
default:
|
||||
- dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n",
|
||||
+ dev_err(ocelot->dev, "Unsupported speed on port %d: %d\n",
|
||||
port, speed);
|
||||
return;
|
||||
}
|
||||
|
||||
- phy_print_status(phydev);
|
||||
-
|
||||
- if (!phydev->link)
|
||||
- return;
|
||||
-
|
||||
/* Only full duplex supported for now */
|
||||
ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
|
||||
|
||||
@@ -469,27 +512,36 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
QSYS_SWITCH_PORT_MODE, port);
|
||||
|
||||
/* Flow control */
|
||||
- ocelot_write_rix(ocelot, SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) |
|
||||
- SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA |
|
||||
- SYS_MAC_FC_CFG_ZERO_PAUSE_ENA |
|
||||
- SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
|
||||
- SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed),
|
||||
- SYS_MAC_FC_CFG, port);
|
||||
+ mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed);
|
||||
+ if (state->pause & MLO_PAUSE_RX)
|
||||
+ mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA;
|
||||
+ if (state->pause & MLO_PAUSE_TX)
|
||||
+ mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA |
|
||||
+ SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) |
|
||||
+ SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
|
||||
+ SYS_MAC_FC_CFG_ZERO_PAUSE_ENA;
|
||||
+ ocelot_write_rix(ocelot, mac_fc_cfg, SYS_MAC_FC_CFG, port);
|
||||
+
|
||||
ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port);
|
||||
}
|
||||
-EXPORT_SYMBOL(ocelot_adjust_link);
|
||||
+EXPORT_SYMBOL(ocelot_phylink_mac_config);
|
||||
|
||||
-static void ocelot_port_adjust_link(struct net_device *dev)
|
||||
+void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface)
|
||||
{
|
||||
- struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
+ struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
|
||||
- ocelot_adjust_link(ocelot, port, dev->phydev);
|
||||
+ ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG);
|
||||
+ ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA,
|
||||
+ QSYS_SWITCH_PORT_MODE, port);
|
||||
}
|
||||
+EXPORT_SYMBOL(ocelot_phylink_mac_link_down);
|
||||
|
||||
-void ocelot_port_enable(struct ocelot *ocelot, int port,
|
||||
- struct phy_device *phy)
|
||||
+void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface,
|
||||
+ struct phy_device *phy)
|
||||
{
|
||||
/* Enable receiving frames on the port, and activate auto-learning of
|
||||
* MAC addresses.
|
||||
@@ -499,62 +551,22 @@ void ocelot_port_enable(struct ocelot *o
|
||||
ANA_PORT_PORT_CFG_PORTID_VAL(port),
|
||||
ANA_PORT_PORT_CFG, port);
|
||||
}
|
||||
-EXPORT_SYMBOL(ocelot_port_enable);
|
||||
+EXPORT_SYMBOL(ocelot_phylink_mac_link_up);
|
||||
|
||||
static int ocelot_port_open(struct net_device *dev)
|
||||
{
|
||||
struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
- int err;
|
||||
-
|
||||
- if (priv->serdes) {
|
||||
- err = phy_set_mode_ext(priv->serdes, PHY_MODE_ETHERNET,
|
||||
- priv->phy_mode);
|
||||
- if (err) {
|
||||
- netdev_err(dev, "Could not set mode of SerDes\n");
|
||||
- return err;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- err = phy_connect_direct(dev, priv->phy, &ocelot_port_adjust_link,
|
||||
- priv->phy_mode);
|
||||
- if (err) {
|
||||
- netdev_err(dev, "Could not attach to PHY\n");
|
||||
- return err;
|
||||
- }
|
||||
|
||||
- dev->phydev = priv->phy;
|
||||
-
|
||||
- phy_attached_info(priv->phy);
|
||||
- phy_start(priv->phy);
|
||||
-
|
||||
- ocelot_port_enable(ocelot, port, priv->phy);
|
||||
+ phylink_start(priv->phylink);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void ocelot_port_disable(struct ocelot *ocelot, int port)
|
||||
-{
|
||||
- struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
-
|
||||
- ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG);
|
||||
- ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA,
|
||||
- QSYS_SWITCH_PORT_MODE, port);
|
||||
-}
|
||||
-EXPORT_SYMBOL(ocelot_port_disable);
|
||||
-
|
||||
static int ocelot_port_stop(struct net_device *dev)
|
||||
{
|
||||
struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- phy_disconnect(priv->phy);
|
||||
-
|
||||
- dev->phydev = NULL;
|
||||
|
||||
- ocelot_port_disable(ocelot, port);
|
||||
+ phylink_stop(priv->phylink);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2251,8 +2263,7 @@ void ocelot_init_port(struct ocelot *oce
|
||||
EXPORT_SYMBOL(ocelot_init_port);
|
||||
|
||||
int ocelot_probe_port(struct ocelot *ocelot, u8 port,
|
||||
- void __iomem *regs,
|
||||
- struct phy_device *phy)
|
||||
+ void __iomem *regs)
|
||||
{
|
||||
struct ocelot_port_private *priv;
|
||||
struct ocelot_port *ocelot_port;
|
||||
@@ -2265,7 +2276,6 @@ int ocelot_probe_port(struct ocelot *oce
|
||||
SET_NETDEV_DEV(dev, ocelot->dev);
|
||||
priv = netdev_priv(dev);
|
||||
priv->dev = dev;
|
||||
- priv->phy = phy;
|
||||
priv->chip_port = port;
|
||||
ocelot_port = &priv->port;
|
||||
ocelot_port->ocelot = ocelot;
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.h
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.h
|
||||
@@ -12,8 +12,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/net_tstamp.h>
|
||||
-#include <linux/phy.h>
|
||||
-#include <linux/phy/phy.h>
|
||||
+#include <linux/phylink.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ptp_clock_kernel.h>
|
||||
#include <linux/regmap.h>
|
||||
@@ -65,14 +64,12 @@ struct ocelot_multicast {
|
||||
struct ocelot_port_private {
|
||||
struct ocelot_port port;
|
||||
struct net_device *dev;
|
||||
- struct phy_device *phy;
|
||||
+ struct phylink *phylink;
|
||||
+ struct phylink_config phylink_config;
|
||||
u8 chip_port;
|
||||
|
||||
u8 vlan_aware;
|
||||
|
||||
- phy_interface_t phy_mode;
|
||||
- struct phy *serdes;
|
||||
-
|
||||
struct ocelot_port_tc tc;
|
||||
};
|
||||
|
||||
@@ -83,9 +80,7 @@ void ocelot_port_writel(struct ocelot_po
|
||||
#define ocelot_field_read(ocelot, reg, val) regmap_field_read((ocelot)->regfields[(reg)], (val))
|
||||
|
||||
int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops);
|
||||
-int ocelot_probe_port(struct ocelot *ocelot, u8 port,
|
||||
- void __iomem *regs,
|
||||
- struct phy_device *phy);
|
||||
+int ocelot_probe_port(struct ocelot *ocelot, u8 port, void __iomem *regs);
|
||||
|
||||
void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu,
|
||||
enum ocelot_tag_prefix injection,
|
||||
--- a/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <net/switchdev.h>
|
||||
+#include <linux/phy/phy.h>
|
||||
|
||||
#include "ocelot.h"
|
||||
|
||||
@@ -262,6 +263,91 @@ static const struct ocelot_ops ocelot_op
|
||||
.reset = ocelot_reset,
|
||||
};
|
||||
|
||||
+static void ocelot_port_phylink_validate(struct phylink_config *config,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct net_device *ndev = to_net_dev(config->dev);
|
||||
+ struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ ocelot_phylink_validate(ocelot, port, supported, state);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+ocelot_port_phylink_mac_pcs_get_state(struct phylink_config *config,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct net_device *ndev = to_net_dev(config->dev);
|
||||
+ struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ ocelot_phylink_mac_pcs_get_state(ocelot, port, state);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void ocelot_port_phylink_mac_an_restart(struct phylink_config *config)
|
||||
+{
|
||||
+ struct net_device *ndev = to_net_dev(config->dev);
|
||||
+ struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ ocelot_phylink_mac_an_restart(ocelot, port);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ocelot_port_phylink_mac_config(struct phylink_config *config,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct net_device *ndev = to_net_dev(config->dev);
|
||||
+ struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ ocelot_phylink_mac_config(ocelot, port, link_an_mode, state);
|
||||
+}
|
||||
+
|
||||
+static void ocelot_port_phylink_mac_link_down(struct phylink_config *config,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface)
|
||||
+{
|
||||
+ struct net_device *ndev = to_net_dev(config->dev);
|
||||
+ struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ return ocelot_phylink_mac_link_down(ocelot, port, link_an_mode,
|
||||
+ interface);
|
||||
+}
|
||||
+
|
||||
+static void ocelot_port_phylink_mac_link_up(struct phylink_config *config,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface,
|
||||
+ struct phy_device *phy)
|
||||
+{
|
||||
+ struct net_device *ndev = to_net_dev(config->dev);
|
||||
+ struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ return ocelot_phylink_mac_link_up(ocelot, port, link_an_mode,
|
||||
+ interface, phy);
|
||||
+}
|
||||
+
|
||||
+static const struct phylink_mac_ops ocelot_phylink_ops = {
|
||||
+ .validate = ocelot_port_phylink_validate,
|
||||
+ .mac_link_state = ocelot_port_phylink_mac_pcs_get_state,
|
||||
+ .mac_an_restart = ocelot_port_phylink_mac_an_restart,
|
||||
+ .mac_config = ocelot_port_phylink_mac_config,
|
||||
+ .mac_link_down = ocelot_port_phylink_mac_link_down,
|
||||
+ .mac_link_up = ocelot_port_phylink_mac_link_up,
|
||||
+};
|
||||
+
|
||||
static int mscc_ocelot_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
@@ -369,8 +455,6 @@ static int mscc_ocelot_probe(struct plat
|
||||
for_each_available_child_of_node(ports, portnp) {
|
||||
struct ocelot_port_private *priv;
|
||||
struct ocelot_port *ocelot_port;
|
||||
- struct device_node *phy_node;
|
||||
- struct phy_device *phy;
|
||||
struct resource *res;
|
||||
struct phy *serdes;
|
||||
void __iomem *regs;
|
||||
@@ -389,16 +473,7 @@ static int mscc_ocelot_probe(struct plat
|
||||
if (IS_ERR(regs))
|
||||
continue;
|
||||
|
||||
- phy_node = of_parse_phandle(portnp, "phy-handle", 0);
|
||||
- if (!phy_node)
|
||||
- continue;
|
||||
-
|
||||
- phy = of_phy_find_device(phy_node);
|
||||
- of_node_put(phy_node);
|
||||
- if (!phy)
|
||||
- continue;
|
||||
-
|
||||
- err = ocelot_probe_port(ocelot, port, regs, phy);
|
||||
+ err = ocelot_probe_port(ocelot, port, regs);
|
||||
if (err) {
|
||||
of_node_put(portnp);
|
||||
goto out_put_ports;
|
||||
@@ -412,9 +487,7 @@ static int mscc_ocelot_probe(struct plat
|
||||
if (phy_mode < 0)
|
||||
phy_mode = PHY_INTERFACE_MODE_NA;
|
||||
|
||||
- priv->phy_mode = phy_mode;
|
||||
-
|
||||
- switch (priv->phy_mode) {
|
||||
+ switch (phy_mode) {
|
||||
case PHY_INTERFACE_MODE_NA:
|
||||
continue;
|
||||
case PHY_INTERFACE_MODE_SGMII:
|
||||
@@ -451,7 +524,41 @@ static int mscc_ocelot_probe(struct plat
|
||||
goto out_put_ports;
|
||||
}
|
||||
|
||||
- priv->serdes = serdes;
|
||||
+ if (serdes) {
|
||||
+ err = phy_set_mode_ext(serdes, PHY_MODE_ETHERNET,
|
||||
+ phy_mode);
|
||||
+ if (err) {
|
||||
+ dev_err(ocelot->dev,
|
||||
+ "Could not set mode of SerDes\n");
|
||||
+ of_node_put(portnp);
|
||||
+ goto out_put_ports;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ priv->phylink_config.dev = &priv->dev->dev;
|
||||
+ priv->phylink_config.type = PHYLINK_NETDEV;
|
||||
+
|
||||
+ priv->phylink = phylink_create(&priv->phylink_config,
|
||||
+ of_fwnode_handle(portnp),
|
||||
+ phy_mode, &ocelot_phylink_ops);
|
||||
+ if (IS_ERR(priv->phylink)) {
|
||||
+ dev_err(ocelot->dev,
|
||||
+ "Could not create a phylink instance (%ld)\n",
|
||||
+ PTR_ERR(priv->phylink));
|
||||
+ err = PTR_ERR(priv->phylink);
|
||||
+ priv->phylink = NULL;
|
||||
+ of_node_put(portnp);
|
||||
+ goto out_put_ports;
|
||||
+ }
|
||||
+
|
||||
+ err = phylink_of_phy_connect(priv->phylink, portnp, 0);
|
||||
+ if (err) {
|
||||
+ dev_err(ocelot->dev, "Could not connect to PHY: %d\n",
|
||||
+ err);
|
||||
+ phylink_destroy(priv->phylink);
|
||||
+ of_node_put(portnp);
|
||||
+ goto out_put_ports;
|
||||
+ }
|
||||
}
|
||||
|
||||
register_netdevice_notifier(&ocelot_netdevice_nb);
|
||||
@@ -468,12 +575,27 @@ out_put_ports:
|
||||
static int mscc_ocelot_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ocelot *ocelot = platform_get_drvdata(pdev);
|
||||
+ int port;
|
||||
|
||||
ocelot_deinit(ocelot);
|
||||
unregister_switchdev_blocking_notifier(&ocelot_switchdev_blocking_nb);
|
||||
unregister_switchdev_notifier(&ocelot_switchdev_nb);
|
||||
unregister_netdevice_notifier(&ocelot_netdevice_nb);
|
||||
|
||||
+ for (port = 0; port < ocelot->num_phys_ports; port++) {
|
||||
+ struct ocelot_port_private *priv;
|
||||
+
|
||||
+ priv = container_of(ocelot->ports[port],
|
||||
+ struct ocelot_port_private,
|
||||
+ port);
|
||||
+
|
||||
+ if (priv->phylink) {
|
||||
+ rtnl_lock();
|
||||
+ phylink_destroy(priv->phylink);
|
||||
+ rtnl_unlock();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/include/soc/mscc/ocelot.h
|
||||
+++ b/include/soc/mscc/ocelot.h
|
||||
@@ -518,17 +518,12 @@ void ocelot_deinit(struct ocelot *ocelot
|
||||
void ocelot_init_port(struct ocelot *ocelot, int port);
|
||||
|
||||
/* DSA callbacks */
|
||||
-void ocelot_port_enable(struct ocelot *ocelot, int port,
|
||||
- struct phy_device *phy);
|
||||
-void ocelot_port_disable(struct ocelot *ocelot, int port);
|
||||
void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data);
|
||||
void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data);
|
||||
int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset);
|
||||
int ocelot_get_ts_info(struct ocelot *ocelot, int port,
|
||||
struct ethtool_ts_info *info);
|
||||
void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs);
|
||||
-void ocelot_adjust_link(struct ocelot *ocelot, int port,
|
||||
- struct phy_device *phydev);
|
||||
void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port,
|
||||
bool vlan_aware);
|
||||
void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state);
|
||||
@@ -597,4 +592,21 @@ int ocelot_rtag_parse_enable(struct ocel
|
||||
int ocelot_dscp_set(struct ocelot *ocelot, int port,
|
||||
bool enable, const u8 dscp_ix,
|
||||
struct tsn_qos_switch_dscp_conf *c);
|
||||
+void ocelot_phylink_validate(struct ocelot *ocelot, int port,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state);
|
||||
+void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port,
|
||||
+ struct phylink_link_state *state);
|
||||
+void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port);
|
||||
+void ocelot_phylink_mac_config(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state);
|
||||
+void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface);
|
||||
+void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ phy_interface_t interface,
|
||||
+ struct phy_device *phy);
|
||||
+
|
||||
#endif
|
||||
@ -1,169 +0,0 @@
|
||||
From 07f63e91f5e81f7f36c1e646f72c394c7f60c05c Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Fri, 22 Nov 2019 13:46:34 +0200
|
||||
Subject: [PATCH] net: mscc: ocelot: introduce more focused PCS ops for PHYLINK
|
||||
|
||||
The reason for doing this is that the 2 mainline Ocelot switches so far,
|
||||
VSC7514 and VSC9959, have radically different SoC/SerDes integration. So
|
||||
although the PHYLINK callbacks are common, the implementations will
|
||||
actually lie in device-specific function pointers.
|
||||
|
||||
Also, there was a duplicated and unused function pointer for pcs_init in
|
||||
struct ocelot, remove that.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/ethernet/mscc/ocelot.c | 36 ++++++++------------------------
|
||||
drivers/net/ethernet/mscc/ocelot_board.c | 35 ++++++++++++++++++++++++++++++-
|
||||
include/soc/mscc/ocelot.h | 12 ++++++++---
|
||||
3 files changed, 52 insertions(+), 31 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -410,43 +410,25 @@ void ocelot_phylink_validate(struct ocel
|
||||
unsigned long *supported,
|
||||
struct phylink_link_state *state)
|
||||
{
|
||||
- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
-
|
||||
- if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
- state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_QSGMII) {
|
||||
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* No half-duplex. */
|
||||
- phylink_set_port_modes(mask);
|
||||
- phylink_set(mask, Autoneg);
|
||||
- phylink_set(mask, Pause);
|
||||
- phylink_set(mask, Asym_Pause);
|
||||
- phylink_set(mask, 10baseT_Full);
|
||||
- phylink_set(mask, 100baseT_Full);
|
||||
- phylink_set(mask, 1000baseT_Full);
|
||||
- phylink_set(mask, 2500baseT_Full);
|
||||
-
|
||||
- bitmap_and(supported, supported, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- bitmap_and(state->advertising, state->advertising, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ if (ocelot->ops->pcs_validate)
|
||||
+ ocelot->ops->pcs_validate(ocelot, port, supported, state);
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_phylink_validate);
|
||||
|
||||
void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port,
|
||||
struct phylink_link_state *state)
|
||||
{
|
||||
- state->link = 1;
|
||||
+ if (ocelot->ops->pcs_link_state)
|
||||
+ ocelot->ops->pcs_link_state(ocelot, port, state);
|
||||
+ else
|
||||
+ state->link = 1;
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state);
|
||||
|
||||
void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port)
|
||||
{
|
||||
- /* Not supported */
|
||||
+ if (ocelot->ops->pcs_an_restart)
|
||||
+ ocelot->ops->pcs_an_restart(ocelot, port);
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_phylink_mac_an_restart);
|
||||
|
||||
@@ -490,7 +472,7 @@ void ocelot_phylink_mac_config(struct oc
|
||||
ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
|
||||
|
||||
if (ocelot->ops->pcs_init)
|
||||
- ocelot->ops->pcs_init(ocelot, port);
|
||||
+ ocelot->ops->pcs_init(ocelot, port, link_an_mode, state);
|
||||
|
||||
/* Enable MAC module */
|
||||
ocelot_port_writel(ocelot_port, DEV_MAC_ENA_CFG_RX_ENA |
|
||||
--- a/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
@@ -212,7 +212,9 @@ static const struct of_device_id mscc_oc
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mscc_ocelot_match);
|
||||
|
||||
-static void ocelot_port_pcs_init(struct ocelot *ocelot, int port)
|
||||
+static void ocelot_port_pcs_init(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
{
|
||||
struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
|
||||
@@ -235,6 +237,36 @@ static void ocelot_port_pcs_init(struct
|
||||
ocelot_port_writel(ocelot_port, 0, PCS1G_LB_CFG);
|
||||
}
|
||||
|
||||
+void ocelot_port_pcs_validate(struct ocelot *ocelot, int port,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
+
|
||||
+ if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_QSGMII) {
|
||||
+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* No half-duplex. */
|
||||
+ phylink_set_port_modes(mask);
|
||||
+ phylink_set(mask, Autoneg);
|
||||
+ phylink_set(mask, Pause);
|
||||
+ phylink_set(mask, Asym_Pause);
|
||||
+ phylink_set(mask, 10baseT_Full);
|
||||
+ phylink_set(mask, 100baseT_Full);
|
||||
+ phylink_set(mask, 1000baseT_Full);
|
||||
+ phylink_set(mask, 2500baseT_Full);
|
||||
+
|
||||
+ bitmap_and(supported, supported, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ bitmap_and(state->advertising, state->advertising, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+}
|
||||
+
|
||||
static int ocelot_reset(struct ocelot *ocelot)
|
||||
{
|
||||
int retries = 100;
|
||||
@@ -260,6 +292,7 @@ static int ocelot_reset(struct ocelot *o
|
||||
|
||||
static const struct ocelot_ops ocelot_ops = {
|
||||
.pcs_init = ocelot_port_pcs_init,
|
||||
+ .pcs_validate = ocelot_port_pcs_validate,
|
||||
.reset = ocelot_reset,
|
||||
};
|
||||
|
||||
--- a/include/soc/mscc/ocelot.h
|
||||
+++ b/include/soc/mscc/ocelot.h
|
||||
@@ -412,7 +412,15 @@ enum {
|
||||
struct ocelot;
|
||||
|
||||
struct ocelot_ops {
|
||||
- void (*pcs_init)(struct ocelot *ocelot, int port);
|
||||
+ void (*pcs_init)(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state);
|
||||
+ void (*pcs_an_restart)(struct ocelot *ocelot, int port);
|
||||
+ void (*pcs_link_state)(struct ocelot *ocelot, int port,
|
||||
+ struct phylink_link_state *state);
|
||||
+ void (*pcs_validate)(struct ocelot *ocelot, int port,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state);
|
||||
int (*reset)(struct ocelot *ocelot);
|
||||
};
|
||||
|
||||
@@ -479,8 +487,6 @@ struct ocelot {
|
||||
struct mutex ptp_lock;
|
||||
/* Protects the PTP clock */
|
||||
spinlock_t ptp_clock_lock;
|
||||
-
|
||||
- void (*port_pcs_init)(struct ocelot_port *port);
|
||||
};
|
||||
|
||||
#define ocelot_read_ix(ocelot, reg, gi, ri) __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
|
||||
@ -1,442 +0,0 @@
|
||||
From 0e219a6aa07754d81a25c9e4408d81d194cd2000 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Fri, 22 Nov 2019 13:45:52 +0200
|
||||
Subject: [PATCH] net: dsa: felix: Add PCS operations for PHYLINK
|
||||
|
||||
This removes the bootloader dependency for SGMII PCS pre-configuration,
|
||||
as well as adds support for monitoring the in-band SGMII AN between the
|
||||
PCS and the system-side link partner (PHY or other MAC).
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/dsa/ocelot/felix.c | 23 ++-
|
||||
drivers/net/dsa/ocelot/felix.h | 7 +-
|
||||
drivers/net/dsa/ocelot/felix_vsc9959.c | 292 ++++++++++++++++++++++++++++++++-
|
||||
3 files changed, 314 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -265,7 +265,7 @@ static int felix_get_ts_info(struct dsa_
|
||||
static int felix_init_structs(struct felix *felix, int num_phys_ports)
|
||||
{
|
||||
struct ocelot *ocelot = &felix->ocelot;
|
||||
- resource_size_t base;
|
||||
+ resource_size_t switch_base;
|
||||
int port, i, err;
|
||||
|
||||
ocelot->num_phys_ports = num_phys_ports;
|
||||
@@ -281,7 +281,8 @@ static int felix_init_structs(struct fel
|
||||
ocelot->ops = felix->info->ops;
|
||||
ocelot->quirks = felix->info->quirks;
|
||||
|
||||
- base = pci_resource_start(felix->pdev, felix->info->pci_bar);
|
||||
+ switch_base = pci_resource_start(felix->pdev,
|
||||
+ felix->info->switch_pci_bar);
|
||||
|
||||
for (i = 0; i < TARGET_MAX; i++) {
|
||||
struct regmap *target;
|
||||
@@ -292,8 +293,8 @@ static int felix_init_structs(struct fel
|
||||
|
||||
res = &felix->info->target_io_res[i];
|
||||
res->flags = IORESOURCE_MEM;
|
||||
- res->start += base;
|
||||
- res->end += base;
|
||||
+ res->start += switch_base;
|
||||
+ res->end += switch_base;
|
||||
|
||||
target = ocelot_regmap_init(ocelot, res);
|
||||
if (IS_ERR(target)) {
|
||||
@@ -327,8 +328,8 @@ static int felix_init_structs(struct fel
|
||||
|
||||
res = &felix->info->port_io_res[port];
|
||||
res->flags = IORESOURCE_MEM;
|
||||
- res->start += base;
|
||||
- res->end += base;
|
||||
+ res->start += switch_base;
|
||||
+ res->end += switch_base;
|
||||
|
||||
port_regs = devm_ioremap_resource(ocelot->dev, res);
|
||||
if (IS_ERR(port_regs)) {
|
||||
@@ -342,6 +343,12 @@ static int felix_init_structs(struct fel
|
||||
ocelot->ports[port] = ocelot_port;
|
||||
}
|
||||
|
||||
+ if (felix->info->mdio_bus_alloc) {
|
||||
+ err = felix->info->mdio_bus_alloc(ocelot);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -377,6 +384,10 @@ static int felix_setup(struct dsa_switch
|
||||
static void felix_teardown(struct dsa_switch *ds)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
+ struct felix *felix = ocelot_to_felix(ocelot);
|
||||
+
|
||||
+ if (felix->imdio)
|
||||
+ mdiobus_unregister(felix->imdio);
|
||||
|
||||
/* stop workqueue thread */
|
||||
ocelot_deinit(ocelot);
|
||||
--- a/drivers/net/dsa/ocelot/felix.h
|
||||
+++ b/drivers/net/dsa/ocelot/felix.h
|
||||
@@ -10,6 +10,7 @@
|
||||
struct felix_info {
|
||||
struct resource *target_io_res;
|
||||
struct resource *port_io_res;
|
||||
+ struct resource *imdio_res;
|
||||
const struct reg_field *regfields;
|
||||
const u32 *const *map;
|
||||
const struct ocelot_ops *ops;
|
||||
@@ -17,8 +18,10 @@ struct felix_info {
|
||||
const struct ocelot_stat_layout *stats_layout;
|
||||
unsigned int num_stats;
|
||||
int num_ports;
|
||||
- int pci_bar;
|
||||
+ int switch_pci_bar;
|
||||
+ int imdio_pci_bar;
|
||||
unsigned long quirks;
|
||||
+ int (*mdio_bus_alloc)(struct ocelot *ocelot);
|
||||
};
|
||||
|
||||
extern struct felix_info felix_info_vsc9959;
|
||||
@@ -33,6 +36,8 @@ struct felix {
|
||||
struct pci_dev *pdev;
|
||||
struct felix_info *info;
|
||||
struct ocelot ocelot;
|
||||
+ struct mii_bus *imdio;
|
||||
+ struct phy_device **pcs;
|
||||
};
|
||||
|
||||
#endif
|
||||
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright 2017 Microsemi Corporation
|
||||
* Copyright 2018-2019 NXP Semiconductors
|
||||
*/
|
||||
+#include <linux/fsl/enetc_mdio.h>
|
||||
#include <soc/mscc/ocelot_sys.h>
|
||||
#include <soc/mscc/ocelot.h>
|
||||
#include <linux/iopoll.h>
|
||||
@@ -390,6 +391,15 @@ static struct resource vsc9959_port_io_r
|
||||
},
|
||||
};
|
||||
|
||||
+/* Port MAC 0 Internal MDIO bus through which the SerDes acting as an
|
||||
+ * SGMII/QSGMII MAC PCS can be found.
|
||||
+ */
|
||||
+static struct resource vsc9959_imdio_res = {
|
||||
+ .start = 0x8030,
|
||||
+ .end = 0x8040,
|
||||
+ .name = "imdio",
|
||||
+};
|
||||
+
|
||||
static const struct reg_field vsc9959_regfields[] = {
|
||||
[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6),
|
||||
[ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 5),
|
||||
@@ -569,13 +579,291 @@ static int vsc9959_reset(struct ocelot *
|
||||
return 0;
|
||||
}
|
||||
|
||||
+void vsc9959_pcs_validate(struct ocelot *ocelot, int port,
|
||||
+ unsigned long *supported,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
+
|
||||
+ if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_QSGMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_USXGMII) {
|
||||
+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* No half-duplex. */
|
||||
+ phylink_set_port_modes(mask);
|
||||
+ phylink_set(mask, Autoneg);
|
||||
+ phylink_set(mask, Pause);
|
||||
+ phylink_set(mask, Asym_Pause);
|
||||
+ phylink_set(mask, 10baseT_Full);
|
||||
+ phylink_set(mask, 100baseT_Full);
|
||||
+ phylink_set(mask, 1000baseT_Full);
|
||||
+ phylink_set(mask, 1000baseX_Full);
|
||||
+ phylink_set(mask, 2500baseT_Full);
|
||||
+ phylink_set(mask, 2500baseX_Full);
|
||||
+ phylink_set(mask, 1000baseKX_Full);
|
||||
+
|
||||
+ bitmap_and(supported, supported, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ bitmap_and(state->advertising, state->advertising, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+}
|
||||
+
|
||||
+static void vsc9959_pcs_an_restart(struct ocelot *ocelot, int port)
|
||||
+{
|
||||
+ struct felix *felix = ocelot_to_felix(ocelot);
|
||||
+ struct phy_device *pcs = felix->pcs[port];
|
||||
+
|
||||
+ if (!pcs)
|
||||
+ return;
|
||||
+
|
||||
+ phy_set_bits(pcs, MII_BMCR, BMCR_ANRESTART);
|
||||
+}
|
||||
+
|
||||
+static void vsc9959_pcs_init_sgmii(struct phy_device *pcs,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
+{
|
||||
+ /* SGMII spec requires tx_config_Reg[15:0] to be exactly 0x4001
|
||||
+ * for the MAC PCS in order to acknowledge the AN.
|
||||
+ */
|
||||
+ phy_write(pcs, MII_ADVERTISE, ADVERTISE_SGMII | ADVERTISE_LPACK);
|
||||
+
|
||||
+ /* Set to SGMII mode, use AN */
|
||||
+ phy_write(pcs, ENETC_PCS_IF_MODE, ENETC_PCS_IF_MODE_SGMII_AN);
|
||||
+
|
||||
+ /* Adjust link timer for SGMII */
|
||||
+ phy_write(pcs, ENETC_PCS_LINK_TIMER1, ENETC_PCS_LINK_TIMER1_VAL);
|
||||
+ phy_write(pcs, ENETC_PCS_LINK_TIMER2, ENETC_PCS_LINK_TIMER2_VAL);
|
||||
+
|
||||
+ phy_write(pcs, MII_BMCR, BMCR_SPEED1000 |
|
||||
+ BMCR_FULLDPLX |
|
||||
+ BMCR_ANENABLE);
|
||||
+}
|
||||
+
|
||||
+#define ADVERTISE_USXGMII_FDX BIT(12)
|
||||
+
|
||||
+static void vsc9959_pcs_init_sxgmii(struct phy_device *pcs,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
+{
|
||||
+ /* Configure device ability for the USXGMII Replicator */
|
||||
+ phy_write_mmd(pcs, MDIO_MMD_VEND2, MII_ADVERTISE,
|
||||
+ ADVERTISE_SGMII |
|
||||
+ ADVERTISE_LPACK |
|
||||
+ ADVERTISE_USXGMII_FDX);
|
||||
+}
|
||||
+
|
||||
+static void vsc9959_pcs_init(struct ocelot *ocelot, int port,
|
||||
+ unsigned int link_an_mode,
|
||||
+ const struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct felix *felix = ocelot_to_felix(ocelot);
|
||||
+ struct phy_device *pcs = felix->pcs[port];
|
||||
+
|
||||
+ if (!pcs)
|
||||
+ return;
|
||||
+
|
||||
+ if (link_an_mode == MLO_AN_FIXED) {
|
||||
+ phydev_err(pcs, "Fixed modes are not yet supported.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ pcs->interface = state->interface;
|
||||
+ if (pcs->interface == PHY_INTERFACE_MODE_USXGMII)
|
||||
+ pcs->is_c45 = true;
|
||||
+ else
|
||||
+ pcs->is_c45 = false;
|
||||
+
|
||||
+ /* The PCS does not implement the BMSR register fully, so capability
|
||||
+ * detection via genphy_read_abilities does not work. Since we can get
|
||||
+ * the PHY config word from the LPA register though, there is still
|
||||
+ * value in using the generic phy_resolve_aneg_linkmode function. So
|
||||
+ * populate the supported and advertising link modes manually here.
|
||||
+ */
|
||||
+ linkmode_set_bit_array(phy_basic_ports_array,
|
||||
+ ARRAY_SIZE(phy_basic_ports_array),
|
||||
+ pcs->supported);
|
||||
+ linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, pcs->supported);
|
||||
+ linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, pcs->supported);
|
||||
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, pcs->supported);
|
||||
+ linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, pcs->supported);
|
||||
+ phy_advertise_supported(pcs);
|
||||
+
|
||||
+ switch (pcs->interface) {
|
||||
+ case PHY_INTERFACE_MODE_SGMII:
|
||||
+ case PHY_INTERFACE_MODE_QSGMII:
|
||||
+ vsc9959_pcs_init_sgmii(pcs, link_an_mode, state);
|
||||
+ break;
|
||||
+ case PHY_INTERFACE_MODE_USXGMII:
|
||||
+ vsc9959_pcs_init_sxgmii(pcs, link_an_mode, state);
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_err(ocelot->dev, "Unsupported link mode %s\n",
|
||||
+ phy_modes(pcs->interface));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void vsc9959_pcs_link_state(struct ocelot *ocelot, int port,
|
||||
+ struct phylink_link_state *state)
|
||||
+{
|
||||
+ struct felix *felix = ocelot_to_felix(ocelot);
|
||||
+ struct phy_device *pcs = felix->pcs[port];
|
||||
+ int err;
|
||||
+
|
||||
+ if (!pcs)
|
||||
+ return;
|
||||
+
|
||||
+ /* Reading PCS status not yet supported for USXGMII */
|
||||
+ if (pcs->is_c45) {
|
||||
+ state->link = 1;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ pcs->speed = SPEED_UNKNOWN;
|
||||
+ pcs->duplex = DUPLEX_UNKNOWN;
|
||||
+ pcs->pause = 0;
|
||||
+ pcs->asym_pause = 0;
|
||||
+
|
||||
+ err = genphy_update_link(pcs);
|
||||
+ if (err < 0)
|
||||
+ return;
|
||||
+
|
||||
+ if (pcs->autoneg_complete) {
|
||||
+ u16 lpa = phy_read(pcs, MII_LPA);
|
||||
+
|
||||
+ switch (state->interface) {
|
||||
+ case PHY_INTERFACE_MODE_SGMII:
|
||||
+ case PHY_INTERFACE_MODE_QSGMII:
|
||||
+ mii_lpa_to_linkmode_lpa_sgmii(pcs->lp_advertising, lpa);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ phy_resolve_aneg_linkmode(pcs);
|
||||
+ }
|
||||
+
|
||||
+ state->an_complete = pcs->autoneg_complete;
|
||||
+ state->an_enabled = pcs->autoneg;
|
||||
+ state->link = pcs->link;
|
||||
+ state->duplex = pcs->duplex;
|
||||
+ state->speed = pcs->speed;
|
||||
+ /* SGMII AN does not negotiate flow control, but that's ok,
|
||||
+ * since phylink already knows that, and does:
|
||||
+ * link_state.pause |= pl->phy_state.pause;
|
||||
+ */
|
||||
+ state->pause = pcs->pause;
|
||||
+
|
||||
+ dev_dbg(ocelot->dev,
|
||||
+ "%s: mode=%s/%s/%s adv=%*pb lpa=%*pb link=%u an_enabled=%u an_complete=%u\n",
|
||||
+ __func__,
|
||||
+ phy_modes(state->interface),
|
||||
+ phy_speed_to_str(state->speed),
|
||||
+ phy_duplex_to_str(state->duplex),
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS, state->lp_advertising,
|
||||
+ state->link, state->an_enabled, state->an_complete);
|
||||
+}
|
||||
+
|
||||
static const struct ocelot_ops vsc9959_ops = {
|
||||
.reset = vsc9959_reset,
|
||||
+ .pcs_init = vsc9959_pcs_init,
|
||||
+ .pcs_an_restart = vsc9959_pcs_an_restart,
|
||||
+ .pcs_link_state = vsc9959_pcs_link_state,
|
||||
+ .pcs_validate = vsc9959_pcs_validate,
|
||||
};
|
||||
|
||||
+static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
|
||||
+{
|
||||
+ struct felix *felix = ocelot_to_felix(ocelot);
|
||||
+ struct enetc_mdio_priv *mdio_priv;
|
||||
+ struct device *dev = ocelot->dev;
|
||||
+ resource_size_t imdio_base;
|
||||
+ void __iomem *imdio_regs;
|
||||
+ struct resource *res;
|
||||
+ struct enetc_hw *hw;
|
||||
+ struct mii_bus *bus;
|
||||
+ int port;
|
||||
+ int rc;
|
||||
+
|
||||
+ felix->pcs = devm_kcalloc(dev, felix->info->num_ports,
|
||||
+ sizeof(struct phy_device),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!felix->pcs) {
|
||||
+ dev_err(dev, "failed to allocate array for PCS PHYs\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ imdio_base = pci_resource_start(felix->pdev,
|
||||
+ felix->info->imdio_pci_bar);
|
||||
+
|
||||
+ res = felix->info->imdio_res;
|
||||
+ res->flags = IORESOURCE_MEM;
|
||||
+ res->start += imdio_base;
|
||||
+ res->end += imdio_base;
|
||||
+
|
||||
+ imdio_regs = devm_ioremap_resource(dev, res);
|
||||
+ if (IS_ERR(imdio_regs)) {
|
||||
+ dev_err(dev, "failed to map internal MDIO registers\n");
|
||||
+ return PTR_ERR(imdio_regs);
|
||||
+ }
|
||||
+
|
||||
+ hw = enetc_hw_alloc(dev, imdio_regs);
|
||||
+ if (IS_ERR(hw)) {
|
||||
+ dev_err(dev, "failed to allocate ENETC HW structure\n");
|
||||
+ return PTR_ERR(hw);
|
||||
+ }
|
||||
+
|
||||
+ bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv));
|
||||
+ if (!bus)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ bus->name = "VSC9959 internal MDIO bus";
|
||||
+ bus->read = enetc_mdio_read;
|
||||
+ bus->write = enetc_mdio_write;
|
||||
+ bus->parent = dev;
|
||||
+ mdio_priv = bus->priv;
|
||||
+ mdio_priv->hw = hw;
|
||||
+ /* This gets added to imdio_regs, which already maps addresses
|
||||
+ * starting with the proper offset.
|
||||
+ */
|
||||
+ mdio_priv->mdio_base = 0;
|
||||
+ snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev));
|
||||
+
|
||||
+ /* Needed in order to initialize the bus mutex lock */
|
||||
+ rc = mdiobus_register(bus);
|
||||
+ if (rc < 0) {
|
||||
+ dev_err(dev, "failed to register MDIO bus\n");
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
+ felix->imdio = bus;
|
||||
+
|
||||
+ for (port = 0; port < felix->info->num_ports; port++) {
|
||||
+ struct phy_device *pcs;
|
||||
+ bool is_c45 = false;
|
||||
+
|
||||
+ pcs = get_phy_device(felix->imdio, port, is_c45);
|
||||
+ if (IS_ERR(pcs))
|
||||
+ continue;
|
||||
+
|
||||
+ felix->pcs[port] = pcs;
|
||||
+
|
||||
+ dev_info(dev, "Found PCS at internal MDIO address %d\n", port);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
struct felix_info felix_info_vsc9959 = {
|
||||
.target_io_res = vsc9959_target_io_res,
|
||||
.port_io_res = vsc9959_port_io_res,
|
||||
+ .imdio_res = &vsc9959_imdio_res,
|
||||
.regfields = vsc9959_regfields,
|
||||
.map = vsc9959_regmap,
|
||||
.ops = &vsc9959_ops,
|
||||
@@ -583,6 +871,8 @@ struct felix_info felix_info_vsc9959 = {
|
||||
.num_stats = ARRAY_SIZE(vsc9959_stats_layout),
|
||||
.shared_queue_sz = 128 * 1024,
|
||||
.num_ports = 6,
|
||||
- .pci_bar = 4,
|
||||
+ .switch_pci_bar = 4,
|
||||
+ .imdio_pci_bar = 0,
|
||||
.quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION,
|
||||
+ .mdio_bus_alloc = vsc9959_mdio_bus_alloc,
|
||||
};
|
||||
@ -90,7 +90,7 @@ Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -530,7 +530,7 @@ static int felix_pci_probe(struct pci_de
|
||||
@@ -485,7 +485,7 @@ static int felix_pci_probe(struct pci_de
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
|
||||
if (!felix) {
|
||||
err = -ENOMEM;
|
||||
dev_err(&pdev->dev, "Failed to allocate driver memory\n");
|
||||
@@ -577,11 +577,9 @@ static int felix_pci_probe(struct pci_de
|
||||
@@ -532,11 +532,9 @@ static int felix_pci_probe(struct pci_de
|
||||
return 0;
|
||||
|
||||
err_register_ds:
|
||||
@ -111,7 +111,7 @@ Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
|
||||
err_dma:
|
||||
pci_disable_device(pdev);
|
||||
err_pci_enable:
|
||||
@@ -596,9 +594,6 @@ static void felix_pci_remove(struct pci_
|
||||
@@ -551,9 +549,6 @@ static void felix_pci_remove(struct pci_
|
||||
|
||||
dsa_unregister_switch(felix->ds);
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -2338,6 +2338,20 @@ void ocelot_set_cpu_port(struct ocelot *
|
||||
@@ -2342,6 +2342,20 @@ void ocelot_set_cpu_port(struct ocelot *
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_set_cpu_port);
|
||||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
int ocelot_init(struct ocelot *ocelot)
|
||||
{
|
||||
char queue_name[32];
|
||||
@@ -2475,6 +2489,13 @@ int ocelot_init(struct ocelot *ocelot)
|
||||
@@ -2479,6 +2493,13 @@ int ocelot_init(struct ocelot *ocelot)
|
||||
"Timestamp initialization failed\n");
|
||||
return ret;
|
||||
}
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2489,6 +2510,8 @@ void ocelot_deinit(struct ocelot *ocelot
|
||||
@@ -2493,6 +2514,8 @@ void ocelot_deinit(struct ocelot *ocelot
|
||||
cancel_delayed_work(&ocelot->stats_work);
|
||||
destroy_workqueue(ocelot->stats_queue);
|
||||
mutex_destroy(&ocelot->stats_lock);
|
||||
|
||||
@ -128,7 +128,7 @@ Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -2292,6 +2292,18 @@ void ocelot_set_cpu_port(struct ocelot *
|
||||
@@ -2296,6 +2296,18 @@ void ocelot_set_cpu_port(struct ocelot *
|
||||
enum ocelot_tag_prefix injection,
|
||||
enum ocelot_tag_prefix extraction)
|
||||
{
|
||||
|
||||
@ -1,440 +0,0 @@
|
||||
From 9ee918eb911853c7b46cd84779d857988366e845 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:30:24 +0200
|
||||
Subject: [PATCH] Revert "net: dsa: felix: Add PCS operations for PHYLINK"
|
||||
|
||||
This reverts commit 1082a3ef9e832cc52c4b0053c7c52453376f4830.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/dsa/ocelot/felix.c | 23 +--
|
||||
drivers/net/dsa/ocelot/felix.h | 7 +-
|
||||
drivers/net/dsa/ocelot/felix_vsc9959.c | 292 +--------------------------------
|
||||
3 files changed, 8 insertions(+), 314 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -265,7 +265,7 @@ static int felix_get_ts_info(struct dsa_
|
||||
static int felix_init_structs(struct felix *felix, int num_phys_ports)
|
||||
{
|
||||
struct ocelot *ocelot = &felix->ocelot;
|
||||
- resource_size_t switch_base;
|
||||
+ resource_size_t base;
|
||||
int port, i, err;
|
||||
|
||||
ocelot->num_phys_ports = num_phys_ports;
|
||||
@@ -281,8 +281,7 @@ static int felix_init_structs(struct fel
|
||||
ocelot->ops = felix->info->ops;
|
||||
ocelot->quirks = felix->info->quirks;
|
||||
|
||||
- switch_base = pci_resource_start(felix->pdev,
|
||||
- felix->info->switch_pci_bar);
|
||||
+ base = pci_resource_start(felix->pdev, felix->info->pci_bar);
|
||||
|
||||
for (i = 0; i < TARGET_MAX; i++) {
|
||||
struct regmap *target;
|
||||
@@ -293,8 +292,8 @@ static int felix_init_structs(struct fel
|
||||
|
||||
res = &felix->info->target_io_res[i];
|
||||
res->flags = IORESOURCE_MEM;
|
||||
- res->start += switch_base;
|
||||
- res->end += switch_base;
|
||||
+ res->start += base;
|
||||
+ res->end += base;
|
||||
|
||||
target = ocelot_regmap_init(ocelot, res);
|
||||
if (IS_ERR(target)) {
|
||||
@@ -328,8 +327,8 @@ static int felix_init_structs(struct fel
|
||||
|
||||
res = &felix->info->port_io_res[port];
|
||||
res->flags = IORESOURCE_MEM;
|
||||
- res->start += switch_base;
|
||||
- res->end += switch_base;
|
||||
+ res->start += base;
|
||||
+ res->end += base;
|
||||
|
||||
port_regs = devm_ioremap_resource(ocelot->dev, res);
|
||||
if (IS_ERR(port_regs)) {
|
||||
@@ -343,12 +342,6 @@ static int felix_init_structs(struct fel
|
||||
ocelot->ports[port] = ocelot_port;
|
||||
}
|
||||
|
||||
- if (felix->info->mdio_bus_alloc) {
|
||||
- err = felix->info->mdio_bus_alloc(ocelot);
|
||||
- if (err < 0)
|
||||
- return err;
|
||||
- }
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -384,10 +377,6 @@ static int felix_setup(struct dsa_switch
|
||||
static void felix_teardown(struct dsa_switch *ds)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
- struct felix *felix = ocelot_to_felix(ocelot);
|
||||
-
|
||||
- if (felix->imdio)
|
||||
- mdiobus_unregister(felix->imdio);
|
||||
|
||||
/* stop workqueue thread */
|
||||
ocelot_deinit(ocelot);
|
||||
--- a/drivers/net/dsa/ocelot/felix.h
|
||||
+++ b/drivers/net/dsa/ocelot/felix.h
|
||||
@@ -10,7 +10,6 @@
|
||||
struct felix_info {
|
||||
struct resource *target_io_res;
|
||||
struct resource *port_io_res;
|
||||
- struct resource *imdio_res;
|
||||
const struct reg_field *regfields;
|
||||
const u32 *const *map;
|
||||
const struct ocelot_ops *ops;
|
||||
@@ -18,10 +17,8 @@ struct felix_info {
|
||||
const struct ocelot_stat_layout *stats_layout;
|
||||
unsigned int num_stats;
|
||||
int num_ports;
|
||||
- int switch_pci_bar;
|
||||
- int imdio_pci_bar;
|
||||
+ int pci_bar;
|
||||
unsigned long quirks;
|
||||
- int (*mdio_bus_alloc)(struct ocelot *ocelot);
|
||||
};
|
||||
|
||||
extern struct felix_info felix_info_vsc9959;
|
||||
@@ -36,8 +33,6 @@ struct felix {
|
||||
struct pci_dev *pdev;
|
||||
struct felix_info *info;
|
||||
struct ocelot ocelot;
|
||||
- struct mii_bus *imdio;
|
||||
- struct phy_device **pcs;
|
||||
};
|
||||
|
||||
#endif
|
||||
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
@@ -2,7 +2,6 @@
|
||||
/* Copyright 2017 Microsemi Corporation
|
||||
* Copyright 2018-2019 NXP Semiconductors
|
||||
*/
|
||||
-#include <linux/fsl/enetc_mdio.h>
|
||||
#include <soc/mscc/ocelot_sys.h>
|
||||
#include <soc/mscc/ocelot.h>
|
||||
#include <linux/iopoll.h>
|
||||
@@ -391,15 +390,6 @@ static struct resource vsc9959_port_io_r
|
||||
},
|
||||
};
|
||||
|
||||
-/* Port MAC 0 Internal MDIO bus through which the SerDes acting as an
|
||||
- * SGMII/QSGMII MAC PCS can be found.
|
||||
- */
|
||||
-static struct resource vsc9959_imdio_res = {
|
||||
- .start = 0x8030,
|
||||
- .end = 0x8040,
|
||||
- .name = "imdio",
|
||||
-};
|
||||
-
|
||||
static const struct reg_field vsc9959_regfields[] = {
|
||||
[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6),
|
||||
[ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 5),
|
||||
@@ -579,291 +569,13 @@ static int vsc9959_reset(struct ocelot *
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void vsc9959_pcs_validate(struct ocelot *ocelot, int port,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
-
|
||||
- if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
- state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_QSGMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_USXGMII) {
|
||||
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* No half-duplex. */
|
||||
- phylink_set_port_modes(mask);
|
||||
- phylink_set(mask, Autoneg);
|
||||
- phylink_set(mask, Pause);
|
||||
- phylink_set(mask, Asym_Pause);
|
||||
- phylink_set(mask, 10baseT_Full);
|
||||
- phylink_set(mask, 100baseT_Full);
|
||||
- phylink_set(mask, 1000baseT_Full);
|
||||
- phylink_set(mask, 1000baseX_Full);
|
||||
- phylink_set(mask, 2500baseT_Full);
|
||||
- phylink_set(mask, 2500baseX_Full);
|
||||
- phylink_set(mask, 1000baseKX_Full);
|
||||
-
|
||||
- bitmap_and(supported, supported, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- bitmap_and(state->advertising, state->advertising, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
-}
|
||||
-
|
||||
-static void vsc9959_pcs_an_restart(struct ocelot *ocelot, int port)
|
||||
-{
|
||||
- struct felix *felix = ocelot_to_felix(ocelot);
|
||||
- struct phy_device *pcs = felix->pcs[port];
|
||||
-
|
||||
- if (!pcs)
|
||||
- return;
|
||||
-
|
||||
- phy_set_bits(pcs, MII_BMCR, BMCR_ANRESTART);
|
||||
-}
|
||||
-
|
||||
-static void vsc9959_pcs_init_sgmii(struct phy_device *pcs,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
-{
|
||||
- /* SGMII spec requires tx_config_Reg[15:0] to be exactly 0x4001
|
||||
- * for the MAC PCS in order to acknowledge the AN.
|
||||
- */
|
||||
- phy_write(pcs, MII_ADVERTISE, ADVERTISE_SGMII | ADVERTISE_LPACK);
|
||||
-
|
||||
- /* Set to SGMII mode, use AN */
|
||||
- phy_write(pcs, ENETC_PCS_IF_MODE, ENETC_PCS_IF_MODE_SGMII_AN);
|
||||
-
|
||||
- /* Adjust link timer for SGMII */
|
||||
- phy_write(pcs, ENETC_PCS_LINK_TIMER1, ENETC_PCS_LINK_TIMER1_VAL);
|
||||
- phy_write(pcs, ENETC_PCS_LINK_TIMER2, ENETC_PCS_LINK_TIMER2_VAL);
|
||||
-
|
||||
- phy_write(pcs, MII_BMCR, BMCR_SPEED1000 |
|
||||
- BMCR_FULLDPLX |
|
||||
- BMCR_ANENABLE);
|
||||
-}
|
||||
-
|
||||
-#define ADVERTISE_USXGMII_FDX BIT(12)
|
||||
-
|
||||
-static void vsc9959_pcs_init_sxgmii(struct phy_device *pcs,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
-{
|
||||
- /* Configure device ability for the USXGMII Replicator */
|
||||
- phy_write_mmd(pcs, MDIO_MMD_VEND2, MII_ADVERTISE,
|
||||
- ADVERTISE_SGMII |
|
||||
- ADVERTISE_LPACK |
|
||||
- ADVERTISE_USXGMII_FDX);
|
||||
-}
|
||||
-
|
||||
-static void vsc9959_pcs_init(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
-{
|
||||
- struct felix *felix = ocelot_to_felix(ocelot);
|
||||
- struct phy_device *pcs = felix->pcs[port];
|
||||
-
|
||||
- if (!pcs)
|
||||
- return;
|
||||
-
|
||||
- if (link_an_mode == MLO_AN_FIXED) {
|
||||
- phydev_err(pcs, "Fixed modes are not yet supported.\n");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- pcs->interface = state->interface;
|
||||
- if (pcs->interface == PHY_INTERFACE_MODE_USXGMII)
|
||||
- pcs->is_c45 = true;
|
||||
- else
|
||||
- pcs->is_c45 = false;
|
||||
-
|
||||
- /* The PCS does not implement the BMSR register fully, so capability
|
||||
- * detection via genphy_read_abilities does not work. Since we can get
|
||||
- * the PHY config word from the LPA register though, there is still
|
||||
- * value in using the generic phy_resolve_aneg_linkmode function. So
|
||||
- * populate the supported and advertising link modes manually here.
|
||||
- */
|
||||
- linkmode_set_bit_array(phy_basic_ports_array,
|
||||
- ARRAY_SIZE(phy_basic_ports_array),
|
||||
- pcs->supported);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, pcs->supported);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, pcs->supported);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, pcs->supported);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, pcs->supported);
|
||||
- phy_advertise_supported(pcs);
|
||||
-
|
||||
- switch (pcs->interface) {
|
||||
- case PHY_INTERFACE_MODE_SGMII:
|
||||
- case PHY_INTERFACE_MODE_QSGMII:
|
||||
- vsc9959_pcs_init_sgmii(pcs, link_an_mode, state);
|
||||
- break;
|
||||
- case PHY_INTERFACE_MODE_USXGMII:
|
||||
- vsc9959_pcs_init_sxgmii(pcs, link_an_mode, state);
|
||||
- break;
|
||||
- default:
|
||||
- dev_err(ocelot->dev, "Unsupported link mode %s\n",
|
||||
- phy_modes(pcs->interface));
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-static void vsc9959_pcs_link_state(struct ocelot *ocelot, int port,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- struct felix *felix = ocelot_to_felix(ocelot);
|
||||
- struct phy_device *pcs = felix->pcs[port];
|
||||
- int err;
|
||||
-
|
||||
- if (!pcs)
|
||||
- return;
|
||||
-
|
||||
- /* Reading PCS status not yet supported for USXGMII */
|
||||
- if (pcs->is_c45) {
|
||||
- state->link = 1;
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- pcs->speed = SPEED_UNKNOWN;
|
||||
- pcs->duplex = DUPLEX_UNKNOWN;
|
||||
- pcs->pause = 0;
|
||||
- pcs->asym_pause = 0;
|
||||
-
|
||||
- err = genphy_update_link(pcs);
|
||||
- if (err < 0)
|
||||
- return;
|
||||
-
|
||||
- if (pcs->autoneg_complete) {
|
||||
- u16 lpa = phy_read(pcs, MII_LPA);
|
||||
-
|
||||
- switch (state->interface) {
|
||||
- case PHY_INTERFACE_MODE_SGMII:
|
||||
- case PHY_INTERFACE_MODE_QSGMII:
|
||||
- mii_lpa_to_linkmode_lpa_sgmii(pcs->lp_advertising, lpa);
|
||||
- break;
|
||||
- default:
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- phy_resolve_aneg_linkmode(pcs);
|
||||
- }
|
||||
-
|
||||
- state->an_complete = pcs->autoneg_complete;
|
||||
- state->an_enabled = pcs->autoneg;
|
||||
- state->link = pcs->link;
|
||||
- state->duplex = pcs->duplex;
|
||||
- state->speed = pcs->speed;
|
||||
- /* SGMII AN does not negotiate flow control, but that's ok,
|
||||
- * since phylink already knows that, and does:
|
||||
- * link_state.pause |= pl->phy_state.pause;
|
||||
- */
|
||||
- state->pause = pcs->pause;
|
||||
-
|
||||
- dev_dbg(ocelot->dev,
|
||||
- "%s: mode=%s/%s/%s adv=%*pb lpa=%*pb link=%u an_enabled=%u an_complete=%u\n",
|
||||
- __func__,
|
||||
- phy_modes(state->interface),
|
||||
- phy_speed_to_str(state->speed),
|
||||
- phy_duplex_to_str(state->duplex),
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS, state->lp_advertising,
|
||||
- state->link, state->an_enabled, state->an_complete);
|
||||
-}
|
||||
-
|
||||
static const struct ocelot_ops vsc9959_ops = {
|
||||
.reset = vsc9959_reset,
|
||||
- .pcs_init = vsc9959_pcs_init,
|
||||
- .pcs_an_restart = vsc9959_pcs_an_restart,
|
||||
- .pcs_link_state = vsc9959_pcs_link_state,
|
||||
- .pcs_validate = vsc9959_pcs_validate,
|
||||
};
|
||||
|
||||
-static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
|
||||
-{
|
||||
- struct felix *felix = ocelot_to_felix(ocelot);
|
||||
- struct enetc_mdio_priv *mdio_priv;
|
||||
- struct device *dev = ocelot->dev;
|
||||
- resource_size_t imdio_base;
|
||||
- void __iomem *imdio_regs;
|
||||
- struct resource *res;
|
||||
- struct enetc_hw *hw;
|
||||
- struct mii_bus *bus;
|
||||
- int port;
|
||||
- int rc;
|
||||
-
|
||||
- felix->pcs = devm_kcalloc(dev, felix->info->num_ports,
|
||||
- sizeof(struct phy_device),
|
||||
- GFP_KERNEL);
|
||||
- if (!felix->pcs) {
|
||||
- dev_err(dev, "failed to allocate array for PCS PHYs\n");
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- imdio_base = pci_resource_start(felix->pdev,
|
||||
- felix->info->imdio_pci_bar);
|
||||
-
|
||||
- res = felix->info->imdio_res;
|
||||
- res->flags = IORESOURCE_MEM;
|
||||
- res->start += imdio_base;
|
||||
- res->end += imdio_base;
|
||||
-
|
||||
- imdio_regs = devm_ioremap_resource(dev, res);
|
||||
- if (IS_ERR(imdio_regs)) {
|
||||
- dev_err(dev, "failed to map internal MDIO registers\n");
|
||||
- return PTR_ERR(imdio_regs);
|
||||
- }
|
||||
-
|
||||
- hw = enetc_hw_alloc(dev, imdio_regs);
|
||||
- if (IS_ERR(hw)) {
|
||||
- dev_err(dev, "failed to allocate ENETC HW structure\n");
|
||||
- return PTR_ERR(hw);
|
||||
- }
|
||||
-
|
||||
- bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv));
|
||||
- if (!bus)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- bus->name = "VSC9959 internal MDIO bus";
|
||||
- bus->read = enetc_mdio_read;
|
||||
- bus->write = enetc_mdio_write;
|
||||
- bus->parent = dev;
|
||||
- mdio_priv = bus->priv;
|
||||
- mdio_priv->hw = hw;
|
||||
- /* This gets added to imdio_regs, which already maps addresses
|
||||
- * starting with the proper offset.
|
||||
- */
|
||||
- mdio_priv->mdio_base = 0;
|
||||
- snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev));
|
||||
-
|
||||
- /* Needed in order to initialize the bus mutex lock */
|
||||
- rc = mdiobus_register(bus);
|
||||
- if (rc < 0) {
|
||||
- dev_err(dev, "failed to register MDIO bus\n");
|
||||
- return rc;
|
||||
- }
|
||||
-
|
||||
- felix->imdio = bus;
|
||||
-
|
||||
- for (port = 0; port < felix->info->num_ports; port++) {
|
||||
- struct phy_device *pcs;
|
||||
- bool is_c45 = false;
|
||||
-
|
||||
- pcs = get_phy_device(felix->imdio, port, is_c45);
|
||||
- if (IS_ERR(pcs))
|
||||
- continue;
|
||||
-
|
||||
- felix->pcs[port] = pcs;
|
||||
-
|
||||
- dev_info(dev, "Found PCS at internal MDIO address %d\n", port);
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
struct felix_info felix_info_vsc9959 = {
|
||||
.target_io_res = vsc9959_target_io_res,
|
||||
.port_io_res = vsc9959_port_io_res,
|
||||
- .imdio_res = &vsc9959_imdio_res,
|
||||
.regfields = vsc9959_regfields,
|
||||
.map = vsc9959_regmap,
|
||||
.ops = &vsc9959_ops,
|
||||
@@ -871,8 +583,6 @@ struct felix_info felix_info_vsc9959 = {
|
||||
.num_stats = ARRAY_SIZE(vsc9959_stats_layout),
|
||||
.shared_queue_sz = 128 * 1024,
|
||||
.num_ports = 6,
|
||||
- .switch_pci_bar = 4,
|
||||
- .imdio_pci_bar = 0,
|
||||
+ .pci_bar = 4,
|
||||
.quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION,
|
||||
- .mdio_bus_alloc = vsc9959_mdio_bus_alloc,
|
||||
};
|
||||
@ -1,164 +0,0 @@
|
||||
From e1aa2a770cc5f4d46693bb491ed2ca7f066c3585 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:30:41 +0200
|
||||
Subject: [PATCH] Revert "net: mscc: ocelot: introduce more focused PCS ops for
|
||||
PHYLINK"
|
||||
|
||||
This reverts commit 423c8b04007c85907f8f514de459ebc8541f0a54.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/ethernet/mscc/ocelot.c | 36 ++++++++++++++++++++++++--------
|
||||
drivers/net/ethernet/mscc/ocelot_board.c | 35 +------------------------------
|
||||
include/soc/mscc/ocelot.h | 12 +++--------
|
||||
3 files changed, 31 insertions(+), 52 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -410,25 +410,43 @@ void ocelot_phylink_validate(struct ocel
|
||||
unsigned long *supported,
|
||||
struct phylink_link_state *state)
|
||||
{
|
||||
- if (ocelot->ops->pcs_validate)
|
||||
- ocelot->ops->pcs_validate(ocelot, port, supported, state);
|
||||
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
+
|
||||
+ if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
+ state->interface != PHY_INTERFACE_MODE_QSGMII) {
|
||||
+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* No half-duplex. */
|
||||
+ phylink_set_port_modes(mask);
|
||||
+ phylink_set(mask, Autoneg);
|
||||
+ phylink_set(mask, Pause);
|
||||
+ phylink_set(mask, Asym_Pause);
|
||||
+ phylink_set(mask, 10baseT_Full);
|
||||
+ phylink_set(mask, 100baseT_Full);
|
||||
+ phylink_set(mask, 1000baseT_Full);
|
||||
+ phylink_set(mask, 2500baseT_Full);
|
||||
+
|
||||
+ bitmap_and(supported, supported, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
+ bitmap_and(state->advertising, state->advertising, mask,
|
||||
+ __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_phylink_validate);
|
||||
|
||||
void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port,
|
||||
struct phylink_link_state *state)
|
||||
{
|
||||
- if (ocelot->ops->pcs_link_state)
|
||||
- ocelot->ops->pcs_link_state(ocelot, port, state);
|
||||
- else
|
||||
- state->link = 1;
|
||||
+ state->link = 1;
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state);
|
||||
|
||||
void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port)
|
||||
{
|
||||
- if (ocelot->ops->pcs_an_restart)
|
||||
- ocelot->ops->pcs_an_restart(ocelot, port);
|
||||
+ /* Not supported */
|
||||
}
|
||||
EXPORT_SYMBOL(ocelot_phylink_mac_an_restart);
|
||||
|
||||
@@ -472,7 +490,7 @@ void ocelot_phylink_mac_config(struct oc
|
||||
ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
|
||||
|
||||
if (ocelot->ops->pcs_init)
|
||||
- ocelot->ops->pcs_init(ocelot, port, link_an_mode, state);
|
||||
+ ocelot->ops->pcs_init(ocelot, port);
|
||||
|
||||
/* Enable MAC module */
|
||||
ocelot_port_writel(ocelot_port, DEV_MAC_ENA_CFG_RX_ENA |
|
||||
--- a/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
@@ -212,9 +212,7 @@ static const struct of_device_id mscc_oc
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mscc_ocelot_match);
|
||||
|
||||
-static void ocelot_port_pcs_init(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
+static void ocelot_port_pcs_init(struct ocelot *ocelot, int port)
|
||||
{
|
||||
struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
|
||||
@@ -237,36 +235,6 @@ static void ocelot_port_pcs_init(struct
|
||||
ocelot_port_writel(ocelot_port, 0, PCS1G_LB_CFG);
|
||||
}
|
||||
|
||||
-void ocelot_port_pcs_validate(struct ocelot *ocelot, int port,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
-
|
||||
- if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
- state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_QSGMII) {
|
||||
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* No half-duplex. */
|
||||
- phylink_set_port_modes(mask);
|
||||
- phylink_set(mask, Autoneg);
|
||||
- phylink_set(mask, Pause);
|
||||
- phylink_set(mask, Asym_Pause);
|
||||
- phylink_set(mask, 10baseT_Full);
|
||||
- phylink_set(mask, 100baseT_Full);
|
||||
- phylink_set(mask, 1000baseT_Full);
|
||||
- phylink_set(mask, 2500baseT_Full);
|
||||
-
|
||||
- bitmap_and(supported, supported, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- bitmap_and(state->advertising, state->advertising, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
-}
|
||||
-
|
||||
static int ocelot_reset(struct ocelot *ocelot)
|
||||
{
|
||||
int retries = 100;
|
||||
@@ -292,7 +260,6 @@ static int ocelot_reset(struct ocelot *o
|
||||
|
||||
static const struct ocelot_ops ocelot_ops = {
|
||||
.pcs_init = ocelot_port_pcs_init,
|
||||
- .pcs_validate = ocelot_port_pcs_validate,
|
||||
.reset = ocelot_reset,
|
||||
};
|
||||
|
||||
--- a/include/soc/mscc/ocelot.h
|
||||
+++ b/include/soc/mscc/ocelot.h
|
||||
@@ -412,15 +412,7 @@ enum {
|
||||
struct ocelot;
|
||||
|
||||
struct ocelot_ops {
|
||||
- void (*pcs_init)(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state);
|
||||
- void (*pcs_an_restart)(struct ocelot *ocelot, int port);
|
||||
- void (*pcs_link_state)(struct ocelot *ocelot, int port,
|
||||
- struct phylink_link_state *state);
|
||||
- void (*pcs_validate)(struct ocelot *ocelot, int port,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state);
|
||||
+ void (*pcs_init)(struct ocelot *ocelot, int port);
|
||||
int (*reset)(struct ocelot *ocelot);
|
||||
};
|
||||
|
||||
@@ -487,6 +479,8 @@ struct ocelot {
|
||||
struct mutex ptp_lock;
|
||||
/* Protects the PTP clock */
|
||||
spinlock_t ptp_clock_lock;
|
||||
+
|
||||
+ void (*port_pcs_init)(struct ocelot_port *port);
|
||||
};
|
||||
|
||||
#define ocelot_read_ix(ocelot, reg, gi, ri) __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
|
||||
@ -1,653 +0,0 @@
|
||||
From 74e550d54d7c8142aefc06d1f00c506cd9039b6d Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:30:48 +0200
|
||||
Subject: [PATCH] Revert "net: mscc: ocelot: convert to PHYLINK"
|
||||
|
||||
This reverts commit e51cc023c37902e10d1e0109ff0c6ddcce3d5c03.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/dsa/ocelot/felix.c | 65 ++++---------
|
||||
drivers/net/ethernet/mscc/Kconfig | 2 +-
|
||||
drivers/net/ethernet/mscc/ocelot.c | 150 ++++++++++++++----------------
|
||||
drivers/net/ethernet/mscc/ocelot.h | 13 ++-
|
||||
drivers/net/ethernet/mscc/ocelot_board.c | 154 ++++---------------------------
|
||||
include/soc/mscc/ocelot.h | 22 +----
|
||||
6 files changed, 117 insertions(+), 289 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -58,6 +58,14 @@ static int felix_set_ageing_time(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void felix_adjust_link(struct dsa_switch *ds, int port,
|
||||
+ struct phy_device *phydev)
|
||||
+{
|
||||
+ struct ocelot *ocelot = ds->priv;
|
||||
+
|
||||
+ ocelot_adjust_link(ocelot, port, phydev);
|
||||
+}
|
||||
+
|
||||
static int felix_fdb_dump(struct dsa_switch *ds, int port,
|
||||
dsa_fdb_dump_cb_t *cb, void *data)
|
||||
{
|
||||
@@ -177,59 +185,21 @@ static int felix_tsn_enable(struct dsa_p
|
||||
}
|
||||
#endif
|
||||
|
||||
-static void felix_phylink_validate(struct dsa_switch *ds, int port,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state)
|
||||
+static int felix_port_enable(struct dsa_switch *ds, int port,
|
||||
+ struct phy_device *phy)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
- ocelot_phylink_validate(ocelot, port, supported, state);
|
||||
-}
|
||||
-
|
||||
-static int felix_phylink_mac_pcs_get_state(struct dsa_switch *ds, int port,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- struct ocelot *ocelot = ds->priv;
|
||||
-
|
||||
- ocelot_phylink_mac_pcs_get_state(ocelot, port, state);
|
||||
+ ocelot_port_enable(ocelot, port, phy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void felix_phylink_mac_config(struct dsa_switch *ds, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
-{
|
||||
- struct ocelot *ocelot = ds->priv;
|
||||
-
|
||||
- ocelot_phylink_mac_config(ocelot, port, link_an_mode, state);
|
||||
-}
|
||||
-
|
||||
-static void felix_phylink_mac_an_restart(struct dsa_switch *ds, int port)
|
||||
-{
|
||||
- struct ocelot *ocelot = ds->priv;
|
||||
-
|
||||
- ocelot_phylink_mac_an_restart(ocelot, port);
|
||||
-}
|
||||
-
|
||||
-static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface)
|
||||
-{
|
||||
- struct ocelot *ocelot = ds->priv;
|
||||
-
|
||||
- ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface);
|
||||
-}
|
||||
-
|
||||
-static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface,
|
||||
- struct phy_device *phydev)
|
||||
+static void felix_port_disable(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
- ocelot_phylink_mac_link_up(ocelot, port, link_an_mode, interface,
|
||||
- phydev);
|
||||
+ return ocelot_port_disable(ocelot, port);
|
||||
}
|
||||
|
||||
static void felix_get_strings(struct dsa_switch *ds, int port,
|
||||
@@ -447,12 +417,9 @@ static const struct dsa_switch_ops felix
|
||||
.get_ethtool_stats = felix_get_ethtool_stats,
|
||||
.get_sset_count = felix_get_sset_count,
|
||||
.get_ts_info = felix_get_ts_info,
|
||||
- .phylink_validate = felix_phylink_validate,
|
||||
- .phylink_mac_link_state = felix_phylink_mac_pcs_get_state,
|
||||
- .phylink_mac_config = felix_phylink_mac_config,
|
||||
- .phylink_mac_an_restart = felix_phylink_mac_an_restart,
|
||||
- .phylink_mac_link_down = felix_phylink_mac_link_down,
|
||||
- .phylink_mac_link_up = felix_phylink_mac_link_up,
|
||||
+ .adjust_link = felix_adjust_link,
|
||||
+ .port_enable = felix_port_enable,
|
||||
+ .port_disable = felix_port_disable,
|
||||
.port_fdb_dump = felix_fdb_dump,
|
||||
.port_fdb_add = felix_fdb_add,
|
||||
.port_fdb_del = felix_fdb_del,
|
||||
--- a/drivers/net/ethernet/mscc/Kconfig
|
||||
+++ b/drivers/net/ethernet/mscc/Kconfig
|
||||
@@ -15,7 +15,7 @@ config MSCC_OCELOT_SWITCH
|
||||
tristate "Ocelot switch driver"
|
||||
depends on NET_SWITCHDEV
|
||||
depends on HAS_IOMEM
|
||||
- select PHYLINK
|
||||
+ select PHYLIB
|
||||
select REGMAP_MMIO
|
||||
help
|
||||
This driver supports the Ocelot network switch device.
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/netdevice.h>
|
||||
-#include <linux/phylink.h>
|
||||
+#include <linux/phy.h>
|
||||
#include <linux/ptp_clock_kernel.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/iopoll.h>
|
||||
@@ -406,66 +406,18 @@ static u16 ocelot_wm_enc(u16 value)
|
||||
return value;
|
||||
}
|
||||
|
||||
-void ocelot_phylink_validate(struct ocelot *ocelot, int port,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
-
|
||||
- if (state->interface != PHY_INTERFACE_MODE_NA &&
|
||||
- state->interface != PHY_INTERFACE_MODE_GMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_SGMII &&
|
||||
- state->interface != PHY_INTERFACE_MODE_QSGMII) {
|
||||
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- /* No half-duplex. */
|
||||
- phylink_set_port_modes(mask);
|
||||
- phylink_set(mask, Autoneg);
|
||||
- phylink_set(mask, Pause);
|
||||
- phylink_set(mask, Asym_Pause);
|
||||
- phylink_set(mask, 10baseT_Full);
|
||||
- phylink_set(mask, 100baseT_Full);
|
||||
- phylink_set(mask, 1000baseT_Full);
|
||||
- phylink_set(mask, 2500baseT_Full);
|
||||
-
|
||||
- bitmap_and(supported, supported, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
- bitmap_and(state->advertising, state->advertising, mask,
|
||||
- __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
-}
|
||||
-EXPORT_SYMBOL(ocelot_phylink_validate);
|
||||
-
|
||||
-void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- state->link = 1;
|
||||
-}
|
||||
-EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state);
|
||||
-
|
||||
-void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port)
|
||||
-{
|
||||
- /* Not supported */
|
||||
-}
|
||||
-EXPORT_SYMBOL(ocelot_phylink_mac_an_restart);
|
||||
-
|
||||
-void ocelot_phylink_mac_config(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
+void ocelot_adjust_link(struct ocelot *ocelot, int port,
|
||||
+ struct phy_device *phydev)
|
||||
{
|
||||
int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA;
|
||||
struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
- u32 mac_fc_cfg;
|
||||
|
||||
if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION)
|
||||
speed = SPEED_1000;
|
||||
else
|
||||
- speed = state->speed;
|
||||
+ speed = phydev->speed;
|
||||
|
||||
switch (speed) {
|
||||
- case SPEED_UNKNOWN:
|
||||
- return;
|
||||
case SPEED_10:
|
||||
mac_speed = OCELOT_SPEED_10;
|
||||
break;
|
||||
@@ -481,11 +433,16 @@ void ocelot_phylink_mac_config(struct oc
|
||||
mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
break;
|
||||
default:
|
||||
- dev_err(ocelot->dev, "Unsupported speed on port %d: %d\n",
|
||||
+ dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n",
|
||||
port, speed);
|
||||
return;
|
||||
}
|
||||
|
||||
+ phy_print_status(phydev);
|
||||
+
|
||||
+ if (!phydev->link)
|
||||
+ return;
|
||||
+
|
||||
/* Only full duplex supported for now */
|
||||
ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
|
||||
|
||||
@@ -512,36 +469,27 @@ void ocelot_phylink_mac_config(struct oc
|
||||
QSYS_SWITCH_PORT_MODE, port);
|
||||
|
||||
/* Flow control */
|
||||
- mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed);
|
||||
- if (state->pause & MLO_PAUSE_RX)
|
||||
- mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA;
|
||||
- if (state->pause & MLO_PAUSE_TX)
|
||||
- mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA |
|
||||
- SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) |
|
||||
- SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
|
||||
- SYS_MAC_FC_CFG_ZERO_PAUSE_ENA;
|
||||
- ocelot_write_rix(ocelot, mac_fc_cfg, SYS_MAC_FC_CFG, port);
|
||||
-
|
||||
+ ocelot_write_rix(ocelot, SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) |
|
||||
+ SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA |
|
||||
+ SYS_MAC_FC_CFG_ZERO_PAUSE_ENA |
|
||||
+ SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
|
||||
+ SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed),
|
||||
+ SYS_MAC_FC_CFG, port);
|
||||
ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port);
|
||||
}
|
||||
-EXPORT_SYMBOL(ocelot_phylink_mac_config);
|
||||
+EXPORT_SYMBOL(ocelot_adjust_link);
|
||||
|
||||
-void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface)
|
||||
+static void ocelot_port_adjust_link(struct net_device *dev)
|
||||
{
|
||||
- struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
+ struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
|
||||
- ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG);
|
||||
- ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA,
|
||||
- QSYS_SWITCH_PORT_MODE, port);
|
||||
+ ocelot_adjust_link(ocelot, port, dev->phydev);
|
||||
}
|
||||
-EXPORT_SYMBOL(ocelot_phylink_mac_link_down);
|
||||
|
||||
-void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface,
|
||||
- struct phy_device *phy)
|
||||
+void ocelot_port_enable(struct ocelot *ocelot, int port,
|
||||
+ struct phy_device *phy)
|
||||
{
|
||||
/* Enable receiving frames on the port, and activate auto-learning of
|
||||
* MAC addresses.
|
||||
@@ -551,22 +499,62 @@ void ocelot_phylink_mac_link_up(struct o
|
||||
ANA_PORT_PORT_CFG_PORTID_VAL(port),
|
||||
ANA_PORT_PORT_CFG, port);
|
||||
}
|
||||
-EXPORT_SYMBOL(ocelot_phylink_mac_link_up);
|
||||
+EXPORT_SYMBOL(ocelot_port_enable);
|
||||
|
||||
static int ocelot_port_open(struct net_device *dev)
|
||||
{
|
||||
struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+ int err;
|
||||
+
|
||||
+ if (priv->serdes) {
|
||||
+ err = phy_set_mode_ext(priv->serdes, PHY_MODE_ETHERNET,
|
||||
+ priv->phy_mode);
|
||||
+ if (err) {
|
||||
+ netdev_err(dev, "Could not set mode of SerDes\n");
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ err = phy_connect_direct(dev, priv->phy, &ocelot_port_adjust_link,
|
||||
+ priv->phy_mode);
|
||||
+ if (err) {
|
||||
+ netdev_err(dev, "Could not attach to PHY\n");
|
||||
+ return err;
|
||||
+ }
|
||||
|
||||
- phylink_start(priv->phylink);
|
||||
+ dev->phydev = priv->phy;
|
||||
+
|
||||
+ phy_attached_info(priv->phy);
|
||||
+ phy_start(priv->phy);
|
||||
+
|
||||
+ ocelot_port_enable(ocelot, port, priv->phy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+void ocelot_port_disable(struct ocelot *ocelot, int port)
|
||||
+{
|
||||
+ struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
+
|
||||
+ ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG);
|
||||
+ ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA,
|
||||
+ QSYS_SWITCH_PORT_MODE, port);
|
||||
+}
|
||||
+EXPORT_SYMBOL(ocelot_port_disable);
|
||||
+
|
||||
static int ocelot_port_stop(struct net_device *dev)
|
||||
{
|
||||
struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
+ struct ocelot *ocelot = priv->port.ocelot;
|
||||
+ int port = priv->chip_port;
|
||||
+
|
||||
+ phy_disconnect(priv->phy);
|
||||
+
|
||||
+ dev->phydev = NULL;
|
||||
|
||||
- phylink_stop(priv->phylink);
|
||||
+ ocelot_port_disable(ocelot, port);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2263,7 +2251,8 @@ void ocelot_init_port(struct ocelot *oce
|
||||
EXPORT_SYMBOL(ocelot_init_port);
|
||||
|
||||
int ocelot_probe_port(struct ocelot *ocelot, u8 port,
|
||||
- void __iomem *regs)
|
||||
+ void __iomem *regs,
|
||||
+ struct phy_device *phy)
|
||||
{
|
||||
struct ocelot_port_private *priv;
|
||||
struct ocelot_port *ocelot_port;
|
||||
@@ -2276,6 +2265,7 @@ int ocelot_probe_port(struct ocelot *oce
|
||||
SET_NETDEV_DEV(dev, ocelot->dev);
|
||||
priv = netdev_priv(dev);
|
||||
priv->dev = dev;
|
||||
+ priv->phy = phy;
|
||||
priv->chip_port = port;
|
||||
ocelot_port = &priv->port;
|
||||
ocelot_port->ocelot = ocelot;
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.h
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.h
|
||||
@@ -12,7 +12,8 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/net_tstamp.h>
|
||||
-#include <linux/phylink.h>
|
||||
+#include <linux/phy.h>
|
||||
+#include <linux/phy/phy.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ptp_clock_kernel.h>
|
||||
#include <linux/regmap.h>
|
||||
@@ -64,12 +65,14 @@ struct ocelot_multicast {
|
||||
struct ocelot_port_private {
|
||||
struct ocelot_port port;
|
||||
struct net_device *dev;
|
||||
- struct phylink *phylink;
|
||||
- struct phylink_config phylink_config;
|
||||
+ struct phy_device *phy;
|
||||
u8 chip_port;
|
||||
|
||||
u8 vlan_aware;
|
||||
|
||||
+ phy_interface_t phy_mode;
|
||||
+ struct phy *serdes;
|
||||
+
|
||||
struct ocelot_port_tc tc;
|
||||
};
|
||||
|
||||
@@ -80,7 +83,9 @@ void ocelot_port_writel(struct ocelot_po
|
||||
#define ocelot_field_read(ocelot, reg, val) regmap_field_read((ocelot)->regfields[(reg)], (val))
|
||||
|
||||
int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops);
|
||||
-int ocelot_probe_port(struct ocelot *ocelot, u8 port, void __iomem *regs);
|
||||
+int ocelot_probe_port(struct ocelot *ocelot, u8 port,
|
||||
+ void __iomem *regs,
|
||||
+ struct phy_device *phy);
|
||||
|
||||
void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu,
|
||||
enum ocelot_tag_prefix injection,
|
||||
--- a/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot_board.c
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <net/switchdev.h>
|
||||
-#include <linux/phy/phy.h>
|
||||
|
||||
#include "ocelot.h"
|
||||
|
||||
@@ -263,91 +262,6 @@ static const struct ocelot_ops ocelot_op
|
||||
.reset = ocelot_reset,
|
||||
};
|
||||
|
||||
-static void ocelot_port_phylink_validate(struct phylink_config *config,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- struct net_device *ndev = to_net_dev(config->dev);
|
||||
- struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- ocelot_phylink_validate(ocelot, port, supported, state);
|
||||
-}
|
||||
-
|
||||
-static int
|
||||
-ocelot_port_phylink_mac_pcs_get_state(struct phylink_config *config,
|
||||
- struct phylink_link_state *state)
|
||||
-{
|
||||
- struct net_device *ndev = to_net_dev(config->dev);
|
||||
- struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- ocelot_phylink_mac_pcs_get_state(ocelot, port, state);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static void ocelot_port_phylink_mac_an_restart(struct phylink_config *config)
|
||||
-{
|
||||
- struct net_device *ndev = to_net_dev(config->dev);
|
||||
- struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- ocelot_phylink_mac_an_restart(ocelot, port);
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-ocelot_port_phylink_mac_config(struct phylink_config *config,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state)
|
||||
-{
|
||||
- struct net_device *ndev = to_net_dev(config->dev);
|
||||
- struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- ocelot_phylink_mac_config(ocelot, port, link_an_mode, state);
|
||||
-}
|
||||
-
|
||||
-static void ocelot_port_phylink_mac_link_down(struct phylink_config *config,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface)
|
||||
-{
|
||||
- struct net_device *ndev = to_net_dev(config->dev);
|
||||
- struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- return ocelot_phylink_mac_link_down(ocelot, port, link_an_mode,
|
||||
- interface);
|
||||
-}
|
||||
-
|
||||
-static void ocelot_port_phylink_mac_link_up(struct phylink_config *config,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface,
|
||||
- struct phy_device *phy)
|
||||
-{
|
||||
- struct net_device *ndev = to_net_dev(config->dev);
|
||||
- struct ocelot_port_private *priv = netdev_priv(ndev);
|
||||
- struct ocelot *ocelot = priv->port.ocelot;
|
||||
- int port = priv->chip_port;
|
||||
-
|
||||
- return ocelot_phylink_mac_link_up(ocelot, port, link_an_mode,
|
||||
- interface, phy);
|
||||
-}
|
||||
-
|
||||
-static const struct phylink_mac_ops ocelot_phylink_ops = {
|
||||
- .validate = ocelot_port_phylink_validate,
|
||||
- .mac_link_state = ocelot_port_phylink_mac_pcs_get_state,
|
||||
- .mac_an_restart = ocelot_port_phylink_mac_an_restart,
|
||||
- .mac_config = ocelot_port_phylink_mac_config,
|
||||
- .mac_link_down = ocelot_port_phylink_mac_link_down,
|
||||
- .mac_link_up = ocelot_port_phylink_mac_link_up,
|
||||
-};
|
||||
-
|
||||
static int mscc_ocelot_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
@@ -455,6 +369,8 @@ static int mscc_ocelot_probe(struct plat
|
||||
for_each_available_child_of_node(ports, portnp) {
|
||||
struct ocelot_port_private *priv;
|
||||
struct ocelot_port *ocelot_port;
|
||||
+ struct device_node *phy_node;
|
||||
+ struct phy_device *phy;
|
||||
struct resource *res;
|
||||
struct phy *serdes;
|
||||
void __iomem *regs;
|
||||
@@ -473,7 +389,16 @@ static int mscc_ocelot_probe(struct plat
|
||||
if (IS_ERR(regs))
|
||||
continue;
|
||||
|
||||
- err = ocelot_probe_port(ocelot, port, regs);
|
||||
+ phy_node = of_parse_phandle(portnp, "phy-handle", 0);
|
||||
+ if (!phy_node)
|
||||
+ continue;
|
||||
+
|
||||
+ phy = of_phy_find_device(phy_node);
|
||||
+ of_node_put(phy_node);
|
||||
+ if (!phy)
|
||||
+ continue;
|
||||
+
|
||||
+ err = ocelot_probe_port(ocelot, port, regs, phy);
|
||||
if (err) {
|
||||
of_node_put(portnp);
|
||||
goto out_put_ports;
|
||||
@@ -487,7 +412,9 @@ static int mscc_ocelot_probe(struct plat
|
||||
if (phy_mode < 0)
|
||||
phy_mode = PHY_INTERFACE_MODE_NA;
|
||||
|
||||
- switch (phy_mode) {
|
||||
+ priv->phy_mode = phy_mode;
|
||||
+
|
||||
+ switch (priv->phy_mode) {
|
||||
case PHY_INTERFACE_MODE_NA:
|
||||
continue;
|
||||
case PHY_INTERFACE_MODE_SGMII:
|
||||
@@ -524,41 +451,7 @@ static int mscc_ocelot_probe(struct plat
|
||||
goto out_put_ports;
|
||||
}
|
||||
|
||||
- if (serdes) {
|
||||
- err = phy_set_mode_ext(serdes, PHY_MODE_ETHERNET,
|
||||
- phy_mode);
|
||||
- if (err) {
|
||||
- dev_err(ocelot->dev,
|
||||
- "Could not set mode of SerDes\n");
|
||||
- of_node_put(portnp);
|
||||
- goto out_put_ports;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- priv->phylink_config.dev = &priv->dev->dev;
|
||||
- priv->phylink_config.type = PHYLINK_NETDEV;
|
||||
-
|
||||
- priv->phylink = phylink_create(&priv->phylink_config,
|
||||
- of_fwnode_handle(portnp),
|
||||
- phy_mode, &ocelot_phylink_ops);
|
||||
- if (IS_ERR(priv->phylink)) {
|
||||
- dev_err(ocelot->dev,
|
||||
- "Could not create a phylink instance (%ld)\n",
|
||||
- PTR_ERR(priv->phylink));
|
||||
- err = PTR_ERR(priv->phylink);
|
||||
- priv->phylink = NULL;
|
||||
- of_node_put(portnp);
|
||||
- goto out_put_ports;
|
||||
- }
|
||||
-
|
||||
- err = phylink_of_phy_connect(priv->phylink, portnp, 0);
|
||||
- if (err) {
|
||||
- dev_err(ocelot->dev, "Could not connect to PHY: %d\n",
|
||||
- err);
|
||||
- phylink_destroy(priv->phylink);
|
||||
- of_node_put(portnp);
|
||||
- goto out_put_ports;
|
||||
- }
|
||||
+ priv->serdes = serdes;
|
||||
}
|
||||
|
||||
register_netdevice_notifier(&ocelot_netdevice_nb);
|
||||
@@ -575,27 +468,12 @@ out_put_ports:
|
||||
static int mscc_ocelot_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ocelot *ocelot = platform_get_drvdata(pdev);
|
||||
- int port;
|
||||
|
||||
ocelot_deinit(ocelot);
|
||||
unregister_switchdev_blocking_notifier(&ocelot_switchdev_blocking_nb);
|
||||
unregister_switchdev_notifier(&ocelot_switchdev_nb);
|
||||
unregister_netdevice_notifier(&ocelot_netdevice_nb);
|
||||
|
||||
- for (port = 0; port < ocelot->num_phys_ports; port++) {
|
||||
- struct ocelot_port_private *priv;
|
||||
-
|
||||
- priv = container_of(ocelot->ports[port],
|
||||
- struct ocelot_port_private,
|
||||
- port);
|
||||
-
|
||||
- if (priv->phylink) {
|
||||
- rtnl_lock();
|
||||
- phylink_destroy(priv->phylink);
|
||||
- rtnl_unlock();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/include/soc/mscc/ocelot.h
|
||||
+++ b/include/soc/mscc/ocelot.h
|
||||
@@ -518,12 +518,17 @@ void ocelot_deinit(struct ocelot *ocelot
|
||||
void ocelot_init_port(struct ocelot *ocelot, int port);
|
||||
|
||||
/* DSA callbacks */
|
||||
+void ocelot_port_enable(struct ocelot *ocelot, int port,
|
||||
+ struct phy_device *phy);
|
||||
+void ocelot_port_disable(struct ocelot *ocelot, int port);
|
||||
void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data);
|
||||
void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data);
|
||||
int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset);
|
||||
int ocelot_get_ts_info(struct ocelot *ocelot, int port,
|
||||
struct ethtool_ts_info *info);
|
||||
void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs);
|
||||
+void ocelot_adjust_link(struct ocelot *ocelot, int port,
|
||||
+ struct phy_device *phydev);
|
||||
void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port,
|
||||
bool vlan_aware);
|
||||
void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state);
|
||||
@@ -592,21 +597,4 @@ int ocelot_rtag_parse_enable(struct ocel
|
||||
int ocelot_dscp_set(struct ocelot *ocelot, int port,
|
||||
bool enable, const u8 dscp_ix,
|
||||
struct tsn_qos_switch_dscp_conf *c);
|
||||
-void ocelot_phylink_validate(struct ocelot *ocelot, int port,
|
||||
- unsigned long *supported,
|
||||
- struct phylink_link_state *state);
|
||||
-void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port,
|
||||
- struct phylink_link_state *state);
|
||||
-void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port);
|
||||
-void ocelot_phylink_mac_config(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- const struct phylink_link_state *state);
|
||||
-void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface);
|
||||
-void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port,
|
||||
- unsigned int link_an_mode,
|
||||
- phy_interface_t interface,
|
||||
- struct phy_device *phy);
|
||||
-
|
||||
#endif
|
||||
@ -1,145 +0,0 @@
|
||||
From 6864e50946bf92f96b8452d1e47765230a276bb0 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:30:58 +0200
|
||||
Subject: [PATCH] Revert "net: mscc: ocelot: do not force Felix MACs at lower
|
||||
speeds than gigabit"
|
||||
|
||||
This reverts commit f3ebad1269aad8a04710e84dc1cd5de485e5fec4.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/dsa/ocelot/felix.c | 1 -
|
||||
drivers/net/dsa/ocelot/felix.h | 1 -
|
||||
drivers/net/dsa/ocelot/felix_vsc9959.c | 1 -
|
||||
drivers/net/ethernet/mscc/ocelot.c | 32 ++++++++++++++------------------
|
||||
include/soc/mscc/ocelot.h | 7 -------
|
||||
5 files changed, 14 insertions(+), 28 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix.c
|
||||
@@ -249,7 +249,6 @@ static int felix_init_structs(struct fel
|
||||
ocelot->num_stats = felix->info->num_stats;
|
||||
ocelot->shared_queue_sz = felix->info->shared_queue_sz;
|
||||
ocelot->ops = felix->info->ops;
|
||||
- ocelot->quirks = felix->info->quirks;
|
||||
|
||||
base = pci_resource_start(felix->pdev, felix->info->pci_bar);
|
||||
|
||||
--- a/drivers/net/dsa/ocelot/felix.h
|
||||
+++ b/drivers/net/dsa/ocelot/felix.h
|
||||
@@ -18,7 +18,6 @@ struct felix_info {
|
||||
unsigned int num_stats;
|
||||
int num_ports;
|
||||
int pci_bar;
|
||||
- unsigned long quirks;
|
||||
};
|
||||
|
||||
extern struct felix_info felix_info_vsc9959;
|
||||
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
|
||||
@@ -584,5 +584,4 @@ struct felix_info felix_info_vsc9959 = {
|
||||
.shared_queue_sz = 128 * 1024,
|
||||
.num_ports = 6,
|
||||
.pci_bar = 4,
|
||||
- .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION,
|
||||
};
|
||||
--- a/drivers/net/ethernet/mscc/ocelot.c
|
||||
+++ b/drivers/net/ethernet/mscc/ocelot.c
|
||||
@@ -409,32 +409,27 @@ static u16 ocelot_wm_enc(u16 value)
|
||||
void ocelot_adjust_link(struct ocelot *ocelot, int port,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
- int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA;
|
||||
struct ocelot_port *ocelot_port = ocelot->ports[port];
|
||||
+ int speed, mode = 0;
|
||||
|
||||
- if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION)
|
||||
- speed = SPEED_1000;
|
||||
- else
|
||||
- speed = phydev->speed;
|
||||
-
|
||||
- switch (speed) {
|
||||
+ switch (phydev->speed) {
|
||||
case SPEED_10:
|
||||
- mac_speed = OCELOT_SPEED_10;
|
||||
+ speed = OCELOT_SPEED_10;
|
||||
break;
|
||||
case SPEED_100:
|
||||
- mac_speed = OCELOT_SPEED_100;
|
||||
+ speed = OCELOT_SPEED_100;
|
||||
break;
|
||||
case SPEED_1000:
|
||||
- mac_speed = OCELOT_SPEED_1000;
|
||||
- mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
+ speed = OCELOT_SPEED_1000;
|
||||
+ mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
break;
|
||||
case SPEED_2500:
|
||||
- mac_speed = OCELOT_SPEED_2500;
|
||||
- mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
+ speed = OCELOT_SPEED_2500;
|
||||
+ mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
|
||||
break;
|
||||
default:
|
||||
dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n",
|
||||
- port, speed);
|
||||
+ port, phydev->speed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,7 +439,8 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
return;
|
||||
|
||||
/* Only full duplex supported for now */
|
||||
- ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
|
||||
+ ocelot_port_writel(ocelot_port, DEV_MAC_MODE_CFG_FDX_ENA |
|
||||
+ mode, DEV_MAC_MODE_CFG);
|
||||
|
||||
if (ocelot->ops->pcs_init)
|
||||
ocelot->ops->pcs_init(ocelot, port);
|
||||
@@ -455,11 +451,11 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
|
||||
/* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of
|
||||
* reset */
|
||||
- ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(mac_speed),
|
||||
+ ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed),
|
||||
DEV_CLOCK_CFG);
|
||||
|
||||
/* No PFC */
|
||||
- ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(mac_speed),
|
||||
+ ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(speed),
|
||||
ANA_PFC_PFC_CFG, port);
|
||||
|
||||
/* Core: Enable port for frame transfer */
|
||||
@@ -473,7 +469,7 @@ void ocelot_adjust_link(struct ocelot *o
|
||||
SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA |
|
||||
SYS_MAC_FC_CFG_ZERO_PAUSE_ENA |
|
||||
SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
|
||||
- SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed),
|
||||
+ SYS_MAC_FC_CFG_FC_LINK_SPEED(speed),
|
||||
SYS_MAC_FC_CFG, port);
|
||||
ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port);
|
||||
}
|
||||
--- a/include/soc/mscc/ocelot.h
|
||||
+++ b/include/soc/mscc/ocelot.h
|
||||
@@ -404,11 +404,6 @@ enum ocelot_tag_prefix {
|
||||
OCELOT_TAG_PREFIX_LONG,
|
||||
};
|
||||
|
||||
-/* Hardware quirks (differences between switch instantiations) */
|
||||
-enum {
|
||||
- OCELOT_PCS_PERFORMS_RATE_ADAPTATION = BIT(0),
|
||||
-};
|
||||
-
|
||||
struct ocelot;
|
||||
|
||||
struct ocelot_ops {
|
||||
@@ -469,8 +464,6 @@ struct ocelot {
|
||||
struct delayed_work stats_work;
|
||||
struct workqueue_struct *stats_queue;
|
||||
|
||||
- unsigned long quirks;
|
||||
-
|
||||
u8 ptp:1;
|
||||
struct ptp_clock *ptp_clock;
|
||||
struct ptp_clock_info ptp_info;
|
||||
@ -1,55 +0,0 @@
|
||||
From d93ca8d9c8365cf533f88582c57c83cb50fe598a Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:31:13 +0200
|
||||
Subject: [PATCH] Revert "enetc: Set MDIO_CFG_HOLD to the recommended value of
|
||||
2"
|
||||
|
||||
This reverts commit 3f643e4af035886cd2ca4bf79967098cfe55b40b.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 12 ++++--------
|
||||
1 file changed, 4 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
@@ -31,19 +31,15 @@ static inline void _enetc_mdio_wr(struct
|
||||
_enetc_mdio_wr(mdio_priv, ENETC_##off, val)
|
||||
#define enetc_mdio_rd_reg(off) enetc_mdio_rd(mdio_priv, off)
|
||||
|
||||
+#define ENETC_MDC_DIV 258
|
||||
+
|
||||
#define MDIO_CFG_CLKDIV(x) ((((x) >> 1) & 0xff) << 8)
|
||||
#define MDIO_CFG_BSY BIT(0)
|
||||
#define MDIO_CFG_RD_ER BIT(1)
|
||||
-#define MDIO_CFG_HOLD(x) (((x) << 2) & GENMASK(4, 2))
|
||||
#define MDIO_CFG_ENC45 BIT(6)
|
||||
/* external MDIO only - driven on neg MDC edge */
|
||||
#define MDIO_CFG_NEG BIT(23)
|
||||
|
||||
-#define ENETC_EMDIO_CFG \
|
||||
- (MDIO_CFG_HOLD(2) | \
|
||||
- MDIO_CFG_CLKDIV(258) | \
|
||||
- MDIO_CFG_NEG)
|
||||
-
|
||||
#define MDIO_CTL_DEV_ADDR(x) ((x) & 0x1f)
|
||||
#define MDIO_CTL_PORT_ADDR(x) (((x) & 0x1f) << 5)
|
||||
#define MDIO_CTL_READ BIT(15)
|
||||
@@ -65,7 +61,7 @@ int enetc_mdio_write(struct mii_bus *bus
|
||||
u16 dev_addr;
|
||||
int ret;
|
||||
|
||||
- mdio_cfg = ENETC_EMDIO_CFG;
|
||||
+ mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG;
|
||||
if (regnum & MII_ADDR_C45) {
|
||||
dev_addr = (regnum >> 16) & 0x1f;
|
||||
mdio_cfg |= MDIO_CFG_ENC45;
|
||||
@@ -112,7 +108,7 @@ int enetc_mdio_read(struct mii_bus *bus,
|
||||
u16 dev_addr, value;
|
||||
int ret;
|
||||
|
||||
- mdio_cfg = ENETC_EMDIO_CFG;
|
||||
+ mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG;
|
||||
if (regnum & MII_ADDR_C45) {
|
||||
dev_addr = (regnum >> 16) & 0x1f;
|
||||
mdio_cfg |= MDIO_CFG_ENC45;
|
||||
@ -1,192 +0,0 @@
|
||||
From 78378454e7978ea3b4128822880677e6efa9ddef Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:31:22 +0200
|
||||
Subject: [PATCH] Revert "enetc: export enetc_mdio definitionns to
|
||||
include/linux/fsl"
|
||||
|
||||
This reverts commit f8d80c003b76f397696bf887ebbd37a78781c050.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 18 +---------
|
||||
drivers/net/ethernet/freescale/enetc/enetc_mdio.h | 12 +++++++
|
||||
.../net/ethernet/freescale/enetc/enetc_pci_mdio.c | 41 +++++++++-------------
|
||||
include/linux/fsl/enetc_mdio.h | 21 -----------
|
||||
4 files changed, 30 insertions(+), 62 deletions(-)
|
||||
create mode 100644 drivers/net/ethernet/freescale/enetc/enetc_mdio.h
|
||||
delete mode 100644 include/linux/fsl/enetc_mdio.h
|
||||
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/* Copyright 2019 NXP */
|
||||
|
||||
-#include <linux/fsl/enetc_mdio.h>
|
||||
#include <linux/mdio.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#include "enetc_pf.h"
|
||||
+#include "enetc_mdio.h"
|
||||
|
||||
#define ENETC_MDIO_CFG 0x0 /* MDIO configuration and status */
|
||||
#define ENETC_MDIO_CTL 0x4 /* MDIO control */
|
||||
@@ -99,7 +99,6 @@ int enetc_mdio_write(struct mii_bus *bus
|
||||
|
||||
return 0;
|
||||
}
|
||||
-EXPORT_SYMBOL_GPL(enetc_mdio_write);
|
||||
|
||||
int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
|
||||
{
|
||||
@@ -155,21 +154,6 @@ int enetc_mdio_read(struct mii_bus *bus,
|
||||
|
||||
return value;
|
||||
}
|
||||
-EXPORT_SYMBOL_GPL(enetc_mdio_read);
|
||||
-
|
||||
-struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs)
|
||||
-{
|
||||
- struct enetc_hw *hw;
|
||||
-
|
||||
- hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL);
|
||||
- if (!hw)
|
||||
- return ERR_PTR(-ENOMEM);
|
||||
-
|
||||
- hw->port = port_regs;
|
||||
-
|
||||
- return hw;
|
||||
-}
|
||||
-EXPORT_SYMBOL_GPL(enetc_hw_alloc);
|
||||
|
||||
int enetc_mdio_probe(struct enetc_pf *pf)
|
||||
{
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.h
|
||||
@@ -0,0 +1,12 @@
|
||||
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
|
||||
+/* Copyright 2019 NXP */
|
||||
+
|
||||
+#include <linux/phy.h>
|
||||
+
|
||||
+struct enetc_mdio_priv {
|
||||
+ struct enetc_hw *hw;
|
||||
+ int mdio_base;
|
||||
+};
|
||||
+
|
||||
+int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value);
|
||||
+int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum);
|
||||
--- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
|
||||
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
|
||||
@@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/* Copyright 2019 NXP */
|
||||
-#include <linux/fsl/enetc_mdio.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include "enetc_pf.h"
|
||||
+#include "enetc_mdio.h"
|
||||
|
||||
#define ENETC_MDIO_DEV_ID 0xee01
|
||||
#define ENETC_MDIO_DEV_NAME "FSL PCIe IE Central MDIO"
|
||||
@@ -14,29 +14,17 @@ static int enetc_pci_mdio_probe(struct p
|
||||
{
|
||||
struct enetc_mdio_priv *mdio_priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
- void __iomem *port_regs;
|
||||
struct enetc_hw *hw;
|
||||
struct mii_bus *bus;
|
||||
int err;
|
||||
|
||||
- port_regs = pci_iomap(pdev, 0, 0);
|
||||
- if (!port_regs) {
|
||||
- dev_err(dev, "iomap failed\n");
|
||||
- err = -ENXIO;
|
||||
- goto err_ioremap;
|
||||
- }
|
||||
-
|
||||
- hw = enetc_hw_alloc(dev, port_regs);
|
||||
- if (IS_ERR(enetc_hw_alloc)) {
|
||||
- err = PTR_ERR(hw);
|
||||
- goto err_hw_alloc;
|
||||
- }
|
||||
+ hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL);
|
||||
+ if (!hw)
|
||||
+ return -ENOMEM;
|
||||
|
||||
bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv));
|
||||
- if (!bus) {
|
||||
- err = -ENOMEM;
|
||||
- goto err_mdiobus_alloc;
|
||||
- }
|
||||
+ if (!bus)
|
||||
+ return -ENOMEM;
|
||||
|
||||
bus->name = ENETC_MDIO_BUS_NAME;
|
||||
bus->read = enetc_mdio_read;
|
||||
@@ -51,7 +39,7 @@ static int enetc_pci_mdio_probe(struct p
|
||||
err = pci_enable_device_mem(pdev);
|
||||
if (err) {
|
||||
dev_err(dev, "device enable failed\n");
|
||||
- goto err_pci_enable;
|
||||
+ return err;
|
||||
}
|
||||
|
||||
err = pci_request_region(pdev, 0, KBUILD_MODNAME);
|
||||
@@ -60,6 +48,13 @@ static int enetc_pci_mdio_probe(struct p
|
||||
goto err_pci_mem_reg;
|
||||
}
|
||||
|
||||
+ hw->port = pci_iomap(pdev, 0, 0);
|
||||
+ if (!hw->port) {
|
||||
+ err = -ENXIO;
|
||||
+ dev_err(dev, "iomap failed\n");
|
||||
+ goto err_ioremap;
|
||||
+ }
|
||||
+
|
||||
err = of_mdiobus_register(bus, dev->of_node);
|
||||
if (err)
|
||||
goto err_mdiobus_reg;
|
||||
@@ -69,14 +64,12 @@ static int enetc_pci_mdio_probe(struct p
|
||||
return 0;
|
||||
|
||||
err_mdiobus_reg:
|
||||
+ iounmap(mdio_priv->hw->port);
|
||||
+err_ioremap:
|
||||
pci_release_mem_regions(pdev);
|
||||
err_pci_mem_reg:
|
||||
pci_disable_device(pdev);
|
||||
-err_pci_enable:
|
||||
-err_mdiobus_alloc:
|
||||
- iounmap(port_regs);
|
||||
-err_hw_alloc:
|
||||
-err_ioremap:
|
||||
+
|
||||
return err;
|
||||
}
|
||||
|
||||
--- a/include/linux/fsl/enetc_mdio.h
|
||||
+++ /dev/null
|
||||
@@ -1,21 +0,0 @@
|
||||
-/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
|
||||
-/* Copyright 2019 NXP */
|
||||
-
|
||||
-#include <linux/phy.h>
|
||||
-
|
||||
-/* PCS registers */
|
||||
-#define ENETC_PCS_LINK_TIMER1 0x12
|
||||
-#define ENETC_PCS_LINK_TIMER1_VAL 0x06a0
|
||||
-#define ENETC_PCS_LINK_TIMER2 0x13
|
||||
-#define ENETC_PCS_LINK_TIMER2_VAL 0x0003
|
||||
-#define ENETC_PCS_IF_MODE 0x14
|
||||
-#define ENETC_PCS_IF_MODE_SGMII_AN 0x0003
|
||||
-
|
||||
-struct enetc_mdio_priv {
|
||||
- struct enetc_hw *hw;
|
||||
- int mdio_base;
|
||||
-};
|
||||
-
|
||||
-int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value);
|
||||
-int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum);
|
||||
-struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs);
|
||||
@ -1,26 +0,0 @@
|
||||
From d3a532021976d98bfc9e3dac18a17abccf6eb567 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:31:42 +0200
|
||||
Subject: [PATCH] Revert "net: phylink: call mac_an_restart for SGMII/QSGMII
|
||||
inband interfaces too"
|
||||
|
||||
This reverts commit 57fe15baac62dad00817e3359cefc123e24f10a2.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/phy/phylink.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/phylink.c
|
||||
+++ b/drivers/net/phy/phylink.c
|
||||
@@ -360,9 +360,7 @@ static void phylink_mac_config_up(struct
|
||||
static void phylink_mac_an_restart(struct phylink *pl)
|
||||
{
|
||||
if (pl->link_config.an_enabled &&
|
||||
- (phy_interface_mode_is_8023z(pl->link_config.interface) ||
|
||||
- pl->link_config.interface == PHY_INTERFACE_MODE_SGMII ||
|
||||
- pl->link_config.interface == PHY_INTERFACE_MODE_QSGMII))
|
||||
+ phy_interface_mode_is_8023z(pl->link_config.interface))
|
||||
pl->ops->mac_an_restart(pl->config);
|
||||
}
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
From e53b64cab45ea4d01226840efd963a6bec8ad2f9 Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:31:58 +0200
|
||||
Subject: [PATCH] Revert "net: phylink: make QSGMII a valid PHY mode for
|
||||
in-band AN"
|
||||
|
||||
This reverts commit fe7fd9f6afce50c0fc09fd3d56cd59eda44d8dd0.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
drivers/net/phy/phylink.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/phy/phylink.c
|
||||
+++ b/drivers/net/phy/phylink.c
|
||||
@@ -283,7 +283,6 @@ static int phylink_parse_mode(struct phy
|
||||
|
||||
switch (pl->link_config.interface) {
|
||||
case PHY_INTERFACE_MODE_SGMII:
|
||||
- case PHY_INTERFACE_MODE_QSGMII:
|
||||
phylink_set(pl->supported, 10baseT_Half);
|
||||
phylink_set(pl->supported, 10baseT_Full);
|
||||
phylink_set(pl->supported, 100baseT_Half);
|
||||
@ -1,110 +0,0 @@
|
||||
From c6f9fb78b7534392d3be307e566d10c8525c7c9a Mon Sep 17 00:00:00 2001
|
||||
From: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
Date: Mon, 6 Jan 2020 14:32:06 +0200
|
||||
Subject: [PATCH] Revert "mii: Add helpers for parsing SGMII auto-negotiation"
|
||||
|
||||
This reverts commit de81e3c1ccbf27eda7584e23c713705a221a57da.
|
||||
|
||||
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
|
||||
---
|
||||
include/linux/mii.h | 50 ------------------------------------------------
|
||||
include/uapi/linux/mii.h | 10 ----------
|
||||
2 files changed, 60 deletions(-)
|
||||
|
||||
--- a/include/linux/mii.h
|
||||
+++ b/include/linux/mii.h
|
||||
@@ -373,56 +373,6 @@ static inline u32 mii_lpa_to_ethtool_lpa
|
||||
}
|
||||
|
||||
/**
|
||||
- * mii_lpa_mod_linkmode_adv_sgmii
|
||||
- * @lp_advertising: pointer to destination link mode.
|
||||
- * @lpa: value of the MII_LPA register
|
||||
- *
|
||||
- * A small helper function that translates MII_LPA bits to
|
||||
- * linkmode advertisement settings for SGMII.
|
||||
- * Leaves other bits unchanged.
|
||||
- */
|
||||
-static inline void
|
||||
-mii_lpa_mod_linkmode_lpa_sgmii(unsigned long *lp_advertising, u32 lpa)
|
||||
-{
|
||||
- u32 speed_duplex = lpa & LPA_SGMII_DPX_SPD_MASK;
|
||||
-
|
||||
- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, lp_advertising,
|
||||
- speed_duplex == LPA_SGMII_1000HALF);
|
||||
-
|
||||
- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, lp_advertising,
|
||||
- speed_duplex == LPA_SGMII_1000FULL);
|
||||
-
|
||||
- linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, lp_advertising,
|
||||
- speed_duplex == LPA_SGMII_100HALF);
|
||||
-
|
||||
- linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, lp_advertising,
|
||||
- speed_duplex == LPA_SGMII_100FULL);
|
||||
-
|
||||
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, lp_advertising,
|
||||
- speed_duplex == LPA_SGMII_10HALF);
|
||||
-
|
||||
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, lp_advertising,
|
||||
- speed_duplex == LPA_SGMII_10FULL);
|
||||
-}
|
||||
-
|
||||
-/**
|
||||
- * mii_lpa_to_linkmode_adv_sgmii
|
||||
- * @advertising: pointer to destination link mode.
|
||||
- * @lpa: value of the MII_LPA register
|
||||
- *
|
||||
- * A small helper function that translates MII_ADVERTISE bits
|
||||
- * to linkmode advertisement settings when in SGMII mode.
|
||||
- * Clears the old value of advertising.
|
||||
- */
|
||||
-static inline void mii_lpa_to_linkmode_lpa_sgmii(unsigned long *lp_advertising,
|
||||
- u32 lpa)
|
||||
-{
|
||||
- linkmode_zero(lp_advertising);
|
||||
-
|
||||
- mii_lpa_mod_linkmode_lpa_sgmii(lp_advertising, lpa);
|
||||
-}
|
||||
-
|
||||
-/**
|
||||
* mii_adv_mod_linkmode_adv_t
|
||||
* @advertising:pointer to destination link mode.
|
||||
* @adv: value of the MII_ADVERTISE register
|
||||
--- a/include/uapi/linux/mii.h
|
||||
+++ b/include/uapi/linux/mii.h
|
||||
@@ -71,7 +71,6 @@
|
||||
/* Advertisement control register. */
|
||||
#define ADVERTISE_SLCT 0x001f /* Selector bits */
|
||||
#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
|
||||
-#define ADVERTISE_SGMII 0x0001 /* Can do SGMII */
|
||||
#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
|
||||
#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
|
||||
#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
|
||||
@@ -95,7 +94,6 @@
|
||||
|
||||
/* Link partner ability register. */
|
||||
#define LPA_SLCT 0x001f /* Same as advertise selector */
|
||||
-#define LPA_SGMII 0x0001 /* Can do SGMII */
|
||||
#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
|
||||
#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
|
||||
#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
|
||||
@@ -106,19 +104,11 @@
|
||||
#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
|
||||
#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
|
||||
#define LPA_PAUSE_CAP 0x0400 /* Can pause */
|
||||
-#define LPA_SGMII_DPX_SPD_MASK 0x1C00 /* SGMII duplex and speed bits */
|
||||
-#define LPA_SGMII_10HALF 0x0000 /* Can do SGMII 10mbps half-duplex */
|
||||
-#define LPA_SGMII_10FULL 0x1000 /* Can do SGMII 10mbps full-duplex */
|
||||
-#define LPA_SGMII_100HALF 0x0400 /* Can do SGMII 100mbps half-duplex */
|
||||
-#define LPA_SGMII_100FULL 0x1400 /* Can do SGMII 100mbps full-duplex */
|
||||
#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
|
||||
-#define LPA_SGMII_1000HALF 0x0800 /* Can do SGMII 1000mbps half-duplex */
|
||||
-#define LPA_SGMII_1000FULL 0x1800 /* Can do SGMII 1000mbps full-duplex */
|
||||
#define LPA_RESV 0x1000 /* Unused... */
|
||||
#define LPA_RFAULT 0x2000 /* Link partner faulted */
|
||||
#define LPA_LPACK 0x4000 /* Link partner acked us */
|
||||
#define LPA_NPAGE 0x8000 /* Next page bit */
|
||||
-#define LPA_SGMII_LINK 0x8000 /* Link partner has link */
|
||||
|
||||
#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
|
||||
#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
|
||||
@ -28,7 +28,7 @@ This reverts commit e75f4940e8ad0dd76527302a10c06b58bf7eb590.
|
||||
ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints);
|
||||
|
||||
@@ -1048,35 +1038,30 @@ static int fsl_sai_remove(struct platfor
|
||||
@@ -1049,35 +1039,30 @@ static int fsl_sai_remove(struct platfor
|
||||
|
||||
static const struct fsl_sai_soc_data fsl_sai_vf610_data = {
|
||||
.use_imx_pcm = false,
|
||||
|
||||
@ -10,7 +10,7 @@ This reverts commit 6eeb60be5ebb73b2e5911e26fb1aed02940b7d09.
|
||||
|
||||
--- a/sound/soc/fsl/fsl_sai.c
|
||||
+++ b/sound/soc/fsl/fsl_sai.c
|
||||
@@ -1043,19 +1043,12 @@ static const struct fsl_sai_soc_data fsl
|
||||
@@ -1044,19 +1044,12 @@ static const struct fsl_sai_soc_data fsl
|
||||
.reg_offset = 8,
|
||||
};
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ This reverts commit a860fac420971c5a90d4f78959b44ead793aee4f.
|
||||
|
||||
--- a/sound/soc/fsl/fsl_sai.c
|
||||
+++ b/sound/soc/fsl/fsl_sai.c
|
||||
@@ -1031,24 +1031,10 @@ static const struct fsl_sai_soc_data fsl
|
||||
@@ -1032,24 +1032,10 @@ static const struct fsl_sai_soc_data fsl
|
||||
.reg_offset = 0,
|
||||
};
|
||||
|
||||
|
||||
@ -287,7 +287,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
FSL_SAI_CR3_TRCE_MASK, 0);
|
||||
}
|
||||
|
||||
@@ -643,20 +633,18 @@ static const struct snd_soc_dai_ops fsl_
|
||||
@@ -643,20 +633,17 @@ static const struct snd_soc_dai_ops fsl_
|
||||
static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev);
|
||||
@ -305,17 +305,16 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
+ regmap_write(sai->regmap, FSL_SAI_RCSR, 0);
|
||||
|
||||
- regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs),
|
||||
- FSL_SAI_CR1_RFW_MASK,
|
||||
- FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
|
||||
+ regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK,
|
||||
sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX);
|
||||
- regmap_update_bits(sai->regmap, FSL_SAI_RCR1(ofs),
|
||||
- FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1);
|
||||
- FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
|
||||
+ regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK,
|
||||
+ FSL_SAI_MAXBURST_RX - 1);
|
||||
FSL_SAI_MAXBURST_RX - 1);
|
||||
|
||||
snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx,
|
||||
&sai->dma_params_rx);
|
||||
@@ -693,12 +681,12 @@ static const struct snd_soc_component_dr
|
||||
@@ -694,12 +681,12 @@ static const struct snd_soc_component_dr
|
||||
.name = "fsl-sai",
|
||||
};
|
||||
|
||||
@ -334,7 +333,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
{FSL_SAI_TDR0, 0},
|
||||
{FSL_SAI_TDR1, 0},
|
||||
{FSL_SAI_TDR2, 0},
|
||||
@@ -707,50 +695,24 @@ static struct reg_default fsl_sai_reg_de
|
||||
@@ -708,50 +695,24 @@ static struct reg_default fsl_sai_reg_de
|
||||
{FSL_SAI_TDR5, 0},
|
||||
{FSL_SAI_TDR6, 0},
|
||||
{FSL_SAI_TDR7, 0},
|
||||
@ -398,7 +397,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
case FSL_SAI_TFR0:
|
||||
case FSL_SAI_TFR1:
|
||||
case FSL_SAI_TFR2:
|
||||
@@ -760,6 +722,12 @@ static bool fsl_sai_readable_reg(struct
|
||||
@@ -761,6 +722,12 @@ static bool fsl_sai_readable_reg(struct
|
||||
case FSL_SAI_TFR6:
|
||||
case FSL_SAI_TFR7:
|
||||
case FSL_SAI_TMR:
|
||||
@ -411,7 +410,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
case FSL_SAI_RDR0:
|
||||
case FSL_SAI_RDR1:
|
||||
case FSL_SAI_RDR2:
|
||||
@@ -785,13 +753,9 @@ static bool fsl_sai_readable_reg(struct
|
||||
@@ -786,13 +753,9 @@ static bool fsl_sai_readable_reg(struct
|
||||
|
||||
static bool fsl_sai_volatile_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
@ -427,7 +426,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
case FSL_SAI_TFR0:
|
||||
case FSL_SAI_TFR1:
|
||||
case FSL_SAI_TFR2:
|
||||
@@ -824,16 +788,13 @@ static bool fsl_sai_volatile_reg(struct
|
||||
@@ -825,16 +788,13 @@ static bool fsl_sai_volatile_reg(struct
|
||||
|
||||
static bool fsl_sai_writeable_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
@ -450,7 +449,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
case FSL_SAI_TDR0:
|
||||
case FSL_SAI_TDR1:
|
||||
case FSL_SAI_TDR2:
|
||||
@@ -843,6 +804,12 @@ static bool fsl_sai_writeable_reg(struct
|
||||
@@ -844,6 +804,12 @@ static bool fsl_sai_writeable_reg(struct
|
||||
case FSL_SAI_TDR6:
|
||||
case FSL_SAI_TDR7:
|
||||
case FSL_SAI_TMR:
|
||||
@ -463,7 +462,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
case FSL_SAI_RMR:
|
||||
return true;
|
||||
default:
|
||||
@@ -850,15 +817,15 @@ static bool fsl_sai_writeable_reg(struct
|
||||
@@ -851,15 +817,15 @@ static bool fsl_sai_writeable_reg(struct
|
||||
}
|
||||
}
|
||||
|
||||
@ -482,7 +481,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
.readable_reg = fsl_sai_readable_reg,
|
||||
.volatile_reg = fsl_sai_volatile_reg,
|
||||
.writeable_reg = fsl_sai_writeable_reg,
|
||||
@@ -890,12 +857,6 @@ static int fsl_sai_probe(struct platform
|
||||
@@ -891,12 +857,6 @@ static int fsl_sai_probe(struct platform
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
|
||||
@ -495,7 +494,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
|
||||
"bus", base, &fsl_sai_regmap_config);
|
||||
|
||||
@@ -1022,13 +983,11 @@ static int fsl_sai_remove(struct platfor
|
||||
@@ -1023,13 +983,11 @@ static int fsl_sai_remove(struct platfor
|
||||
static const struct fsl_sai_soc_data fsl_sai_vf610_data = {
|
||||
.use_imx_pcm = false,
|
||||
.fifo_depth = 32,
|
||||
@ -509,7 +508,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
};
|
||||
|
||||
static const struct of_device_id fsl_sai_ids[] = {
|
||||
@@ -1061,7 +1020,6 @@ static int fsl_sai_runtime_suspend(struc
|
||||
@@ -1062,7 +1020,6 @@ static int fsl_sai_runtime_suspend(struc
|
||||
static int fsl_sai_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct fsl_sai *sai = dev_get_drvdata(dev);
|
||||
@ -517,7 +516,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674.
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare_enable(sai->bus_clk);
|
||||
@@ -1083,11 +1041,11 @@ static int fsl_sai_runtime_resume(struct
|
||||
@@ -1084,11 +1041,11 @@ static int fsl_sai_runtime_resume(struct
|
||||
}
|
||||
|
||||
regcache_cache_only(sai->regmap, false);
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From 5d816f1a5cac458a7fff9ecf896c85eb351a7352 Mon Sep 17 00:00:00 2001
|
||||
From: Viorel Suman <viorel.suman@nxp.com>
|
||||
Date: Mon, 30 Mar 2020 16:24:59 +0800
|
||||
Subject: [PATCH] ASoC: fsl: add imx-pcm-dma v2 platform driver (part 2)
|
||||
|
||||
which don't request the dma channel in the probe, but request
|
||||
dma channel when needed. for the dma channel of cpu dai in BE
|
||||
can be reused by the FE.
|
||||
|
||||
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
||||
[ Aisheng: split PCM changes ]
|
||||
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
|
||||
[rebase]
|
||||
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
|
||||
---
|
||||
sound/soc/fsl/fsl_sai.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/sound/soc/fsl/fsl_sai.c
|
||||
+++ b/sound/soc/fsl/fsl_sai.c
|
||||
@@ -1046,6 +1046,8 @@ static int fsl_sai_probe(struct platform
|
||||
MCLK_DIR(index));
|
||||
}
|
||||
|
||||
+ sai->dma_params_rx.filter_data = "rx";
|
||||
+ sai->dma_params_tx.filter_data = "tx";
|
||||
sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0;
|
||||
sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0;
|
||||
sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX;
|
||||
@@ -1061,7 +1063,7 @@ static int fsl_sai_probe(struct platform
|
||||
goto err_pm_disable;
|
||||
|
||||
if (sai->soc->imx)
|
||||
- ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE);
|
||||
+ ret = imx_pcm_platform_register(&pdev->dev);
|
||||
if (ret)
|
||||
goto err_pm_disable;
|
||||
} else {
|
||||
@ -590,7 +590,7 @@ Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
|
||||
return ret;
|
||||
@@ -1090,6 +1134,7 @@ static int fsl_sai_runtime_suspend(struc
|
||||
@@ -1088,6 +1132,7 @@ static int fsl_sai_runtime_suspend(struc
|
||||
static int fsl_sai_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct fsl_sai *sai = dev_get_drvdata(dev);
|
||||
@ -598,7 +598,7 @@ Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare_enable(sai->bus_clk);
|
||||
@@ -1115,11 +1160,11 @@ static int fsl_sai_runtime_resume(struct
|
||||
@@ -1113,11 +1158,11 @@ static int fsl_sai_runtime_resume(struct
|
||||
PM_QOS_CPU_DMA_LATENCY, 0);
|
||||
|
||||
regcache_cache_only(sai->regmap, false);
|
||||
|
||||
@ -16,7 +16,7 @@ Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
|
||||
|
||||
--- a/sound/soc/fsl/fsl_sai.c
|
||||
+++ b/sound/soc/fsl/fsl_sai.c
|
||||
@@ -1096,6 +1096,8 @@ static int fsl_sai_probe(struct platform
|
||||
@@ -1094,6 +1094,8 @@ static int fsl_sai_probe(struct platform
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
@ -25,7 +25,7 @@ Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
|
||||
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,
|
||||
&fsl_sai_dai, 1);
|
||||
if (ret)
|
||||
@@ -1139,6 +1141,8 @@ static int fsl_sai_runtime_suspend(struc
|
||||
@@ -1137,6 +1139,8 @@ static int fsl_sai_runtime_suspend(struc
|
||||
{
|
||||
struct fsl_sai *sai = dev_get_drvdata(dev);
|
||||
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From 8d4837f146cd14cf7041050ddec77b2a5c3f2f27 Mon Sep 17 00:00:00 2001
|
||||
From: Shengjiu Wang <shengjiu.wang@nxp.com>
|
||||
Date: Tue, 23 Jan 2018 13:25:40 +0800
|
||||
Subject: [PATCH] MLK-17442: ASoC: fsl: fix wrong usage of filter_data (part 1)
|
||||
|
||||
The filter_data should be used for dma_filter_fn function,
|
||||
but we used the filter_data wrongly for dma channel name.
|
||||
This patch is to fix the issue.
|
||||
|
||||
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
||||
Reviwed-by: Daniel Baluta <daniel.baluta@nxp.com>
|
||||
[ Aisheng: split out esai and pcm changes ]
|
||||
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
|
||||
---
|
||||
sound/soc/fsl/fsl_sai.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/sound/soc/fsl/fsl_sai.c
|
||||
+++ b/sound/soc/fsl/fsl_sai.c
|
||||
@@ -1136,8 +1136,8 @@ static int fsl_sai_probe(struct platform
|
||||
MCLK_DIR(index));
|
||||
}
|
||||
|
||||
- sai->dma_params_rx.filter_data = "rx";
|
||||
- sai->dma_params_tx.filter_data = "tx";
|
||||
+ sai->dma_params_rx.chan_name = "rx";
|
||||
+ sai->dma_params_tx.chan_name = "tx";
|
||||
sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0;
|
||||
sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0;
|
||||
sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX;
|
||||
@ -274,7 +274,7 @@ Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
|
||||
if ((of_find_property(np, "fsl,i2s-xtor", NULL) != NULL) ||
|
||||
(of_find_property(np, "fsl,txm-rxs", NULL) != NULL))
|
||||
{
|
||||
@@ -1143,6 +1282,11 @@ static int fsl_sai_probe(struct platform
|
||||
@@ -1141,6 +1280,11 @@ static int fsl_sai_probe(struct platform
|
||||
sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX;
|
||||
sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX;
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com
|
||||
if (ret) {
|
||||
dev_err(cpu_dai->dev,
|
||||
"failed to set proper pins state: %d\n", ret);
|
||||
@@ -1356,9 +1347,6 @@ static int fsl_sai_probe(struct platform
|
||||
@@ -1354,9 +1345,6 @@ static int fsl_sai_probe(struct platform
|
||||
|
||||
sai->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
||||
ret = pinctrl_select_state(sai->pinctrl, sai->pins_state);
|
||||
if (ret) {
|
||||
dev_err(cpu_dai->dev,
|
||||
@@ -1345,7 +1348,7 @@ static int fsl_sai_probe(struct platform
|
||||
@@ -1343,7 +1346,7 @@ static int fsl_sai_probe(struct platform
|
||||
sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX;
|
||||
sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX;
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
|
||||
break;
|
||||
case SND_SOC_DAIFMT_CBM_CFS:
|
||||
val_cr4 |= FSL_SAI_CR4_FSD_MSTR;
|
||||
@@ -1574,14 +1572,6 @@ static int fsl_sai_remove(struct platfor
|
||||
@@ -1572,14 +1570,6 @@ static int fsl_sai_remove(struct platfor
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
|
||||
|
||||
--- a/sound/soc/fsl/fsl_sai.c
|
||||
+++ b/sound/soc/fsl/fsl_sai.c
|
||||
@@ -1616,6 +1616,8 @@ static int fsl_sai_runtime_resume(struct
|
||||
@@ -1614,6 +1614,8 @@ static int fsl_sai_runtime_resume(struct
|
||||
PM_QOS_CPU_DMA_LATENCY, 0);
|
||||
|
||||
regcache_cache_only(sai->regmap, false);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user