This commit is contained in:
lean 2022-08-30 15:38:56 +08:00
commit 40e3a3f754
101 changed files with 1134 additions and 562 deletions

View File

@ -13,10 +13,16 @@ on:
release:
types: [published]
permissions:
contents: read
jobs:
build_openwrt:
permissions:
contents: write # for release creation
name: Build OpenWrt firmware
runs-on: ubuntu-latest

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mbedtls
PKG_VERSION:=2.28.0
PKG_VERSION:=2.28.1
PKG_RELEASE:=$(AUTORELEASE)
PKG_USE_MIPS16:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=6519579b836ed78cc549375c7c18b111df5717e86ca0eeff4cb64b2674f424cc
PKG_HASH:=6797a7b6483ef589deeab8d33d401ed235d7be25eeecda1be8ddfed406d40ff4
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0-or-later

View File

@ -0,0 +1,22 @@
Fix a compile problem introduced in commit 331c3421d1f0 ("Address review comments")
Bug report: https://github.com/Mbed-TLS/mbedtls/issues/6243
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -2511,7 +2511,6 @@ int main( int argc, char *argv[] )
}
key_cert_init2 = 2;
#endif /* MBEDTLS_ECDSA_C */
- }
#if defined(MBEDTLS_USE_PSA_CRYPTO)
if( opt.key_opaque != 0 )
@@ -2540,6 +2539,7 @@ int main( int argc, char *argv[] )
}
#endif /* MBEDTLS_USE_PSA_CRYPTO */
#endif /* MBEDTLS_CERTS_C */
+ }
mbedtls_printf( " ok (key types: %s - %s)\n", mbedtls_pk_get_name( &pkey ), mbedtls_pk_get_name( &pkey2 ) );
#endif /* MBEDTLS_X509_CRT_PARSE_C */

View File

