Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
e3ed04c344
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.1 = .104
|
||||
LINUX_KERNEL_HASH-6.1.104 = 5cfa326492241397e15c3601ccd3c9dfb72436674f364b470e9d1d5642759976
|
||||
LINUX_VERSION-6.1 = .106
|
||||
LINUX_KERNEL_HASH-6.1.106 = 3773c9052c7ba7432e8337ca84bee115c1a94ccef9d62b72b99ae30c4cd5f80f
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .45
|
||||
LINUX_KERNEL_HASH-6.6.45 = 121bed240767e4a0959c1609e78eeaaf3e0620d9d1a5ed1f6e36bdf609c4f179
|
||||
LINUX_VERSION-6.6 = .47
|
||||
LINUX_KERNEL_HASH-6.6.47 = d43376c9e9eaa92bb1b926054bd160d329c58a62d64bd65fe1222c11c6564f50
|
||||
|
||||
@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-08-18
|
||||
PKG_SOURCE_VERSION:=0ac3041a9ac8f79aa0b859213bc223e0c471fcfb
|
||||
PKG_MIRROR_HASH:=758df7f12a240ab32b61f81e2982417c7449f1cb3b41d41de02e7af91314b195
|
||||
PKG_SOURCE_DATE:=2024-08-21
|
||||
PKG_SOURCE_VERSION:=a5e630ef458ce7b91bf522247ef3320ed5845e2a
|
||||
PKG_MIRROR_HASH:=a16f647206d68d67f9b2b134935f27ed66b7302a4ca8243842987dcfafbe8317
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
|
||||
@ -59,10 +59,8 @@ CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_AMU_EXTN=y
|
||||
CONFIG_ARM64_BTI=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_E0PD=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1024718=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
@ -93,7 +91,6 @@ CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MTE=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
|
||||
@ -55,6 +55,7 @@ CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
# CONFIG_ARM64_ACPI_PARKING_PROTOCOL is not set
|
||||
CONFIG_ARM64_ERRATUM_3194386=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
|
||||
@ -867,7 +867,7 @@ SVN-Revision: 35130
|
||||
iph->daddr == iph2->daddr && iph->saddr == iph2->saddr)
|
||||
return segs;
|
||||
|
||||
@@ -255,7 +255,7 @@ struct sk_buff *tcp_gro_lookup(struct li
|
||||
@@ -258,7 +258,7 @@ struct sk_buff *tcp_gro_lookup(struct li
|
||||
continue;
|
||||
|
||||
th2 = tcp_hdr(p);
|
||||
@ -876,7 +876,7 @@ SVN-Revision: 35130
|
||||
NAPI_GRO_CB(p)->same_flow = 0;
|
||||
continue;
|
||||
}
|
||||
@@ -321,8 +321,8 @@ struct sk_buff *tcp_gro_receive(struct l
|
||||
@@ -324,8 +324,8 @@ struct sk_buff *tcp_gro_receive(struct l
|
||||
~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
|
||||
flush |= (__force int)(th->ack_seq ^ th2->ack_seq);
|
||||
for (i = sizeof(*th); i < thlen; i += 4)
|
||||
|
||||
@ -204,7 +204,6 @@ CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_BCM2835=y
|
||||
@ -367,7 +366,6 @@ CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_HWMON=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
|
||||
@ -262,7 +262,6 @@ CONFIG_HIGHPTE=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_BCM2835=y
|
||||
@ -462,7 +461,6 @@ CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_HWMON=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
|
||||
@ -23,8 +23,6 @@ CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
@ -34,7 +32,6 @@ CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
@ -268,7 +265,6 @@ CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_BCM2835=y
|
||||
@ -460,7 +456,6 @@ CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_HWMON=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
|
||||
@ -23,13 +23,10 @@ CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1319367=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
@ -269,7 +266,6 @@ CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HWMON=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_IPROC_RNG200=y
|
||||
@ -466,7 +462,6 @@ CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_HWMON=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
|
||||
@ -24,15 +24,13 @@ CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
CONFIG_ARM64_ERRATUM_1463225=y
|
||||
CONFIG_ARM64_ERRATUM_3194386=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
@ -583,7 +581,6 @@ CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_HWMON=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
|
||||
@ -201,7 +201,7 @@ define Device/rpi-5
|
||||
cypress-firmware-43455-sdio \
|
||||
brcmfmac-nvram-43455-sdio \
|
||||
kmod-brcmfmac wpad-basic-mbedtls \
|
||||
kmod-hwmon-pwmfan
|
||||
kmod-hwmon-pwmfan kmod-thermal
|
||||
IMAGE/sysupgrade.img.gz := boot-common | sdcard-img | gzip | append-metadata
|
||||
IMAGE/factory.img.gz := boot-common | sdcard-img | gzip
|
||||
endef
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/kernel/cgroup/cgroup.c
|
||||
+++ b/kernel/cgroup/cgroup.c
|
||||
@@ -6051,6 +6051,9 @@ int __init cgroup_init_early(void)
|
||||
@@ -6060,6 +6060,9 @@ int __init cgroup_init_early(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
/**
|
||||
* cgroup_init - cgroup initialization
|
||||
*
|
||||
@@ -6084,6 +6087,12 @@ int __init cgroup_init(void)
|
||||
@@ -6093,6 +6096,12 @@ int __init cgroup_init(void)
|
||||
|
||||
cgroup_unlock();
|
||||
|
||||
@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
for_each_subsys(ss, ssid) {
|
||||
if (ss->early_init) {
|
||||
struct cgroup_subsys_state *css =
|
||||
@@ -6724,6 +6733,10 @@ static int __init cgroup_disable(char *s
|
||||
@@ -6733,6 +6742,10 @@ static int __init cgroup_disable(char *s
|
||||
strcmp(token, ss->legacy_name))
|
||||
continue;
|
||||
|
||||
@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
static_branch_disable(cgroup_subsys_enabled_key[i]);
|
||||
pr_info("Disabling %s control group subsystem\n",
|
||||
ss->name);
|
||||
@@ -6742,6 +6755,31 @@ static int __init cgroup_disable(char *s
|
||||
@@ -6751,6 +6764,31 @@ static int __init cgroup_disable(char *s
|
||||
}
|
||||
__setup("cgroup_disable=", cgroup_disable);
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -719,7 +719,7 @@ MODULE_DEVICE_TABLE(spi, spidev_spi_ids)
|
||||
@@ -720,7 +720,7 @@ MODULE_DEVICE_TABLE(spi, spidev_spi_ids)
|
||||
*/
|
||||
static int spidev_of_check(struct device *dev)
|
||||
{
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/gpio/gpiolib.c
|
||||
+++ b/drivers/gpio/gpiolib.c
|
||||
@@ -57,6 +57,8 @@
|
||||
@@ -58,6 +58,8 @@
|
||||
#define extra_checks 0
|
||||
#endif
|
||||
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
/* Device and char device-related information */
|
||||
static DEFINE_IDA(gpio_ida);
|
||||
static dev_t gpio_devt;
|
||||
@@ -2591,8 +2593,8 @@ int gpiod_direction_output(struct gpio_d
|
||||
@@ -2592,8 +2594,8 @@ int gpiod_direction_output(struct gpio_d
|
||||
value = !!value;
|
||||
|
||||
/* GPIOs used for enabled IRQs shall not be set as output */
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
gpiod_err(desc,
|
||||
"%s: tried to set a GPIO tied to an IRQ as output\n",
|
||||
__func__);
|
||||
@@ -3470,8 +3472,8 @@ int gpiochip_lock_as_irq(struct gpio_chi
|
||||
@@ -3471,8 +3473,8 @@ int gpiochip_lock_as_irq(struct gpio_chi
|
||||
}
|
||||
|
||||
/* To be valid for IRQ the line needs to be input or open drain */
|
||||
|
||||
@ -20,6 +20,6 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
static const struct spi_device_id spidev_spi_ids[] = {
|
||||
+ { .name = "spidev" },
|
||||
{ .name = "bh2228fv" },
|
||||
{ .name = "dh2228fv" },
|
||||
{ .name = "ltc2488" },
|
||||
{ .name = "sx1301" },
|
||||
|
||||
@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/net/bluetooth/hci_sync.c
|
||||
+++ b/net/bluetooth/hci_sync.c
|
||||
@@ -4693,6 +4693,7 @@ static const struct {
|
||||
@@ -4707,6 +4707,7 @@ static const struct {
|
||||
*/
|
||||
static int hci_dev_setup_sync(struct hci_dev *hdev)
|
||||
{
|
||||
@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
int ret = 0;
|
||||
bool invalid_bdaddr;
|
||||
size_t i;
|
||||
@@ -4721,7 +4722,8 @@ static int hci_dev_setup_sync(struct hci
|
||||
@@ -4735,7 +4736,8 @@ static int hci_dev_setup_sync(struct hci
|
||||
test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
|
||||
if (!ret) {
|
||||
if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) &&
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/drivers/gpio/gpiolib.c
|
||||
+++ b/drivers/gpio/gpiolib.c
|
||||
@@ -110,6 +110,7 @@ static int gpiochip_irqchip_init_valid_m
|
||||
@@ -111,6 +111,7 @@ static int gpiochip_irqchip_init_valid_m
|
||||
static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gc);
|
||||
|
||||
static bool gpiolib_initialized;
|
||||
@ -22,7 +22,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
static inline void desc_set_label(struct gpio_desc *d, const char *label)
|
||||
{
|
||||
@@ -745,6 +746,7 @@ int gpiochip_add_data_with_key(struct gp
|
||||
@@ -746,6 +747,7 @@ int gpiochip_add_data_with_key(struct gp
|
||||
unsigned int i;
|
||||
int base = 0;
|
||||
int ret = 0;
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
/*
|
||||
* First: allocate and populate the internal stat container, and
|
||||
@@ -769,7 +771,16 @@ int gpiochip_add_data_with_key(struct gp
|
||||
@@ -770,7 +772,16 @@ int gpiochip_add_data_with_key(struct gp
|
||||
else if (gc->parent)
|
||||
device_set_node(&gdev->dev, dev_fwnode(gc->parent));
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1522,10 +1522,14 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
@@ -1524,10 +1524,14 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
rev = reg_readl(priv, REG_PHY_REVISION);
|
||||
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1536,6 +1536,12 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
@@ -1538,6 +1538,12 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
|
||||
priv->irq0, priv->irq1);
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1522,10 +1522,14 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
@@ -1524,10 +1524,14 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
rev = reg_readl(priv, REG_PHY_REVISION);
|
||||
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/net/dsa/bcm_sf2.c
|
||||
+++ b/drivers/net/dsa/bcm_sf2.c
|
||||
@@ -1536,6 +1536,12 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
@@ -1538,6 +1538,12 @@ static int bcm_sf2_sw_probe(struct platf
|
||||
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
|
||||
priv->irq0, priv->irq1);
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ inteno,xg6846)
|
||||
;;
|
||||
comtrend,ar-5381u |\
|
||||
comtrend,ar-5387un |\
|
||||
dlink,dsl-2750b-b1 |\
|
||||
innacomm,w3400v6 |\
|
||||
nucom,r5010unv2)
|
||||
ucidef_set_bridge_device switch
|
||||
|
||||
@ -6,6 +6,7 @@ case "$(board_name)" in
|
||||
arcadyan,ar7516 |\
|
||||
comtrend,ar-5381u |\
|
||||
comtrend,ar-5387un |\
|
||||
dlink,dsl-2750b-b1 |\
|
||||
nucom,r5010unv2)
|
||||
mtd fixtrx firmware
|
||||
;;
|
||||
|
||||
273
target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts
Normal file
273
target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts
Normal file
@ -0,0 +1,273 @@
|
||||
#include "bcm6328.dtsi"
|
||||
|
||||
/ {
|
||||
model = "D-Link DSL-2750B rev B1/DSL-2740B rev F1/DSL-2741B rev F1";
|
||||
compatible = "dlink,dsl-2750b-b1", "brcm,bcm6328";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_power_green;
|
||||
led-failsafe = &led_power_red;
|
||||
led-running = &led_power_green;
|
||||
led-upgrade = &led_power_green;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys-polled";
|
||||
poll-interval = <100>;
|
||||
|
||||
wifi {
|
||||
label = "wifi";
|
||||
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WLAN>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-31 {
|
||||
function = LED_FUNCTION_USB;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
|
||||
trigger-sources = <&ehci_port1>;
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-8 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&ath9k 8 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
status = "okay";
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_leds>;
|
||||
|
||||
led@2 {
|
||||
reg = <2>;
|
||||
active-low;
|
||||
label = "red:internet";
|
||||
};
|
||||
|
||||
led@3 {
|
||||
reg = <3>;
|
||||
active-low;
|
||||
label = "green:dsl";
|
||||
};
|
||||
|
||||
led_power_green: led@4 {
|
||||
reg = <4>;
|
||||
active-low;
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
led_power_red: led@8 {
|
||||
reg = <8>;
|
||||
active-low;
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@9 {
|
||||
reg = <9>;
|
||||
active-low;
|
||||
function = LED_FUNCTION_WPS;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
|
||||
led@11 {
|
||||
reg = <11>;
|
||||
active-low;
|
||||
label = "green:internet";
|
||||
};
|
||||
};
|
||||
|
||||
&ehci {
|
||||
status = "okay";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ehci_port1: port@1 {
|
||||
reg = <1>;
|
||||
#trigger-source-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
ðernet {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
&hsspi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
spi-max-frequency = <16666667>;
|
||||
spi-tx-bus-width = <2>;
|
||||
spi-rx-bus-width = <2>;
|
||||
reg = <0>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
reg = <0x000000 0x010000>;
|
||||
label = "cfe";
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_cfe_6a0: macaddr@6a0 {
|
||||
compatible = "mac-base";
|
||||
reg = <0x6a0 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@10000 {
|
||||
reg = <0x010000 0x7c0000>;
|
||||
label = "linux";
|
||||
compatible = "brcm,bcm963xx-imagetag";
|
||||
};
|
||||
|
||||
partition@7d0000 {
|
||||
reg = <0x7d0000 0x010000>;
|
||||
label = "cal_data";
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_data_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@7e0000 {
|
||||
reg = <0x7e0000 0x020000>;
|
||||
label = "nvram";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ohci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie {
|
||||
status = "okay";
|
||||
|
||||
pcie@0 {
|
||||
reg = <0 0 0 0 0>;
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
device_type = "pci";
|
||||
|
||||
ath9k: wifi@168c,002e {
|
||||
compatible = "pci168c,002e";
|
||||
reg = <0 0 0 0 0>;
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>, <&cal_data_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
pinctrl_leds: leds {
|
||||
function = "led";
|
||||
pins = "gpio2", "gpio3", "gpio4",
|
||||
"gpio8", "gpio9", "gpio11";
|
||||
};
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
label = "lan1";
|
||||
|
||||
phy-handle = <&phy1>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
label = "lan2";
|
||||
|
||||
phy-handle = <&phy2>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
|
||||
port@2 {
|
||||
reg = <2>;
|
||||
label = "lan3";
|
||||
|
||||
phy-handle = <&phy3>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
|
||||
port@3 {
|
||||
reg = <3>;
|
||||
label = "lan4";
|
||||
|
||||
phy-handle = <&phy4>;
|
||||
phy-mode = "mii";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbh {
|
||||
status = "okay";
|
||||
};
|
||||
@ -49,69 +49,69 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@0 {
|
||||
led-0 {
|
||||
label = "red:message";
|
||||
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@1 {
|
||||
led-1 {
|
||||
label = "red:hspa";
|
||||
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@2 {
|
||||
led-2 {
|
||||
label = "red:dsl";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_red: led@3 {
|
||||
led_power_red: led-3 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@6 {
|
||||
led-6 {
|
||||
label = "all";
|
||||
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
led@12 {
|
||||
led-12 {
|
||||
label = "green:lan1";
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@13 {
|
||||
led-13 {
|
||||
label = "red:lan1";
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@15 {
|
||||
led-15 {
|
||||
label = "green:lan2";
|
||||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@22 {
|
||||
led-22 {
|
||||
label = "red:lan2";
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@23 {
|
||||
led-23 {
|
||||
label = "green:lan3";
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@26 {
|
||||
led-26 {
|
||||
label = "red:lan3";
|
||||
gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@27 {
|
||||
led-27 {
|
||||
label = "green:lan4";
|
||||
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@28 {
|
||||
led-28 {
|
||||
label = "red:lan4";
|
||||
gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
@ -120,7 +120,7 @@
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
wlan {
|
||||
led-2 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
@ -41,12 +41,12 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_phone_green: led@28 {
|
||||
led_phone_green: led-28 {
|
||||
label = "green:phone";
|
||||
gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@30 {
|
||||
led-30 {
|
||||
function = LED_FUNCTION_USB;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
|
||||
|
||||
@ -42,12 +42,12 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@28 {
|
||||
led-28 {
|
||||
label = "green:dsl";
|
||||
gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_red: led@34 {
|
||||
led_power_red: led-34 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
|
||||
|
||||
@ -35,44 +35,44 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led@21 {
|
||||
led-21 {
|
||||
function = LED_FUNCTION_USB;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_green: led@22 {
|
||||
led_power_green: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led@23 {
|
||||
led-23 {
|
||||
function = LED_FUNCTION_WPS;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_red: led@24 {
|
||||
led_power_red: led-24 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@30 {
|
||||
led-30 {
|
||||
function = LED_FUNCTION_WPS;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@31 {
|
||||
led-31 {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
|
||||
|
||||
@ -28,30 +28,30 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@2 {
|
||||
led-2 {
|
||||
label = "green:dsl";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
label = "green:internet";
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_power_green: led@22 {
|
||||
led_power_green: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_power_red: led@24 {
|
||||
led_power_red: led-24 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@31 {
|
||||
led-31 {
|
||||
label = "red:internet";
|
||||
gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
@ -28,30 +28,30 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@2 {
|
||||
led-2 {
|
||||
label = "green:dsl";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
label = "green:internet";
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_power_green: led@22 {
|
||||
led_power_green: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_power_red: led@24 {
|
||||
led_power_red: led-24 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@31 {
|
||||
led-31 {
|
||||
label = "red:internet";
|
||||
gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
@ -41,66 +41,66 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@2 {
|
||||
led-2 {
|
||||
label = "green:dsl";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@4 {
|
||||
led-4 {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@11 {
|
||||
led-11 {
|
||||
function = LED_FUNCTION_WPS;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@13 {
|
||||
led-13 {
|
||||
/* Front USB port */
|
||||
label = "green:usb2";
|
||||
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@14 {
|
||||
led-14 {
|
||||
/* Back USB port */
|
||||
label = "green:usb1";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_red: led@22 {
|
||||
led_power_red: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@23 {
|
||||
led-23 {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_green: led@24 {
|
||||
led_power_green: led-24 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@26 {
|
||||
led-26 {
|
||||
label = "green:wifi2g";
|
||||
gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@27 {
|
||||
led-27 {
|
||||
label = "blue:wifi5g";
|
||||
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
@ -35,45 +35,45 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@2 {
|
||||
led-2 {
|
||||
label = "blue:dsl";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
label = "red:dsl";
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@11 {
|
||||
led-11 {
|
||||
label = "blue:hspa";
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@12 {
|
||||
led-12 {
|
||||
label = "red:hspa";
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_blue: led@22 {
|
||||
led_power_blue: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led_power_red: led@24 {
|
||||
led_power_red: led-24 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@25 {
|
||||
led-25 {
|
||||
label = "blue:voice";
|
||||
gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@26 {
|
||||
led-26 {
|
||||
label = "red:voice";
|
||||
gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
@ -42,37 +42,37 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
label = "green:internet";
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led@14 {
|
||||
led-14 {
|
||||
function = LED_FUNCTION_USB;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_green: led@22 {
|
||||
led_power_green: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led@23 {
|
||||
led-23 {
|
||||
function = LED_FUNCTION_WPS;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_red: led@24 {
|
||||
led_power_red: led-24 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@31 {
|
||||
led-31 {
|
||||
label = "red:internet";
|
||||
gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
@ -35,52 +35,52 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led@2 {
|
||||
led-2 {
|
||||
label = "green:voip2";
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@4 {
|
||||
led-4 {
|
||||
label = "red:internet";
|
||||
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@5 {
|
||||
led-5 {
|
||||
label = "green:internet";
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@14 {
|
||||
led-14 {
|
||||
label = "green:voip1";
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@15 {
|
||||
led-15 {
|
||||
function = LED_FUNCTION_USB;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_green: led@22 {
|
||||
led_power_green: led-22 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_power_red: led@23 {
|
||||
led_power_red: led-23 {
|
||||
function = LED_FUNCTION_POWER;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
|
||||
panic-indicator;
|
||||
};
|
||||
|
||||
led@24 {
|
||||
led-24 {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@27 {
|
||||
led-27 {
|
||||
function = LED_FUNCTION_WAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
|
||||
|
||||
@ -39,6 +39,27 @@ define Device/comtrend_ar-5387un
|
||||
endef
|
||||
TARGET_DEVICES += comtrend_ar-5387un
|
||||
|
||||
define Device/dlink_dsl-2750b-b1
|
||||
$(Device/bcm63xx-cfe)
|
||||
DEVICE_VENDOR := D-Link
|
||||
DEVICE_MODEL := DSL-2750B
|
||||
DEVICE_VARIANT := B1
|
||||
DEVICE_ALT0_VENDOR := D-Link
|
||||
DEVICE_ALT0_MODEL := DSL-2740B
|
||||
DEVICE_ALT0_VARIANT := F1
|
||||
DEVICE_ALT1_VENDOR := D-Link
|
||||
DEVICE_ALT1_MODEL := DSL-2741B
|
||||
DEVICE_ALT1_VARIANT := F1
|
||||
CFE_BOARD_ID := AW4339U
|
||||
CHIP_ID := 6328
|
||||
IMAGES := cfe-EU.bin cfe-AU.bin
|
||||
IMAGE/cfe-AU.bin := cfe-bin --signature2 "4.06.01.AUF1" --pad 4
|
||||
IMAGE/cfe-EU.bin := cfe-bin --signature2 "4.06.01.EUF1" --pad 4
|
||||
DEVICE_PACKAGES += $(USB2_PACKAGES) $(ATH9K_PACKAGES) \
|
||||
kmod-leds-gpio kmod-leds-bcm6328
|
||||
endef
|
||||
TARGET_DEVICES += dlink_dsl-2750b-b1
|
||||
|
||||
define Device/innacomm_w3400v6
|
||||
$(Device/bcm63xx-cfe)
|
||||
DEVICE_VENDOR := Innacomm
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -701,6 +701,7 @@ static const struct spi_device_id spidev
|
||||
@@ -702,6 +702,7 @@ static const struct spi_device_id spidev
|
||||
{ .name = "spi-petra" },
|
||||
{ .name = "spi-authenta" },
|
||||
{ .name = "em3581" },
|
||||
@ -22,7 +22,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
|
||||
@@ -729,6 +730,7 @@ static const struct of_device_id spidev_
|
||||
@@ -730,6 +731,7 @@ static const struct of_device_id spidev_
|
||||
{ .compatible = "rohm,dh2228fv", .data = &spidev_of_check },
|
||||
{ .compatible = "semtech,sx1301", .data = &spidev_of_check },
|
||||
{ .compatible = "silabs,em3581", .data = &spidev_of_check },
|
||||
|
||||
@ -22,7 +22,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
--- a/drivers/bus/mhi/host/pci_generic.c
|
||||
+++ b/drivers/bus/mhi/host/pci_generic.c
|
||||
@@ -596,6 +596,9 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -599,6 +599,9 @@ static const struct pci_device_id mhi_pc
|
||||
/* MV32-WB (Cinterion) */
|
||||
{ PCI_DEVICE(0x1269, 0x00bb),
|
||||
.driver_data = (kernel_ulong_t) &mhi_mv32_info },
|
||||
|
||||
@ -28,7 +28,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
/**
|
||||
* struct mhi_pci_dev_info - MHI PCI device specific information
|
||||
* @config: MHI controller configuration
|
||||
@@ -557,11 +561,11 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -560,11 +564,11 @@ static const struct pci_device_id mhi_pc
|
||||
.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308),
|
||||
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },
|
||||
@ -43,7 +43,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
|
||||
/* T99W175 (sdx55), Both for eSIM and Non-eSIM */
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0ab),
|
||||
@@ -585,16 +589,16 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -588,16 +592,16 @@ static const struct pci_device_id mhi_pc
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9),
|
||||
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info },
|
||||
/* MV31-W (Cinterion) */
|
||||
|
||||
@ -36,7 +36,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/mhi.h>
|
||||
@@ -901,11 +900,9 @@ static int mhi_pci_probe(struct pci_dev
|
||||
@@ -904,11 +903,9 @@ static int mhi_pci_probe(struct pci_dev
|
||||
mhi_pdev->pci_state = pci_store_saved_state(pdev);
|
||||
pci_load_saved_state(pdev, NULL);
|
||||
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
/* MHI bus does not power up the controller by default */
|
||||
err = mhi_prepare_for_power_up(mhi_cntrl);
|
||||
@@ -939,8 +936,6 @@ err_unprepare:
|
||||
@@ -942,8 +939,6 @@ err_unprepare:
|
||||
mhi_unprepare_after_power_down(mhi_cntrl);
|
||||
err_unregister:
|
||||
mhi_unregister_controller(mhi_cntrl);
|
||||
@ -58,7 +58,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -963,7 +958,6 @@ static void mhi_pci_remove(struct pci_de
|
||||
@@ -966,7 +961,6 @@ static void mhi_pci_remove(struct pci_de
|
||||
pm_runtime_get_noresume(&pdev->dev);
|
||||
|
||||
mhi_unregister_controller(mhi_cntrl);
|
||||
|
||||
@ -31,7 +31,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
|
||||
.name = "foxconn-sdx55",
|
||||
.fw = "qcom/sdx55m/sbl1.mbn",
|
||||
@@ -587,6 +596,15 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -590,6 +599,15 @@ static const struct pci_device_id mhi_pc
|
||||
/* T99W373 (sdx62) */
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9),
|
||||
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info },
|
||||
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
--- a/drivers/bus/mhi/host/pci_generic.c
|
||||
+++ b/drivers/bus/mhi/host/pci_generic.c
|
||||
@@ -591,6 +591,8 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -594,6 +594,8 @@ static const struct pci_device_id mhi_pc
|
||||
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1002), /* EM160R-GL (sdx24) */
|
||||
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
|
||||
|
||||
@ -37,7 +37,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
|
||||
MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 32, 0),
|
||||
MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 32, 0),
|
||||
@@ -591,6 +601,9 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -594,6 +604,9 @@ static const struct pci_device_id mhi_pc
|
||||
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1002), /* EM160R-GL (sdx24) */
|
||||
.driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info },
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
--- a/drivers/bus/mhi/host/pci_generic.c
|
||||
+++ b/drivers/bus/mhi/host/pci_generic.c
|
||||
@@ -638,6 +638,12 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -641,6 +641,12 @@ static const struct pci_device_id mhi_pc
|
||||
/* T99W510 (sdx24), variant 3 */
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f2),
|
||||
.driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info },
|
||||
|
||||
@ -24,7 +24,7 @@ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
|
||||
--- a/drivers/bus/mhi/host/pci_generic.c
|
||||
+++ b/drivers/bus/mhi/host/pci_generic.c
|
||||
@@ -604,6 +604,9 @@ static const struct pci_device_id mhi_pc
|
||||
@@ -607,6 +607,9 @@ static const struct pci_device_id mhi_pc
|
||||
/* RM520N-GL (sdx6x), eSIM */
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1004),
|
||||
.driver_data = (kernel_ulong_t) &mhi_quectel_rm5xx_info },
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
From 30001cf3a19a2f676a0e23c2c3a511c4a8903284 Mon Sep 17 00:00:00 2001
|
||||
From: Daniele Palmas <dnlplm@gmail.com>
|
||||
Date: Fri, 4 Aug 2023 11:40:39 +0200
|
||||
Subject: [PATCH 11/13] bus: mhi: host: pci_generic: add support for Telit
|
||||
FE990 modem
|
||||
|
||||
Add support for Telit FE990 that has the same configuration as FN990:
|
||||
|
||||
$ lspci -vv
|
||||
04:00.0 Unassigned class [ff00]: Qualcomm Device 0308
|
||||
Subsystem: Device 1c5d:2015
|
||||
|
||||
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
|
||||
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20230804094039.365102-1-dnlplm@gmail.com
|
||||
[mani: minor update to commit subject and adjusted comment]
|
||||
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
---
|
||||
drivers/bus/mhi/host/pci_generic.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- a/drivers/bus/mhi/host/pci_generic.c
|
||||
+++ b/drivers/bus/mhi/host/pci_generic.c
|
||||
@@ -595,6 +595,9 @@ static const struct pci_device_id mhi_pc
|
||||
/* Telit FN990 */
|
||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2010),
|
||||
.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
|
||||
+ /* Telit FE990 */
|
||||
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2015),
|
||||
+ .driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308),
|
||||
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1001), /* EM120R-GL (sdx24) */
|
||||
@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
}
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -357,6 +357,14 @@ struct sk_buff *__udp_gso_segment(struct
|
||||
@@ -361,6 +361,14 @@ struct sk_buff *__udp_gso_segment(struct
|
||||
else
|
||||
uh->check = gso_make_checksum(seg, ~check) ? : CSUM_MANGLED_0;
|
||||
|
||||
|
||||
@ -71,8 +71,8 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -278,6 +278,12 @@ struct sk_buff *__udp_gso_segment(struct
|
||||
if (gso_skb->len <= sizeof(*uh) + mss)
|
||||
@@ -282,6 +282,12 @@ struct sk_buff *__udp_gso_segment(struct
|
||||
skb_transport_header(gso_skb)))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
+ /* We don't know if egress device can segment and checksum the packet
|
||||
|
||||
@ -349,7 +349,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
|
||||
# CONFIG_ARM64_LSE_ATOMICS is not set
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
# CONFIG_ARM64_MTE is not set
|
||||
# CONFIG_ARM64_PAN is not set
|
||||
CONFIG_ARM64_PAN=y
|
||||
# CONFIG_ARM64_PMEM is not set
|
||||
# CONFIG_ARM64_PSEUDO_NMI is not set
|
||||
# CONFIG_ARM64_PTDUMP_DEBUGFS is not set
|
||||
|
||||
@ -368,6 +368,8 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
|
||||
# CONFIG_ARM64_ERRATUM_2441009 is not set
|
||||
# CONFIG_ARM64_ERRATUM_2658417 is not set
|
||||
# CONFIG_ARM64_ERRATUM_2966298 is not set
|
||||
# CONFIG_ARM64_ERRATUM_3194386 is not set
|
||||
# CONFIG_ARM64_ERRATUM_3312417 is not set
|
||||
# CONFIG_ARM64_ERRATUM_819472 is not set
|
||||
# CONFIG_ARM64_ERRATUM_824069 is not set
|
||||
# CONFIG_ARM64_ERRATUM_826319 is not set
|
||||
@ -381,7 +383,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
|
||||
# CONFIG_ARM64_LSE_ATOMICS is not set
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
# CONFIG_ARM64_MTE is not set
|
||||
# CONFIG_ARM64_PAN is not set
|
||||
CONFIG_ARM64_PAN=y
|
||||
# CONFIG_ARM64_PMEM is not set
|
||||
# CONFIG_ARM64_PSEUDO_NMI is not set
|
||||
# CONFIG_ARM64_PTDUMP_DEBUGFS is not set
|
||||
|
||||
@ -324,7 +324,9 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
|
||||
# CONFIG_ARM64_64K_PAGES is not set
|
||||
# CONFIG_ARM64_AMU_EXTN is not set
|
||||
# CONFIG_ARM64_BTI is not set
|
||||
CONFIG_ARM64_CNP=y
|
||||
# CONFIG_ARM64_E0PD is not set
|
||||
CONFIG_ARM64_EPAN=y
|
||||
# CONFIG_ARM64_ERRATUM_1024718 is not set
|
||||
# CONFIG_ARM64_ERRATUM_1165522 is not set
|
||||
# CONFIG_ARM64_ERRATUM_1286807 is not set
|
||||
@ -345,6 +347,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
|
||||
# CONFIG_ARM64_ERRATUM_2658417 is not set
|
||||
# CONFIG_ARM64_ERRATUM_2966298 is not set
|
||||
# CONFIG_ARM64_ERRATUM_3117295 is not set
|
||||
# CONFIG_ARM64_ERRATUM_3194386 is not set
|
||||
# CONFIG_ARM64_ERRATUM_819472 is not set
|
||||
# CONFIG_ARM64_ERRATUM_824069 is not set
|
||||
# CONFIG_ARM64_ERRATUM_826319 is not set
|
||||
@ -357,7 +360,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
|
||||
# CONFIG_ARM64_HW_AFDBM is not set
|
||||
# CONFIG_ARM64_LSE_ATOMICS is not set
|
||||
# CONFIG_ARM64_MTE is not set
|
||||
# CONFIG_ARM64_PAN is not set
|
||||
CONFIG_ARM64_PAN=y
|
||||
# CONFIG_ARM64_PMEM is not set
|
||||
# CONFIG_ARM64_PSEUDO_NMI is not set
|
||||
# CONFIG_ARM64_PTR_AUTH is not set
|
||||
@ -3132,7 +3135,7 @@ CONFIG_LINEAR_RANGES=y
|
||||
# CONFIG_LIQUIDIO is not set
|
||||
# CONFIG_LIQUIDIO_VF is not set
|
||||
# CONFIG_LIRC is not set
|
||||
# CONFIG_LIST_HARDENED is not set
|
||||
CONFIG_LIST_HARDENED=y
|
||||
# CONFIG_LITEX_LITEETH is not set
|
||||
# CONFIG_LITEX_SOC_CONTROLLER is not set
|
||||
# CONFIG_LIVEPATCH is not set
|
||||
@ -5506,7 +5509,6 @@ CONFIG_SELECT_MEMORY_MODEL=y
|
||||
# CONFIG_SENSORS_PWM_FAN is not set
|
||||
# CONFIG_SENSORS_PXE1610 is not set
|
||||
# CONFIG_SENSORS_Q54SJ108A2 is not set
|
||||
# CONFIG_SENSORS_RASPBERRYPI_HWMON is not set
|
||||
# CONFIG_SENSORS_RM3100_I2C is not set
|
||||
# CONFIG_SENSORS_RM3100_SPI is not set
|
||||
# CONFIG_SENSORS_SBRMI is not set
|
||||
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
|
||||
|
||||
--- a/drivers/net/usb/qmi_wwan.c
|
||||
+++ b/drivers/net/usb/qmi_wwan.c
|
||||
@@ -1082,12 +1082,18 @@ static const struct usb_device_id produc
|
||||
@@ -1083,12 +1083,18 @@ static const struct usb_device_id produc
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
|
||||
.driver_info = (unsigned long)&qmi_wwan_info,
|
||||
},
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/base/core.c
|
||||
+++ b/drivers/base/core.c
|
||||
@@ -1717,7 +1717,7 @@ static void device_links_purge(struct de
|
||||
@@ -1718,7 +1718,7 @@ static void device_links_purge(struct de
|
||||
#define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \
|
||||
DL_FLAG_PM_RUNTIME)
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
|
||||
|
||||
--- a/drivers/net/usb/qmi_wwan.c
|
||||
+++ b/drivers/net/usb/qmi_wwan.c
|
||||
@@ -1083,12 +1083,18 @@ static const struct usb_device_id produc
|
||||
@@ -1084,12 +1084,18 @@ static const struct usb_device_id produc
|
||||
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
|
||||
.driver_info = (unsigned long)&qmi_wwan_info,
|
||||
},
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
|
||||
--- a/drivers/base/core.c
|
||||
+++ b/drivers/base/core.c
|
||||
@@ -1657,7 +1657,7 @@ static void device_links_purge(struct de
|
||||
@@ -1658,7 +1658,7 @@ static void device_links_purge(struct de
|
||||
#define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \
|
||||
DL_FLAG_PM_RUNTIME)
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/netfilter/nf_tables_api.c
|
||||
+++ b/net/netfilter/nf_tables_api.c
|
||||
@@ -7958,7 +7958,7 @@ static int nft_register_flowtable_net_ho
|
||||
@@ -7969,7 +7969,7 @@ static int nft_register_flowtable_net_ho
|
||||
err = flowtable->data.type->setup(&flowtable->data,
|
||||
hook->ops.dev,
|
||||
FLOW_BLOCK_BIND);
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From 32412565c27d63e15f25e76d86ee04c29b201b96 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 19 Aug 2024 15:20:42 +0200
|
||||
Subject: [PATCH] udp: fix receiving fraglist GSO packets
|
||||
|
||||
When assembling fraglist GSO packets, udp4_gro_complete does not set
|
||||
skb->csum_start, which makes the extra validation in __udp_gso_segment fail.
|
||||
|
||||
Fixes: 89add40066f9 ("net: drop bad gso csum_start and offset in virtio_net_hdr")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
net/ipv4/udp_offload.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -279,7 +279,8 @@ struct sk_buff *__udp_gso_segment(struct
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (unlikely(skb_checksum_start(gso_skb) !=
|
||||
- skb_transport_header(gso_skb)))
|
||||
+ skb_transport_header(gso_skb) &&
|
||||
+ !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST)))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
/* We don't know if egress device can segment and checksum the packet
|
||||
@ -162,7 +162,7 @@ Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
@@ -178,61 +245,76 @@ out:
|
||||
@@ -181,61 +248,76 @@ out:
|
||||
return segs;
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
flush = NAPI_GRO_CB(p)->flush;
|
||||
flush |= (__force int)(flags & TCP_FLAG_CWR);
|
||||
flush |= (__force int)((flags ^ tcp_flag_word(th2)) &
|
||||
@@ -269,6 +351,19 @@ found:
|
||||
@@ -272,6 +354,19 @@ found:
|
||||
flush |= p->decrypted ^ skb->decrypted;
|
||||
#endif
|
||||
|
||||
@ -289,7 +289,7 @@ Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (flush || skb_gro_receive(p, skb)) {
|
||||
mss = 1;
|
||||
goto out_check_final;
|
||||
@@ -290,7 +385,6 @@ out_check_final:
|
||||
@@ -293,7 +388,6 @@ out_check_final:
|
||||
if (p && (!NAPI_GRO_CB(skb)->same_flow || flush))
|
||||
pp = p;
|
||||
|
||||
@ -297,7 +297,7 @@ Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
NAPI_GRO_CB(skb)->flush |= (flush != 0);
|
||||
|
||||
return pp;
|
||||
@@ -314,18 +408,58 @@ void tcp_gro_complete(struct sk_buff *sk
|
||||
@@ -317,18 +411,58 @@ void tcp_gro_complete(struct sk_buff *sk
|
||||
}
|
||||
EXPORT_SYMBOL(tcp_gro_complete);
|
||||
|
||||
@ -361,7 +361,7 @@ Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
INDIRECT_CALLABLE_SCOPE int tcp4_gro_complete(struct sk_buff *skb, int thoff)
|
||||
@@ -333,6 +467,15 @@ INDIRECT_CALLABLE_SCOPE int tcp4_gro_com
|
||||
@@ -336,6 +470,15 @@ INDIRECT_CALLABLE_SCOPE int tcp4_gro_com
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *th = tcp_hdr(skb);
|
||||
|
||||
@ -379,7 +379,7 @@ Signe-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
|
||||
--- a/net/ipv4/udp_offload.c
|
||||
+++ b/net/ipv4/udp_offload.c
|
||||
@@ -447,33 +447,6 @@ out:
|
||||
@@ -452,33 +452,6 @@ out:
|
||||
return segs;
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/netfilter/nf_tables_api.c
|
||||
+++ b/net/netfilter/nf_tables_api.c
|
||||
@@ -8267,7 +8267,7 @@ static int nft_register_flowtable_net_ho
|
||||
@@ -8279,7 +8279,7 @@ static int nft_register_flowtable_net_ho
|
||||
err = flowtable->data.type->setup(&flowtable->data,
|
||||
hook->ops.dev,
|
||||
FLOW_BLOCK_BIND);
|
||||
|
||||
@ -22,8 +22,6 @@ CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
CONFIG_ARM64_ERRATUM_2051678=y
|
||||
@ -40,7 +38,6 @@ CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
|
||||
@ -23,8 +23,6 @@ CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
CONFIG_ARM64_ERRATUM_2051678=y
|
||||
@ -41,7 +39,6 @@ CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
|
||||
@ -1490,6 +1490,23 @@
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <15>;
|
||||
phy-mode = "internal";
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
i2p5gbe_led0: i2p5gbe-led0@0 {
|
||||
reg = <0>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2p5gbe_led1: i2p5gbe-led1@1 {
|
||||
reg = <1>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,321 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/nvmem-consumer.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
#define MT7988_2P5GE_PMB "mediatek/mt7988/i2p5ge-phy-pmb.bin"
|
||||
|
||||
#define MD32_EN BIT(0)
|
||||
#define PMEM_PRIORITY BIT(8)
|
||||
#define DMEM_PRIORITY BIT(16)
|
||||
|
||||
#define BASE100T_STATUS_EXTEND 0x10
|
||||
#define BASE1000T_STATUS_EXTEND 0x11
|
||||
#define EXTEND_CTRL_AND_STATUS 0x16
|
||||
|
||||
#define PHY_AUX_CTRL_STATUS 0x1d
|
||||
#define PHY_AUX_DPX_MASK GENMASK(5, 5)
|
||||
#define PHY_AUX_SPEED_MASK GENMASK(4, 2)
|
||||
|
||||
/* Registers on MDIO_MMD_VEND1 */
|
||||
#define MTK_PHY_LINK_STATUS_MISC 0xa2
|
||||
#define MTK_PHY_FDX_ENABLE BIT(5)
|
||||
|
||||
#define MTK_PHY_LPI_PCS_DSP_CTRL 0x121
|
||||
#define MTK_PHY_LPI_SIG_EN_LO_THRESH100_MASK GENMASK(12, 8)
|
||||
|
||||
/* Registers on MDIO_MMD_VEND2 */
|
||||
#define MTK_PHY_LED0_ON_CTRL 0x24
|
||||
#define MTK_PHY_LED0_ON_LINK1000 BIT(0)
|
||||
#define MTK_PHY_LED0_ON_LINK100 BIT(1)
|
||||
#define MTK_PHY_LED0_ON_LINK10 BIT(2)
|
||||
#define MTK_PHY_LED0_ON_LINK2500 BIT(7)
|
||||
#define MTK_PHY_LED0_POLARITY BIT(14)
|
||||
|
||||
#define MTK_PHY_LED1_ON_CTRL 0x26
|
||||
#define MTK_PHY_LED1_ON_FDX BIT(4)
|
||||
#define MTK_PHY_LED1_ON_HDX BIT(5)
|
||||
#define MTK_PHY_LED1_POLARITY BIT(14)
|
||||
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
|
||||
struct mtk_i2p5ge_phy_priv {
|
||||
bool fw_loaded;
|
||||
};
|
||||
|
||||
enum {
|
||||
PHY_AUX_SPD_10 = 0,
|
||||
PHY_AUX_SPD_100,
|
||||
PHY_AUX_SPD_1000,
|
||||
PHY_AUX_SPD_2500,
|
||||
};
|
||||
|
||||
static int mtk_2p5ge_phy_read_page(struct phy_device *phydev)
|
||||
{
|
||||
return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
|
||||
}
|
||||
|
||||
static int mtk_2p5ge_phy_write_page(struct phy_device *phydev, int page)
|
||||
{
|
||||
return __phy_write(phydev, MTK_EXT_PAGE_ACCESS, page);
|
||||
}
|
||||
|
||||
static int mt7988_2p5ge_phy_probe(struct phy_device *phydev)
|
||||
{
|
||||
struct mtk_i2p5ge_phy_priv *phy_priv;
|
||||
|
||||
phy_priv = devm_kzalloc(&phydev->mdio.dev,
|
||||
sizeof(struct mtk_i2p5ge_phy_priv), GFP_KERNEL);
|
||||
if (!phy_priv)
|
||||
return -ENOMEM;
|
||||
|
||||
phydev->priv = phy_priv;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt7988_2p5ge_phy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
int ret, i;
|
||||
const struct firmware *fw;
|
||||
struct device *dev = &phydev->mdio.dev;
|
||||
struct device_node *np;
|
||||
void __iomem *pmb_addr;
|
||||
void __iomem *md32_en_cfg_base;
|
||||
struct mtk_i2p5ge_phy_priv *phy_priv = phydev->priv;
|
||||
u16 reg;
|
||||
struct pinctrl *pinctrl;
|
||||
|
||||
if (!phy_priv->fw_loaded) {
|
||||
np = of_find_compatible_node(NULL, NULL, "mediatek,2p5gphy-fw");
|
||||
if (!np)
|
||||
return -ENOENT;
|
||||
pmb_addr = of_iomap(np, 0);
|
||||
if (!pmb_addr)
|
||||
return -ENOMEM;
|
||||
md32_en_cfg_base = of_iomap(np, 1);
|
||||
if (!md32_en_cfg_base)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = request_firmware(&fw, MT7988_2P5GE_PMB, dev);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to load firmware: %s, ret: %d\n",
|
||||
MT7988_2P5GE_PMB, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
reg = readw(md32_en_cfg_base);
|
||||
if (reg & MD32_EN) {
|
||||
phy_set_bits(phydev, 0, BIT(15));
|
||||
usleep_range(10000, 11000);
|
||||
}
|
||||
phy_set_bits(phydev, 0, BIT(11));
|
||||
|
||||
/* Write magic number to safely stall MCU */
|
||||
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x800e, 0x1100);
|
||||
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x800f, 0x00df);
|
||||
|
||||
for (i = 0; i < fw->size - 1; i += 4)
|
||||
writel(*((uint32_t *)(fw->data + i)), pmb_addr + i);
|
||||
release_firmware(fw);
|
||||
|
||||
writew(reg & ~MD32_EN, md32_en_cfg_base);
|
||||
writew(reg | MD32_EN, md32_en_cfg_base);
|
||||
phy_set_bits(phydev, 0, BIT(15));
|
||||
dev_info(dev, "Firmware loading/trigger ok.\n");
|
||||
|
||||
phy_priv->fw_loaded = true;
|
||||
}
|
||||
|
||||
/* Setup LED */
|
||||
|
||||
/* Set polarity of led0 to active-high for BPI-R4 */
|
||||
phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED0_ON_CTRL,
|
||||
MTK_PHY_LED0_POLARITY);
|
||||
|
||||
phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED0_ON_CTRL,
|
||||
MTK_PHY_LED0_ON_LINK10 |
|
||||
MTK_PHY_LED0_ON_LINK100 |
|
||||
MTK_PHY_LED0_ON_LINK1000 |
|
||||
MTK_PHY_LED0_ON_LINK2500);
|
||||
phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED1_ON_CTRL,
|
||||
MTK_PHY_LED1_ON_FDX | MTK_PHY_LED1_ON_HDX);
|
||||
|
||||
pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "i2p5gbe-led");
|
||||
if (IS_ERR(pinctrl)) {
|
||||
dev_err(&phydev->mdio.dev, "Fail to set LED pins!\n");
|
||||
return PTR_ERR(pinctrl);
|
||||
}
|
||||
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_LPI_PCS_DSP_CTRL,
|
||||
MTK_PHY_LPI_SIG_EN_LO_THRESH100_MASK, 0);
|
||||
|
||||
/* Enable 16-bit next page exchange bit if 1000-BT isn't advertizing */
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
__phy_write(phydev, 0x11, 0xfbfa);
|
||||
__phy_write(phydev, 0x12, 0xc3);
|
||||
__phy_write(phydev, 0x10, 0x87f8);
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt7988_2p5ge_phy_config_aneg(struct phy_device *phydev)
|
||||
{
|
||||
bool changed = false;
|
||||
u32 adv;
|
||||
int ret;
|
||||
|
||||
if (phydev->autoneg == AUTONEG_DISABLE) {
|
||||
/* Configure half duplex with genphy_setup_forced,
|
||||
* because genphy_c45_pma_setup_forced does not support.
|
||||
*/
|
||||
return phydev->duplex != DUPLEX_FULL
|
||||
? genphy_setup_forced(phydev)
|
||||
: genphy_c45_pma_setup_forced(phydev);
|
||||
}
|
||||
|
||||
ret = genphy_c45_an_config_aneg(phydev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
changed = true;
|
||||
|
||||
adv = linkmode_adv_to_mii_ctrl1000_t(phydev->advertising);
|
||||
ret = phy_modify_changed(phydev, MII_CTRL1000,
|
||||
ADVERTISE_1000FULL | ADVERTISE_1000HALF,
|
||||
adv);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
changed = true;
|
||||
|
||||
return genphy_c45_check_and_restart_aneg(phydev, changed);
|
||||
}
|
||||
|
||||
static int mt7988_2p5ge_phy_get_features(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = genphy_read_abilities(phydev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* We don't support HDX at MAC layer on mt7988.
|
||||
* So mask phy's HDX capabilities, too.
|
||||
*/
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT,
|
||||
phydev->supported);
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
|
||||
phydev->supported);
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
|
||||
phydev->supported);
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
|
||||
phydev->supported);
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt7988_2p5ge_phy_read_status(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = genphy_update_link(phydev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
phydev->speed = SPEED_UNKNOWN;
|
||||
phydev->duplex = DUPLEX_UNKNOWN;
|
||||
phydev->pause = 0;
|
||||
phydev->asym_pause = 0;
|
||||
|
||||
if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
|
||||
ret = genphy_c45_read_lpa(phydev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Read the link partner's 1G advertisement */
|
||||
ret = phy_read(phydev, MII_STAT1000);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, ret);
|
||||
} else if (phydev->autoneg == AUTONEG_DISABLE) {
|
||||
linkmode_zero(phydev->lp_advertising);
|
||||
}
|
||||
|
||||
ret = phy_read(phydev, PHY_AUX_CTRL_STATUS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
switch (FIELD_GET(PHY_AUX_SPEED_MASK, ret)) {
|
||||
case PHY_AUX_SPD_10:
|
||||
phydev->speed = SPEED_10;
|
||||
break;
|
||||
case PHY_AUX_SPD_100:
|
||||
phydev->speed = SPEED_100;
|
||||
break;
|
||||
case PHY_AUX_SPD_1000:
|
||||
phydev->speed = SPEED_1000;
|
||||
break;
|
||||
case PHY_AUX_SPD_2500:
|
||||
phydev->speed = SPEED_2500;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_LINK_STATUS_MISC);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
phydev->duplex = (ret & MTK_PHY_FDX_ENABLE) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
/* FIXME: The current firmware always enables rate adaptation mode. */
|
||||
phydev->rate_matching = RATE_MATCH_PAUSE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt7988_2p5ge_phy_get_rate_matching(struct phy_device *phydev,
|
||||
phy_interface_t iface)
|
||||
{
|
||||
return RATE_MATCH_PAUSE;
|
||||
}
|
||||
|
||||
static struct phy_driver mtk_gephy_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_MODEL(0x00339c11),
|
||||
.name = "MediaTek MT798x 2.5GbE PHY",
|
||||
.probe = mt7988_2p5ge_phy_probe,
|
||||
.config_init = mt7988_2p5ge_phy_config_init,
|
||||
.config_aneg = mt7988_2p5ge_phy_config_aneg,
|
||||
.get_features = mt7988_2p5ge_phy_get_features,
|
||||
.read_status = mt7988_2p5ge_phy_read_status,
|
||||
.get_rate_matching = mt7988_2p5ge_phy_get_rate_matching,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
.read_page = mtk_2p5ge_phy_read_page,
|
||||
.write_page = mtk_2p5ge_phy_write_page,
|
||||
},
|
||||
};
|
||||
|
||||
module_phy_driver(mtk_gephy_driver);
|
||||
|
||||
static struct mdio_device_id __maybe_unused mtk_2p5ge_phy_tbl[] = {
|
||||
{ PHY_ID_MATCH_VENDOR(0x00339c00) },
|
||||
{ }
|
||||
};
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek 2.5Gb Ethernet PHY driver");
|
||||
MODULE_AUTHOR("SkyLake Huang <SkyLake.Huang@mediatek.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
MODULE_DEVICE_TABLE(mdio, mtk_2p5ge_phy_tbl);
|
||||
MODULE_FIRMWARE(MT7988_2P5GE_PMB);
|
||||
@ -240,7 +240,7 @@ CONFIG_MAXLINEAR_GPHY=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEDIATEK_2P5G_PHY=y
|
||||
CONFIG_MEDIATEK_2P5GE_PHY=y
|
||||
CONFIG_MEDIATEK_GE_PHY=y
|
||||
CONFIG_MEDIATEK_GE_SOC_PHY=y
|
||||
CONFIG_MEDIATEK_WATCHDOG=y
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,62 @@
|
||||
From 12054d38fc55adbfa2b40299ad8af3449d882ee2 Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:06 +0800
|
||||
Subject: [PATCH 02/13] net: phy: mediatek: Fix spelling errors and rearrange
|
||||
variables
|
||||
|
||||
This patch fixes spelling errors which comes from mediatek-ge-soc.c and
|
||||
rearrange variables with reverse Xmas tree order.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 19 ++++++++++---------
|
||||
1 file changed, 10 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -408,16 +408,17 @@ static int tx_offset_cal_efuse(struct ph
|
||||
|
||||
static int tx_amp_fill_result(struct phy_device *phydev, u16 *buf)
|
||||
{
|
||||
- int i;
|
||||
- int bias[16] = {};
|
||||
- const int vals_9461[16] = { 7, 1, 4, 7,
|
||||
- 7, 1, 4, 7,
|
||||
- 7, 1, 4, 7,
|
||||
- 7, 1, 4, 7 };
|
||||
const int vals_9481[16] = { 10, 6, 6, 10,
|
||||
10, 6, 6, 10,
|
||||
10, 6, 6, 10,
|
||||
10, 6, 6, 10 };
|
||||
+ const int vals_9461[16] = { 7, 1, 4, 7,
|
||||
+ 7, 1, 4, 7,
|
||||
+ 7, 1, 4, 7,
|
||||
+ 7, 1, 4, 7 };
|
||||
+ int bias[16] = {};
|
||||
+ int i;
|
||||
+
|
||||
switch (phydev->drv->phy_id) {
|
||||
case MTK_GPHY_ID_MT7981:
|
||||
/* We add some calibration to efuse values
|
||||
@@ -1069,10 +1070,10 @@ static int start_cal(struct phy_device *
|
||||
|
||||
static int mt798x_phy_calibration(struct phy_device *phydev)
|
||||
{
|
||||
+ struct nvmem_cell *cell;
|
||||
int ret = 0;
|
||||
- u32 *buf;
|
||||
size_t len;
|
||||
- struct nvmem_cell *cell;
|
||||
+ u32 *buf;
|
||||
|
||||
cell = nvmem_cell_get(&phydev->mdio.dev, "phy-cal-data");
|
||||
if (IS_ERR(cell)) {
|
||||
@@ -1415,7 +1416,7 @@ static int mt7988_phy_probe_shared(struc
|
||||
* LED_C and LED_D respectively. At the same time those pins are used to
|
||||
* bootstrap configuration of the reference clock source (LED_A),
|
||||
* DRAM DDRx16b x2/x1 (LED_B) and boot device (LED_C, LED_D).
|
||||
- * In practise this is done using a LED and a resistor pulling the pin
|
||||
+ * In practice this is done using a LED and a resistor pulling the pin
|
||||
* either to GND or to VIO.
|
||||
* The detected value at boot time is accessible at run-time using the
|
||||
* TPBANK0 register located in the gpio base of the pinctrl, in order
|
||||
@ -0,0 +1,742 @@
|
||||
From 434e41555c45ec10b19320024163bb009da168bc Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:07 +0800
|
||||
Subject: [PATCH 03/13] net: phy: mediatek: Move LED helper functions into mtk
|
||||
phy lib
|
||||
|
||||
This patch creates mtk-phy-lib.c & mtk-phy.h and integrates mtk-ge-soc.c's
|
||||
LED helper functions so that we can use those helper functions in other
|
||||
MTK's ethernet phy driver.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/Kconfig | 5 +
|
||||
drivers/net/phy/mediatek/Makefile | 1 +
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 262 +++----------------------
|
||||
drivers/net/phy/mediatek/mtk-phy-lib.c | 251 +++++++++++++++++++++++
|
||||
drivers/net/phy/mediatek/mtk.h | 82 ++++++++
|
||||
6 files changed, 368 insertions(+), 235 deletions(-)
|
||||
create mode 100644 drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
create mode 100644 drivers/net/phy/mediatek/mtk.h
|
||||
|
||||
--- a/drivers/net/phy/mediatek/Kconfig
|
||||
+++ b/drivers/net/phy/mediatek/Kconfig
|
||||
@@ -1,6 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
+config MTK_NET_PHYLIB
|
||||
+ tristate
|
||||
+
|
||||
config MEDIATEK_GE_PHY
|
||||
tristate "MediaTek Gigabit Ethernet PHYs"
|
||||
+ select MTK_NET_PHYLIB
|
||||
help
|
||||
Supports the MediaTek non-built-in Gigabit Ethernet PHYs.
|
||||
|
||||
@@ -13,6 +17,7 @@ config MEDIATEK_GE_SOC_PHY
|
||||
tristate "MediaTek SoC Ethernet PHYs"
|
||||
depends on (ARM64 && ARCH_MEDIATEK) || COMPILE_TEST
|
||||
select NVMEM_MTK_EFUSE
|
||||
+ select MTK_NET_PHYLIB
|
||||
help
|
||||
Supports MediaTek SoC built-in Gigabit Ethernet PHYs.
|
||||
|
||||
--- a/drivers/net/phy/mediatek/Makefile
|
||||
+++ b/drivers/net/phy/mediatek/Makefile
|
||||
@@ -1,3 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
+obj-$(CONFIG_MTK_NET_PHYLIB) += mtk-phy-lib.o
|
||||
obj-$(CONFIG_MEDIATEK_GE_PHY) += mtk-ge.o
|
||||
obj-$(CONFIG_MEDIATEK_GE_SOC_PHY) += mtk-ge-soc.o
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <linux/phy.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
+#include "mtk.h"
|
||||
+
|
||||
#define MTK_GPHY_ID_MT7981 0x03a29461
|
||||
#define MTK_GPHY_ID_MT7988 0x03a29481
|
||||
|
||||
@@ -210,41 +212,6 @@
|
||||
#define MTK_PHY_DA_TX_R50_PAIR_D 0x540
|
||||
|
||||
/* Registers on MDIO_MMD_VEND2 */
|
||||
-#define MTK_PHY_LED0_ON_CTRL 0x24
|
||||
-#define MTK_PHY_LED1_ON_CTRL 0x26
|
||||
-#define MTK_PHY_LED_ON_MASK GENMASK(6, 0)
|
||||
-#define MTK_PHY_LED_ON_LINK1000 BIT(0)
|
||||
-#define MTK_PHY_LED_ON_LINK100 BIT(1)
|
||||
-#define MTK_PHY_LED_ON_LINK10 BIT(2)
|
||||
-#define MTK_PHY_LED_ON_LINK (MTK_PHY_LED_ON_LINK10 |\
|
||||
- MTK_PHY_LED_ON_LINK100 |\
|
||||
- MTK_PHY_LED_ON_LINK1000)
|
||||
-#define MTK_PHY_LED_ON_LINKDOWN BIT(3)
|
||||
-#define MTK_PHY_LED_ON_FDX BIT(4) /* Full duplex */
|
||||
-#define MTK_PHY_LED_ON_HDX BIT(5) /* Half duplex */
|
||||
-#define MTK_PHY_LED_ON_FORCE_ON BIT(6)
|
||||
-#define MTK_PHY_LED_ON_POLARITY BIT(14)
|
||||
-#define MTK_PHY_LED_ON_ENABLE BIT(15)
|
||||
-
|
||||
-#define MTK_PHY_LED0_BLINK_CTRL 0x25
|
||||
-#define MTK_PHY_LED1_BLINK_CTRL 0x27
|
||||
-#define MTK_PHY_LED_BLINK_1000TX BIT(0)
|
||||
-#define MTK_PHY_LED_BLINK_1000RX BIT(1)
|
||||
-#define MTK_PHY_LED_BLINK_100TX BIT(2)
|
||||
-#define MTK_PHY_LED_BLINK_100RX BIT(3)
|
||||
-#define MTK_PHY_LED_BLINK_10TX BIT(4)
|
||||
-#define MTK_PHY_LED_BLINK_10RX BIT(5)
|
||||
-#define MTK_PHY_LED_BLINK_RX (MTK_PHY_LED_BLINK_10RX |\
|
||||
- MTK_PHY_LED_BLINK_100RX |\
|
||||
- MTK_PHY_LED_BLINK_1000RX)
|
||||
-#define MTK_PHY_LED_BLINK_TX (MTK_PHY_LED_BLINK_10TX |\
|
||||
- MTK_PHY_LED_BLINK_100TX |\
|
||||
- MTK_PHY_LED_BLINK_1000TX)
|
||||
-#define MTK_PHY_LED_BLINK_COLLISION BIT(6)
|
||||
-#define MTK_PHY_LED_BLINK_RX_CRC_ERR BIT(7)
|
||||
-#define MTK_PHY_LED_BLINK_RX_IDLE_ERR BIT(8)
|
||||
-#define MTK_PHY_LED_BLINK_FORCE_BLINK BIT(9)
|
||||
-
|
||||
#define MTK_PHY_LED1_DEFAULT_POLARITIES BIT(1)
|
||||
|
||||
#define MTK_PHY_RG_BG_RASEL 0x115
|
||||
@@ -299,10 +266,6 @@ enum CAL_MODE {
|
||||
SW_M
|
||||
};
|
||||
|
||||
-#define MTK_PHY_LED_STATE_FORCE_ON 0
|
||||
-#define MTK_PHY_LED_STATE_FORCE_BLINK 1
|
||||
-#define MTK_PHY_LED_STATE_NETDEV 2
|
||||
-
|
||||
struct mtk_socphy_priv {
|
||||
unsigned long led_state;
|
||||
};
|
||||
@@ -1131,84 +1094,39 @@ static int mt798x_phy_config_init(struct
|
||||
return mt798x_phy_calibration(phydev);
|
||||
}
|
||||
|
||||
-static int mt798x_phy_hw_led_on_set(struct phy_device *phydev, u8 index,
|
||||
- bool on)
|
||||
-{
|
||||
- unsigned int bit_on = MTK_PHY_LED_STATE_FORCE_ON + (index ? 16 : 0);
|
||||
- struct mtk_socphy_priv *priv = phydev->priv;
|
||||
- bool changed;
|
||||
-
|
||||
- if (on)
|
||||
- changed = !test_and_set_bit(bit_on, &priv->led_state);
|
||||
- else
|
||||
- changed = !!test_and_clear_bit(bit_on, &priv->led_state);
|
||||
-
|
||||
- changed |= !!test_and_clear_bit(MTK_PHY_LED_STATE_NETDEV +
|
||||
- (index ? 16 : 0), &priv->led_state);
|
||||
- if (changed)
|
||||
- return phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
- MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL,
|
||||
- MTK_PHY_LED_ON_MASK,
|
||||
- on ? MTK_PHY_LED_ON_FORCE_ON : 0);
|
||||
- else
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int mt798x_phy_hw_led_blink_set(struct phy_device *phydev, u8 index,
|
||||
- bool blinking)
|
||||
-{
|
||||
- unsigned int bit_blink = MTK_PHY_LED_STATE_FORCE_BLINK + (index ? 16 : 0);
|
||||
- struct mtk_socphy_priv *priv = phydev->priv;
|
||||
- bool changed;
|
||||
-
|
||||
- if (blinking)
|
||||
- changed = !test_and_set_bit(bit_blink, &priv->led_state);
|
||||
- else
|
||||
- changed = !!test_and_clear_bit(bit_blink, &priv->led_state);
|
||||
-
|
||||
- changed |= !!test_bit(MTK_PHY_LED_STATE_NETDEV +
|
||||
- (index ? 16 : 0), &priv->led_state);
|
||||
- if (changed)
|
||||
- return phy_write_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
- MTK_PHY_LED1_BLINK_CTRL : MTK_PHY_LED0_BLINK_CTRL,
|
||||
- blinking ? MTK_PHY_LED_BLINK_FORCE_BLINK : 0);
|
||||
- else
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int mt798x_phy_led_blink_set(struct phy_device *phydev, u8 index,
|
||||
unsigned long *delay_on,
|
||||
unsigned long *delay_off)
|
||||
{
|
||||
+ struct mtk_socphy_priv *priv = phydev->priv;
|
||||
bool blinking = false;
|
||||
int err = 0;
|
||||
|
||||
- if (index > 1)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- if (delay_on && delay_off && (*delay_on > 0) && (*delay_off > 0)) {
|
||||
- blinking = true;
|
||||
- *delay_on = 50;
|
||||
- *delay_off = 50;
|
||||
- }
|
||||
+ err = mtk_phy_led_num_dly_cfg(index, delay_on, delay_off, &blinking);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
|
||||
- err = mt798x_phy_hw_led_blink_set(phydev, index, blinking);
|
||||
+ err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state,
|
||||
+ blinking);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- return mt798x_phy_hw_led_on_set(phydev, index, false);
|
||||
+ return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_MASK, false);
|
||||
}
|
||||
|
||||
static int mt798x_phy_led_brightness_set(struct phy_device *phydev,
|
||||
u8 index, enum led_brightness value)
|
||||
{
|
||||
+ struct mtk_socphy_priv *priv = phydev->priv;
|
||||
int err;
|
||||
|
||||
- err = mt798x_phy_hw_led_blink_set(phydev, index, false);
|
||||
+ err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state, false);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- return mt798x_phy_hw_led_on_set(phydev, index, (value != LED_OFF));
|
||||
+ return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_MASK, (value != LED_OFF));
|
||||
}
|
||||
|
||||
static const unsigned long supported_triggers = (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
@@ -1223,148 +1141,30 @@ static const unsigned long supported_tri
|
||||
static int mt798x_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules)
|
||||
{
|
||||
- if (index > 1)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- /* All combinations of the supported triggers are allowed */
|
||||
- if (rules & ~supported_triggers)
|
||||
- return -EOPNOTSUPP;
|
||||
-
|
||||
- return 0;
|
||||
-};
|
||||
+ return mtk_phy_led_hw_is_supported(phydev, index, rules,
|
||||
+ supported_triggers);
|
||||
+}
|
||||
|
||||
static int mt798x_phy_led_hw_control_get(struct phy_device *phydev, u8 index,
|
||||
unsigned long *rules)
|
||||
{
|
||||
- unsigned int bit_blink = MTK_PHY_LED_STATE_FORCE_BLINK + (index ? 16 : 0);
|
||||
- unsigned int bit_netdev = MTK_PHY_LED_STATE_NETDEV + (index ? 16 : 0);
|
||||
- unsigned int bit_on = MTK_PHY_LED_STATE_FORCE_ON + (index ? 16 : 0);
|
||||
struct mtk_socphy_priv *priv = phydev->priv;
|
||||
- int on, blink;
|
||||
-
|
||||
- if (index > 1)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- on = phy_read_mmd(phydev, MDIO_MMD_VEND2,
|
||||
- index ? MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL);
|
||||
-
|
||||
- if (on < 0)
|
||||
- return -EIO;
|
||||
-
|
||||
- blink = phy_read_mmd(phydev, MDIO_MMD_VEND2,
|
||||
- index ? MTK_PHY_LED1_BLINK_CTRL :
|
||||
- MTK_PHY_LED0_BLINK_CTRL);
|
||||
- if (blink < 0)
|
||||
- return -EIO;
|
||||
-
|
||||
- if ((on & (MTK_PHY_LED_ON_LINK | MTK_PHY_LED_ON_FDX | MTK_PHY_LED_ON_HDX |
|
||||
- MTK_PHY_LED_ON_LINKDOWN)) ||
|
||||
- (blink & (MTK_PHY_LED_BLINK_RX | MTK_PHY_LED_BLINK_TX)))
|
||||
- set_bit(bit_netdev, &priv->led_state);
|
||||
- else
|
||||
- clear_bit(bit_netdev, &priv->led_state);
|
||||
-
|
||||
- if (on & MTK_PHY_LED_ON_FORCE_ON)
|
||||
- set_bit(bit_on, &priv->led_state);
|
||||
- else
|
||||
- clear_bit(bit_on, &priv->led_state);
|
||||
-
|
||||
- if (blink & MTK_PHY_LED_BLINK_FORCE_BLINK)
|
||||
- set_bit(bit_blink, &priv->led_state);
|
||||
- else
|
||||
- clear_bit(bit_blink, &priv->led_state);
|
||||
-
|
||||
- if (!rules)
|
||||
- return 0;
|
||||
-
|
||||
- if (on & MTK_PHY_LED_ON_LINK)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_LINK);
|
||||
|
||||
- if (on & MTK_PHY_LED_ON_LINK10)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_LINK_10);
|
||||
-
|
||||
- if (on & MTK_PHY_LED_ON_LINK100)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_LINK_100);
|
||||
-
|
||||
- if (on & MTK_PHY_LED_ON_LINK1000)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_LINK_1000);
|
||||
-
|
||||
- if (on & MTK_PHY_LED_ON_FDX)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_FULL_DUPLEX);
|
||||
-
|
||||
- if (on & MTK_PHY_LED_ON_HDX)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_HALF_DUPLEX);
|
||||
-
|
||||
- if (blink & MTK_PHY_LED_BLINK_RX)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_RX);
|
||||
-
|
||||
- if (blink & MTK_PHY_LED_BLINK_TX)
|
||||
- *rules |= BIT(TRIGGER_NETDEV_TX);
|
||||
-
|
||||
- return 0;
|
||||
+ return mtk_phy_led_hw_ctrl_get(phydev, index, rules, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_SET,
|
||||
+ MTK_GPHY_LED_RX_BLINK_SET,
|
||||
+ MTK_GPHY_LED_TX_BLINK_SET);
|
||||
};
|
||||
|
||||
static int mt798x_phy_led_hw_control_set(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules)
|
||||
{
|
||||
- unsigned int bit_netdev = MTK_PHY_LED_STATE_NETDEV + (index ? 16 : 0);
|
||||
struct mtk_socphy_priv *priv = phydev->priv;
|
||||
- u16 on = 0, blink = 0;
|
||||
- int ret;
|
||||
|
||||
- if (index > 1)
|
||||
- return -EINVAL;
|
||||
-
|
||||
- if (rules & BIT(TRIGGER_NETDEV_FULL_DUPLEX))
|
||||
- on |= MTK_PHY_LED_ON_FDX;
|
||||
-
|
||||
- if (rules & BIT(TRIGGER_NETDEV_HALF_DUPLEX))
|
||||
- on |= MTK_PHY_LED_ON_HDX;
|
||||
-
|
||||
- if (rules & (BIT(TRIGGER_NETDEV_LINK_10) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
- on |= MTK_PHY_LED_ON_LINK10;
|
||||
-
|
||||
- if (rules & (BIT(TRIGGER_NETDEV_LINK_100) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
- on |= MTK_PHY_LED_ON_LINK100;
|
||||
-
|
||||
- if (rules & (BIT(TRIGGER_NETDEV_LINK_1000) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
- on |= MTK_PHY_LED_ON_LINK1000;
|
||||
-
|
||||
- if (rules & BIT(TRIGGER_NETDEV_RX)) {
|
||||
- blink |= (on & MTK_PHY_LED_ON_LINK) ?
|
||||
- (((on & MTK_PHY_LED_ON_LINK10) ? MTK_PHY_LED_BLINK_10RX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK100) ? MTK_PHY_LED_BLINK_100RX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK1000) ? MTK_PHY_LED_BLINK_1000RX : 0)) :
|
||||
- MTK_PHY_LED_BLINK_RX;
|
||||
- }
|
||||
-
|
||||
- if (rules & BIT(TRIGGER_NETDEV_TX)) {
|
||||
- blink |= (on & MTK_PHY_LED_ON_LINK) ?
|
||||
- (((on & MTK_PHY_LED_ON_LINK10) ? MTK_PHY_LED_BLINK_10TX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK100) ? MTK_PHY_LED_BLINK_100TX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK1000) ? MTK_PHY_LED_BLINK_1000TX : 0)) :
|
||||
- MTK_PHY_LED_BLINK_TX;
|
||||
- }
|
||||
-
|
||||
- if (blink || on)
|
||||
- set_bit(bit_netdev, &priv->led_state);
|
||||
- else
|
||||
- clear_bit(bit_netdev, &priv->led_state);
|
||||
-
|
||||
- ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
- MTK_PHY_LED1_ON_CTRL :
|
||||
- MTK_PHY_LED0_ON_CTRL,
|
||||
- MTK_PHY_LED_ON_FDX |
|
||||
- MTK_PHY_LED_ON_HDX |
|
||||
- MTK_PHY_LED_ON_LINK,
|
||||
- on);
|
||||
-
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- return phy_write_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
- MTK_PHY_LED1_BLINK_CTRL :
|
||||
- MTK_PHY_LED0_BLINK_CTRL, blink);
|
||||
+ return mtk_phy_led_hw_ctrl_set(phydev, index, rules, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_SET,
|
||||
+ MTK_GPHY_LED_RX_BLINK_SET,
|
||||
+ MTK_GPHY_LED_TX_BLINK_SET);
|
||||
};
|
||||
|
||||
static bool mt7988_phy_led_get_polarity(struct phy_device *phydev, int led_num)
|
||||
@@ -1438,14 +1238,6 @@ static int mt7988_phy_probe_shared(struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void mt798x_phy_leds_state_init(struct phy_device *phydev)
|
||||
-{
|
||||
- int i;
|
||||
-
|
||||
- for (i = 0; i < 2; ++i)
|
||||
- mt798x_phy_led_hw_control_get(phydev, i, NULL);
|
||||
-}
|
||||
-
|
||||
static int mt7988_phy_probe(struct phy_device *phydev)
|
||||
{
|
||||
struct mtk_socphy_shared *shared;
|
||||
@@ -1471,7 +1263,7 @@ static int mt7988_phy_probe(struct phy_d
|
||||
|
||||
phydev->priv = priv;
|
||||
|
||||
- mt798x_phy_leds_state_init(phydev);
|
||||
+ mtk_phy_leds_state_init(phydev);
|
||||
|
||||
err = mt7988_phy_fix_leds_polarities(phydev);
|
||||
if (err)
|
||||
@@ -1498,7 +1290,7 @@ static int mt7981_phy_probe(struct phy_d
|
||||
|
||||
phydev->priv = priv;
|
||||
|
||||
- mt798x_phy_leds_state_init(phydev);
|
||||
+ mtk_phy_leds_state_init(phydev);
|
||||
|
||||
return mt798x_phy_calibration(phydev);
|
||||
}
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
@@ -0,0 +1,251 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+#include <linux/phy.h>
|
||||
+#include <linux/module.h>
|
||||
+
|
||||
+#include <linux/netdevice.h>
|
||||
+
|
||||
+#include "mtk.h"
|
||||
+
|
||||
+int mtk_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long rules,
|
||||
+ unsigned long supported_triggers)
|
||||
+{
|
||||
+ if (index > 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* All combinations of the supported triggers are allowed */
|
||||
+ if (rules & ~supported_triggers)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_led_hw_is_supported);
|
||||
+
|
||||
+int mtk_phy_led_hw_ctrl_get(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *rules, unsigned long *led_state,
|
||||
+ u16 on_set, u16 rx_blink_set, u16 tx_blink_set)
|
||||
+{
|
||||
+ unsigned int bit_blink = MTK_PHY_LED_STATE_FORCE_BLINK +
|
||||
+ (index ? 16 : 0);
|
||||
+ unsigned int bit_netdev = MTK_PHY_LED_STATE_NETDEV + (index ? 16 : 0);
|
||||
+ unsigned int bit_on = MTK_PHY_LED_STATE_FORCE_ON + (index ? 16 : 0);
|
||||
+ int on, blink;
|
||||
+
|
||||
+ if (index > 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ on = phy_read_mmd(phydev, MDIO_MMD_VEND2,
|
||||
+ index ? MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL);
|
||||
+
|
||||
+ if (on < 0)
|
||||
+ return -EIO;
|
||||
+
|
||||
+ blink = phy_read_mmd(phydev, MDIO_MMD_VEND2,
|
||||
+ index ? MTK_PHY_LED1_BLINK_CTRL :
|
||||
+ MTK_PHY_LED0_BLINK_CTRL);
|
||||
+ if (blink < 0)
|
||||
+ return -EIO;
|
||||
+
|
||||
+ if ((on & (on_set | MTK_PHY_LED_ON_FDX |
|
||||
+ MTK_PHY_LED_ON_HDX | MTK_PHY_LED_ON_LINKDOWN)) ||
|
||||
+ (blink & (rx_blink_set | tx_blink_set)))
|
||||
+ set_bit(bit_netdev, led_state);
|
||||
+ else
|
||||
+ clear_bit(bit_netdev, led_state);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_FORCE_ON)
|
||||
+ set_bit(bit_on, led_state);
|
||||
+ else
|
||||
+ clear_bit(bit_on, led_state);
|
||||
+
|
||||
+ if (blink & MTK_PHY_LED_BLINK_FORCE_BLINK)
|
||||
+ set_bit(bit_blink, led_state);
|
||||
+ else
|
||||
+ clear_bit(bit_blink, led_state);
|
||||
+
|
||||
+ if (!rules)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (on & on_set)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_LINK);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_LINK10)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_LINK_10);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_LINK100)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_LINK_100);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_LINK1000)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_LINK_1000);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_LINK2500)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_LINK_2500);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_FDX)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_FULL_DUPLEX);
|
||||
+
|
||||
+ if (on & MTK_PHY_LED_ON_HDX)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_HALF_DUPLEX);
|
||||
+
|
||||
+ if (blink & rx_blink_set)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_RX);
|
||||
+
|
||||
+ if (blink & tx_blink_set)
|
||||
+ *rules |= BIT(TRIGGER_NETDEV_TX);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_led_hw_ctrl_get);
|
||||
+
|
||||
+int mtk_phy_led_hw_ctrl_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long rules, unsigned long *led_state,
|
||||
+ u16 on_set, u16 rx_blink_set, u16 tx_blink_set)
|
||||
+{
|
||||
+ unsigned int bit_netdev = MTK_PHY_LED_STATE_NETDEV + (index ? 16 : 0);
|
||||
+ u16 on = 0, blink = 0;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (index > 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (rules & BIT(TRIGGER_NETDEV_FULL_DUPLEX))
|
||||
+ on |= MTK_PHY_LED_ON_FDX;
|
||||
+
|
||||
+ if (rules & BIT(TRIGGER_NETDEV_HALF_DUPLEX))
|
||||
+ on |= MTK_PHY_LED_ON_HDX;
|
||||
+
|
||||
+ if (rules & (BIT(TRIGGER_NETDEV_LINK_10) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
+ on |= MTK_PHY_LED_ON_LINK10;
|
||||
+
|
||||
+ if (rules & (BIT(TRIGGER_NETDEV_LINK_100) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
+ on |= MTK_PHY_LED_ON_LINK100;
|
||||
+
|
||||
+ if (rules & (BIT(TRIGGER_NETDEV_LINK_1000) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
+ on |= MTK_PHY_LED_ON_LINK1000;
|
||||
+
|
||||
+ if (rules & (BIT(TRIGGER_NETDEV_LINK_2500) | BIT(TRIGGER_NETDEV_LINK)))
|
||||
+ on |= MTK_PHY_LED_ON_LINK2500;
|
||||
+
|
||||
+ if (rules & BIT(TRIGGER_NETDEV_RX)) {
|
||||
+ blink |= (on & on_set) ?
|
||||
+ (((on & MTK_PHY_LED_ON_LINK10) ?
|
||||
+ MTK_PHY_LED_BLINK_10RX : 0) |
|
||||
+ ((on & MTK_PHY_LED_ON_LINK100) ?
|
||||
+ MTK_PHY_LED_BLINK_100RX : 0) |
|
||||
+ ((on & MTK_PHY_LED_ON_LINK1000) ?
|
||||
+ MTK_PHY_LED_BLINK_1000RX : 0) |
|
||||
+ ((on & MTK_PHY_LED_ON_LINK2500) ?
|
||||
+ MTK_PHY_LED_BLINK_2500RX : 0)) :
|
||||
+ rx_blink_set;
|
||||
+ }
|
||||
+
|
||||
+ if (rules & BIT(TRIGGER_NETDEV_TX)) {
|
||||
+ blink |= (on & on_set) ?
|
||||
+ (((on & MTK_PHY_LED_ON_LINK10) ?
|
||||
+ MTK_PHY_LED_BLINK_10TX : 0) |
|
||||
+ ((on & MTK_PHY_LED_ON_LINK100) ?
|
||||
+ MTK_PHY_LED_BLINK_100TX : 0) |
|
||||
+ ((on & MTK_PHY_LED_ON_LINK1000) ?
|
||||
+ MTK_PHY_LED_BLINK_1000TX : 0) |
|
||||
+ ((on & MTK_PHY_LED_ON_LINK2500) ?
|
||||
+ MTK_PHY_LED_BLINK_2500TX : 0)) :
|
||||
+ tx_blink_set;
|
||||
+ }
|
||||
+
|
||||
+ if (blink || on)
|
||||
+ set_bit(bit_netdev, led_state);
|
||||
+ else
|
||||
+ clear_bit(bit_netdev, led_state);
|
||||
+
|
||||
+ ret = phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
+ MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL,
|
||||
+ MTK_PHY_LED_ON_FDX | MTK_PHY_LED_ON_HDX | on_set,
|
||||
+ on);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return phy_write_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
+ MTK_PHY_LED1_BLINK_CTRL :
|
||||
+ MTK_PHY_LED0_BLINK_CTRL, blink);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_led_hw_ctrl_set);
|
||||
+
|
||||
+int mtk_phy_led_num_dly_cfg(u8 index, unsigned long *delay_on,
|
||||
+ unsigned long *delay_off, bool *blinking)
|
||||
+{
|
||||
+ if (index > 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (delay_on && delay_off && (*delay_on > 0) && (*delay_off > 0)) {
|
||||
+ *blinking = true;
|
||||
+ *delay_on = 50;
|
||||
+ *delay_off = 50;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_led_num_dly_cfg);
|
||||
+
|
||||
+int mtk_phy_hw_led_on_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *led_state, u16 led_on_mask, bool on)
|
||||
+{
|
||||
+ unsigned int bit_on = MTK_PHY_LED_STATE_FORCE_ON + (index ? 16 : 0);
|
||||
+ bool changed;
|
||||
+
|
||||
+ if (on)
|
||||
+ changed = !test_and_set_bit(bit_on, led_state);
|
||||
+ else
|
||||
+ changed = !!test_and_clear_bit(bit_on, led_state);
|
||||
+
|
||||
+ changed |= !!test_and_clear_bit(MTK_PHY_LED_STATE_NETDEV +
|
||||
+ (index ? 16 : 0), led_state);
|
||||
+ if (changed)
|
||||
+ return phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
+ MTK_PHY_LED1_ON_CTRL :
|
||||
+ MTK_PHY_LED0_ON_CTRL,
|
||||
+ led_on_mask,
|
||||
+ on ? MTK_PHY_LED_ON_FORCE_ON : 0);
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_hw_led_on_set);
|
||||
+
|
||||
+int mtk_phy_hw_led_blink_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *led_state, bool blinking)
|
||||
+{
|
||||
+ unsigned int bit_blink = MTK_PHY_LED_STATE_FORCE_BLINK +
|
||||
+ (index ? 16 : 0);
|
||||
+ bool changed;
|
||||
+
|
||||
+ if (blinking)
|
||||
+ changed = !test_and_set_bit(bit_blink, led_state);
|
||||
+ else
|
||||
+ changed = !!test_and_clear_bit(bit_blink, led_state);
|
||||
+
|
||||
+ changed |= !!test_bit(MTK_PHY_LED_STATE_NETDEV +
|
||||
+ (index ? 16 : 0), led_state);
|
||||
+ if (changed)
|
||||
+ return phy_write_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
+ MTK_PHY_LED1_BLINK_CTRL :
|
||||
+ MTK_PHY_LED0_BLINK_CTRL,
|
||||
+ blinking ?
|
||||
+ MTK_PHY_LED_BLINK_FORCE_BLINK : 0);
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_hw_led_blink_set);
|
||||
+
|
||||
+void mtk_phy_leds_state_init(struct phy_device *phydev)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < 2; ++i)
|
||||
+ phydev->drv->led_hw_control_get(phydev, i, NULL);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_leds_state_init);
|
||||
+
|
||||
+MODULE_DESCRIPTION("MediaTek Ethernet PHY driver common");
|
||||
+MODULE_AUTHOR("Sky Huang <SkyLake.Huang@mediatek.com>");
|
||||
+MODULE_AUTHOR("Daniel Golle <daniel@makrotopia.org>");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/phy/mediatek/mtk.h
|
||||
@@ -0,0 +1,82 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0
|
||||
+ *
|
||||
+ * Common definition for Mediatek Ethernet PHYs
|
||||
+ * Author: SkyLake Huang <SkyLake.Huang@mediatek.com>
|
||||
+ * Copyright (c) 2024 MediaTek Inc.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _MTK_EPHY_H_
|
||||
+#define _MTK_EPHY_H_
|
||||
+
|
||||
+#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
+
|
||||
+/* Registers on MDIO_MMD_VEND2 */
|
||||
+#define MTK_PHY_LED0_ON_CTRL 0x24
|
||||
+#define MTK_PHY_LED1_ON_CTRL 0x26
|
||||
+#define MTK_GPHY_LED_ON_MASK GENMASK(6, 0)
|
||||
+#define MTK_2P5GPHY_LED_ON_MASK GENMASK(7, 0)
|
||||
+#define MTK_PHY_LED_ON_LINK1000 BIT(0)
|
||||
+#define MTK_PHY_LED_ON_LINK100 BIT(1)
|
||||
+#define MTK_PHY_LED_ON_LINK10 BIT(2)
|
||||
+#define MTK_PHY_LED_ON_LINKDOWN BIT(3)
|
||||
+#define MTK_PHY_LED_ON_FDX BIT(4) /* Full duplex */
|
||||
+#define MTK_PHY_LED_ON_HDX BIT(5) /* Half duplex */
|
||||
+#define MTK_PHY_LED_ON_FORCE_ON BIT(6)
|
||||
+#define MTK_PHY_LED_ON_LINK2500 BIT(7)
|
||||
+#define MTK_PHY_LED_ON_POLARITY BIT(14)
|
||||
+#define MTK_PHY_LED_ON_ENABLE BIT(15)
|
||||
+
|
||||
+#define MTK_PHY_LED0_BLINK_CTRL 0x25
|
||||
+#define MTK_PHY_LED1_BLINK_CTRL 0x27
|
||||
+#define MTK_PHY_LED_BLINK_1000TX BIT(0)
|
||||
+#define MTK_PHY_LED_BLINK_1000RX BIT(1)
|
||||
+#define MTK_PHY_LED_BLINK_100TX BIT(2)
|
||||
+#define MTK_PHY_LED_BLINK_100RX BIT(3)
|
||||
+#define MTK_PHY_LED_BLINK_10TX BIT(4)
|
||||
+#define MTK_PHY_LED_BLINK_10RX BIT(5)
|
||||
+#define MTK_PHY_LED_BLINK_COLLISION BIT(6)
|
||||
+#define MTK_PHY_LED_BLINK_RX_CRC_ERR BIT(7)
|
||||
+#define MTK_PHY_LED_BLINK_RX_IDLE_ERR BIT(8)
|
||||
+#define MTK_PHY_LED_BLINK_FORCE_BLINK BIT(9)
|
||||
+#define MTK_PHY_LED_BLINK_2500TX BIT(10)
|
||||
+#define MTK_PHY_LED_BLINK_2500RX BIT(11)
|
||||
+
|
||||
+#define MTK_GPHY_LED_ON_SET (MTK_PHY_LED_ON_LINK1000 | \
|
||||
+ MTK_PHY_LED_ON_LINK100 | \
|
||||
+ MTK_PHY_LED_ON_LINK10)
|
||||
+#define MTK_GPHY_LED_RX_BLINK_SET (MTK_PHY_LED_BLINK_1000RX | \
|
||||
+ MTK_PHY_LED_BLINK_100RX | \
|
||||
+ MTK_PHY_LED_BLINK_10RX)
|
||||
+#define MTK_GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_1000RX | \
|
||||
+ MTK_PHY_LED_BLINK_100RX | \
|
||||
+ MTK_PHY_LED_BLINK_10RX)
|
||||
+
|
||||
+#define MTK_2P5GPHY_LED_ON_SET (MTK_PHY_LED_ON_LINK2500 | \
|
||||
+ MTK_GPHY_LED_ON_SET)
|
||||
+#define MTK_2P5GPHY_LED_RX_BLINK_SET (MTK_PHY_LED_BLINK_2500RX | \
|
||||
+ MTK_GPHY_LED_RX_BLINK_SET)
|
||||
+#define MTK_2P5GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_2500RX | \
|
||||
+ MTK_GPHY_LED_TX_BLINK_SET)
|
||||
+
|
||||
+#define MTK_PHY_LED_STATE_FORCE_ON 0
|
||||
+#define MTK_PHY_LED_STATE_FORCE_BLINK 1
|
||||
+#define MTK_PHY_LED_STATE_NETDEV 2
|
||||
+
|
||||
+int mtk_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long rules,
|
||||
+ unsigned long supported_triggers);
|
||||
+int mtk_phy_led_hw_ctrl_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long rules, unsigned long *led_state,
|
||||
+ u16 on_set, u16 rx_blink_set, u16 tx_blink_set);
|
||||
+int mtk_phy_led_hw_ctrl_get(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *rules, unsigned long *led_state,
|
||||
+ u16 on_set, u16 rx_blink_set, u16 tx_blink_set);
|
||||
+int mtk_phy_led_num_dly_cfg(u8 index, unsigned long *delay_on,
|
||||
+ unsigned long *delay_off, bool *blinking);
|
||||
+int mtk_phy_hw_led_on_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *led_state, u16 led_on_mask, bool on);
|
||||
+int mtk_phy_hw_led_blink_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *led_state, bool blinking);
|
||||
+void mtk_phy_leds_state_init(struct phy_device *phydev);
|
||||
+
|
||||
+#endif /* _MTK_EPHY_H_ */
|
||||
@ -0,0 +1,70 @@
|
||||
From 2783929879854d5750ba82e2e203663313362abb Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:08 +0800
|
||||
Subject: [PATCH 04/13] net: phy: mediatek: Improve readability of
|
||||
mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set()
|
||||
|
||||
This patch removes parens around TRIGGER_NETDEV_RX/TRIGGER_NETDEV_TX in
|
||||
mtk_phy_led_hw_ctrl_set(), which improves readability.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-phy-lib.c | 44 ++++++++++++++------------
|
||||
1 file changed, 24 insertions(+), 20 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
@@ -127,29 +127,33 @@ int mtk_phy_led_hw_ctrl_set(struct phy_d
|
||||
on |= MTK_PHY_LED_ON_LINK2500;
|
||||
|
||||
if (rules & BIT(TRIGGER_NETDEV_RX)) {
|
||||
- blink |= (on & on_set) ?
|
||||
- (((on & MTK_PHY_LED_ON_LINK10) ?
|
||||
- MTK_PHY_LED_BLINK_10RX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK100) ?
|
||||
- MTK_PHY_LED_BLINK_100RX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK1000) ?
|
||||
- MTK_PHY_LED_BLINK_1000RX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK2500) ?
|
||||
- MTK_PHY_LED_BLINK_2500RX : 0)) :
|
||||
- rx_blink_set;
|
||||
+ if (on & on_set) {
|
||||
+ if (on & MTK_PHY_LED_ON_LINK10)
|
||||
+ blink |= MTK_PHY_LED_BLINK_10RX;
|
||||
+ if (on & MTK_PHY_LED_ON_LINK100)
|
||||
+ blink |= MTK_PHY_LED_BLINK_100RX;
|
||||
+ if (on & MTK_PHY_LED_ON_LINK1000)
|
||||
+ blink |= MTK_PHY_LED_BLINK_1000RX;
|
||||
+ if (on & MTK_PHY_LED_ON_LINK2500)
|
||||
+ blink |= MTK_PHY_LED_BLINK_2500RX;
|
||||
+ } else {
|
||||
+ blink |= rx_blink_set;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (rules & BIT(TRIGGER_NETDEV_TX)) {
|
||||
- blink |= (on & on_set) ?
|
||||
- (((on & MTK_PHY_LED_ON_LINK10) ?
|
||||
- MTK_PHY_LED_BLINK_10TX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK100) ?
|
||||
- MTK_PHY_LED_BLINK_100TX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK1000) ?
|
||||
- MTK_PHY_LED_BLINK_1000TX : 0) |
|
||||
- ((on & MTK_PHY_LED_ON_LINK2500) ?
|
||||
- MTK_PHY_LED_BLINK_2500TX : 0)) :
|
||||
- tx_blink_set;
|
||||
+ if (on & on_set) {
|
||||
+ if (on & MTK_PHY_LED_ON_LINK10)
|
||||
+ blink |= MTK_PHY_LED_BLINK_10TX;
|
||||
+ if (on & MTK_PHY_LED_ON_LINK100)
|
||||
+ blink |= MTK_PHY_LED_BLINK_100TX;
|
||||
+ if (on & MTK_PHY_LED_ON_LINK1000)
|
||||
+ blink |= MTK_PHY_LED_BLINK_1000TX;
|
||||
+ if (on & MTK_PHY_LED_ON_LINK2500)
|
||||
+ blink |= MTK_PHY_LED_BLINK_2500TX;
|
||||
+ } else {
|
||||
+ blink |= tx_blink_set;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (blink || on)
|
||||
@ -0,0 +1,141 @@
|
||||
From 58c1270423ab48464cdc31ef71ffe7f5b2441961 Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:09 +0800
|
||||
Subject: [PATCH 05/13] net: phy: mediatek: Integrate read/write page helper
|
||||
functions
|
||||
|
||||
This patch integrates read/write page helper functions as MTK phy lib.
|
||||
They are basically the same in mtk-ge.c & mtk-ge-soc.c.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 18 ++++--------------
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 20 ++++++--------------
|
||||
drivers/net/phy/mediatek/mtk-phy-lib.c | 12 ++++++++++++
|
||||
drivers/net/phy/mediatek/mtk.h | 3 +++
|
||||
4 files changed, 25 insertions(+), 28 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -275,16 +275,6 @@ struct mtk_socphy_shared {
|
||||
struct mtk_socphy_priv priv[4];
|
||||
};
|
||||
|
||||
-static int mtk_socphy_read_page(struct phy_device *phydev)
|
||||
-{
|
||||
- return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
|
||||
-}
|
||||
-
|
||||
-static int mtk_socphy_write_page(struct phy_device *phydev, int page)
|
||||
-{
|
||||
- return __phy_write(phydev, MTK_EXT_PAGE_ACCESS, page);
|
||||
-}
|
||||
-
|
||||
/* One calibration cycle consists of:
|
||||
* 1.Set DA_CALIN_FLAG high to start calibration. Keep it high
|
||||
* until AD_CAL_COMP is ready to output calibration result.
|
||||
@@ -1305,8 +1295,8 @@ static struct phy_driver mtk_socphy_driv
|
||||
.probe = mt7981_phy_probe,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
- .read_page = mtk_socphy_read_page,
|
||||
- .write_page = mtk_socphy_write_page,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
.led_blink_set = mt798x_phy_led_blink_set,
|
||||
.led_brightness_set = mt798x_phy_led_brightness_set,
|
||||
.led_hw_is_supported = mt798x_phy_led_hw_is_supported,
|
||||
@@ -1322,8 +1312,8 @@ static struct phy_driver mtk_socphy_driv
|
||||
.probe = mt7988_phy_probe,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
- .read_page = mtk_socphy_read_page,
|
||||
- .write_page = mtk_socphy_write_page,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
.led_blink_set = mt798x_phy_led_blink_set,
|
||||
.led_brightness_set = mt798x_phy_led_brightness_set,
|
||||
.led_hw_is_supported = mt798x_phy_led_hw_is_supported,
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/phy.h>
|
||||
|
||||
+#include "mtk.h"
|
||||
+
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
#define MTK_PHY_PAGE_EXTENDED 0x0001
|
||||
@@ -12,16 +14,6 @@
|
||||
#define MTK_PHY_PAGE_EXTENDED_2A30 0x2a30
|
||||
#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
|
||||
-static int mtk_gephy_read_page(struct phy_device *phydev)
|
||||
-{
|
||||
- return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
|
||||
-}
|
||||
-
|
||||
-static int mtk_gephy_write_page(struct phy_device *phydev, int page)
|
||||
-{
|
||||
- return __phy_write(phydev, MTK_EXT_PAGE_ACCESS, page);
|
||||
-}
|
||||
-
|
||||
static void mtk_gephy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
/* Disable EEE */
|
||||
@@ -114,8 +106,8 @@ static struct phy_driver mtk_gephy_drive
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
- .read_page = mtk_gephy_read_page,
|
||||
- .write_page = mtk_gephy_write_page,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
},
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(0x03a29441),
|
||||
@@ -128,8 +120,8 @@ static struct phy_driver mtk_gephy_drive
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
- .read_page = mtk_gephy_read_page,
|
||||
- .write_page = mtk_gephy_write_page,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
},
|
||||
};
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
@@ -6,6 +6,18 @@
|
||||
|
||||
#include "mtk.h"
|
||||
|
||||
+int mtk_phy_read_page(struct phy_device *phydev)
|
||||
+{
|
||||
+ return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_read_page);
|
||||
+
|
||||
+int mtk_phy_write_page(struct phy_device *phydev, int page)
|
||||
+{
|
||||
+ return __phy_write(phydev, MTK_EXT_PAGE_ACCESS, page);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_phy_write_page);
|
||||
+
|
||||
int mtk_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules,
|
||||
unsigned long supported_triggers)
|
||||
--- a/drivers/net/phy/mediatek/mtk.h
|
||||
+++ b/drivers/net/phy/mediatek/mtk.h
|
||||
@@ -62,6 +62,9 @@
|
||||
#define MTK_PHY_LED_STATE_FORCE_BLINK 1
|
||||
#define MTK_PHY_LED_STATE_NETDEV 2
|
||||
|
||||
+int mtk_phy_read_page(struct phy_device *phydev);
|
||||
+int mtk_phy_write_page(struct phy_device *phydev, int page);
|
||||
+
|
||||
int mtk_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules,
|
||||
unsigned long supported_triggers);
|
||||
@ -0,0 +1,146 @@
|
||||
From 9403f1d54598ae56386a8bf47a5b6b34c884e4f5 Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:10 +0800
|
||||
Subject: [PATCH 06/13] net: phy: mediatek: Hook LED helper functions in
|
||||
mtk-ge.c
|
||||
|
||||
We have mtk-phy-lib.c now so that we can use LED helper functions in
|
||||
mtk-ge.c(mt7531 part). It also means that mt7531/mt7981/mt7988's
|
||||
Giga ethernet phys share almost the same HW LED controller design.
|
||||
Also, add probe function for mt7531 so that it can initialize LED state.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 100 ++++++++++++++++++++++++++++++
|
||||
1 file changed, 100 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -14,6 +14,10 @@
|
||||
#define MTK_PHY_PAGE_EXTENDED_2A30 0x2a30
|
||||
#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
|
||||
+struct mtk_gephy_priv {
|
||||
+ unsigned long led_state;
|
||||
+};
|
||||
+
|
||||
static void mtk_gephy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
/* Disable EEE */
|
||||
@@ -94,6 +98,96 @@ static int mt7531_phy_config_init(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int mt7531_phy_probe(struct phy_device *phydev)
|
||||
+{
|
||||
+ struct mtk_gephy_priv *priv;
|
||||
+
|
||||
+ priv = devm_kzalloc(&phydev->mdio.dev, sizeof(struct mtk_gephy_priv),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ phydev->priv = priv;
|
||||
+
|
||||
+ mtk_phy_leds_state_init(phydev);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mt753x_phy_led_blink_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ struct mtk_gephy_priv *priv = phydev->priv;
|
||||
+ bool blinking = false;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ err = mtk_phy_led_num_dly_cfg(index, delay_on, delay_off, &blinking);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state,
|
||||
+ blinking);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_MASK, false);
|
||||
+}
|
||||
+
|
||||
+static int mt753x_phy_led_brightness_set(struct phy_device *phydev,
|
||||
+ u8 index, enum led_brightness value)
|
||||
+{
|
||||
+ struct mtk_gephy_priv *priv = phydev->priv;
|
||||
+ int err;
|
||||
+
|
||||
+ err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state, false);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_MASK, (value != LED_OFF));
|
||||
+}
|
||||
+
|
||||
+static const unsigned long supported_triggers =
|
||||
+ (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
+ BIT(TRIGGER_NETDEV_RX) |
|
||||
+ BIT(TRIGGER_NETDEV_TX));
|
||||
+
|
||||
+static int mt753x_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long rules)
|
||||
+{
|
||||
+ return mtk_phy_led_hw_is_supported(phydev, index, rules,
|
||||
+ supported_triggers);
|
||||
+}
|
||||
+
|
||||
+static int mt753x_phy_led_hw_control_get(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *rules)
|
||||
+{
|
||||
+ struct mtk_gephy_priv *priv = phydev->priv;
|
||||
+
|
||||
+ return mtk_phy_led_hw_ctrl_get(phydev, index, rules, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_SET,
|
||||
+ MTK_GPHY_LED_RX_BLINK_SET,
|
||||
+ MTK_GPHY_LED_TX_BLINK_SET);
|
||||
+};
|
||||
+
|
||||
+static int mt753x_phy_led_hw_control_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long rules)
|
||||
+{
|
||||
+ struct mtk_gephy_priv *priv = phydev->priv;
|
||||
+
|
||||
+ return mtk_phy_led_hw_ctrl_set(phydev, index, rules, &priv->led_state,
|
||||
+ MTK_GPHY_LED_ON_SET,
|
||||
+ MTK_GPHY_LED_RX_BLINK_SET,
|
||||
+ MTK_GPHY_LED_TX_BLINK_SET);
|
||||
+};
|
||||
+
|
||||
static struct phy_driver mtk_gephy_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(0x03a29412),
|
||||
@@ -112,6 +206,7 @@ static struct phy_driver mtk_gephy_drive
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(0x03a29441),
|
||||
.name = "MediaTek MT7531 PHY",
|
||||
+ .probe = mt7531_phy_probe,
|
||||
.config_init = mt7531_phy_config_init,
|
||||
/* Interrupts are handled by the switch, not the PHY
|
||||
* itself.
|
||||
@@ -122,6 +217,11 @@ static struct phy_driver mtk_gephy_drive
|
||||
.resume = genphy_resume,
|
||||
.read_page = mtk_phy_read_page,
|
||||
.write_page = mtk_phy_write_page,
|
||||
+ .led_blink_set = mt753x_phy_led_blink_set,
|
||||
+ .led_brightness_set = mt753x_phy_led_brightness_set,
|
||||
+ .led_hw_is_supported = mt753x_phy_led_hw_is_supported,
|
||||
+ .led_hw_control_set = mt753x_phy_led_hw_control_set,
|
||||
+ .led_hw_control_get = mt753x_phy_led_hw_control_get,
|
||||
},
|
||||
};
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
From 51ee83602dbb84716180d9b6e43f6bebb0c2d7bd Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:11 +0800
|
||||
Subject: [PATCH 07/13] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros
|
||||
|
||||
This patch adds MT7530 & MT7531's PHY ID macros in mtk-ge.c so that
|
||||
it follows the same rule of mtk-ge-soc.c.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
#include "mtk.h"
|
||||
|
||||
+#define MTK_GPHY_ID_MT7530 0x03a29412
|
||||
+#define MTK_GPHY_ID_MT7531 0x03a29441
|
||||
+
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
#define MTK_PHY_PAGE_EXTENDED 0x0001
|
||||
@@ -190,7 +193,7 @@ static int mt753x_phy_led_hw_control_set
|
||||
|
||||
static struct phy_driver mtk_gephy_driver[] = {
|
||||
{
|
||||
- PHY_ID_MATCH_EXACT(0x03a29412),
|
||||
+ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7530),
|
||||
.name = "MediaTek MT7530 PHY",
|
||||
.config_init = mt7530_phy_config_init,
|
||||
/* Interrupts are handled by the switch, not the PHY
|
||||
@@ -204,7 +207,7 @@ static struct phy_driver mtk_gephy_drive
|
||||
.write_page = mtk_phy_write_page,
|
||||
},
|
||||
{
|
||||
- PHY_ID_MATCH_EXACT(0x03a29441),
|
||||
+ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7531),
|
||||
.name = "MediaTek MT7531 PHY",
|
||||
.probe = mt7531_phy_probe,
|
||||
.config_init = mt7531_phy_config_init,
|
||||
@@ -228,8 +231,8 @@ static struct phy_driver mtk_gephy_drive
|
||||
module_phy_driver(mtk_gephy_driver);
|
||||
|
||||
static struct mdio_device_id __maybe_unused mtk_gephy_tbl[] = {
|
||||
- { PHY_ID_MATCH_EXACT(0x03a29441) },
|
||||
- { PHY_ID_MATCH_EXACT(0x03a29412) },
|
||||
+ { PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7530) },
|
||||
+ { PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7531) },
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -0,0 +1,182 @@
|
||||
From e73df692396b0d6bdcb2317299fa1e8e547f3446 Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:12 +0800
|
||||
Subject: [PATCH 08/13] net: phy: mediatek: Change mtk-ge-soc.c line wrapping
|
||||
|
||||
This patch shrinks mtk-ge-soc.c line wrapping to 80 characters.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 67 +++++++++++++++++----------
|
||||
1 file changed, 42 insertions(+), 25 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -295,7 +295,8 @@ static int cal_cycle(struct phy_device *
|
||||
ret = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
|
||||
MTK_PHY_RG_AD_CAL_CLK, reg_val,
|
||||
reg_val & MTK_PHY_DA_CAL_CLK, 500,
|
||||
- ANALOG_INTERNAL_OPERATION_MAX_US, false);
|
||||
+ ANALOG_INTERNAL_OPERATION_MAX_US,
|
||||
+ false);
|
||||
if (ret) {
|
||||
phydev_err(phydev, "Calibration cycle timeout\n");
|
||||
return ret;
|
||||
@@ -304,7 +305,7 @@ static int cal_cycle(struct phy_device *
|
||||
phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_RG_AD_CALIN,
|
||||
MTK_PHY_DA_CALIN_FLAG);
|
||||
ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_RG_AD_CAL_COMP) >>
|
||||
- MTK_PHY_AD_CAL_COMP_OUT_SHIFT;
|
||||
+ MTK_PHY_AD_CAL_COMP_OUT_SHIFT;
|
||||
phydev_dbg(phydev, "cal_val: 0x%x, ret: %d\n", cal_val, ret);
|
||||
|
||||
return ret;
|
||||
@@ -394,38 +395,46 @@ static int tx_amp_fill_result(struct phy
|
||||
}
|
||||
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TXVLD_DA_RG,
|
||||
- MTK_PHY_DA_TX_I2MPB_A_GBE_MASK, (buf[0] + bias[0]) << 10);
|
||||
+ MTK_PHY_DA_TX_I2MPB_A_GBE_MASK,
|
||||
+ (buf[0] + bias[0]) << 10);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TXVLD_DA_RG,
|
||||
MTK_PHY_DA_TX_I2MPB_A_TBT_MASK, buf[0] + bias[1]);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_A2,
|
||||
- MTK_PHY_DA_TX_I2MPB_A_HBT_MASK, (buf[0] + bias[2]) << 10);
|
||||
+ MTK_PHY_DA_TX_I2MPB_A_HBT_MASK,
|
||||
+ (buf[0] + bias[2]) << 10);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_A2,
|
||||
MTK_PHY_DA_TX_I2MPB_A_TST_MASK, buf[0] + bias[3]);
|
||||
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_B1,
|
||||
- MTK_PHY_DA_TX_I2MPB_B_GBE_MASK, (buf[1] + bias[4]) << 8);
|
||||
+ MTK_PHY_DA_TX_I2MPB_B_GBE_MASK,
|
||||
+ (buf[1] + bias[4]) << 8);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_B1,
|
||||
MTK_PHY_DA_TX_I2MPB_B_TBT_MASK, buf[1] + bias[5]);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_B2,
|
||||
- MTK_PHY_DA_TX_I2MPB_B_HBT_MASK, (buf[1] + bias[6]) << 8);
|
||||
+ MTK_PHY_DA_TX_I2MPB_B_HBT_MASK,
|
||||
+ (buf[1] + bias[6]) << 8);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_B2,
|
||||
MTK_PHY_DA_TX_I2MPB_B_TST_MASK, buf[1] + bias[7]);
|
||||
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_C1,
|
||||
- MTK_PHY_DA_TX_I2MPB_C_GBE_MASK, (buf[2] + bias[8]) << 8);
|
||||
+ MTK_PHY_DA_TX_I2MPB_C_GBE_MASK,
|
||||
+ (buf[2] + bias[8]) << 8);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_C1,
|
||||
MTK_PHY_DA_TX_I2MPB_C_TBT_MASK, buf[2] + bias[9]);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_C2,
|
||||
- MTK_PHY_DA_TX_I2MPB_C_HBT_MASK, (buf[2] + bias[10]) << 8);
|
||||
+ MTK_PHY_DA_TX_I2MPB_C_HBT_MASK,
|
||||
+ (buf[2] + bias[10]) << 8);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_C2,
|
||||
MTK_PHY_DA_TX_I2MPB_C_TST_MASK, buf[2] + bias[11]);
|
||||
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_D1,
|
||||
- MTK_PHY_DA_TX_I2MPB_D_GBE_MASK, (buf[3] + bias[12]) << 8);
|
||||
+ MTK_PHY_DA_TX_I2MPB_D_GBE_MASK,
|
||||
+ (buf[3] + bias[12]) << 8);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_D1,
|
||||
MTK_PHY_DA_TX_I2MPB_D_TBT_MASK, buf[3] + bias[13]);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_D2,
|
||||
- MTK_PHY_DA_TX_I2MPB_D_HBT_MASK, (buf[3] + bias[14]) << 8);
|
||||
+ MTK_PHY_DA_TX_I2MPB_D_HBT_MASK,
|
||||
+ (buf[3] + bias[14]) << 8);
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TX_I2MPB_TEST_MODE_D2,
|
||||
MTK_PHY_DA_TX_I2MPB_D_TST_MASK, buf[3] + bias[15]);
|
||||
|
||||
@@ -616,7 +625,8 @@ static int tx_vcm_cal_sw(struct phy_devi
|
||||
goto restore;
|
||||
|
||||
/* We calibrate TX-VCM in different logic. Check upper index and then
|
||||
- * lower index. If this calibration is valid, apply lower index's result.
|
||||
+ * lower index. If this calibration is valid, apply lower index's
|
||||
+ * result.
|
||||
*/
|
||||
ret = upper_ret - lower_ret;
|
||||
if (ret == 1) {
|
||||
@@ -645,7 +655,8 @@ static int tx_vcm_cal_sw(struct phy_devi
|
||||
} else if (upper_idx == TXRESERVE_MAX && upper_ret == 0 &&
|
||||
lower_ret == 0) {
|
||||
ret = 0;
|
||||
- phydev_warn(phydev, "TX-VCM SW cal result at high margin 0x%x\n",
|
||||
+ phydev_warn(phydev,
|
||||
+ "TX-VCM SW cal result at high margin 0x%x\n",
|
||||
upper_idx);
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
@@ -749,7 +760,8 @@ static void mt7981_phy_finetune(struct p
|
||||
|
||||
/* TR_OPEN_LOOP_EN = 1, lpf_x_average = 9 */
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_RG_DEV1E_REG234,
|
||||
- MTK_PHY_TR_OPEN_LOOP_EN_MASK | MTK_PHY_LPF_X_AVERAGE_MASK,
|
||||
+ MTK_PHY_TR_OPEN_LOOP_EN_MASK |
|
||||
+ MTK_PHY_LPF_X_AVERAGE_MASK,
|
||||
BIT(0) | FIELD_PREP(MTK_PHY_LPF_X_AVERAGE_MASK, 0x9));
|
||||
|
||||
/* rg_tr_lpf_cnt_val = 512 */
|
||||
@@ -818,7 +830,8 @@ static void mt7988_phy_finetune(struct p
|
||||
|
||||
/* TR_OPEN_LOOP_EN = 1, lpf_x_average = 10 */
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_RG_DEV1E_REG234,
|
||||
- MTK_PHY_TR_OPEN_LOOP_EN_MASK | MTK_PHY_LPF_X_AVERAGE_MASK,
|
||||
+ MTK_PHY_TR_OPEN_LOOP_EN_MASK |
|
||||
+ MTK_PHY_LPF_X_AVERAGE_MASK,
|
||||
BIT(0) | FIELD_PREP(MTK_PHY_LPF_X_AVERAGE_MASK, 0xa));
|
||||
|
||||
/* rg_tr_lpf_cnt_val = 1023 */
|
||||
@@ -930,7 +943,8 @@ static void mt798x_phy_eee(struct phy_de
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_3);
|
||||
- __phy_modify(phydev, MTK_PHY_LPI_REG_14, MTK_PHY_LPI_WAKE_TIMER_1000_MASK,
|
||||
+ __phy_modify(phydev, MTK_PHY_LPI_REG_14,
|
||||
+ MTK_PHY_LPI_WAKE_TIMER_1000_MASK,
|
||||
FIELD_PREP(MTK_PHY_LPI_WAKE_TIMER_1000_MASK, 0x19c));
|
||||
|
||||
__phy_modify(phydev, MTK_PHY_LPI_REG_1c, MTK_PHY_SMI_DET_ON_THRESH_MASK,
|
||||
@@ -940,7 +954,8 @@ static void mt798x_phy_eee(struct phy_de
|
||||
phy_modify_mmd(phydev, MDIO_MMD_VEND1,
|
||||
MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG122,
|
||||
MTK_PHY_LPI_NORM_MSE_HI_THRESH1000_MASK,
|
||||
- FIELD_PREP(MTK_PHY_LPI_NORM_MSE_HI_THRESH1000_MASK, 0xff));
|
||||
+ FIELD_PREP(MTK_PHY_LPI_NORM_MSE_HI_THRESH1000_MASK,
|
||||
+ 0xff));
|
||||
}
|
||||
|
||||
static int cal_sw(struct phy_device *phydev, enum CAL_ITEM cal_item,
|
||||
@@ -1119,14 +1134,15 @@ static int mt798x_phy_led_brightness_set
|
||||
MTK_GPHY_LED_ON_MASK, (value != LED_OFF));
|
||||
}
|
||||
|
||||
-static const unsigned long supported_triggers = (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
- BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
- BIT(TRIGGER_NETDEV_LINK) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
- BIT(TRIGGER_NETDEV_RX) |
|
||||
- BIT(TRIGGER_NETDEV_TX));
|
||||
+static const unsigned long supported_triggers =
|
||||
+ (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
+ BIT(TRIGGER_NETDEV_RX) |
|
||||
+ BIT(TRIGGER_NETDEV_TX));
|
||||
|
||||
static int mt798x_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules)
|
||||
@@ -1189,7 +1205,8 @@ static int mt7988_phy_fix_leds_polaritie
|
||||
/* Only now setup pinctrl to avoid bogus blinking */
|
||||
pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "gbe-led");
|
||||
if (IS_ERR(pinctrl))
|
||||
- dev_err(&phydev->mdio.bus->dev, "Failed to setup PHY LED pinctrl\n");
|
||||
+ dev_err(&phydev->mdio.bus->dev,
|
||||
+ "Failed to setup PHY LED pinctrl\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,614 @@
|
||||
From 60228de48d8bfde62b4db5945314e6a62079f091 Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:13 +0800
|
||||
Subject: [PATCH 09/13] net: phy: mediatek: Add token ring access helper
|
||||
functions in mtk-phy-lib
|
||||
|
||||
This patch adds TR(token ring) manipulations and adds correct
|
||||
macro names for those magic numbers. TR is a way to access
|
||||
proprietary registers on page 52b5. Use these helper functions
|
||||
so we can see which fields we're going to modify/set/clear.
|
||||
|
||||
This patch doesn't really change registers' settings but just
|
||||
enhances readability and maintainability.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 297 ++++++++++++++++---------
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 82 +++++--
|
||||
drivers/net/phy/mediatek/mtk-phy-lib.c | 91 ++++++++
|
||||
drivers/net/phy/mediatek/mtk.h | 13 ++
|
||||
4 files changed, 358 insertions(+), 125 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -24,7 +24,108 @@
|
||||
#define MTK_PHY_SMI_DET_ON_THRESH_MASK GENMASK(13, 8)
|
||||
|
||||
#define MTK_PHY_PAGE_EXTENDED_2A30 0x2a30
|
||||
-#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
+
|
||||
+/* Registers on Token Ring debug nodes */
|
||||
+/* ch_addr = 0x0, node_addr = 0x7, data_addr = 0x15 */
|
||||
+/* NormMseLoThresh */
|
||||
+#define NORMAL_MSE_LO_THRESH_MASK GENMASK(15, 8)
|
||||
+
|
||||
+/* ch_addr = 0x0, node_addr = 0xf, data_addr = 0x3c */
|
||||
+/* RemAckCntLimitCtrl */
|
||||
+#define REMOTE_ACK_COUNT_LIMIT_CTRL_MASK GENMASK(2, 1)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xd, data_addr = 0x20 */
|
||||
+/* VcoSlicerThreshBitsHigh */
|
||||
+#define VCO_SLICER_THRESH_HIGH_MASK GENMASK(23, 0)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x0 */
|
||||
+/* DfeTailEnableVgaThresh1000 */
|
||||
+#define DFE_TAIL_EANBLE_VGA_TRHESH_1000 GENMASK(5, 1)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x1 */
|
||||
+/* MrvlTrFix100Kp */
|
||||
+#define MRVL_TR_FIX_100KP_MASK GENMASK(22, 20)
|
||||
+/* MrvlTrFix100Kf */
|
||||
+#define MRVL_TR_FIX_100KF_MASK GENMASK(19, 17)
|
||||
+/* MrvlTrFix1000Kp */
|
||||
+#define MRVL_TR_FIX_1000KP_MASK GENMASK(16, 14)
|
||||
+/* MrvlTrFix1000Kf */
|
||||
+#define MRVL_TR_FIX_1000KF_MASK GENMASK(13, 11)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x12 */
|
||||
+/* VgaDecRate */
|
||||
+#define VGA_DECIMATION_RATE_MASK GENMASK(8, 5)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x17 */
|
||||
+/* SlvDSPreadyTime */
|
||||
+#define SLAVE_DSP_READY_TIME_MASK GENMASK(22, 15)
|
||||
+/* MasDSPreadyTime */
|
||||
+#define MASTER_DSP_READY_TIME_MASK GENMASK(14, 7)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x18 */
|
||||
+/* EnabRandUpdTrig */
|
||||
+#define ENABLE_RANDOM_UPDOWN_COUNTER_TRIGGER BIT(8)
|
||||
+
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x20 */
|
||||
+/* ResetSyncOffset */
|
||||
+#define RESET_SYNC_OFFSET_MASK GENMASK(11, 8)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x0 */
|
||||
+/* FfeUpdGainForceVal */
|
||||
+#define FFE_UPDATE_GAIN_FORCE_VAL_MASK GENMASK(9, 7)
|
||||
+/* FfeUpdGainForce */
|
||||
+#define FFE_UPDATE_GAIN_FORCE BIT(6)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x3 */
|
||||
+/* TrFreeze */
|
||||
+#define TR_FREEZE_MASK GENMASK(11, 0)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x6 */
|
||||
+/* SS: Steady-state, KP: Proportional Gain */
|
||||
+/* SSTrKp100 */
|
||||
+#define SS_TR_KP100_MASK GENMASK(21, 19)
|
||||
+/* SSTrKf100 */
|
||||
+#define SS_TR_KF100_MASK GENMASK(18, 16)
|
||||
+/* SSTrKp1000Mas */
|
||||
+#define SS_TR_KP1000_MASTER_MASK GENMASK(15, 13)
|
||||
+/* SSTrKf1000Mas */
|
||||
+#define SS_TR_KF1000_MASTER_MASK GENMASK(12, 10)
|
||||
+/* SSTrKp1000Slv */
|
||||
+#define SS_TR_KP1000_SLAVE_MASK GENMASK(9, 7)
|
||||
+/* SSTrKf1000Slv */
|
||||
+#define SS_TR_KF1000_SLAVE_MASK GENMASK(6, 4)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x8 */
|
||||
+/* clear this bit if wanna select from AFE */
|
||||
+/* Regsigdet_sel_1000 */
|
||||
+#define EEE1000_SELECT_SIGNAL_DETECTION_FROM_DFE BIT(4)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0xd */
|
||||
+/* RegEEE_st2TrKf1000 */
|
||||
+#define EEE1000_STAGE2_TR_KF_MASK GENMASK(13, 11)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0xf */
|
||||
+/* RegEEE_slv_waketr_timer_tar */
|
||||
+#define SLAVE_WAKETR_TIMER_MASK GENMASK(20, 11)
|
||||
+/* RegEEE_slv_remtx_timer_tar */
|
||||
+#define SLAVE_REMTX_TIMER_MASK GENMASK(10, 1)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x10 */
|
||||
+/* RegEEE_slv_wake_int_timer_tar */
|
||||
+#define SLAVE_WAKEINT_TIMER_MASK GENMASK(10, 1)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x14 */
|
||||
+/* RegEEE_trfreeze_timer2 */
|
||||
+#define TR_FREEZE_TIMER2_MASK GENMASK(9, 0)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x1c */
|
||||
+/* RegEEE100Stg1_tar */
|
||||
+#define EEE100_LPSYNC_STAGE1_UPDATE_TIMER_MASK GENMASK(8, 0)
|
||||
+
|
||||
+/* ch_addr = 0x2, node_addr = 0xd, data_addr = 0x25 */
|
||||
+/* REGEEE_wake_slv_tr_wait_dfesigdet_en */
|
||||
+#define WAKE_SLAVE_TR_WAIT_DFE_DETECTION_EN BIT(11)
|
||||
+
|
||||
|
||||
#define ANALOG_INTERNAL_OPERATION_MAX_US 20
|
||||
#define TXRESERVE_MIN 0
|
||||
@@ -679,40 +780,36 @@ restore:
|
||||
static void mt798x_phy_common_finetune(struct phy_device *phydev)
|
||||
{
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
- /* SlvDSPreadyTime = 24, MasDSPreadyTime = 24 */
|
||||
- __phy_write(phydev, 0x11, 0xc71);
|
||||
- __phy_write(phydev, 0x12, 0xc);
|
||||
- __phy_write(phydev, 0x10, 0x8fae);
|
||||
-
|
||||
- /* EnabRandUpdTrig = 1 */
|
||||
- __phy_write(phydev, 0x11, 0x2f00);
|
||||
- __phy_write(phydev, 0x12, 0xe);
|
||||
- __phy_write(phydev, 0x10, 0x8fb0);
|
||||
-
|
||||
- /* NormMseLoThresh = 85 */
|
||||
- __phy_write(phydev, 0x11, 0x55a0);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x83aa);
|
||||
-
|
||||
- /* FfeUpdGainForce = 1(Enable), FfeUpdGainForceVal = 4 */
|
||||
- __phy_write(phydev, 0x11, 0x240);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x9680);
|
||||
-
|
||||
- /* TrFreeze = 0 (mt7988 default) */
|
||||
- __phy_write(phydev, 0x11, 0x0);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x9686);
|
||||
-
|
||||
- /* SSTrKp100 = 5 */
|
||||
- /* SSTrKf100 = 6 */
|
||||
- /* SSTrKp1000Mas = 5 */
|
||||
- /* SSTrKf1000Mas = 6 */
|
||||
- /* SSTrKp1000Slv = 5 */
|
||||
- /* SSTrKf1000Slv = 6 */
|
||||
- __phy_write(phydev, 0x11, 0xbaef);
|
||||
- __phy_write(phydev, 0x12, 0x2e);
|
||||
- __phy_write(phydev, 0x10, 0x968c);
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x17,
|
||||
+ SLAVE_DSP_READY_TIME_MASK | MASTER_DSP_READY_TIME_MASK,
|
||||
+ FIELD_PREP(SLAVE_DSP_READY_TIME_MASK, 0x18) |
|
||||
+ FIELD_PREP(MASTER_DSP_READY_TIME_MASK, 0x18));
|
||||
+
|
||||
+ __mtk_tr_set_bits(phydev, 0x1, 0xf, 0x18,
|
||||
+ ENABLE_RANDOM_UPDOWN_COUNTER_TRIGGER);
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x0, 0x7, 0x15,
|
||||
+ NORMAL_MSE_LO_THRESH_MASK,
|
||||
+ FIELD_PREP(NORMAL_MSE_LO_THRESH_MASK, 0x55));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0x0,
|
||||
+ FFE_UPDATE_GAIN_FORCE_VAL_MASK,
|
||||
+ FIELD_PREP(FFE_UPDATE_GAIN_FORCE_VAL_MASK, 0x4) |
|
||||
+ FFE_UPDATE_GAIN_FORCE);
|
||||
+
|
||||
+ __mtk_tr_clr_bits(phydev, 0x2, 0xd, 0x3, TR_FREEZE_MASK);
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0x6,
|
||||
+ SS_TR_KP100_MASK | SS_TR_KF100_MASK |
|
||||
+ SS_TR_KP1000_MASTER_MASK | SS_TR_KF1000_MASTER_MASK |
|
||||
+ SS_TR_KP1000_SLAVE_MASK | SS_TR_KF1000_SLAVE_MASK,
|
||||
+ FIELD_PREP(SS_TR_KP100_MASK, 0x5) |
|
||||
+ FIELD_PREP(SS_TR_KF100_MASK, 0x6) |
|
||||
+ FIELD_PREP(SS_TR_KP1000_MASTER_MASK, 0x5) |
|
||||
+ FIELD_PREP(SS_TR_KF1000_MASTER_MASK, 0x6) |
|
||||
+ FIELD_PREP(SS_TR_KP1000_SLAVE_MASK, 0x5) |
|
||||
+ FIELD_PREP(SS_TR_KF1000_SLAVE_MASK, 0x6));
|
||||
+
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
}
|
||||
|
||||
@@ -735,27 +832,29 @@ static void mt7981_phy_finetune(struct p
|
||||
}
|
||||
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
- /* ResetSyncOffset = 6 */
|
||||
- __phy_write(phydev, 0x11, 0x600);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x8fc0);
|
||||
-
|
||||
- /* VgaDecRate = 1 */
|
||||
- __phy_write(phydev, 0x11, 0x4c2a);
|
||||
- __phy_write(phydev, 0x12, 0x3e);
|
||||
- __phy_write(phydev, 0x10, 0x8fa4);
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x20,
|
||||
+ RESET_SYNC_OFFSET_MASK,
|
||||
+ FIELD_PREP(RESET_SYNC_OFFSET_MASK, 0x6));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x12,
|
||||
+ VGA_DECIMATION_RATE_MASK,
|
||||
+ FIELD_PREP(VGA_DECIMATION_RATE_MASK, 0x1));
|
||||
|
||||
/* MrvlTrFix100Kp = 3, MrvlTrFix100Kf = 2,
|
||||
* MrvlTrFix1000Kp = 3, MrvlTrFix1000Kf = 2
|
||||
*/
|
||||
- __phy_write(phydev, 0x11, 0xd10a);
|
||||
- __phy_write(phydev, 0x12, 0x34);
|
||||
- __phy_write(phydev, 0x10, 0x8f82);
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x1,
|
||||
+ MRVL_TR_FIX_100KP_MASK | MRVL_TR_FIX_100KF_MASK |
|
||||
+ MRVL_TR_FIX_1000KP_MASK | MRVL_TR_FIX_1000KF_MASK,
|
||||
+ FIELD_PREP(MRVL_TR_FIX_100KP_MASK, 0x3) |
|
||||
+ FIELD_PREP(MRVL_TR_FIX_100KF_MASK, 0x2) |
|
||||
+ FIELD_PREP(MRVL_TR_FIX_1000KP_MASK, 0x3) |
|
||||
+ FIELD_PREP(MRVL_TR_FIX_1000KF_MASK, 0x2));
|
||||
|
||||
/* VcoSlicerThreshBitsHigh */
|
||||
- __phy_write(phydev, 0x11, 0x5555);
|
||||
- __phy_write(phydev, 0x12, 0x55);
|
||||
- __phy_write(phydev, 0x10, 0x8ec0);
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xd, 0x20,
|
||||
+ VCO_SLICER_THRESH_HIGH_MASK,
|
||||
+ FIELD_PREP(VCO_SLICER_THRESH_HIGH_MASK, 0x555555));
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
|
||||
/* TR_OPEN_LOOP_EN = 1, lpf_x_average = 9 */
|
||||
@@ -807,25 +906,23 @@ static void mt7988_phy_finetune(struct p
|
||||
phy_write_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_RG_TX_FILTER, 0x5);
|
||||
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
- /* ResetSyncOffset = 5 */
|
||||
- __phy_write(phydev, 0x11, 0x500);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x8fc0);
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x20,
|
||||
+ RESET_SYNC_OFFSET_MASK,
|
||||
+ FIELD_PREP(RESET_SYNC_OFFSET_MASK, 0x5));
|
||||
|
||||
/* VgaDecRate is 1 at default on mt7988 */
|
||||
|
||||
- /* MrvlTrFix100Kp = 6, MrvlTrFix100Kf = 7,
|
||||
- * MrvlTrFix1000Kp = 6, MrvlTrFix1000Kf = 7
|
||||
- */
|
||||
- __phy_write(phydev, 0x11, 0xb90a);
|
||||
- __phy_write(phydev, 0x12, 0x6f);
|
||||
- __phy_write(phydev, 0x10, 0x8f82);
|
||||
-
|
||||
- /* RemAckCntLimitCtrl = 1 */
|
||||
- __phy_write(phydev, 0x11, 0xfbba);
|
||||
- __phy_write(phydev, 0x12, 0xc3);
|
||||
- __phy_write(phydev, 0x10, 0x87f8);
|
||||
-
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x1,
|
||||
+ MRVL_TR_FIX_100KP_MASK | MRVL_TR_FIX_100KF_MASK |
|
||||
+ MRVL_TR_FIX_1000KP_MASK | MRVL_TR_FIX_1000KF_MASK,
|
||||
+ FIELD_PREP(MRVL_TR_FIX_100KP_MASK, 0x6) |
|
||||
+ FIELD_PREP(MRVL_TR_FIX_100KF_MASK, 0x7) |
|
||||
+ FIELD_PREP(MRVL_TR_FIX_1000KP_MASK, 0x6) |
|
||||
+ FIELD_PREP(MRVL_TR_FIX_1000KF_MASK, 0x7));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x0, 0xf, 0x3c,
|
||||
+ REMOTE_ACK_COUNT_LIMIT_CTRL_MASK,
|
||||
+ FIELD_PREP(REMOTE_ACK_COUNT_LIMIT_CTRL_MASK, 0x1));
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
|
||||
/* TR_OPEN_LOOP_EN = 1, lpf_x_average = 10 */
|
||||
@@ -901,45 +998,37 @@ static void mt798x_phy_eee(struct phy_de
|
||||
MTK_PHY_TR_READY_SKIP_AFE_WAKEUP);
|
||||
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
- /* Regsigdet_sel_1000 = 0 */
|
||||
- __phy_write(phydev, 0x11, 0xb);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x9690);
|
||||
-
|
||||
- /* REG_EEE_st2TrKf1000 = 2 */
|
||||
- __phy_write(phydev, 0x11, 0x114f);
|
||||
- __phy_write(phydev, 0x12, 0x2);
|
||||
- __phy_write(phydev, 0x10, 0x969a);
|
||||
-
|
||||
- /* RegEEE_slv_wake_tr_timer_tar = 6, RegEEE_slv_remtx_timer_tar = 20 */
|
||||
- __phy_write(phydev, 0x11, 0x3028);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x969e);
|
||||
-
|
||||
- /* RegEEE_slv_wake_int_timer_tar = 8 */
|
||||
- __phy_write(phydev, 0x11, 0x5010);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x96a0);
|
||||
-
|
||||
- /* RegEEE_trfreeze_timer2 = 586 */
|
||||
- __phy_write(phydev, 0x11, 0x24a);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x96a8);
|
||||
-
|
||||
- /* RegEEE100Stg1_tar = 16 */
|
||||
- __phy_write(phydev, 0x11, 0x3210);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x96b8);
|
||||
-
|
||||
- /* REGEEE_wake_slv_tr_wait_dfesigdet_en = 0 */
|
||||
- __phy_write(phydev, 0x11, 0x1463);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x96ca);
|
||||
-
|
||||
- /* DfeTailEnableVgaThresh1000 = 27 */
|
||||
- __phy_write(phydev, 0x11, 0x36);
|
||||
- __phy_write(phydev, 0x12, 0x0);
|
||||
- __phy_write(phydev, 0x10, 0x8f80);
|
||||
+ __mtk_tr_clr_bits(phydev, 0x2, 0xd, 0x8,
|
||||
+ EEE1000_SELECT_SIGNAL_DETECTION_FROM_DFE);
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0xd,
|
||||
+ EEE1000_STAGE2_TR_KF_MASK,
|
||||
+ FIELD_PREP(EEE1000_STAGE2_TR_KF_MASK, 0x2));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0xf,
|
||||
+ SLAVE_WAKETR_TIMER_MASK | SLAVE_REMTX_TIMER_MASK,
|
||||
+ FIELD_PREP(SLAVE_WAKETR_TIMER_MASK, 0x6) |
|
||||
+ FIELD_PREP(SLAVE_REMTX_TIMER_MASK, 0x14));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0x10,
|
||||
+ SLAVE_WAKEINT_TIMER_MASK,
|
||||
+ FIELD_PREP(SLAVE_WAKEINT_TIMER_MASK, 0x8));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0x14,
|
||||
+ TR_FREEZE_TIMER2_MASK,
|
||||
+ FIELD_PREP(TR_FREEZE_TIMER2_MASK, 0x24a));
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x2, 0xd, 0x1c,
|
||||
+ EEE100_LPSYNC_STAGE1_UPDATE_TIMER_MASK,
|
||||
+ FIELD_PREP(EEE100_LPSYNC_STAGE1_UPDATE_TIMER_MASK,
|
||||
+ 0x10));
|
||||
+
|
||||
+ __mtk_tr_clr_bits(phydev, 0x2, 0xd, 0x25,
|
||||
+ WAKE_SLAVE_TR_WAIT_DFE_DETECTION_EN);
|
||||
+
|
||||
+ __mtk_tr_modify(phydev, 0x1, 0xf, 0x0,
|
||||
+ DFE_TAIL_EANBLE_VGA_TRHESH_1000,
|
||||
+ FIELD_PREP(DFE_TAIL_EANBLE_VGA_TRHESH_1000, 0x1b));
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_3);
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -9,13 +9,35 @@
|
||||
#define MTK_GPHY_ID_MT7530 0x03a29412
|
||||
#define MTK_GPHY_ID_MT7531 0x03a29441
|
||||
|
||||
-#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
-#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
-#define MTK_PHY_PAGE_EXTENDED 0x0001
|
||||
-#define MTK_PHY_PAGE_EXTENDED_2 0x0002
|
||||
-#define MTK_PHY_PAGE_EXTENDED_3 0x0003
|
||||
-#define MTK_PHY_PAGE_EXTENDED_2A30 0x2a30
|
||||
-#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
+#define MTK_PHY_PAGE_EXTENDED_1 0x0001
|
||||
+#define MTK_PHY_AUX_CTRL_AND_STATUS 0x14
|
||||
+#define MTK_PHY_ENABLE_DOWNSHIFT BIT(4)
|
||||
+
|
||||
+#define MTK_PHY_PAGE_EXTENDED_2 0x0002
|
||||
+#define MTK_PHY_PAGE_EXTENDED_3 0x0003
|
||||
+#define MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG11 0x11
|
||||
+
|
||||
+#define MTK_PHY_PAGE_EXTENDED_2A30 0x2a30
|
||||
+
|
||||
+/* Registers on Token Ring debug nodes */
|
||||
+/* ch_addr = 0x1, node_addr = 0xf, data_addr = 0x17 */
|
||||
+#define SLAVE_DSP_READY_TIME_MASK GENMASK(22, 15)
|
||||
+
|
||||
+/* Registers on MDIO_MMD_VEND1 */
|
||||
+#define MTK_PHY_GBE_MODE_TX_DELAY_SEL 0x13
|
||||
+#define MTK_PHY_TEST_MODE_TX_DELAY_SEL 0x14
|
||||
+#define MTK_TX_DELAY_PAIR_B_MASK GENMASK(10, 8)
|
||||
+#define MTK_TX_DELAY_PAIR_D_MASK GENMASK(2, 0)
|
||||
+
|
||||
+#define MTK_PHY_MCC_CTRL_AND_TX_POWER_CTRL 0xa6
|
||||
+#define MTK_MCC_NEARECHO_OFFSET_MASK GENMASK(15, 8)
|
||||
+
|
||||
+#define MTK_PHY_RXADC_CTRL_RG7 0xc6
|
||||
+#define MTK_PHY_DA_AD_BUF_BIAS_LP_MASK GENMASK(9, 8)
|
||||
+
|
||||
+#define MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG123 0x123
|
||||
+#define MTK_PHY_LPI_NORM_MSE_LO_THRESH100_MASK GENMASK(15, 8)
|
||||
+#define MTK_PHY_LPI_NORM_MSE_HI_THRESH100_MASK GENMASK(7, 0)
|
||||
|
||||
struct mtk_gephy_priv {
|
||||
unsigned long led_state;
|
||||
@@ -27,20 +49,29 @@ static void mtk_gephy_config_init(struct
|
||||
phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0);
|
||||
|
||||
/* Enable HW auto downshift */
|
||||
- phy_modify_paged(phydev, MTK_PHY_PAGE_EXTENDED, 0x14, 0, BIT(4));
|
||||
+ phy_modify_paged(phydev, MTK_PHY_PAGE_EXTENDED_1,
|
||||
+ MTK_PHY_AUX_CTRL_AND_STATUS,
|
||||
+ 0, MTK_PHY_ENABLE_DOWNSHIFT);
|
||||
|
||||
/* Increase SlvDPSready time */
|
||||
- phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
- __phy_write(phydev, 0x10, 0xafae);
|
||||
- __phy_write(phydev, 0x12, 0x2f);
|
||||
- __phy_write(phydev, 0x10, 0x8fae);
|
||||
- phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
+ mtk_tr_modify(phydev, 0x1, 0xf, 0x17, SLAVE_DSP_READY_TIME_MASK,
|
||||
+ FIELD_PREP(SLAVE_DSP_READY_TIME_MASK, 0x5e));
|
||||
|
||||
/* Adjust 100_mse_threshold */
|
||||
- phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x123, 0xffff);
|
||||
-
|
||||
- /* Disable mcc */
|
||||
- phy_write_mmd(phydev, MDIO_MMD_VEND1, 0xa6, 0x300);
|
||||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1,
|
||||
+ MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG123,
|
||||
+ MTK_PHY_LPI_NORM_MSE_LO_THRESH100_MASK |
|
||||
+ MTK_PHY_LPI_NORM_MSE_HI_THRESH100_MASK,
|
||||
+ FIELD_PREP(MTK_PHY_LPI_NORM_MSE_LO_THRESH100_MASK,
|
||||
+ 0xff) |
|
||||
+ FIELD_PREP(MTK_PHY_LPI_NORM_MSE_HI_THRESH100_MASK,
|
||||
+ 0xff));
|
||||
+
|
||||
+ /* If echo time is narrower than 0x3, it will be regarded as noise */
|
||||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1,
|
||||
+ MTK_PHY_MCC_CTRL_AND_TX_POWER_CTRL,
|
||||
+ MTK_MCC_NEARECHO_OFFSET_MASK,
|
||||
+ FIELD_PREP(MTK_MCC_NEARECHO_OFFSET_MASK, 0x3));
|
||||
}
|
||||
|
||||
static int mt7530_phy_config_init(struct phy_device *phydev)
|
||||
@@ -48,7 +79,8 @@ static int mt7530_phy_config_init(struct
|
||||
mtk_gephy_config_init(phydev);
|
||||
|
||||
/* Increase post_update_timer */
|
||||
- phy_write_paged(phydev, MTK_PHY_PAGE_EXTENDED_3, 0x11, 0x4b);
|
||||
+ phy_write_paged(phydev, MTK_PHY_PAGE_EXTENDED_3,
|
||||
+ MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG11, 0x4b);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -89,11 +121,19 @@ static int mt7531_phy_config_init(struct
|
||||
|
||||
/* PHY link down power saving enable */
|
||||
phy_set_bits(phydev, 0x17, BIT(4));
|
||||
- phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, 0xc6, 0x300);
|
||||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_RXADC_CTRL_RG7,
|
||||
+ MTK_PHY_DA_AD_BUF_BIAS_LP_MASK,
|
||||
+ FIELD_PREP(MTK_PHY_DA_AD_BUF_BIAS_LP_MASK, 0x3));
|
||||
|
||||
/* Set TX Pair delay selection */
|
||||
- phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x13, 0x404);
|
||||
- phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x14, 0x404);
|
||||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_GBE_MODE_TX_DELAY_SEL,
|
||||
+ MTK_TX_DELAY_PAIR_B_MASK | MTK_TX_DELAY_PAIR_D_MASK,
|
||||
+ FIELD_PREP(MTK_TX_DELAY_PAIR_B_MASK, 0x4) |
|
||||
+ FIELD_PREP(MTK_TX_DELAY_PAIR_D_MASK, 0x4));
|
||||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_TEST_MODE_TX_DELAY_SEL,
|
||||
+ MTK_TX_DELAY_PAIR_B_MASK | MTK_TX_DELAY_PAIR_D_MASK,
|
||||
+ FIELD_PREP(MTK_TX_DELAY_PAIR_B_MASK, 0x4) |
|
||||
+ FIELD_PREP(MTK_TX_DELAY_PAIR_D_MASK, 0x4));
|
||||
|
||||
/* LED Config*/
|
||||
mt7530_led_config_of(phydev);
|
||||
--- a/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
@@ -6,6 +6,97 @@
|
||||
|
||||
#include "mtk.h"
|
||||
|
||||
+/* Difference between functions with mtk_tr* and __mtk_tr* prefixes is
|
||||
+ * mtk_tr* functions: wrapped by page switching operations
|
||||
+ * __mtk_tr* functions: no page switching operations
|
||||
+ */
|
||||
+
|
||||
+static void __mtk_tr_access(struct phy_device *phydev, bool read, u8 ch_addr,
|
||||
+ u8 node_addr, u8 data_addr)
|
||||
+{
|
||||
+ u16 tr_cmd = BIT(15); /* bit 14 & 0 are reserved */
|
||||
+
|
||||
+ if (read)
|
||||
+ tr_cmd |= BIT(13);
|
||||
+
|
||||
+ tr_cmd |= (((ch_addr & 0x3) << 11) |
|
||||
+ ((node_addr & 0xf) << 7) |
|
||||
+ ((data_addr & 0x3f) << 1));
|
||||
+ dev_dbg(&phydev->mdio.dev, "tr_cmd: 0x%x\n", tr_cmd);
|
||||
+ __phy_write(phydev, 0x10, tr_cmd);
|
||||
+}
|
||||
+
|
||||
+static void __mtk_tr_read(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u16 *tr_high, u16 *tr_low)
|
||||
+{
|
||||
+ __mtk_tr_access(phydev, true, ch_addr, node_addr, data_addr);
|
||||
+ *tr_low = __phy_read(phydev, 0x11);
|
||||
+ *tr_high = __phy_read(phydev, 0x12);
|
||||
+ dev_dbg(&phydev->mdio.dev, "tr_high read: 0x%x, tr_low read: 0x%x\n",
|
||||
+ *tr_high, *tr_low);
|
||||
+}
|
||||
+
|
||||
+u32 mtk_tr_read(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr)
|
||||
+{
|
||||
+ u16 tr_high;
|
||||
+ u16 tr_low;
|
||||
+
|
||||
+ phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
+ __mtk_tr_read(phydev, ch_addr, node_addr, data_addr, &tr_high, &tr_low);
|
||||
+ phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
+
|
||||
+ return (tr_high << 16) | tr_low;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_tr_read);
|
||||
+
|
||||
+static void __mtk_tr_write(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 tr_data)
|
||||
+{
|
||||
+ __phy_write(phydev, 0x11, tr_data & 0xffff);
|
||||
+ __phy_write(phydev, 0x12, tr_data >> 16);
|
||||
+ dev_dbg(&phydev->mdio.dev, "tr_high write: 0x%x, tr_low write: 0x%x\n",
|
||||
+ tr_data >> 16, tr_data & 0xffff);
|
||||
+ __mtk_tr_access(phydev, false, ch_addr, node_addr, data_addr);
|
||||
+}
|
||||
+
|
||||
+void __mtk_tr_modify(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 mask, u32 set)
|
||||
+{
|
||||
+ u32 tr_data;
|
||||
+ u16 tr_high;
|
||||
+ u16 tr_low;
|
||||
+
|
||||
+ __mtk_tr_read(phydev, ch_addr, node_addr, data_addr, &tr_high, &tr_low);
|
||||
+ tr_data = (tr_high << 16) | tr_low;
|
||||
+ tr_data = (tr_data & ~mask) | set;
|
||||
+ __mtk_tr_write(phydev, ch_addr, node_addr, data_addr, tr_data);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(__mtk_tr_modify);
|
||||
+
|
||||
+void mtk_tr_modify(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 mask, u32 set)
|
||||
+{
|
||||
+ phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
+ __mtk_tr_modify(phydev, ch_addr, node_addr, data_addr, mask, set);
|
||||
+ phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_tr_modify);
|
||||
+
|
||||
+void __mtk_tr_set_bits(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 set)
|
||||
+{
|
||||
+ __mtk_tr_modify(phydev, ch_addr, node_addr, data_addr, 0, set);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(__mtk_tr_set_bits);
|
||||
+
|
||||
+void __mtk_tr_clr_bits(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 clr)
|
||||
+{
|
||||
+ __mtk_tr_modify(phydev, ch_addr, node_addr, data_addr, clr, 0);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(__mtk_tr_clr_bits);
|
||||
+
|
||||
int mtk_phy_read_page(struct phy_device *phydev)
|
||||
{
|
||||
return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
|
||||
--- a/drivers/net/phy/mediatek/mtk.h
|
||||
+++ b/drivers/net/phy/mediatek/mtk.h
|
||||
@@ -9,6 +9,8 @@
|
||||
#define _MTK_EPHY_H_
|
||||
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
+#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
+#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
|
||||
/* Registers on MDIO_MMD_VEND2 */
|
||||
#define MTK_PHY_LED0_ON_CTRL 0x24
|
||||
@@ -62,6 +64,17 @@
|
||||
#define MTK_PHY_LED_STATE_FORCE_BLINK 1
|
||||
#define MTK_PHY_LED_STATE_NETDEV 2
|
||||
|
||||
+u32 mtk_tr_read(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr);
|
||||
+void __mtk_tr_modify(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 mask, u32 set);
|
||||
+void mtk_tr_modify(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 mask, u32 set);
|
||||
+void __mtk_tr_set_bits(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 set);
|
||||
+void __mtk_tr_clr_bits(struct phy_device *phydev, u8 ch_addr, u8 node_addr,
|
||||
+ u8 data_addr, u32 clr);
|
||||
+
|
||||
int mtk_phy_read_page(struct phy_device *phydev);
|
||||
int mtk_phy_write_page(struct phy_device *phydev, int page);
|
||||
|
||||
@ -0,0 +1,209 @@
|
||||
From 3c05195fc2c232cd853fc8cebf55310c4605111d Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:14 +0800
|
||||
Subject: [PATCH 10/13] net: phy: mediatek: Extend 1G TX/RX link pulse time
|
||||
|
||||
We observe that some 10G devices' (mostly Marvell's chips inside) 1G
|
||||
training time violates specification, which may last 2230ms and affect
|
||||
later TX/RX link pulse time. This will invalidate MediaTek series
|
||||
gigabit Ethernet PHYs' hardware auto downshift mechanism.
|
||||
|
||||
Without this patch, if someone is trying to use "4-wire" cable to
|
||||
connect above devices, MediaTek' gigabit Ethernet PHYs may fail
|
||||
to downshift to 100Mbps. (If partner 10G devices' downshift mechanism
|
||||
stops at 1G)
|
||||
|
||||
This patch extends our 1G TX/RX link pulse time so that we can still
|
||||
link up with those 10G devices.
|
||||
|
||||
Tested device:
|
||||
- Netgear GS110EMX's 10G port (Marvell 88X3340P)
|
||||
- QNAP QSW-M408-4C
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 2 +
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 5 +-
|
||||
drivers/net/phy/mediatek/mtk-phy-lib.c | 92 ++++++++++++++++++++++++++
|
||||
drivers/net/phy/mediatek/mtk.h | 21 ++++++
|
||||
4 files changed, 116 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -1396,6 +1396,7 @@ static struct phy_driver mtk_socphy_driv
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7981),
|
||||
.name = "MediaTek MT7981 PHY",
|
||||
.config_init = mt798x_phy_config_init,
|
||||
+ .read_status = mtk_gphy_cl22_read_status,
|
||||
.config_intr = genphy_no_config_intr,
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
.probe = mt7981_phy_probe,
|
||||
@@ -1413,6 +1414,7 @@ static struct phy_driver mtk_socphy_driv
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7988),
|
||||
.name = "MediaTek MT7988 PHY",
|
||||
.config_init = mt798x_phy_config_init,
|
||||
+ .read_status = mtk_gphy_cl22_read_status,
|
||||
.config_intr = genphy_no_config_intr,
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
.probe = mt7988_phy_probe,
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -9,10 +9,6 @@
|
||||
#define MTK_GPHY_ID_MT7530 0x03a29412
|
||||
#define MTK_GPHY_ID_MT7531 0x03a29441
|
||||
|
||||
-#define MTK_PHY_PAGE_EXTENDED_1 0x0001
|
||||
-#define MTK_PHY_AUX_CTRL_AND_STATUS 0x14
|
||||
-#define MTK_PHY_ENABLE_DOWNSHIFT BIT(4)
|
||||
-
|
||||
#define MTK_PHY_PAGE_EXTENDED_2 0x0002
|
||||
#define MTK_PHY_PAGE_EXTENDED_3 0x0003
|
||||
#define MTK_PHY_RG_LPI_PCS_DSP_CTRL_REG11 0x11
|
||||
@@ -251,6 +247,7 @@ static struct phy_driver mtk_gephy_drive
|
||||
.name = "MediaTek MT7531 PHY",
|
||||
.probe = mt7531_phy_probe,
|
||||
.config_init = mt7531_phy_config_init,
|
||||
+ .read_status = mtk_gphy_cl22_read_status,
|
||||
/* Interrupts are handled by the switch, not the PHY
|
||||
* itself.
|
||||
*/
|
||||
--- a/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-phy-lib.c
|
||||
@@ -109,6 +109,98 @@ int mtk_phy_write_page(struct phy_device
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_phy_write_page);
|
||||
|
||||
+/* This function deals with the case that 1G AN starts but isn't completed. We
|
||||
+ * set AN_NEW_LP_CNT_LIMIT with different values time after time to let our
|
||||
+ * 1G->100Mbps hardware automatic downshift to fit more partner devices.
|
||||
+ */
|
||||
+static int extend_an_new_lp_cnt_limit(struct phy_device *phydev)
|
||||
+{
|
||||
+ int mmd_read_ret;
|
||||
+ u32 reg_val;
|
||||
+ int timeout;
|
||||
+
|
||||
+ /* According to table 28-9 & Figure 28-18 in IEEE 802.3,
|
||||
+ * link_fail_inhibit_timer of 10/100/1000 Mbps devices ranges from 750
|
||||
+ * to "1000ms". Once MTK_PHY_FINAL_SPEED_1000 is set, it means that we
|
||||
+ * enter "FLP LINK GOOD CHECK" state, link_fail_inhibit_timer starts and
|
||||
+ * this PHY's 1G training starts. If 1G training never starts, we do
|
||||
+ * nothing but leave.
|
||||
+ */
|
||||
+ timeout = read_poll_timeout(mmd_read_ret = phy_read_mmd, reg_val,
|
||||
+ (mmd_read_ret < 0) ||
|
||||
+ reg_val & MTK_PHY_FINAL_SPEED_1000,
|
||||
+ 10000, 1000000, false, phydev,
|
||||
+ MDIO_MMD_VEND1, MTK_PHY_LINK_STATUS_MISC);
|
||||
+ if (mmd_read_ret < 0)
|
||||
+ return mmd_read_ret;
|
||||
+
|
||||
+ if (!timeout) {
|
||||
+ /* Once we found MTK_PHY_FINAL_SPEED_1000 is set, no matter 1G
|
||||
+ * AN is completed or not, we'll set AN_NEW_LP_CNT_LIMIT again
|
||||
+ * and again.
|
||||
+ */
|
||||
+ mtk_tr_modify(phydev, 0x0, 0xf, 0x3c, AN_NEW_LP_CNT_LIMIT_MASK,
|
||||
+ FIELD_PREP(AN_NEW_LP_CNT_LIMIT_MASK, 0xf));
|
||||
+ mdelay(1500);
|
||||
+
|
||||
+ timeout = read_poll_timeout(mtk_tr_read, reg_val,
|
||||
+ (reg_val & AN_STATE_MASK) !=
|
||||
+ (AN_STATE_TX_DISABLE <<
|
||||
+ AN_STATE_SHIFT),
|
||||
+ 10000, 1000000, false, phydev,
|
||||
+ 0x0, 0xf, 0x2);
|
||||
+ if (!timeout) {
|
||||
+ mdelay(625);
|
||||
+ mtk_tr_modify(phydev, 0x0, 0xf, 0x3c,
|
||||
+ AN_NEW_LP_CNT_LIMIT_MASK,
|
||||
+ FIELD_PREP(AN_NEW_LP_CNT_LIMIT_MASK,
|
||||
+ 0x8));
|
||||
+ mdelay(500);
|
||||
+ mtk_tr_modify(phydev, 0x0, 0xf, 0x3c,
|
||||
+ AN_NEW_LP_CNT_LIMIT_MASK,
|
||||
+ FIELD_PREP(AN_NEW_LP_CNT_LIMIT_MASK,
|
||||
+ 0xf));
|
||||
+ } else {
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int mtk_gphy_cl22_read_status(struct phy_device *phydev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = genphy_read_status(phydev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete) {
|
||||
+ ret = phy_read_paged(phydev, MTK_PHY_PAGE_EXTENDED_1,
|
||||
+ MTK_PHY_AUX_CTRL_AND_STATUS);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Once LP_DETECTED is set, it means that"ability_match" in
|
||||
+ * IEEE 802.3 Figure 28-18 is set. This happens after we plug in
|
||||
+ * cable. Also, LP_DETECTED will be cleared after AN complete.
|
||||
+ */
|
||||
+ if (!FIELD_GET(MTK_PHY_LP_DETECTED_MASK, ret))
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = phy_read(phydev, MII_CTRL1000);
|
||||
+ if (ret & (ADVERTISE_1000FULL | ADVERTISE_1000HALF)) {
|
||||
+ ret = extend_an_new_lp_cnt_limit(phydev);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(mtk_gphy_cl22_read_status);
|
||||
+
|
||||
int mtk_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules,
|
||||
unsigned long supported_triggers)
|
||||
--- a/drivers/net/phy/mediatek/mtk.h
|
||||
+++ b/drivers/net/phy/mediatek/mtk.h
|
||||
@@ -10,8 +10,28 @@
|
||||
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
+#define MTK_PHY_PAGE_EXTENDED_1 0x0001
|
||||
+#define MTK_PHY_AUX_CTRL_AND_STATUS 0x14
|
||||
+/* suprv_media_select_RefClk */
|
||||
+#define MTK_PHY_LP_DETECTED_MASK GENMASK(7, 6)
|
||||
+#define MTK_PHY_ENABLE_DOWNSHIFT BIT(4)
|
||||
+
|
||||
#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
|
||||
+/* Registers on Token Ring debug nodes */
|
||||
+/* ch_addr = 0x0, node_addr = 0xf, data_addr = 0x2 */
|
||||
+#define AN_STATE_MASK GENMASK(22, 19)
|
||||
+#define AN_STATE_SHIFT 19
|
||||
+#define AN_STATE_TX_DISABLE 1
|
||||
+
|
||||
+/* ch_addr = 0x0, node_addr = 0xf, data_addr = 0x3c */
|
||||
+#define AN_NEW_LP_CNT_LIMIT_MASK GENMASK(23, 20)
|
||||
+#define AUTO_NP_10XEN BIT(6)
|
||||
+
|
||||
+/* Registers on MDIO_MMD_VEND1 */
|
||||
+#define MTK_PHY_LINK_STATUS_MISC (0xa2)
|
||||
+#define MTK_PHY_FINAL_SPEED_1000 BIT(3)
|
||||
+
|
||||
/* Registers on MDIO_MMD_VEND2 */
|
||||
#define MTK_PHY_LED0_ON_CTRL 0x24
|
||||
#define MTK_PHY_LED1_ON_CTRL 0x26
|
||||
@@ -78,6 +98,7 @@ void __mtk_tr_clr_bits(struct phy_device
|
||||
int mtk_phy_read_page(struct phy_device *phydev);
|
||||
int mtk_phy_write_page(struct phy_device *phydev, int page);
|
||||
|
||||
+int mtk_gphy_cl22_read_status(struct phy_device *phydev);
|
||||
int mtk_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules,
|
||||
unsigned long supported_triggers);
|
||||
@ -0,0 +1,477 @@
|
||||
From 69ca89165e39e6b6f4c79e6b4c03559e0fac7051 Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:15 +0800
|
||||
Subject: [PATCH 11/13] net: phy: add driver for built-in 2.5G ethernet PHY on
|
||||
MT7988
|
||||
|
||||
Add support for internal 2.5Gphy on MT7988. This driver will load
|
||||
necessary firmware, add appropriate time delay and figure out LED.
|
||||
Also, certain control registers will be set to fix link-up issues.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/Kconfig | 11 +
|
||||
drivers/net/phy/mediatek/Makefile | 1 +
|
||||
drivers/net/phy/mediatek/mtk-2p5ge.c | 432 +++++++++++++++++++++++++++
|
||||
4 files changed, 445 insertions(+)
|
||||
create mode 100644 drivers/net/phy/mediatek/mtk-2p5ge.c
|
||||
|
||||
--- a/drivers/net/phy/mediatek/Kconfig
|
||||
+++ b/drivers/net/phy/mediatek/Kconfig
|
||||
@@ -25,3 +25,14 @@ config MEDIATEK_GE_SOC_PHY
|
||||
the MT7981 and MT7988 SoCs. These PHYs need calibration data
|
||||
present in the SoCs efuse and will dynamically calibrate VCM
|
||||
(common-mode voltage) during startup.
|
||||
+
|
||||
+config MEDIATEK_2P5GE_PHY
|
||||
+ tristate "MediaTek 2.5Gb Ethernet PHYs"
|
||||
+ depends on (ARM64 && ARCH_MEDIATEK) || COMPILE_TEST
|
||||
+ select MTK_NET_PHYLIB
|
||||
+ help
|
||||
+ Supports MediaTek SoC built-in 2.5Gb Ethernet PHYs.
|
||||
+
|
||||
+ This will load necessary firmware and add appropriate time delay.
|
||||
+ Accelerate this procedure through internal pbus instead of MDIO
|
||||
+ bus. Certain link-up issues will also be fixed here.
|
||||
--- a/drivers/net/phy/mediatek/Makefile
|
||||
+++ b/drivers/net/phy/mediatek/Makefile
|
||||
@@ -2,3 +2,4 @@
|
||||
obj-$(CONFIG_MTK_NET_PHYLIB) += mtk-phy-lib.o
|
||||
obj-$(CONFIG_MEDIATEK_GE_PHY) += mtk-ge.o
|
||||
obj-$(CONFIG_MEDIATEK_GE_SOC_PHY) += mtk-ge-soc.o
|
||||
+obj-$(CONFIG_MEDIATEK_2P5GE_PHY) += mtk-2p5ge.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/phy/mediatek/mtk-2p5ge.c
|
||||
@@ -0,0 +1,432 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+#include <linux/bitfield.h>
|
||||
+#include <linux/firmware.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/nvmem-consumer.h>
|
||||
+#include <linux/of_address.h>
|
||||
+#include <linux/of_platform.h>
|
||||
+#include <linux/pinctrl/consumer.h>
|
||||
+#include <linux/phy.h>
|
||||
+#include <linux/pm_domain.h>
|
||||
+#include <linux/pm_runtime.h>
|
||||
+
|
||||
+#include "mtk.h"
|
||||
+
|
||||
+#define MTK_2P5GPHY_ID_MT7988 (0x00339c11)
|
||||
+
|
||||
+#define MT7988_2P5GE_PMB_FW "mediatek/mt7988/i2p5ge-phy-pmb.bin"
|
||||
+#define MT7988_2P5GE_PMB_FW_SIZE (0x20000)
|
||||
+#define MT7988_2P5GE_PMB_FW_BASE (0x0f100000)
|
||||
+#define MT7988_2P5GE_PMB_FW_LEN (0x20000)
|
||||
+#define MT7988_2P5GE_MD32_EN_CFG_BASE (0x0f0f0018)
|
||||
+#define MT7988_2P5GE_MD32_EN_CFG_LEN (0x20)
|
||||
+#define MD32_EN BIT(0)
|
||||
+
|
||||
+#define BASE100T_STATUS_EXTEND (0x10)
|
||||
+#define BASE1000T_STATUS_EXTEND (0x11)
|
||||
+#define EXTEND_CTRL_AND_STATUS (0x16)
|
||||
+
|
||||
+#define PHY_AUX_CTRL_STATUS (0x1d)
|
||||
+#define PHY_AUX_DPX_MASK GENMASK(5, 5)
|
||||
+#define PHY_AUX_SPEED_MASK GENMASK(4, 2)
|
||||
+
|
||||
+#define MTK_PHY_LPI_PCS_DSP_CTRL (0x121)
|
||||
+#define MTK_PHY_LPI_SIG_EN_LO_THRESH100_MASK GENMASK(12, 8)
|
||||
+
|
||||
+/* Registers on Token Ring debug nodes */
|
||||
+/* ch_addr = 0x0, node_addr = 0xf, data_addr = 0x3c */
|
||||
+#define AUTO_NP_10XEN BIT(6)
|
||||
+
|
||||
+struct mtk_i2p5ge_phy_priv {
|
||||
+ bool fw_loaded;
|
||||
+ unsigned long led_state;
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ PHY_AUX_SPD_10 = 0,
|
||||
+ PHY_AUX_SPD_100,
|
||||
+ PHY_AUX_SPD_1000,
|
||||
+ PHY_AUX_SPD_2500,
|
||||
+};
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_load_fw(struct phy_device *phydev)
|
||||
+{
|
||||
+ struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
+ void __iomem *md32_en_cfg_base, *pmb_addr;
|
||||
+ struct device *dev = &phydev->mdio.dev;
|
||||
+ const struct firmware *fw;
|
||||
+ int ret, i;
|
||||
+ u16 reg;
|
||||
+
|
||||
+ if (priv->fw_loaded)
|
||||
+ return 0;
|
||||
+
|
||||
+ pmb_addr = ioremap(MT7988_2P5GE_PMB_FW_BASE, MT7988_2P5GE_PMB_FW_LEN);
|
||||
+ if (!pmb_addr)
|
||||
+ return -ENOMEM;
|
||||
+ md32_en_cfg_base = ioremap(MT7988_2P5GE_MD32_EN_CFG_BASE,
|
||||
+ MT7988_2P5GE_MD32_EN_CFG_LEN);
|
||||
+ if (!md32_en_cfg_base) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto free_pmb;
|
||||
+ }
|
||||
+
|
||||
+ ret = request_firmware(&fw, MT7988_2P5GE_PMB_FW, dev);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "failed to load firmware: %s, ret: %d\n",
|
||||
+ MT7988_2P5GE_PMB_FW, ret);
|
||||
+ goto free;
|
||||
+ }
|
||||
+
|
||||
+ if (fw->size != MT7988_2P5GE_PMB_FW_SIZE) {
|
||||
+ dev_err(dev, "Firmware size 0x%zx != 0x%x\n",
|
||||
+ fw->size, MT7988_2P5GE_PMB_FW_SIZE);
|
||||
+ ret = -EINVAL;
|
||||
+ goto release_fw;
|
||||
+ }
|
||||
+
|
||||
+ reg = readw(md32_en_cfg_base);
|
||||
+ if (reg & MD32_EN) {
|
||||
+ phy_set_bits(phydev, MII_BMCR, BMCR_RESET);
|
||||
+ usleep_range(10000, 11000);
|
||||
+ }
|
||||
+ phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN);
|
||||
+
|
||||
+ /* Write magic number to safely stall MCU */
|
||||
+ phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x800e, 0x1100);
|
||||
+ phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x800f, 0x00df);
|
||||
+
|
||||
+ for (i = 0; i < MT7988_2P5GE_PMB_FW_SIZE - 1; i += 4)
|
||||
+ writel(*((uint32_t *)(fw->data + i)), pmb_addr + i);
|
||||
+ dev_info(dev, "Firmware date code: %x/%x/%x, version: %x.%x\n",
|
||||
+ be16_to_cpu(*((__be16 *)(fw->data +
|
||||
+ MT7988_2P5GE_PMB_FW_SIZE - 8))),
|
||||
+ *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 6),
|
||||
+ *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 5),
|
||||
+ *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 2),
|
||||
+ *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 1));
|
||||
+
|
||||
+ writew(reg & ~MD32_EN, md32_en_cfg_base);
|
||||
+ writew(reg | MD32_EN, md32_en_cfg_base);
|
||||
+ phy_set_bits(phydev, MII_BMCR, BMCR_RESET);
|
||||
+ /* We need a delay here to stabilize initialization of MCU */
|
||||
+ usleep_range(7000, 8000);
|
||||
+ dev_info(dev, "Firmware loading/trigger ok.\n");
|
||||
+
|
||||
+ priv->fw_loaded = true;
|
||||
+
|
||||
+release_fw:
|
||||
+ release_firmware(fw);
|
||||
+free:
|
||||
+ iounmap(md32_en_cfg_base);
|
||||
+free_pmb:
|
||||
+ iounmap(pmb_addr);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_config_init(struct phy_device *phydev)
|
||||
+{
|
||||
+ struct pinctrl *pinctrl;
|
||||
+ int ret;
|
||||
+
|
||||
+ /* Check if PHY interface type is compatible */
|
||||
+ if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ ret = mt798x_2p5ge_phy_load_fw(phydev);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Setup LED */
|
||||
+ phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED0_ON_CTRL,
|
||||
+ MTK_PHY_LED_ON_POLARITY | MTK_PHY_LED_ON_LINK10 |
|
||||
+ MTK_PHY_LED_ON_LINK100 | MTK_PHY_LED_ON_LINK1000 |
|
||||
+ MTK_PHY_LED_ON_LINK2500);
|
||||
+ phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED1_ON_CTRL,
|
||||
+ MTK_PHY_LED_ON_FDX | MTK_PHY_LED_ON_HDX);
|
||||
+
|
||||
+ /* Switch pinctrl after setting polarity to avoid bogus blinking */
|
||||
+ pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "i2p5gbe-led");
|
||||
+ if (IS_ERR(pinctrl))
|
||||
+ dev_err(&phydev->mdio.dev, "Fail to set LED pins!\n");
|
||||
+
|
||||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_LPI_PCS_DSP_CTRL,
|
||||
+ MTK_PHY_LPI_SIG_EN_LO_THRESH100_MASK, 0);
|
||||
+
|
||||
+ /* Enable 16-bit next page exchange bit if 1000-BT isn't advertising */
|
||||
+ mtk_tr_modify(phydev, 0x0, 0xf, 0x3c, AUTO_NP_10XEN,
|
||||
+ FIELD_PREP(AUTO_NP_10XEN, 0x1));
|
||||
+
|
||||
+ /* Enable HW auto downshift */
|
||||
+ phy_modify_paged(phydev, MTK_PHY_PAGE_EXTENDED_1,
|
||||
+ MTK_PHY_AUX_CTRL_AND_STATUS,
|
||||
+ 0, MTK_PHY_ENABLE_DOWNSHIFT);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_config_aneg(struct phy_device *phydev)
|
||||
+{
|
||||
+ bool changed = false;
|
||||
+ u32 adv;
|
||||
+ int ret;
|
||||
+
|
||||
+ /* In fact, if we disable autoneg, we can't link up correctly:
|
||||
+ * 2.5G/1G: Need AN to exchange master/slave information.
|
||||
+ * 100M/10M: Without AN, link starts at half duplex (According to
|
||||
+ * IEEE 802.3-2018), which this phy doesn't support.
|
||||
+ */
|
||||
+ if (phydev->autoneg == AUTONEG_DISABLE)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ ret = genphy_c45_an_config_aneg(phydev);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (ret > 0)
|
||||
+ changed = true;
|
||||
+
|
||||
+ /* Clause 45 doesn't define 1000BaseT support. Use Clause 22 instead in
|
||||
+ * our design.
|
||||
+ */
|
||||
+ adv = linkmode_adv_to_mii_ctrl1000_t(phydev->advertising);
|
||||
+ ret = phy_modify_changed(phydev, MII_CTRL1000, ADVERTISE_1000FULL, adv);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (ret > 0)
|
||||
+ changed = true;
|
||||
+
|
||||
+ return genphy_c45_check_and_restart_aneg(phydev, changed);
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_get_features(struct phy_device *phydev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = genphy_c45_pma_read_abilities(phydev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* This phy can't handle collision, and neither can (XFI)MAC it's
|
||||
+ * connected to. Although it can do HDX handshake, it doesn't support
|
||||
+ * CSMA/CD that HDX requires.
|
||||
+ */
|
||||
+ linkmode_clear_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT,
|
||||
+ phydev->supported);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_read_status(struct phy_device *phydev)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ /* When MDIO_STAT1_LSTATUS is raised genphy_c45_read_link(), this phy
|
||||
+ * actually hasn't finished AN. So use CL22's link update function
|
||||
+ * instead.
|
||||
+ */
|
||||
+ ret = genphy_update_link(phydev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ phydev->speed = SPEED_UNKNOWN;
|
||||
+ phydev->duplex = DUPLEX_UNKNOWN;
|
||||
+ phydev->pause = 0;
|
||||
+ phydev->asym_pause = 0;
|
||||
+
|
||||
+ /* We'll read link speed through vendor specific registers down below.
|
||||
+ * So remove phy_resolve_aneg_linkmode (AN on) & genphy_c45_read_pma
|
||||
+ * (AN off).
|
||||
+ */
|
||||
+ if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
|
||||
+ ret = genphy_c45_read_lpa(phydev);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Clause 45 doesn't define 1000BaseT support. Read the link
|
||||
+ * partner's 1G advertisement via Clause 22.
|
||||
+ */
|
||||
+ ret = phy_read(phydev, MII_STAT1000);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, ret);
|
||||
+ } else if (phydev->autoneg == AUTONEG_DISABLE) {
|
||||
+ linkmode_zero(phydev->lp_advertising);
|
||||
+ }
|
||||
+
|
||||
+ if (phydev->link) {
|
||||
+ ret = phy_read(phydev, PHY_AUX_CTRL_STATUS);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ switch (FIELD_GET(PHY_AUX_SPEED_MASK, ret)) {
|
||||
+ case PHY_AUX_SPD_10:
|
||||
+ phydev->speed = SPEED_10;
|
||||
+ break;
|
||||
+ case PHY_AUX_SPD_100:
|
||||
+ phydev->speed = SPEED_100;
|
||||
+ break;
|
||||
+ case PHY_AUX_SPD_1000:
|
||||
+ phydev->speed = SPEED_1000;
|
||||
+ break;
|
||||
+ case PHY_AUX_SPD_2500:
|
||||
+ phydev->speed = SPEED_2500;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ phydev->duplex = DUPLEX_FULL;
|
||||
+ /* FIXME:
|
||||
+ * The current firmware always enables rate adaptation mode.
|
||||
+ */
|
||||
+ phydev->rate_matching = RATE_MATCH_PAUSE;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_get_rate_matching(struct phy_device *phydev,
|
||||
+ phy_interface_t iface)
|
||||
+{
|
||||
+ return RATE_MATCH_PAUSE;
|
||||
+}
|
||||
+
|
||||
+static const unsigned long supported_triggers =
|
||||
+ BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_2500) |
|
||||
+ BIT(TRIGGER_NETDEV_RX) |
|
||||
+ BIT(TRIGGER_NETDEV_TX);
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_led_blink_set(struct phy_device *phydev, u8 index,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
+ bool blinking = false;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ err = mtk_phy_led_num_dly_cfg(index, delay_on, delay_off, &blinking);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state,
|
||||
+ blinking);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
|
||||
+ MTK_2P5GPHY_LED_ON_MASK, false);
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_led_brightness_set(struct phy_device *phydev,
|
||||
+ u8 index,
|
||||
+ enum led_brightness value)
|
||||
+{
|
||||
+ struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
+ int err;
|
||||
+
|
||||
+ err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state, false);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
|
||||
+ MTK_2P5GPHY_LED_ON_MASK,
|
||||
+ (value != LED_OFF));
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_led_hw_is_supported(struct phy_device *phydev,
|
||||
+ u8 index, unsigned long rules)
|
||||
+{
|
||||
+ return mtk_phy_led_hw_is_supported(phydev, index, rules,
|
||||
+ supported_triggers);
|
||||
+}
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_led_hw_control_get(struct phy_device *phydev,
|
||||
+ u8 index, unsigned long *rules)
|
||||
+{
|
||||
+ struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
+
|
||||
+ return mtk_phy_led_hw_ctrl_get(phydev, index, rules, &priv->led_state,
|
||||
+ MTK_2P5GPHY_LED_ON_SET,
|
||||
+ MTK_2P5GPHY_LED_RX_BLINK_SET,
|
||||
+ MTK_2P5GPHY_LED_TX_BLINK_SET);
|
||||
+};
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_led_hw_control_set(struct phy_device *phydev,
|
||||
+ u8 index, unsigned long rules)
|
||||
+{
|
||||
+ struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
+
|
||||
+ return mtk_phy_led_hw_ctrl_set(phydev, index, rules, &priv->led_state,
|
||||
+ MTK_2P5GPHY_LED_ON_SET,
|
||||
+ MTK_2P5GPHY_LED_RX_BLINK_SET,
|
||||
+ MTK_2P5GPHY_LED_TX_BLINK_SET);
|
||||
+};
|
||||
+
|
||||
+static int mt798x_2p5ge_phy_probe(struct phy_device *phydev)
|
||||
+{
|
||||
+ struct mtk_i2p5ge_phy_priv *priv;
|
||||
+
|
||||
+ priv = devm_kzalloc(&phydev->mdio.dev,
|
||||
+ sizeof(struct mtk_i2p5ge_phy_priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ switch (phydev->drv->phy_id) {
|
||||
+ case MTK_2P5GPHY_ID_MT7988:
|
||||
+ /* The original hardware only sets MDIO_DEVS_PMAPMD */
|
||||
+ phydev->c45_ids.mmds_present |= MDIO_DEVS_PCS |
|
||||
+ MDIO_DEVS_AN |
|
||||
+ MDIO_DEVS_VEND1 |
|
||||
+ MDIO_DEVS_VEND2;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ priv->fw_loaded = false;
|
||||
+ phydev->priv = priv;
|
||||
+
|
||||
+ mtk_phy_leds_state_init(phydev);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct phy_driver mtk_2p5gephy_driver[] = {
|
||||
+ {
|
||||
+ PHY_ID_MATCH_MODEL(MTK_2P5GPHY_ID_MT7988),
|
||||
+ .name = "MediaTek MT7988 2.5GbE PHY",
|
||||
+ .probe = mt798x_2p5ge_phy_probe,
|
||||
+ .config_init = mt798x_2p5ge_phy_config_init,
|
||||
+ .config_aneg = mt798x_2p5ge_phy_config_aneg,
|
||||
+ .get_features = mt798x_2p5ge_phy_get_features,
|
||||
+ .read_status = mt798x_2p5ge_phy_read_status,
|
||||
+ .get_rate_matching = mt798x_2p5ge_phy_get_rate_matching,
|
||||
+ .suspend = genphy_suspend,
|
||||
+ .resume = genphy_resume,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
+ .led_blink_set = mt798x_2p5ge_phy_led_blink_set,
|
||||
+ .led_brightness_set = mt798x_2p5ge_phy_led_brightness_set,
|
||||
+ .led_hw_is_supported = mt798x_2p5ge_phy_led_hw_is_supported,
|
||||
+ .led_hw_control_get = mt798x_2p5ge_phy_led_hw_control_get,
|
||||
+ .led_hw_control_set = mt798x_2p5ge_phy_led_hw_control_set,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+module_phy_driver(mtk_2p5gephy_driver);
|
||||
+
|
||||
+static struct mdio_device_id __maybe_unused mtk_2p5ge_phy_tbl[] = {
|
||||
+ { PHY_ID_MATCH_VENDOR(0x00339c00) },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
+MODULE_DESCRIPTION("MediaTek 2.5Gb Ethernet PHY driver");
|
||||
+MODULE_AUTHOR("SkyLake Huang <SkyLake.Huang@mediatek.com>");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+MODULE_DEVICE_TABLE(mdio, mtk_2p5ge_phy_tbl);
|
||||
+MODULE_FIRMWARE(MT7988_2P5GE_PMB_FW);
|
||||
@ -0,0 +1,130 @@
|
||||
From 07e90eb1819319a0c34b0cf3a57a4a3878e96e4d Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:16 +0800
|
||||
Subject: [PATCH 12/13] net: phy: mediatek: Fix alignment in callback
|
||||
functions' hook
|
||||
|
||||
Align declarations in mtk_gephy_driver(mtk-ge.c) and
|
||||
mtk_socphy_driver(mtk-ge-soc.c). At first, some of them are
|
||||
".foo<tab>= method_foo", and others are ".bar<space>= method_bar".
|
||||
Use space instead for all of them here in case line is longer than
|
||||
80 chars.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 40 +++++++++++++--------------
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 34 +++++++++++------------
|
||||
2 files changed, 37 insertions(+), 37 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -1394,17 +1394,17 @@ static int mt7981_phy_probe(struct phy_d
|
||||
static struct phy_driver mtk_socphy_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7981),
|
||||
- .name = "MediaTek MT7981 PHY",
|
||||
- .config_init = mt798x_phy_config_init,
|
||||
- .read_status = mtk_gphy_cl22_read_status,
|
||||
- .config_intr = genphy_no_config_intr,
|
||||
+ .name = "MediaTek MT7981 PHY",
|
||||
+ .config_init = mt798x_phy_config_init,
|
||||
+ .read_status = mtk_gphy_cl22_read_status,
|
||||
+ .config_intr = genphy_no_config_intr,
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
- .probe = mt7981_phy_probe,
|
||||
- .suspend = genphy_suspend,
|
||||
- .resume = genphy_resume,
|
||||
- .read_page = mtk_phy_read_page,
|
||||
- .write_page = mtk_phy_write_page,
|
||||
- .led_blink_set = mt798x_phy_led_blink_set,
|
||||
+ .probe = mt7981_phy_probe,
|
||||
+ .suspend = genphy_suspend,
|
||||
+ .resume = genphy_resume,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
+ .led_blink_set = mt798x_phy_led_blink_set,
|
||||
.led_brightness_set = mt798x_phy_led_brightness_set,
|
||||
.led_hw_is_supported = mt798x_phy_led_hw_is_supported,
|
||||
.led_hw_control_set = mt798x_phy_led_hw_control_set,
|
||||
@@ -1412,17 +1412,17 @@ static struct phy_driver mtk_socphy_driv
|
||||
},
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7988),
|
||||
- .name = "MediaTek MT7988 PHY",
|
||||
- .config_init = mt798x_phy_config_init,
|
||||
- .read_status = mtk_gphy_cl22_read_status,
|
||||
- .config_intr = genphy_no_config_intr,
|
||||
+ .name = "MediaTek MT7988 PHY",
|
||||
+ .config_init = mt798x_phy_config_init,
|
||||
+ .read_status = mtk_gphy_cl22_read_status,
|
||||
+ .config_intr = genphy_no_config_intr,
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
- .probe = mt7988_phy_probe,
|
||||
- .suspend = genphy_suspend,
|
||||
- .resume = genphy_resume,
|
||||
- .read_page = mtk_phy_read_page,
|
||||
- .write_page = mtk_phy_write_page,
|
||||
- .led_blink_set = mt798x_phy_led_blink_set,
|
||||
+ .probe = mt7988_phy_probe,
|
||||
+ .suspend = genphy_suspend,
|
||||
+ .resume = genphy_resume,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
+ .led_blink_set = mt798x_phy_led_blink_set,
|
||||
.led_brightness_set = mt798x_phy_led_brightness_set,
|
||||
.led_hw_is_supported = mt798x_phy_led_hw_is_supported,
|
||||
.led_hw_control_set = mt798x_phy_led_hw_control_set,
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -230,34 +230,34 @@ static int mt753x_phy_led_hw_control_set
|
||||
static struct phy_driver mtk_gephy_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7530),
|
||||
- .name = "MediaTek MT7530 PHY",
|
||||
- .config_init = mt7530_phy_config_init,
|
||||
+ .name = "MediaTek MT7530 PHY",
|
||||
+ .config_init = mt7530_phy_config_init,
|
||||
/* Interrupts are handled by the switch, not the PHY
|
||||
* itself.
|
||||
*/
|
||||
- .config_intr = genphy_no_config_intr,
|
||||
+ .config_intr = genphy_no_config_intr,
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
- .suspend = genphy_suspend,
|
||||
- .resume = genphy_resume,
|
||||
- .read_page = mtk_phy_read_page,
|
||||
- .write_page = mtk_phy_write_page,
|
||||
+ .suspend = genphy_suspend,
|
||||
+ .resume = genphy_resume,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
},
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7531),
|
||||
- .name = "MediaTek MT7531 PHY",
|
||||
- .probe = mt7531_phy_probe,
|
||||
- .config_init = mt7531_phy_config_init,
|
||||
- .read_status = mtk_gphy_cl22_read_status,
|
||||
+ .name = "MediaTek MT7531 PHY",
|
||||
+ .probe = mt7531_phy_probe,
|
||||
+ .config_init = mt7531_phy_config_init,
|
||||
+ .read_status = mtk_gphy_cl22_read_status,
|
||||
/* Interrupts are handled by the switch, not the PHY
|
||||
* itself.
|
||||
*/
|
||||
- .config_intr = genphy_no_config_intr,
|
||||
+ .config_intr = genphy_no_config_intr,
|
||||
.handle_interrupt = genphy_handle_interrupt_no_ack,
|
||||
- .suspend = genphy_suspend,
|
||||
- .resume = genphy_resume,
|
||||
- .read_page = mtk_phy_read_page,
|
||||
- .write_page = mtk_phy_write_page,
|
||||
- .led_blink_set = mt753x_phy_led_blink_set,
|
||||
+ .suspend = genphy_suspend,
|
||||
+ .resume = genphy_resume,
|
||||
+ .read_page = mtk_phy_read_page,
|
||||
+ .write_page = mtk_phy_write_page,
|
||||
+ .led_blink_set = mt753x_phy_led_blink_set,
|
||||
.led_brightness_set = mt753x_phy_led_brightness_set,
|
||||
.led_hw_is_supported = mt753x_phy_led_hw_is_supported,
|
||||
.led_hw_control_set = mt753x_phy_led_hw_control_set,
|
||||
@ -0,0 +1,65 @@
|
||||
From e59883b637ae317c2ac275b542e8a50670d76e7c Mon Sep 17 00:00:00 2001
|
||||
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
||||
Date: Mon, 1 Jul 2024 18:54:17 +0800
|
||||
Subject: [PATCH 13/13] net: phy: mediatek: Remove unnecessary outer parens of
|
||||
"supported_triggers" var
|
||||
|
||||
This patch removes unnecessary outer parens of "supported_triggers" vars
|
||||
in mtk-ge.c & mtk-ge-soc.c to improve readability.
|
||||
|
||||
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
||||
---
|
||||
drivers/net/phy/mediatek/mtk-ge-soc.c | 16 ++++++++--------
|
||||
drivers/net/phy/mediatek/mtk-ge.c | 16 ++++++++--------
|
||||
2 files changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
|
||||
@@ -1224,14 +1224,14 @@ static int mt798x_phy_led_brightness_set
|
||||
}
|
||||
|
||||
static const unsigned long supported_triggers =
|
||||
- (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
- BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
- BIT(TRIGGER_NETDEV_LINK) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
- BIT(TRIGGER_NETDEV_RX) |
|
||||
- BIT(TRIGGER_NETDEV_TX));
|
||||
+ BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
+ BIT(TRIGGER_NETDEV_RX) |
|
||||
+ BIT(TRIGGER_NETDEV_TX);
|
||||
|
||||
static int mt798x_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules)
|
||||
--- a/drivers/net/phy/mediatek/mtk-ge.c
|
||||
+++ b/drivers/net/phy/mediatek/mtk-ge.c
|
||||
@@ -189,14 +189,14 @@ static int mt753x_phy_led_brightness_set
|
||||
}
|
||||
|
||||
static const unsigned long supported_triggers =
|
||||
- (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
- BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
- BIT(TRIGGER_NETDEV_LINK) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
- BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
- BIT(TRIGGER_NETDEV_RX) |
|
||||
- BIT(TRIGGER_NETDEV_TX));
|
||||
+ BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_10) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_100) |
|
||||
+ BIT(TRIGGER_NETDEV_LINK_1000) |
|
||||
+ BIT(TRIGGER_NETDEV_RX) |
|
||||
+ BIT(TRIGGER_NETDEV_TX);
|
||||
|
||||
static int mt753x_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
|
||||
unsigned long rules)
|
||||
@ -1,39 +0,0 @@
|
||||
From 128dc09b0af36772062142ce9e85b19c84ac789a Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 28 Feb 2023 17:53:37 +0000
|
||||
Subject: [PATCH] net: phy: add driver for MediaTek 2.5G PHY
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
drivers/net/phy/Kconfig | 7 ++
|
||||
drivers/net/phy/Makefile | 1 +
|
||||
drivers/net/phy/mediatek-2p5ge.c | 220 +++++++++++++++++++++++++++++++
|
||||
3 files changed, 226 insertions(+)
|
||||
create mode 100644 drivers/net/phy/mediatek-2p5ge.c
|
||||
|
||||
--- a/drivers/net/phy/Kconfig
|
||||
+++ b/drivers/net/phy/Kconfig
|
||||
@@ -330,6 +330,13 @@ config MEDIATEK_GE_SOC_PHY
|
||||
present in the SoCs efuse and will dynamically calibrate VCM
|
||||
(common-mode voltage) during startup.
|
||||
|
||||
+config MEDIATEK_2P5G_PHY
|
||||
+ tristate "MediaTek 2.5G Ethernet PHY"
|
||||
+ depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST
|
||||
+ default NET_MEDIATEK_SOC
|
||||
+ help
|
||||
+ Supports the MediaTek 2.5G Ethernet PHY.
|
||||
+
|
||||
config MICREL_PHY
|
||||
tristate "Micrel PHYs"
|
||||
depends on PTP_1588_CLOCK_OPTIONAL
|
||||
--- a/drivers/net/phy/Makefile
|
||||
+++ b/drivers/net/phy/Makefile
|
||||
@@ -82,6 +82,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o
|
||||
obj-$(CONFIG_MARVELL_88Q2XXX_PHY) += marvell-88q2xxx.o
|
||||
obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o
|
||||
obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o
|
||||
+obj-$(CONFIG_MEDIATEK_2P5G_PHY) += mediatek-2p5ge.o
|
||||
obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o
|
||||
obj-$(CONFIG_MEDIATEK_GE_SOC_PHY) += mediatek-ge-soc.o
|
||||
obj-$(CONFIG_MESON_GXL_PHY) += meson-gxl.o
|
||||
@ -37,7 +37,7 @@
|
||||
* CONFIG_CMDLINE is meant to be a default in case nothing else
|
||||
--- a/arch/arm64/Kconfig
|
||||
+++ b/arch/arm64/Kconfig
|
||||
@@ -2269,6 +2269,14 @@ config CMDLINE_FORCE
|
||||
@@ -2307,6 +2307,14 @@ config CMDLINE_FORCE
|
||||
|
||||
endchoice
|
||||
|
||||
|
||||
@ -28,7 +28,6 @@ ocedo,panda)
|
||||
;;
|
||||
tplink,tl-wdr4900-v1)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
||||
ucidef_set_interface_macaddr "wan" "$(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) 1)"
|
||||
;;
|
||||
watchguard,firebox-t10)
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
||||
|
||||
. /lib/functions/caldata.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$FIRMWARE" in
|
||||
"pci_wmac0.eeprom")
|
||||
case $board in
|
||||
tplink,tl-wdr4900-v1)
|
||||
caldata_extract "caldata" 0x1000 0x800
|
||||
ath9k_patch_mac $(mtd_get_mac_binary u-boot 0x4fc00)
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"pci_wmac1.eeprom")
|
||||
case $board in
|
||||
tplink,tl-wdr4900-v1)
|
||||
caldata_extract "caldata" 0x5000 0x800
|
||||
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) -1)
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@ -63,7 +63,9 @@
|
||||
#size-cells = <1>;
|
||||
|
||||
macaddr_uboot_4fc00: macaddr@4fc00 {
|
||||
compatible = "mac-base";
|
||||
reg = <0x4fc00 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -90,6 +92,20 @@
|
||||
reg = <0x00ff0000 0x00010000>;
|
||||
label = "caldata";
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_caldata_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
|
||||
cal_caldata_5000: calibration@5000 {
|
||||
reg = <0x5000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -148,6 +164,9 @@
|
||||
reg = <1>;
|
||||
label = "wan";
|
||||
phy-handle = <&phy_port1>;
|
||||
|
||||
nvmem-cells = <&macaddr_uboot_4fc00 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
port@2 {
|
||||
@ -187,7 +206,7 @@
|
||||
|
||||
enet0: ethernet@b0000 {
|
||||
phy-connection-type = "rgmii-id";
|
||||
nvmem-cells = <&macaddr_uboot_4fc00>;
|
||||
nvmem-cells = <&macaddr_uboot_4fc00 0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
fixed-link {
|
||||
@ -246,6 +265,16 @@
|
||||
0x1000000 0x0 0x0
|
||||
0x1000000 0x0 0x0
|
||||
0x0 0x100000>;
|
||||
|
||||
ath9k: wifi@0,0 {
|
||||
compatible = "pci168c,0033";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
qca,led-pin = /bits/ 8 <0>;
|
||||
nvmem-cells = <&cal_caldata_1000>, <&macaddr_uboot_4fc00 0>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -261,6 +290,22 @@
|
||||
0x1000000 0x0 0x0
|
||||
0x1000000 0x0 0x0
|
||||
0x0 0x100000>;
|
||||
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,0030";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
/*
|
||||
* The PCI header of the AR9381 chip is not programmed
|
||||
* correctly by the bootloader and the device uses wrong
|
||||
* data due to that. Replace the broken values with the
|
||||
* correct ones.
|
||||
*/
|
||||
device-id = <0x0030>;
|
||||
class-code = <0x028000>;
|
||||
qca,led-pin = /bits/ 8 <0>;
|
||||
nvmem-cells = <&cal_caldata_5000>, <&macaddr_uboot_4fc00 (-1)>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -271,6 +316,11 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
wps {
|
||||
gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
|
||||
label = "tp-link:green:wps";
|
||||
};
|
||||
|
||||
system_green: system {
|
||||
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
|
||||
label = "tp-link:blue:system";
|
||||
|
||||
@ -47,60 +47,6 @@ void __init tl_wdr4900_v1_pic_init(void)
|
||||
mpic_init(mpic);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static struct gpio_led tl_wdr4900_v1_wmac_leds_gpio[] = {
|
||||
{
|
||||
.name = "tp-link:blue:wps",
|
||||
.gpio = 1,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct ath9k_platform_data tl_wdr4900_v1_wmac0_data = {
|
||||
.led_pin = 0,
|
||||
.eeprom_name = "pci_wmac0.eeprom",
|
||||
.leds = tl_wdr4900_v1_wmac_leds_gpio,
|
||||
.num_leds = ARRAY_SIZE(tl_wdr4900_v1_wmac_leds_gpio),
|
||||
};
|
||||
|
||||
static struct ath9k_platform_data tl_wdr4900_v1_wmac1_data = {
|
||||
.led_pin = 0,
|
||||
.eeprom_name = "pci_wmac1.eeprom",
|
||||
};
|
||||
|
||||
static void tl_wdr4900_v1_pci_wmac_fixup(struct pci_dev *dev)
|
||||
{
|
||||
if (!machine_is(tl_wdr4900_v1))
|
||||
return;
|
||||
|
||||
if (dev->bus->number == 1 &&
|
||||
PCI_SLOT(dev->devfn) == 0) {
|
||||
dev->dev.platform_data = &tl_wdr4900_v1_wmac0_data;
|
||||
return;
|
||||
}
|
||||
|
||||
if (dev->bus->number == 3 &&
|
||||
PCI_SLOT(dev->devfn) == 0 &&
|
||||
dev->device == 0xabcd) {
|
||||
dev->dev.platform_data = &tl_wdr4900_v1_wmac1_data;
|
||||
|
||||
/*
|
||||
* The PCI header of the AR9381 chip is not programmed
|
||||
* correctly by the bootloader and the device uses wrong
|
||||
* data due to that. Replace the broken values with the
|
||||
* correct ones.
|
||||
*/
|
||||
dev->device = 0x30;
|
||||
dev->class = 0x028000;
|
||||
|
||||
pr_info("pci %s: AR9381 fixup applied\n", pci_name(dev));
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID,
|
||||
tl_wdr4900_v1_pci_wmac_fixup);
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
/*
|
||||
* Setup the architecture
|
||||
*/
|
||||
|
||||
@ -64,7 +64,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
|
||||
#include <media/v4l2-common.h>
|
||||
|
||||
@@ -1246,9 +1251,149 @@ static void uvc_video_decode_data(struct
|
||||
@@ -1275,9 +1280,149 @@ static void uvc_video_decode_data(struct
|
||||
uvc_urb->async_operations++;
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
/* Mark the buffer as done if the EOF marker is set. */
|
||||
if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) {
|
||||
uvc_dbg(stream->dev, FRAME, "Frame complete (EOF found)\n");
|
||||
@@ -1830,6 +1975,8 @@ static int uvc_init_video_isoc(struct uv
|
||||
@@ -1859,6 +2004,8 @@ static int uvc_init_video_isoc(struct uv
|
||||
if (npackets == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@ -22,8 +22,6 @@ CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARC_EMAC_CORE=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_1024718=y
|
||||
CONFIG_ARM64_ERRATUM_1165522=y
|
||||
CONFIG_ARM64_ERRATUM_1286807=y
|
||||
@ -48,7 +46,6 @@ CONFIG_ARM64_ERRATUM_858921=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
ARCH:=aarch64
|
||||
SUBTARGET:=armv8
|
||||
BOARDNAME:=RK33xx/RK356x/RK3588 boards (64 bit)
|
||||
BOARDNAME:=RK33xx/RK35xx boards (64 bit)
|
||||
|
||||
define Target/Description
|
||||
Build firmware image for Rockchip RK33xx/RK356x/RK3588 devices.
|
||||
Build firmware image for Rockchip RK33xx/RK35xx devices.
|
||||
This firmware features a 64 bit kernel.
|
||||
endef
|
||||
|
||||
@ -255,7 +255,10 @@ CONFIG_HALTPOLL_CPUIDLE=y
|
||||
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y
|
||||
CONFIG_HDMI=y
|
||||
CONFIG_HIBERNATE_CALLBACKS=y
|
||||
CONFIG_HID=y
|
||||
CONFIG_HID_GENERIC=y
|
||||
CONFIG_HID_HYPERV_MOUSE=y
|
||||
CONFIG_HID_SUPPORT=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC_FULL=y
|
||||
@ -540,6 +543,8 @@ CONFIG_TREE_SRCU=y
|
||||
CONFIG_UCS2_STRING=y
|
||||
CONFIG_UNACCEPTED_MEMORY=y
|
||||
# CONFIG_UNWINDER_ORC is not set
|
||||
CONFIG_USB_HID=y
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_VIDEO_CMDLINE=y
|
||||
# CONFIG_VIDEO_IPU3_CIO2 is not set
|
||||
|
||||
@ -182,7 +182,10 @@ CONFIG_GUP_GET_PXX_LOW_HIGH=y
|
||||
CONFIG_HALTPOLL_CPUIDLE=y
|
||||
CONFIG_HDMI=y
|
||||
CONFIG_HIBERNATE_CALLBACKS=y
|
||||
CONFIG_HID=y
|
||||
CONFIG_HID_GENERIC=y
|
||||
CONFIG_HID_HYPERV_MOUSE=y
|
||||
CONFIG_HID_SUPPORT=y
|
||||
# CONFIG_HIGHMEM4G is not set
|
||||
CONFIG_HIGHMEM64G=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC=y
|
||||
@ -449,6 +452,8 @@ CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
CONFIG_UCS2_STRING=y
|
||||
CONFIG_USB_HID=y
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USER_RETURN_NOTIFIER=y
|
||||
CONFIG_VHOST=y
|
||||
|
||||
@ -133,6 +133,9 @@ CONFIG_FUNCTION_PADDING_CFI=0
|
||||
# CONFIG_GIGABYTE_WMI is not set
|
||||
CONFIG_GPIO_ACPI=y
|
||||
CONFIG_HDMI=y
|
||||
CONFIG_HID=y
|
||||
CONFIG_HID_GENERIC=y
|
||||
CONFIG_HID_SUPPORT=y
|
||||
# CONFIG_HIGHMEM4G is not set
|
||||
CONFIG_HPET=y
|
||||
CONFIG_HPET_MMAP=y
|
||||
@ -253,6 +256,8 @@ CONFIG_SYNC_FILE=y
|
||||
# CONFIG_THINKPAD_LMI is not set
|
||||
# CONFIG_TOSHIBA_BT_RFKILL is not set
|
||||
# CONFIG_TOSHIBA_WMI is not set
|
||||
CONFIG_USB_HID=y
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_VIDEO_CMDLINE=y
|
||||
# CONFIG_VIDEO_IPU3_CIO2 is not set
|
||||
|
||||
Loading…
Reference in New Issue
Block a user