提交 c551f6ec 编写于 作者: C coolsnowwolf

Merge branch 'master' of https://github.com/coolsnowwolf/lede

...@@ -22,7 +22,7 @@ asus,rt-acrh17) ...@@ -22,7 +22,7 @@ asus,rt-acrh17)
ucidef_set_led_default "status" "STATUS" "${boardname}:blue:status" "1" ucidef_set_led_default "status" "STATUS" "${boardname}:blue:status" "1"
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:blue:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:blue:wlan5g" "phy0tpt" 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 "lan1" "LAN1" "${boardname}:blue:lan1" "switch0" "0x02"
ucidef_set_led_switch "lan2" "LAN2" "${boardname}:blue:lan2" "switch0" "0x04" ucidef_set_led_switch "lan2" "LAN2" "${boardname}:blue:lan2" "switch0" "0x04"
ucidef_set_led_switch "lan3" "LAN3" "${boardname}:blue:lan3" "switch0" "0x08" ucidef_set_led_switch "lan3" "LAN3" "${boardname}:blue:lan3" "switch0" "0x08"
...@@ -63,6 +63,11 @@ netgear,ex6150v2) ...@@ -63,6 +63,11 @@ netgear,ex6150v2)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "ex61x0v2:green:router" "phy0tpt" ucidef_set_led_wlan "wlan2g" "WLAN2G" "ex61x0v2:green:router" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "ex61x0v2:green:client" "phy1tpt" 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-c1 |\
qxwlan,e2600ac-c2) qxwlan,e2600ac-c2)
ucidef_set_led_wlan "wlan2g" "WLAN0" "e2600ac:green:wlan0" "phy0tpt" ucidef_set_led_wlan "wlan2g" "WLAN0" "e2600ac:green:wlan0" "phy0tpt"
......
...@@ -117,9 +117,7 @@ ipq40xx_setup_macs() ...@@ -117,9 +117,7 @@ ipq40xx_setup_macs()
label_mac=$(mtd_get_mac_binary "ART" 0x1006) label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;; ;;
asus,rt-acrh17|\ asus,rt-acrh17|\
asus,rt-ac58u|\ asus,rt-ac58u)
p2w,r619ac-128m|\
p2w,r619ac)
CI_UBIPART=UBI_DEV CI_UBIPART=UBI_DEV
wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006) lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
...@@ -153,6 +151,11 @@ ipq40xx_setup_macs() ...@@ -153,6 +151,11 @@ ipq40xx_setup_macs()
wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
lan_mac=$(macaddr_add "$wan_mac" 1) 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 esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
led-upgrade = &led_sys; led-upgrade = &led_sys;
}; };
chosen {
bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
};
soc { soc {
rng@22000 { rng@22000 {
status = "okay"; status = "okay";
...@@ -110,7 +114,7 @@ ...@@ -110,7 +114,7 @@
led_spi { led_spi {
compatible = "spi-gpio"; compatible = "spi-gpio";
#address-cells = <1>; #address-cells = <1>;
ranges; #size-cells = <0>;
sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>; sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;
...@@ -129,7 +133,7 @@ ...@@ -129,7 +133,7 @@
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
usb { led_usb: usb {
label = "cm520-79f:blue:usb"; label = "cm520-79f:blue:usb";
gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "usbport"; linux,default-trigger = "usbport";
...@@ -216,66 +220,8 @@ ...@@ -216,66 +220,8 @@
#size-cells = <1>; #size-cells = <1>;
partition@0 { partition@0 {
label = "SBL1"; label = "Bootloader";
reg = <0x0 0x100000>; reg = <0x0 0xb00000>;
read-only;
};
partition@100000 {
label = "MIBIB";
reg = <0x100000 0x100000>;
read-only;
};
partition@200000 {
label = "BOOTCONFIG";
reg = <0x200000 0x100000>;
};
partition@300000 {
label = "QSEE";
reg = <0x300000 0x100000>;
read-only;
};
partition@400000 {
label = "QSEE_1";
reg = <0x400000 0x100000>;
read-only;
};
partition@500000 {
label = "CDT";
reg = <0x500000 0x80000>;
read-only;
};
partition@580000 {
label = "CDT_1";
reg = <0x580000 0x80000>;
read-only;
};
partition@600000 {
label = "BOOTCONFIG1";
reg = <0x600000 0x80000>;
};
partition@680000 {
label = "APPSBLENV";
reg = <0x680000 0x80000>;
};
partition@700000 {
label = "APPSBL";
reg = <0x700000 0x200000>;
read-only;
};
partition@900000 {
label = "APPSBL_1";
reg = <0x900000 0x200000>;
read-only;
}; };
art: partition@b00000 { art: partition@b00000 {
...@@ -285,7 +231,7 @@ ...@@ -285,7 +231,7 @@
}; };
partition@b80000 { partition@b80000 {
label = "ubi"; label = "rootfs";
reg = <0xb80000 0x7480000>; reg = <0xb80000 0x7480000>;
}; };
}; };
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
--- /dev/null --- /dev/null
+++ b/drivers/net/phy/ar40xx.c +++ b/drivers/net/phy/ar40xx.c
@@ -0,0 +1,2090 @@ @@ -0,0 +1,2122 @@
+/* +/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * + *
...@@ -799,6 +799,37 @@ ...@@ -799,6 +799,37 @@
+ return 0; + 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[] = { +static const struct switch_attr ar40xx_sw_attr_globals[] = {
+ { + {
+ .type = SWITCH_TYPE_INT, + .type = SWITCH_TYPE_INT,
...@@ -1177,6 +1208,7 @@ ...@@ -1177,6 +1208,7 @@
+ /* disable phy internal loopback */ + /* disable phy internal loopback */
+ mdiobus_write(bus, 0x1f, 0x10, 0x6860); + mdiobus_write(bus, 0x1f, 0x10, 0x6860);
+ mdiobus_write(bus, 0x1f, 0x0, 0x9040); + 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++) { + for (phy = 0; phy < AR40XX_NUM_PORTS - 1; phy++) {
+ /* disable mac loop back */ + /* disable mac loop back */
...@@ -1788,6 +1820,7 @@ ...@@ -1788,6 +1820,7 @@
+ .apply_config = ar40xx_sw_hw_apply, + .apply_config = ar40xx_sw_hw_apply,
+ .reset_switch = ar40xx_sw_reset_switch, + .reset_switch = ar40xx_sw_reset_switch,
+ .get_port_link = ar40xx_sw_get_port_link, + .get_port_link = ar40xx_sw_get_port_link,
+ .get_port_stats = ar40xx_sw_get_port_stats,
+}; +};
+ +
+/* Start of phy driver support */ +/* Start of phy driver support */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
--- /dev/null --- /dev/null
+++ b/drivers/net/phy/ar40xx.c +++ b/drivers/net/phy/ar40xx.c
@@ -0,0 +1,2090 @@ @@ -0,0 +1,2123 @@
+/* +/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * + *
...@@ -799,6 +799,37 @@ ...@@ -799,6 +799,37 @@
+ return 0; + 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[] = { +static const struct switch_attr ar40xx_sw_attr_globals[] = {
+ { + {
+ .type = SWITCH_TYPE_INT, + .type = SWITCH_TYPE_INT,
...@@ -1177,6 +1208,7 @@ ...@@ -1177,6 +1208,7 @@
+ /* disable phy internal loopback */ + /* disable phy internal loopback */
+ mdiobus_write(bus, 0x1f, 0x10, 0x6860); + mdiobus_write(bus, 0x1f, 0x10, 0x6860);
+ mdiobus_write(bus, 0x1f, 0x0, 0x9040); + 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++) { + for (phy = 0; phy < AR40XX_NUM_PORTS - 1; phy++) {
+ /* disable mac loop back */ + /* disable mac loop back */
...@@ -1788,6 +1820,7 @@ ...@@ -1788,6 +1820,7 @@
+ .apply_config = ar40xx_sw_hw_apply, + .apply_config = ar40xx_sw_hw_apply,
+ .reset_switch = ar40xx_sw_reset_switch, + .reset_switch = ar40xx_sw_reset_switch,
+ .get_port_link = ar40xx_sw_get_port_link, + .get_port_link = ar40xx_sw_get_port_link,
+ .get_port_stats = ar40xx_sw_get_port_stats,
+}; +};
+ +
+/* Start of phy driver support */ +/* Start of phy driver support */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册