@ -1,6 +1,6 @@
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -665,14 +665,14 @@
@@ -670,14 +670,14 @@
*
* Enable Output Feedback mode (OFB) for symmetric ciphers.
*/
@ -17,7 +17,7 @@
/**
* \def MBEDTLS_CIPHER_NULL_CIPHER
@@ -790,20 +790,20 @@
@@ -795,20 +795,20 @@
* Comment macros to disable the curve and functions for it
*/
/* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */
@ -47,7 +47,7 @@
/**
* \def MBEDTLS_ECP_NIST_OPTIM
@@ -956,7 +956,7 @@
@@ -961,7 +961,7 @@
* See dhm.h for more details.
*
*/
@ -56,7 +56,7 @@
/**
* \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
@@ -976,7 +976,7 @@
@@ -981,7 +981,7 @@
* MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
* MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
*/
@ -65,7 +65,7 @@
/**
* \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
@@ -1001,7 +1001,7 @@
@@ -1006,7 +1006,7 @@
* MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
* MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
*/
@ -74,7 +74,7 @@
/**
* \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
@@ -1135,7 +1135,7 @@
@@ -1140,7 +1140,7 @@
* MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
* MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
*/
@ -83,7 +83,7 @@
/**
* \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
@@ -1159,7 +1159,7 @@
@@ -1164,7 +1164,7 @@
* MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
* MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
*/
@ -92,7 +92,7 @@
/**
* \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
@@ -1263,7 +1263,7 @@
@@ -1268,7 +1268,7 @@
* This option is only useful if both MBEDTLS_SHA256_C and
* MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
*/
@ -101,7 +101,7 @@
/**
* \def MBEDTLS_ENTROPY_NV_SEED
@@ -1478,14 +1478,14 @@
@@ -1483,14 +1483,14 @@
* Uncomment this macro to disable the use of CRT in RSA.
*
*/
@ -118,7 +118,7 @@
/**
* \def MBEDTLS_SHA256_SMALLER
@@ -1756,7 +1756,7 @@
@@ -1761,7 +1761,7 @@
* configuration of this extension).
*
*/
@ -127,7 +127,7 @@
/**
* \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
@@ -2017,7 +2017,7 @@
@@ -2022,7 +2022,7 @@
*
* Comment this macro to disable support for truncated HMAC in SSL
*/
@ -136,7 +136,7 @@
/**
* \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT
@@ -2185,7 +2185,7 @@
@@ -2201,7 +2201,7 @@
*
* Comment this to disable run-time checking and save ROM space
*/
@ -145,7 +145,7 @@
/**
* \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
@@ -2534,7 +2534,7 @@
@@ -2550,7 +2550,7 @@
* MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
* MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
*/
@ -154,7 +154,7 @@
/**
* \def MBEDTLS_ARIA_C
@@ -2600,7 +2600,7 @@
@@ -2616,7 +2616,7 @@
* This module enables the AES-CCM ciphersuites, if other requisites are
* enabled as well.
*/
@ -163,7 +163,7 @@
/**
* \def MBEDTLS_CERTS_C
@@ -2612,7 +2612,7 @@
@@ -2628,7 +2628,7 @@
*
* This module is used for testing (ssl_client/server).
*/
@ -172,7 +172,7 @@
/**
* \def MBEDTLS_CHACHA20_C
@@ -2725,7 +2725,7 @@
@@ -2741,7 +2741,7 @@
* \warning DES is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers instead.
*/
@ -181,7 +181,7 @@
/**
* \def MBEDTLS_DHM_C
@@ -2890,7 +2890,7 @@
@@ -2906,7 +2906,7 @@
* This module adds support for the Hashed Message Authentication Code
* (HMAC)-based key derivation function (HKDF).
*/
@ -190,7 +190,7 @@
/**
* \def MBEDTLS_HMAC_DRBG_C
@@ -3203,7 +3203,7 @@
@@ -3219,7 +3219,7 @@
*
* This module enables abstraction of common (libc) functions.
*/
@ -199,7 +199,7 @@
/**
* \def MBEDTLS_POLY1305_C
@@ -3279,7 +3279,7 @@
@@ -3295,7 +3295,7 @@
* Caller: library/md.c
*
*/
@ -208,7 +208,7 @@
/**
* \def MBEDTLS_RSA_C
@@ -3486,7 +3486,7 @@
@@ -3506,7 +3506,7 @@
*
* This module provides run-time version information.
*/
@ -217,12 +217,12 @@
/**
* \def MBEDTLS_X509_USE_C
@@ -3596,7 +3596,7 @@
@@ -3616,7 +3616,7 @@
* Module: library/xtea.c
* Caller:
*/
-#define MBEDTLS_XTEA_C
+//#define MBEDTLS_XTEA_C
/* \} name SECTION: mbed TLS modules */
/** \} name SECTION: mbed TLS modules */

View File

