Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tbblgm119
lede
提交
45ddd9f7
L
lede
项目概览
tbblgm119
/
lede
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
lede
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
45ddd9f7
编写于
7月 03, 2020
作者:
A
AmadeusGhost
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipq40xx: r619ac: fix wan/lan led
上级
51143b4c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
80 addition
and
6 deletion
+80
-6
target/linux/ipq40xx/base-files/etc/board.d/01_leds
target/linux/ipq40xx/base-files/etc/board.d/01_leds
+6
-1
target/linux/ipq40xx/base-files/etc/board.d/02_network
target/linux/ipq40xx/base-files/etc/board.d/02_network
+6
-3
target/linux/ipq40xx/patches-4.19/705-net-add-qualcomm-ar40xx-phy.patch
...pq40xx/patches-4.19/705-net-add-qualcomm-ar40xx-phy.patch
+34
-1
target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch
...ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch
+34
-1
未找到文件。
target/linux/ipq40xx/base-files/etc/board.d/01_leds
浏览文件 @
45ddd9f7
...
...
@@ -22,7 +22,7 @@ asus,rt-acrh17)
ucidef_set_led_default
"status"
"STATUS"
"
${
boardname
}
:blue:status"
"1"
ucidef_set_led_wlan
"wlan2g"
"WLAN2G"
"
${
boardname
}
:blue:wlan2g"
"phy1tpt"
ucidef_set_led_wlan
"wlan5g"
"WLAN5G"
"
${
boardname
}
:blue:wlan5g"
"phy0tpt"
ucidef_set_led_
switch
"wan"
"WAN(blue)"
"
${
boardname
}
:blue:wan"
"switch0"
"0x20
"
ucidef_set_led_
netdev
"wan"
"WAN"
"
${
boardname
}
:blue:wan"
"eth1
"
ucidef_set_led_switch
"lan1"
"LAN1"
"
${
boardname
}
:blue:lan1"
"switch0"
"0x02"
ucidef_set_led_switch
"lan2"
"LAN2"
"
${
boardname
}
:blue:lan2"
"switch0"
"0x04"
ucidef_set_led_switch
"lan3"
"LAN3"
"
${
boardname
}
:blue:lan3"
"switch0"
"0x08"
...
...
@@ -63,6 +63,11 @@ netgear,ex6150v2)
ucidef_set_led_wlan
"wlan2g"
"WLAN2G"
"ex61x0v2:green:router"
"phy0tpt"
ucidef_set_led_wlan
"wlan5g"
"WLAN5G"
"ex61x0v2:green:client"
"phy1tpt"
;;
p2w,r619ac
|
\
p2w,r619ac-128m
)
ucidef_set_led_wlan
"wlan2g"
"WLAN2G"
"r619ac:blue:wlan2g"
"phy0tpt"
ucidef_set_led_wlan
"wlan5g"
"WLAN5G"
"r619ac:blue:wlan5g"
"phy1tpt"
;;
qxwlan,e2600ac-c1
|
\
qxwlan,e2600ac-c2
)
ucidef_set_led_wlan
"wlan2g"
"WLAN0"
"e2600ac:green:wlan0"
"phy0tpt"
...
...
target/linux/ipq40xx/base-files/etc/board.d/02_network
浏览文件 @
45ddd9f7
...
...
@@ -117,9 +117,7 @@ ipq40xx_setup_macs()
label_mac
=
$(
mtd_get_mac_binary
"ART"
0x1006
)
;;
asus,rt-acrh17|
\
asus,rt-ac58u|
\
p2w,r619ac-128m|
\
p2w,r619ac
)
asus,rt-ac58u
)
CI_UBIPART
=
UBI_DEV
wan_mac
=
$(
mtd_get_mac_binary_ubi Factory 0x1006
)
lan_mac
=
$(
mtd_get_mac_binary_ubi Factory 0x5006
)
...
...
@@ -153,6 +151,11 @@ ipq40xx_setup_macs()
wan_mac
=
$(
mtd_get_mac_ascii devinfo hw_mac_addr
)
lan_mac
=
$(
macaddr_add
"
$wan_mac
"
1
)
;;
p2w,r619ac|
\
p2w,r619ac-128m
)
wan_mac
=
$(
cat
/sys/class/net/eth0/address
)
lan_mac
=
$(
macaddr_add
"
$wan_mac
"
1
)
;;
esac
[
-n
"
$lan_mac
"
]
&&
ucidef_set_interface_macaddr
"lan"
$lan_mac
...
...
target/linux/ipq40xx/patches-4.19/705-net-add-qualcomm-ar40xx-phy.patch
浏览文件 @
45ddd9f7
...
...
@@ -26,7 +26,7 @@
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
--- /dev/null
+++ b/drivers/net/phy/ar40xx.c
@@ -0,0 +1,2
090
@@
@@ -0,0 +1,2
122
@@
+/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
...
...
@@ -799,6 +799,37 @@
+ return 0;
+}
+
+static int
+ar40xx_sw_get_port_stats(struct switch_dev *dev, int port,
+ struct switch_port_stats *stats)
+{
+ struct ar40xx_priv *priv = swdev_to_ar40xx(dev);
+ u32 num_mibs = ARRAY_SIZE(ar40xx_mibs);
+ u64 *mib_stats;
+ int ret = 0;
+ static int last_port = AR40XX_NUM_PORTS - 1;
+
+ mutex_lock(&priv->mib_lock);
+
+ /* Avoid unnecessary capture */
+ if (last_port >= port) {
+ ret = ar40xx_mib_capture(priv);
+ if (ret)
+ goto unlock;
+ }
+ last_port = port;
+
+ ar40xx_mib_fetch_port_stat(priv, port, false);
+
+ mib_stats = &priv->mib_stats[port * num_mibs];
+ /* 15: TXBYTE, 31: RXGOODBYTE */
+ stats->tx_bytes = mib_stats[15];
+ stats->rx_bytes = mib_stats[31];
+unlock:
+ mutex_unlock(&priv->mib_lock);
+ return ret;
+}
+
+static const struct switch_attr ar40xx_sw_attr_globals[] = {
+ {
+ .type = SWITCH_TYPE_INT,
...
...
@@ -1177,6 +1208,7 @@
+ /* disable phy internal loopback */
+ mdiobus_write(bus, 0x1f, 0x10, 0x6860);
+ mdiobus_write(bus, 0x1f, 0x0, 0x9040);
+ ar40xx_phy_mmd_write(priv, 0x1f, 7, 0x8076, 0x0670); /* 1000_LED_n */
+
+ for (phy = 0; phy < AR40XX_NUM_PORTS - 1; phy++) {
+ /* disable mac loop back */
...
...
@@ -1788,6 +1820,7 @@
+ .apply_config = ar40xx_sw_hw_apply,
+ .reset_switch = ar40xx_sw_reset_switch,
+ .get_port_link = ar40xx_sw_get_port_link,
+ .get_port_stats = ar40xx_sw_get_port_stats,
+};
+
+/* Start of phy driver support */
...
...
target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch
浏览文件 @
45ddd9f7
...
...
@@ -26,7 +26,7 @@
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
--- /dev/null
+++ b/drivers/net/phy/ar40xx.c
@@ -0,0 +1,2
090
@@
@@ -0,0 +1,2
123
@@
+/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
...
...
@@ -799,6 +799,37 @@
+ return 0;
+}
+
+static int
+ar40xx_sw_get_port_stats(struct switch_dev *dev, int port,
+ struct switch_port_stats *stats)
+{
+ struct ar40xx_priv *priv = swdev_to_ar40xx(dev);
+ u32 num_mibs = ARRAY_SIZE(ar40xx_mibs);
+ u64 *mib_stats;
+ int ret = 0;
+ static int last_port = AR40XX_NUM_PORTS - 1;
+
+ mutex_lock(&priv->mib_lock);
+
+ /* Avoid unnecessary capture */
+ if (last_port >= port) {
+ ret = ar40xx_mib_capture(priv);
+ if (ret)
+ goto unlock;
+ }
+ last_port = port;
+
+ ar40xx_mib_fetch_port_stat(priv, port, false);
+
+ mib_stats = &priv->mib_stats[port * num_mibs];
+ /* 15: TXBYTE, 31: RXGOODBYTE */
+ stats->tx_bytes = mib_stats[15];
+ stats->rx_bytes = mib_stats[31];
+unlock:
+ mutex_unlock(&priv->mib_lock);
+ return ret;
+}
+
+static const struct switch_attr ar40xx_sw_attr_globals[] = {
+ {
+ .type = SWITCH_TYPE_INT,
...
...
@@ -1177,6 +1208,7 @@
+ /* disable phy internal loopback */
+ mdiobus_write(bus, 0x1f, 0x10, 0x6860);
+ mdiobus_write(bus, 0x1f, 0x0, 0x9040);
+ ar40xx_phy_mmd_write(priv, 0x1f, 7, 0x8076, 0x0670); /* 1000_LED_n */
+
+ for (phy = 0; phy < AR40XX_NUM_PORTS - 1; phy++) {
+ /* disable mac loop back */
...
...
@@ -1788,6 +1820,7 @@
+ .apply_config = ar40xx_sw_hw_apply,
+ .reset_switch = ar40xx_sw_reset_switch,
+ .get_port_link = ar40xx_sw_get_port_link,
+ .get_port_stats = ar40xx_sw_get_port_stats,
+};
+
+/* Start of phy driver support */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录