@ -22,7 +22,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -65,9 +65,14 @@
@@ -65,9 +65,14 @@ struct nf_ct_event_notifier {
int (*exp_event)(unsigned int events, const struct nf_exp_event *item);
};
@ -38,7 +38,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
void nf_ct_deliver_cached_events(struct nf_conn *ct);
int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct,
@@ -98,11 +103,13 @@
@@ -98,11 +103,13 @@ static inline void
nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS
@ -53,7 +53,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
e = nf_ct_ecache_find(ct);
if (e == NULL)
@@ -117,20 +124,34 @@
@@ -117,20 +124,34 @@ nf_conntrack_event_report(enum ip_conntr
u32 portid, int report)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS
@ -94,9 +94,9 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
#ifdef CONFIG_NF_CONNTRACK_EVENTS
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -113,6 +113,9 @@ struct netns_ct {
@@ -107,6 +107,9 @@ struct netns_ct {
u8 sysctl_checksum;
struct ct_pcpu __percpu *pcpu_lists;
struct ip_conntrack_stat __percpu *stat;
+#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
+ struct atomic_notifier_head nf_conntrack_chain;
@ -106,7 +106,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
#if defined(CONFIG_NF_CONNTRACK_LABELS)
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -151,6 +151,14 @@ config NF_CONNTRACK_EVENTS
@@ -162,6 +162,14 @@ config NF_CONNTRACK_EVENTS
If unsure, say `N'.
@ -123,7 +123,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
depends on NETFILTER_ADVANCED
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -2878,6 +2878,10 @@ int nf_conntrack_init_net(struct net *ne
@@ -2802,6 +2802,10 @@ int nf_conntrack_init_net(struct net *ne
nf_conntrack_helper_pernet_init(net);
nf_conntrack_proto_pernet_init(net);
@ -136,9 +136,9 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
err_expect:
--- a/net/netfilter/nf_conntrack_ecache.c
+++ b/net/netfilter/nf_conntrack_ecache.c
@@ -18,6 +18,9 @@
@@ -17,6 +17,9 @@
#include <linux/stddef.h>
#include <linux/err.h>
#include <linux/percpu.h>
#include <linux/kernel.h>
+#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
+#include <linux/notifier.h>
@ -146,7 +146,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
#include <linux/netdevice.h>
#include <linux/slab.h>
#include <linux/export.h>
@@ -167,6 +170,35 @@ static int __nf_conntrack_eventmask_repo
@@ -162,6 +165,35 @@ static int __nf_conntrack_eventmask_repo
return ret;
}
@ -182,7 +182,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
int nf_conntrack_eventmask_report(unsigned int events, struct nf_conn *ct,
u32 portid, int report)
{
@@ -203,10 +235,52 @@ int nf_conntrack_eventmask_report(unsign
@@ -197,10 +229,52 @@ int nf_conntrack_eventmask_report(unsign
return ret;
}
@ -235,7 +235,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
void nf_ct_deliver_cached_events(struct nf_conn *ct)
{
struct nf_conntrack_ecache *e;
@@ -232,6 +306,7 @@ void nf_ct_deliver_cached_events(struct
@@ -226,6 +300,7 @@ void nf_ct_deliver_cached_events(struct
*/
__nf_conntrack_eventmask_report(e, events, e->missed, &item);
}
@ -243,7 +243,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events);
void nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
@@ -264,20 +339,43 @@ out_unlock:
@@ -258,20 +333,43 @@ out_unlock:
rcu_read_unlock();
}
@ -289,7 +289,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
void nf_conntrack_unregister_notifier(struct net *net)
{
mutex_lock(&nf_ct_ecache_mutex);
@@ -285,6 +383,7 @@ void nf_conntrack_unregister_notifier(st
@@ -279,6 +377,7 @@ void nf_conntrack_unregister_notifier(st
mutex_unlock(&nf_ct_ecache_mutex);
/* synchronize_rcu() is called after netns pre_exit */
}
@ -299,7 +299,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
void nf_conntrack_ecache_work(struct net *net, enum nf_ct_ecache_state state)
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -706,12 +706,19 @@ static size_t ctnetlink_nlmsg_size(const
@@ -712,12 +712,19 @@ static size_t ctnetlink_nlmsg_size(const
}
static int
@ -319,7 +319,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
struct nf_conn *ct = item->ct;
struct sk_buff *skb;
unsigned int type;
@@ -3761,11 +3768,17 @@ static int ctnetlink_stat_exp_cpu(struct
@@ -3791,11 +3798,17 @@ static int ctnetlink_stat_exp_cpu(struct
}
#ifdef CONFIG_NF_CONNTRACK_EVENTS
@ -337,7 +337,7 @@ Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
static const struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX] = {
[IPCTNL_MSG_CT_NEW] = {
@@ -3864,8 +3877,12 @@ static int __net_init ctnetlink_net_init
@@ -3894,8 +3907,12 @@ static int __net_init ctnetlink_net_init
static void ctnetlink_net_pre_exit(struct net *net)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS

View File

@ -490,13 +490,7 @@
compatible = "mediatek,eth-mac";
reg = <1>;
status = "disabled";
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
phy-mode = "rgmii-rxid";
};
mdio: mdio-bus {
@ -563,8 +557,8 @@
hnat: hnat@1e100000 {
compatible = "mediatek,mtk-hnat_v1";
/* ext-devices = "apcli0", "apclii0","apclix0",
"ra0", "rai0", "rax0", "wlan0", "wlan1"; */
ext-devices = "apcli0", "apclii0","apclix0",
"ra0", "rai0", "rax0", "wlan0", "wlan1";
reg = <0x1e100000 0x3000>;
resets = <&ethsys 0>;
@ -573,7 +567,7 @@
mtketh-wan = "wan";
mtketh-ppd = "lan";
mtketh-lan = "lan";
mtketh-max-gmac = <1>;
mtketh-max-gmac = <2>;
mtkdsa-wan-port = <4>;
};

View File

@ -104,6 +104,19 @@
mtd-mac-address = <&factory 0xe00c>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe00c>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -125,13 +138,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe00c>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -109,6 +109,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -130,13 +143,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -7,18 +7,26 @@
model = "AsiaRF AP7621-001";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -7,15 +7,23 @@
model = "AsiaRF AP7621-NV1";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
port@2 {
status = "okay";
label = "lan1";

View File

@ -133,14 +133,21 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -134,13 +134,22 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0xe000>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -10,7 +10,7 @@
model = "ASUS RT-N56U B1";
aliases {
label-mac-device = &wan;
label-mac-device = &gmac1;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
@ -143,6 +143,19 @@
mtd-mac-address = <&factory 0x8004>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -164,12 +177,6 @@
status = "okay";
label = "lan1";
};
wan: port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
};
};
};

View File

@ -152,8 +152,16 @@
};
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
@ -177,17 +185,12 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
};
};
};
&state_default {
gpio {
groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
groups = "i2c", "uart2", "uart3", "sdhci";
function = "gpio";
};
};

View File

@ -168,13 +168,23 @@
mtd-mac-address-increment = <(-1)>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(-1)>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -149,7 +149,7 @@
&state_default {
gpio {
groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
groups = "i2c", "uart2", "uart3", "sdhci";
function = "gpio";
};
};
@ -172,14 +172,23 @@
};
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
};
&gmac0 {
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -201,11 +210,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
};
};
};

View File

@ -156,6 +156,21 @@
mtd-mac-address = <&bdinfo 0xde00>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&bdinfo 0xde00>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -177,13 +192,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&bdinfo 0xde00>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -81,6 +81,21 @@
mtd-mac-address = <&bdinfo 0xde00>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&bdinfo 0xde00>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&pcie {
status = "okay";
};
@ -189,13 +204,5 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&bdinfo 0xde00>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -166,6 +166,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -187,12 +200,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -12,7 +12,7 @@
model = "D-Link DIR-853 R1";
aliases {
label-mac-device = &wan;
label-mac-device = &gmac1;
led-boot = &led_power_orange;
led-failsafe = &led_power_blue;
led-running = &led_power_blue;
@ -105,6 +105,21 @@
mtd-mac-address-increment = <(-1)>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(-2)>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -126,13 +141,6 @@
status = "okay";
label = "lan1";
};
wan: port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(-2)>;
};
};
};

View File

@ -112,13 +112,21 @@
mtd-mac-address = <&radio 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&radio 0x4>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -95,6 +95,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -116,12 +129,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -155,6 +155,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -176,12 +189,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -121,13 +121,21 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x4>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -70,14 +70,21 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -11,7 +11,7 @@
mtd-mac-address = <&factory 0xfff4>;
};
&wan {
&gmac1 {
mtd-mac-address = <&factory 0xfffa>;
};

View File

@ -11,7 +11,7 @@
mtd-mac-address = <&factory 0xe000>;
};
&wan {
&gmac1 {
mtd-mac-address = <&factory 0xe006>;
};

View File

@ -136,13 +136,20 @@
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -6,7 +6,7 @@
mtd-mac-address = <&factory 0xe000>;
};
&wan {
&gmac1 {
mtd-mac-address = <&factory 0xe006>;
};

View File

@ -11,7 +11,7 @@
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_power_green;
label-mac-device = &wan;
label-mac-device = &gmac1;
};
leds: leds {
@ -83,13 +83,20 @@
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
wan: port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -113,7 +113,14 @@
&gmac1 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -14,7 +14,7 @@
led-failsafe = &led_run;
led-running = &led_run;
led-upgrade = &led_run;
label-mac-device = &wan;
label-mac-device = &gmac1;
};
chosen {
@ -119,6 +119,19 @@
mtd-mac-address-increment = <1>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4000>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@2 {
@ -130,12 +143,6 @@
status = "okay";
label = "lan2";
};
wan: port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4000>;
};
};
};

View File

@ -8,10 +8,10 @@
model = "GB-PC1";
aliases {
led-boot = &led_status;
led-failsafe = &led_status;
led-running = &led_status;
led-upgrade = &led_status;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
keys {
@ -27,24 +27,26 @@
leds {
compatible = "gpio-leds";
system {
label = "green:system";
ethblack_act {
label = "green:ethblack_act";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
ethblue_act {
label = "green:ethblue_act";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
power {
label = "green:power";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
linux,default-trigger = "default-on";
};
led_status: status {
label = "green:status";
led_system: system {
label = "green:system";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
lan1 {
label = "green:lan1";
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
};
lan2 {
label = "green:lan2";
gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
linux,default-trigger = "disk-activity";
};
};
};
@ -59,9 +61,8 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <80000000>;
spi-max-frequency = <50000000>;
broken-flash-reset;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
@ -99,31 +100,35 @@
status = "okay";
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "ethblue";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "lan2";
label = "ethblack";
};
};
};
&state_default {
gpio {
groups = "jtag", "rgmii2", "uart3", "wdt";
groups = "jtag", "uart3", "wdt";
function = "gpio";
};
};

View File

@ -8,10 +8,10 @@
model = "GB-PC2";
aliases {
led-boot = &led_status;
led-failsafe = &led_status;
led-running = &led_status;
led-upgrade = &led_status;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
keys {
@ -27,34 +27,26 @@
leds {
compatible = "gpio-leds";
system {
label = "green:system";
ethblack_act {
label = "green:ethblack_act";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
ethblue_act {
label = "green:ethblue_act";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
power {
label = "green:power";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
linux,default-trigger = "default-on";
};
led_status: status {
label = "green:status";
led_system: system {
label = "green:system";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
lan1 {
label = "green:lan1";
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
};
lan2 {
label = "green:lan2";
gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
};
lan3-yellow {
label = "yellow:lan3";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
lan3-green {
label = "green:lan3";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,default-trigger = "disk-activity";
};
};
};
@ -69,9 +61,8 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <80000000>;
spi-max-frequency = <50000000>;
broken-flash-reset;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
@ -109,31 +100,41 @@
status = "okay";
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "ethyellow";
phy-handle = <&ethphy5>;
mtd-mac-address = <&factory 0xe000>;
};
&mdio {
ethphy5: ethernet-phy@5 {
reg = <5>;
phy-mode = "rgmii-rxid";
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
label = "ethblack";
};
port@4 {
status = "okay";
label = "lan2";
label = "ethblue";
};
};
};
&state_default {
gpio {
groups = "jtag", "rgmii2", "uart3", "wdt";
groups = "jtag", "uart3", "wdt";
function = "gpio";
};
};

View File

@ -61,11 +61,11 @@
cpu_fan: cpu_fan {
compatible = "gpio-fan";
gpios = <&gpio 13 GPIO_ACTIVE_HIGH
&gpio 14 GPIO_ACTIVE_HIGH>;
gpio-fan,speed-map = < 0 0
2000 1
4000 2
6000 3>;
&gpio 14 GPIO_ACTIVE_HIGH>;
gpio-fan,speed-map = < 0 0
2000 1
4000 2
6000 3>;
#cooling-cells = <2>;
};
@ -214,6 +214,10 @@
mtd-mac-address-increment = <6>;
};
&hnat {
mtketh-wan = "eth5";
};
&switch0 {
ports {
port@0 {

View File

@ -73,11 +73,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
};
};
};
@ -85,6 +80,18 @@
mtd-mac-address = <&factory 0x8004>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&state_default {
gpio {
groups = "rgmii2", "jtag";

View File

@ -129,6 +129,18 @@
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@1 {
@ -145,11 +157,6 @@
status = "okay";
label = "lan3";
};
port@4 {
status = "okay";
label = "wan";
};
};
};

View File

@ -131,15 +131,23 @@
mtd-mac-address = <&iNIC_rf 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -14,7 +14,7 @@
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
label-mac-device = &wan;
label-mac-device = &gmac1;
};
leds {
@ -130,14 +130,21 @@
mtd-mac-address = <&factory 0x1e000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x1e006>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
wan: port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x1e006>;
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -131,15 +131,23 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -11,7 +11,7 @@
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
label-mac-device = &wan;
label-mac-device = &gmac1;
};
leds {
@ -121,14 +121,22 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
wan: port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -123,13 +123,22 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x4>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -114,14 +114,22 @@
mtd-mac-address = <&uboot 0x1fc20>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&uboot 0x1fc40>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&uboot 0x1fc40>;
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -98,14 +98,22 @@
mtd-mac-address = <&uboot 0x1fc20>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&uboot 0x1fc40>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&uboot 0x1fc40>;
};
port@1 {
status = "okay";
label = "lan4";

View File

@ -14,7 +14,7 @@
led-failsafe = &led_wps;
led-running = &led_wps;
led-upgrade = &led_wps;
label-mac-device = &wan;
label-mac-device = &gmac1;
};
leds {
@ -132,6 +132,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -156,7 +169,6 @@
wan: port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
};
};
};

View File

@ -93,6 +93,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -114,12 +127,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -144,19 +144,28 @@
};
&gmac0 {
nvmem-cells = <&macaddr_factory_3fff4>;
nvmem-cell-names = "mac-address";
mtd-mac-address = <&factory 0x3fff4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x3fffa>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&hnat {
mtkdsa-wan-port = <0>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
nvmem-cells = <&macaddr_factory_3fffa>;
nvmem-cell-names = "mac-address";
};
port@1 {
status = "okay";
label = "lan1";
@ -175,17 +184,3 @@
function = "gpio";
};
};
&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_factory_3fff4: macaddr@3fff4 {
reg = <0x3fff4 0x6>;
};
macaddr_factory_3fffa: macaddr@3fffa {
reg = <0x3fffa 0x6>;
};
};

View File

@ -94,7 +94,14 @@
&gmac1 {
mtd-mac-address = <&factory 0xe006>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -135,6 +135,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@1 {
@ -146,12 +159,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -148,6 +148,18 @@
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -169,11 +181,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
};
};
};

View File

@ -173,13 +173,20 @@
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -116,13 +116,22 @@
mtd-mac-address = <&factory 0x2e>;
};
&gmac1 {
status = "okay";
label = "lan1";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x2e>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
};
port@1 {
status = "okay";
label = "lan2";

View File

@ -32,7 +32,7 @@
&state_default {
gpio {
groups = "uart2", "rgmii2";
groups = "uart2";
function = "gpio";
};
};
@ -112,14 +112,25 @@
status = "okay";
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
};
&gmac0 {
mtd-mac-address = <&factory 0x5>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x5>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -141,13 +152,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x5>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -39,8 +39,16 @@
status = "okay";
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
@ -64,17 +72,12 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
};
};
};
&state_default {
gpio {
groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
groups = "i2c", "uart2", "uart3", "sdhci";
function = "gpio";
};
};

View File

@ -35,3 +35,23 @@
function = "gpio";
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "disabled";
};
};
};

View File

@ -90,13 +90,20 @@
};
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -97,6 +97,21 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -118,13 +133,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -110,6 +110,21 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -131,13 +146,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -165,6 +165,21 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <2>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -186,13 +201,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <2>;
};
};
};

View File

@ -99,6 +99,21 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <2>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -120,13 +135,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <2>;
};
};
};

View File

@ -125,6 +125,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -146,12 +159,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -128,6 +128,22 @@
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
nvmem-cells = <&macaddr_bdinfo_9>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@2 {
@ -139,14 +155,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
nvmem-cells = <&macaddr_bdinfo_9>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};
};
};

View File

@ -107,7 +107,14 @@
&gmac1 {
mtd-mac-address = <&factory 0xe006>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -78,6 +78,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -99,12 +112,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -115,7 +115,14 @@
};
&gmac1 {
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -109,6 +109,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -130,12 +143,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -105,6 +105,21 @@
mtd-mac-address = <&factory 0xe006>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -126,13 +141,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -14,7 +14,7 @@
led-failsafe = &led_red;
led-running = &led_blue;
led-upgrade = &led_red;
label-mac-device = &wan_port;
label-mac-device = &gmac1;
};
chosen {
@ -112,14 +112,21 @@
mtd-mac-address = <&factory 0x4>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x28>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
wan_port: port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x28>;
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -103,6 +103,21 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -124,13 +139,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -100,6 +100,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -121,12 +134,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -161,24 +161,27 @@
};
};
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
};
&gmac0 {
mtd-mac-address = <&config 0x8>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&config 0x8>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&config 0x8>;
mtd-mac-address-increment = <1>;
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -120,11 +120,6 @@
};
};
&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
};
&pcie {
status = "okay";
};

View File

@ -4,3 +4,25 @@
model = "Ubiquiti EdgeRouter X";
compatible = "ubnt,edgerouter-x", "mediatek,mt7621-soc";
};
&gmac1 {
status = "okay";
label = "eth0";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0x22>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "disabled";
};
};
};

View File

@ -77,6 +77,21 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -98,13 +113,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
};
};

View File

@ -179,6 +179,19 @@
mtd-mac-address = <&factory 0xe006>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe000>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@1 {
@ -195,12 +208,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
};
};
};

View File

@ -68,6 +68,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@1 {
@ -79,12 +92,6 @@
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -11,7 +11,7 @@
led-failsafe = &led_status_yellow;
led-running = &led_status_blue;
led-upgrade = &led_status_yellow;
label-mac-device = &wan;
label-mac-device = &gmac1;
};
chosen {
@ -135,6 +135,21 @@
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
nvmem-cells = <&macaddr_factory_e006>;
nvmem-cell-names = "mac-address";
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@2 {
@ -146,13 +161,6 @@
status = "okay";
label = "lan1";
};
wan: port@4 {
status = "okay";
label = "wan";
nvmem-cells = <&macaddr_factory_e006>;
nvmem-cell-names = "mac-address";
};
};
};

View File

@ -135,7 +135,14 @@
&gmac1 {
mtd-mac-address = <&factory 0x3fffa>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -30,7 +30,14 @@
&gmac1 {
mtd-mac-address = <&factory 0xe006>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -91,7 +91,14 @@
&gmac1 {
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&gsw {

View File

@ -128,14 +128,21 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy0>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
port@1 {
status = "okay";
label = "lan1";

View File

@ -136,6 +136,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -157,12 +170,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -77,6 +77,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -98,12 +111,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -99,6 +99,19 @@
mtd-mac-address = <&factory 0xe000>;
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <&ethphy4>;
mtd-mac-address = <&factory 0xe006>;
};
&mdio {
ethphy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@0 {
@ -120,12 +133,6 @@
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};

View File

@ -143,10 +143,6 @@
};
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
@ -162,7 +158,7 @@
&state_default {
gpio {
groups = "i2c", "rgmii2", "uart3", "jtag", "wdt";
groups = "i2c", "uart3", "jtag", "wdt";
function = "gpio";
};
};

View File

@ -3400,6 +3400,7 @@ static const struct net_device_ops mtk_netdev_ops = {
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
{
const char *name = of_get_property(np, "label", NULL);
const __be32 *_id = of_get_property(np, "reg", NULL);
struct phylink *phylink;
int phy_mode, id, err;
@ -3490,6 +3491,9 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
eth->netdev[id]->irq = eth->irq[0];
eth->netdev[id]->dev.of_node = np;
if (name)
strlcpy(eth->netdev[id]->name, name, IFNAMSIZ);
return 0;
free_netdev:

View File

@ -721,6 +721,7 @@ TARGET_DEVICES += glinet_gl-mt1300
define Device/gnubee_gb-pc1
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := GnuBee
DEVICE_MODEL := Personal Cloud One
DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-openssl
@ -730,6 +731,7 @@ TARGET_DEVICES += gnubee_gb-pc1
define Device/gnubee_gb-pc2
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := GnuBee
DEVICE_MODEL := Personal Cloud Two
DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-openssl

View File

@ -129,6 +129,7 @@ CONFIG_NET_RALINK_SOC=y
# CONFIG_NET_VENDOR_MEDIATEK is not set
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -146,6 +146,7 @@ CONFIG_NET_RALINK_SOC=y
# CONFIG_NET_VENDOR_MEDIATEK is not set
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -55,8 +55,8 @@ gehua,ghl-r-001)
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"
ucidef_set_led_netdev "ethblack_act" "ethblack act" "green:ethblack_act" "ethblack" "tx rx"
ucidef_set_led_netdev "ethblue_act" "ethblue act" "green:ethblue_act" "ethblue" "tx rx"
;;
linksys,e5600)
ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link"

View File

@ -53,9 +53,11 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "4:wan" "6u@eth0" "5u@eth1"
;;
gnubee,gb-pc1|\
gnubee,gb-pc1)
ucidef_set_interface_lan "ethblack ethblue"
;;
gnubee,gb-pc2)
ucidef_set_interface_lan "lan1 lan2"
ucidef_set_interface_lan "ethblack ethblue ethyellow"
;;
hatlab,gateboard-one)
ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth4" "eth5"

View File

@ -104,6 +104,7 @@ CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_GPIO=y
CONFIG_I2C_MT7621=y
CONFIG_ICPLUS_PHY=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
@ -196,6 +197,7 @@ CONFIG_NET_VENDOR_MEDIATEK=y
CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y
CONFIG_NR_CPUS=4
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -105,6 +105,7 @@ CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_GPIO=y
CONFIG_I2C_MT7621=y
CONFIG_ICPLUS_PHY=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
@ -192,6 +193,7 @@ CONFIG_NET_SWITCHDEV=y
# CONFIG_NET_VENDOR_RALINK is not set
CONFIG_NET_VENDOR_RAW_MEDIATEK=y
CONFIG_NR_CPUS=4
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -124,6 +124,7 @@ CONFIG_NET_RALINK_SOC=y
# CONFIG_NET_VENDOR_MEDIATEK is not set
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -126,6 +126,7 @@ CONFIG_NET_RALINK_SOC=y
# CONFIG_NET_VENDOR_MEDIATEK is not set
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -112,6 +112,7 @@ CONFIG_NET_RALINK_SOC=y
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NLS=m
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -112,6 +112,7 @@ CONFIG_NET_RALINK_SOC=y
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NLS=m
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -114,6 +114,7 @@ CONFIG_NET_RALINK_RT3050=y
CONFIG_NET_RALINK_SOC=y
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -114,6 +114,7 @@ CONFIG_NET_RALINK_RT3050=y
CONFIG_NET_RALINK_SOC=y
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

View File

@ -113,6 +113,7 @@ CONFIG_NET_RALINK_RT3883=y
CONFIG_NET_RALINK_SOC=y
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y

Some files were not shown because too many files have changed in this diff Show More