mediatek: add support for Netcore N60 (#165)

* add netcore n60 support

* revert to old wifi firmware

---------

Co-authored-by: padavanonly <padavanonly@github.com>
This commit is contained in:
padavanonly 2023-11-16 21:33:32 +08:00 committed by GitHub
parent d63a69e0d2
commit 65fb5f0767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 674 additions and 1 deletions

View File

@ -61,6 +61,9 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens
# MT7986
cp -f defconfig/mt7986-ax6000.config .config
# MT7986 256M Low Memory
cp -f defconfig/mt7986-ax6000-256m.config .config
```
7. Run `make menuconfig` to select your preferred configuration for the toolchain, target system & firmware packages.

View File

@ -0,0 +1,308 @@
CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_mt7986=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_mediatek_mt7986_DEVICE_xiaomi_redmi-router-ax6000=y
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7986_DEVICE_xiaomi_redmi-router-ax6000=""
CONFIG_TARGET_DEVICE_mediatek_mt7986_DEVICE_xiaomi_redmi-router-ax6000-stock=y
CONFIG_TARGET_DEVICE_PACKAGES_mediatek_mt7986_DEVICE_xiaomi_redmi-router-ax6000-stock=""
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_AFALG_UPDATE_CTR_IV=y
CONFIG_BUSYBOX_CONFIG_BLKID=y
CONFIG_BUSYBOX_CONFIG_FEATURE_BLKID_TYPE=y
CONFIG_BUSYBOX_CONFIG_VOLUMEID=y
CONFIG_CONNINFRA_AUTO_UP=y
CONFIG_CONNINFRA_EMI_SUPPORT=y
# CONFIG_GDB is not set
CONFIG_INCLUDE_CONFIG=y
CONFIG_JSON_OVERVIEW_IMAGE_INFO=y
# CONFIG_KERNEL_BLK_DEV_THROTTLING is not set
# CONFIG_KERNEL_CFS_BANDWIDTH is not set
CONFIG_KERNEL_CGROUP_DEVICE=y
CONFIG_KERNEL_CGROUP_FREEZER=y
CONFIG_KERNEL_DEVMEM=y
# CONFIG_KERNEL_KEYS is not set
# CONFIG_KERNEL_MEMCG_SWAP is not set
CONFIG_KERNEL_NET_CLS_CGROUP=y
CONFIG_MTK_ACK_CTS_TIMEOUT_SUPPORT=y
CONFIG_MTK_AIR_MONITOR=y
CONFIG_MTK_AMPDU_CONF_SUPPORT=y
CONFIG_MTK_ANTENNA_CONTROL_SUPPORT=y
CONFIG_MTK_APCLI_SUPPORT=y
CONFIG_MTK_ATE_SUPPORT=y
CONFIG_MTK_BACKGROUND_SCAN_SUPPORT=y
CONFIG_MTK_CAL_BIN_FILE_SUPPORT=y
CONFIG_MTK_CFG_SUPPORT_FALCON_MURU=y
CONFIG_MTK_CFG_SUPPORT_FALCON_PP=y
CONFIG_MTK_CFG_SUPPORT_FALCON_SR=y
CONFIG_MTK_CFG_SUPPORT_FALCON_TXCMD_DBG=y
CONFIG_MTK_CHIP_MT7986=y
CONFIG_MTK_CONNINFRA_APSOC=y
CONFIG_MTK_CONNINFRA_APSOC_MT7986=y
CONFIG_MTK_CON_WPS_SUPPORT=y
CONFIG_MTK_DBDC_MODE=y
CONFIG_MTK_DOT11K_RRM_SUPPORT=y
CONFIG_MTK_DOT11R_FT_SUPPORT=y
CONFIG_MTK_DOT11W_PMF_SUPPORT=y
CONFIG_MTK_DOT11_HE_AX=y
CONFIG_MTK_DOT11_N_SUPPORT=y
CONFIG_MTK_DOT11_VHT_AC=y
CONFIG_MTK_FAST_NAT_SUPPORT=y
CONFIG_MTK_FIRST_IF_EEPROM_FLASH=y
CONFIG_MTK_FIRST_IF_IPAILNA=y
CONFIG_MTK_FIRST_IF_MT7986=y
CONFIG_MTK_GREENAP_SUPPORT=y
CONFIG_MTK_G_BAND_256QAM_SUPPORT=y
CONFIG_MTK_HDR_TRANS_RX_SUPPORT=y
CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
CONFIG_MTK_ICAP_SUPPORT=y
CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
CONFIG_MTK_INTERWORKING=y
CONFIG_MTK_MAP_R2_VER_SUPPORT=y
CONFIG_MTK_MAP_R3_VER_SUPPORT=y
CONFIG_MTK_MAP_SUPPORT=y
CONFIG_MTK_MBSS_DTIM_SUPPORT=y
CONFIG_MTK_MBSS_SUPPORT=y
CONFIG_MTK_MCAST_RATE_SPECIFIC=y
CONFIG_MTK_MEMORY_SHRINK=y
CONFIG_MTK_MEMORY_SHRINK_AGGRESS=y
CONFIG_MTK_MGMT_TXPWR_CTRL=y
CONFIG_MTK_MLME_MULTI_QUEUE_SUPPORT=y
# CONFIG_MTK_MT7986_NEW_FW is not set
CONFIG_MTK_MT_AP_SUPPORT=m
CONFIG_MTK_MT_DFS_SUPPORT=y
CONFIG_MTK_MT_MAC=y
CONFIG_MTK_MT_WIFI=m
CONFIG_MTK_MT_WIFI_PATH="mt_wifi"
CONFIG_MTK_MUMIMO_SUPPORT=y
CONFIG_MTK_MU_RA_SUPPORT=y
CONFIG_MTK_OFFCHANNEL_SCAN_FEATURE=y
CONFIG_MTK_OWE_SUPPORT=y
CONFIG_MTK_PHY_ICS_SUPPORT=y
CONFIG_MTK_QOS_R1_SUPPORT=y
CONFIG_MTK_RA_PHY_RATE_SUPPORT=y
CONFIG_MTK_RED_SUPPORT=y
CONFIG_MTK_RTMP_FLASH_SUPPORT=y
CONFIG_MTK_RT_FIRST_CARD_EEPROM="flash"
CONFIG_MTK_RT_FIRST_IF_RF_OFFSET=0xc0000
CONFIG_MTK_SCS_FW_OFFLOAD=y
CONFIG_MTK_SECOND_IF_NONE=y
CONFIG_MTK_SMART_CARRIER_SENSE_SUPPORT=y
CONFIG_MTK_SPECTRUM_SUPPORT=y
CONFIG_MTK_SUPPORT_OPENWRT=y
CONFIG_MTK_THERMAL_PROTECT_SUPPORT=y
CONFIG_MTK_THIRD_IF_NONE=y
CONFIG_MTK_TPC_SUPPORT=y
CONFIG_MTK_TXBF_SUPPORT=y
CONFIG_MTK_UAPSD=y
CONFIG_MTK_VLAN_SUPPORT=y
CONFIG_MTK_VOW_SUPPORT=y
CONFIG_MTK_WARP_V2=y
CONFIG_MTK_WDS_SUPPORT=y
CONFIG_MTK_WHNAT_SUPPORT=m
CONFIG_MTK_WIFI_ADIE_TYPE="mt7976"
CONFIG_MTK_WIFI_BASIC_FUNC=y
CONFIG_MTK_WIFI_DRIVER=y
CONFIG_MTK_WIFI_EAP_FEATURE=y
CONFIG_MTK_WIFI_FW_BIN_LOAD=y
CONFIG_MTK_WIFI_MODE_AP=m
CONFIG_MTK_WIFI_MT_MAC=y
CONFIG_MTK_WIFI_SKU_TYPE="AX6000"
CONFIG_MTK_WIFI_TWT_SUPPORT=y
CONFIG_MTK_WLAN_HOOK=y
CONFIG_MTK_WLAN_SERVICE=y
CONFIG_MTK_WNM_SUPPORT=y
CONFIG_MTK_WPA3_SUPPORT=y
CONFIG_MTK_WSC_INCLUDED=y
CONFIG_MTK_WSC_V2_SUPPORT=y
# CONFIG_OPENSSL_ENGINE_BUILTIN is not set
# CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM is not set
CONFIG_OPENSSL_WITH_NPN=y
# CONFIG_PACKAGE_TURBOACC_INCLUDE_FLOW_OFFLOADING is not set
CONFIG_PACKAGE_TURBOACC_INCLUDE_NO_FASTPATH=y
CONFIG_PACKAGE_blkid=m
CONFIG_PACKAGE_blockd=y
CONFIG_PACKAGE_blockdev=m
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_datconf=y
CONFIG_PACKAGE_datconf-lua=y
CONFIG_PACKAGE_e2fsprogs=m
CONFIG_PACKAGE_ethtool=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_ip-bridge=y
CONFIG_PACKAGE_ip6tables-extra=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y
CONFIG_PACKAGE_iptables-mod-filter=y
CONFIG_PACKAGE_iptables-mod-hashlimit=y
CONFIG_PACKAGE_iptables-mod-iface=y
CONFIG_PACKAGE_iptables-mod-ipmark=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-mod-iprange=y
CONFIG_PACKAGE_iptables-mod-ipv4options=y
CONFIG_PACKAGE_iptables-mod-nat-extra=y
CONFIG_PACKAGE_iptables-mod-proto=y
CONFIG_PACKAGE_iptables-mod-tee=y
CONFIG_PACKAGE_iptables-mod-tproxy=y
CONFIG_PACKAGE_iptables-mod-u32=y
CONFIG_PACKAGE_iw=y
CONFIG_PACKAGE_iwinfo=y
CONFIG_PACKAGE_kmod-ata-core=y
CONFIG_PACKAGE_kmod-conninfra=y
CONFIG_PACKAGE_kmod-crypto-acompress=y
CONFIG_PACKAGE_kmod-crypto-ccm=y
CONFIG_PACKAGE_kmod-crypto-cmac=y
CONFIG_PACKAGE_kmod-crypto-crc32c=y
CONFIG_PACKAGE_kmod-crypto-ctr=y
CONFIG_PACKAGE_kmod-crypto-des=y
CONFIG_PACKAGE_kmod-crypto-gcm=y
CONFIG_PACKAGE_kmod-crypto-gf128=y
CONFIG_PACKAGE_kmod-crypto-ghash=y
CONFIG_PACKAGE_kmod-crypto-hmac=y
CONFIG_PACKAGE_kmod-crypto-md4=y
CONFIG_PACKAGE_kmod-crypto-md5=y
CONFIG_PACKAGE_kmod-crypto-rng=y
CONFIG_PACKAGE_kmod-crypto-seqiv=y
CONFIG_PACKAGE_kmod-crypto-sha256=y
CONFIG_PACKAGE_kmod-crypto-sha512=y
CONFIG_PACKAGE_kmod-fs-autofs4=y
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_kmod-inet-diag=y
CONFIG_PACKAGE_kmod-ip6tables-extra=y
CONFIG_PACKAGE_kmod-ipt-compat-xtables=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-extra=y
CONFIG_PACKAGE_kmod-ipt-filter=y
CONFIG_PACKAGE_kmod-ipt-hashlimit=y
CONFIG_PACKAGE_kmod-ipt-iface=y
CONFIG_PACKAGE_kmod-ipt-ipmark=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-ipt-iprange=y
CONFIG_PACKAGE_kmod-ipt-ipv4options=y
CONFIG_PACKAGE_kmod-ipt-nat-extra=y
CONFIG_PACKAGE_kmod-ipt-offload=y
CONFIG_PACKAGE_kmod-ipt-proto=y
CONFIG_PACKAGE_kmod-ipt-raw6=y
CONFIG_PACKAGE_kmod-ipt-tee=y
CONFIG_PACKAGE_kmod-ipt-tproxy=y
CONFIG_PACKAGE_kmod-ipt-u32=y
CONFIG_PACKAGE_kmod-leds-ws2812b=y
CONFIG_PACKAGE_kmod-lib-crc16=m
CONFIG_PACKAGE_kmod-lib-crc32c=y
CONFIG_PACKAGE_kmod-lib-lzo=y
CONFIG_PACKAGE_kmod-mediatek_hnat=y
CONFIG_PACKAGE_kmod-mt_wifi=y
CONFIG_PACKAGE_kmod-nf-flow=y
CONFIG_PACKAGE_kmod-nls-base=y
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-nls-utf8=y
CONFIG_PACKAGE_kmod-scsi-core=y
CONFIG_PACKAGE_kmod-tcp-bbr=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-warp=y
CONFIG_PACKAGE_kmod-zram=y
CONFIG_PACKAGE_kvcedit=y
CONFIG_PACKAGE_libatomic=y
CONFIG_PACKAGE_libblkid=y
CONFIG_PACKAGE_libcap-ng=y
CONFIG_PACKAGE_libcbor=y
CONFIG_PACKAGE_libcomerr=m
CONFIG_PACKAGE_libevdev=y
CONFIG_PACKAGE_libext2fs=m
CONFIG_PACKAGE_libf2fs=m
CONFIG_PACKAGE_libfido2=y
CONFIG_PACKAGE_libipset=y
CONFIG_PACKAGE_libkvcutil=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libnl=y
CONFIG_PACKAGE_libnl-core=y
CONFIG_PACKAGE_libnl-genl=y
CONFIG_PACKAGE_libnl-nf=y
CONFIG_PACKAGE_libnl-route=y
CONFIG_PACKAGE_libopenssl-afalg_sync=y
CONFIG_PACKAGE_libopenssl-devcrypto=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_libsmartcols=m
CONFIG_PACKAGE_libss=m
CONFIG_PACKAGE_libstdcpp=y
CONFIG_PACKAGE_libudev-zero=y
CONFIG_PACKAGE_libuuid=y
CONFIG_PACKAGE_losetup=m
CONFIG_PACKAGE_luci-app-mtk=y
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin is not set
# CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray is not set
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-ng is not set
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-webui is not set
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ChinaDNS_NG is not set
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_NONE_V2RAY=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Libev_Client is not set
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_NONE_Client=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_NONE_Server=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Rust_Client is not set
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Rust_Server is not set
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Simple_Obfs is not set
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray is not set
CONFIG_PACKAGE_luci-app-turboacc-mtk=y
CONFIG_PACKAGE_luci-app-upnp=y
# CONFIG_PACKAGE_luci-app-vssr_INCLUDE_ShadowsocksR_Libev_Server is not set
# CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Trojan is not set
# CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Xray is not set
# CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Xray_plugin is not set
CONFIG_PACKAGE_luci-i18n-mtk-zh-cn=y
CONFIG_PACKAGE_luci-i18n-turboacc-mtk-zh-cn=y
CONFIG_PACKAGE_luci-i18n-upnp-zh-cn=y
CONFIG_PACKAGE_luci-theme-argon=y
CONFIG_PACKAGE_luci-theme-bootstrap-mod=y
CONFIG_PACKAGE_mii_mgr=y
CONFIG_PACKAGE_miniupnpd=y
CONFIG_PACKAGE_mkf2fs=m
CONFIG_PACKAGE_mtkhqos_util=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_openssh-keygen=y
CONFIG_PACKAGE_openssh-sftp-server=y
CONFIG_PACKAGE_openssl-util=y
CONFIG_PACKAGE_regs=y
CONFIG_PACKAGE_resolveip=y
CONFIG_PACKAGE_swconfig=y
CONFIG_PACKAGE_switch=y
CONFIG_PACKAGE_tcpdump=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_wifi-profile=y
CONFIG_PACKAGE_wireless-regdb=y
CONFIG_PACKAGE_wireless-tools=y
CONFIG_PACKAGE_zram-swap=y
# CONFIG_PKG_CHECK_FORMAT_SECURITY is not set
# CONFIG_PKG_FORTIFY_SOURCE_1 is not set
CONFIG_PKG_FORTIFY_SOURCE_2=y
CONFIG_WARP_CHIPSET="mt7986"
CONFIG_WARP_DBG_SUPPORT=y
CONFIG_WARP_MEMORY_LEAK_DBG=y
CONFIG_WARP_NEW_FW=y
CONFIG_WARP_VERSION=2
CONFIG_WED_HW_RRO_SUPPORT=y
CONFIG_WIFI_NORMAL_SETTING=y
# CONFIG_WOLFSSL_HAS_ECC25519 is not set
CONFIG_first_card=y
CONFIG_first_card_name="MT7986"
# CONFIG_AFALG_FALLBACK is not set
# CONFIG_MTK_BAND_STEERING is not set
# CONFIG_MTK_DEFAULT_5G_PROFILE is not set
# CONFIG_MTK_MAC_REPEATER_SUPPORT is not set
# CONFIG_MTK_MULTI_PROFILE_SUPPORT is not set
# CONFIG_MTK_PCIE_ASPM_DYM_CTRL_SUPPORT is not set
# CONFIG_MTK_PRE_CAL_TRX_SET1_SUPPORT is not set
# CONFIG_MTK_PRE_CAL_TRX_SET2_SUPPORT is not set
# CONFIG_MTK_RLM_CAL_CACHE_SUPPORT is not set
# CONFIG_MTK_SNIFFER_RADIOTAP_SUPPORT is not set

View File

@ -0,0 +1,14 @@
--- a/mt_wifi/chips/mt7986.c 2022-11-27 21:58:55.000000000 +0800
+++ b/mt_wifi/chips/mt7986.c 2023-11-15 09:48:03.261447607 +0800
@@ -12157,7 +12157,11 @@
chip_cap->tkn_info.low_water_mark = 5;
chip_cap->tkn_info.hw_tx_token_cnt = 8192;
#ifdef MEMORY_SHRINK
+#ifdef MEMORY_SHRINK_AGGRESS
+ chip_cap->tkn_info.token_rx_cnt = 4592;
+#else
chip_cap->tkn_info.token_rx_cnt = 12288;
+#endif /* MEMORY_SHRINK_AGGRESS */
#else
chip_cap->tkn_info.token_rx_cnt = 15360;
#endif

View File

@ -711,6 +711,7 @@ setup_model()
case $board in
xiaomi,redmi-router-ax6000* |\
bananapi,bpi-r3mini* |\
netcore,n60 |\
*7986*)
MT7986_whnat $num_of_wifi
;;

View File

@ -0,0 +1,320 @@
// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
/dts-v1/;
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "mt7986a.dtsi"
#include "mt7986a-pinctrl.dtsi"
/ {
model = "Netcore N60";
compatible = "netcore,n60", "mediatek,mt7986a";
chosen {
bootargs = "console=ttyS0,115200n1 loglevel=8 \
earlycon=uart8250,mmio32,0x11002000";
};
aliases {
led-boot = &led_status_red;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_blue;
};
memory {
reg = <0 0x40000000 0 0x10000000>;
};
gpio-keys {
compatible = "gpio-keys";
button-reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
};
button-wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led_status_red: status_red {
label = "red:status";
gpios = <&pio 29 GPIO_ACTIVE_LOW>;
};
led_status_blue: status_blue {
label = "blue:status";
gpios = <&pio 32 GPIO_ACTIVE_LOW>;
};
};
nmbm_spim_nand {
compatible = "generic,nmbm";
#address-cells = <1>;
#size-cells = <1>;
lower-mtd-device = <&spi_nand>;
forced-create;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "BL2";
reg = <0x00000 0x0100000>;
read-only;
};
partition@100000 {
label = "u-boot-env";
reg = <0x0100000 0x0080000>;
};
Factory: partition@180000 {
label = "Factory";
reg = <0x180000 0x0200000>;
};
partition@380000 {
label = "FIP";
reg = <0x380000 0x0200000>;
};
partition@580000 {
label = "ubi";
reg = <0x580000 0x7280000>;
};
};
};
};
&eth {
status = "okay";
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
mdio: mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
phy5: phy@5 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <5>;
};
phy6: phy@6 {
compatible = "ethernet-phy-id67c9.de0a";
reg = <6>;
reset-gpios = <&pio 6 1>;
reset-assert-us = <600>;
reset-deassert-us = <20000>;
phy-mode = "2500base-x";
};
switch@0 {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan0";
};
port@1 {
reg = <1>;
label = "lan1";
};
port@3 {
reg = <2>;
label = "lan2";
};
port@4 {
reg = <4>;
label = "lan3";
};
port@6 {
reg = <6>;
label = "cpu";
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
};
};
&xhci {
status = "okay";
};
&hnat {
mtketh-wan = "eth1";
mtketh-lan = "lan";
mtketh-max-gmac = <2>;
status = "okay";
};
&pio {
spi_flash_pins: spi-flash-pins-33-to-38 {
mux {
function = "flash";
groups = "spi0", "spi0_wp_hold";
};
conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <8>;
mediatek,pull-up-adv = <0>;
};
conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <8>;
mediatek,pull-down-adv = <0>;
};
};
wf_2g_5g_pins: wf_2g_5g-pins {
mux {
function = "wifi";
groups = "wf_2g", "wf_5g";
};
conf {
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
"WF1_TOP_CLK", "WF1_TOP_DATA";
drive-strength = <MTK_DRIVE_4mA>;
};
};
wf_dbdc_pins: wf_dbdc-pins {
mux {
function = "wifi";
groups = "wf_dbdc";
};
conf {
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
"WF1_TOP_CLK", "WF1_TOP_DATA";
drive-strength = <MTK_DRIVE_4mA>;
};
};
};
&pcie0 {
pinctrl-names = "default";
pinctrl-0 = <&pcie0_pins>;
status = "okay";
};
&uart0 {
status = "okay";
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
status = "okay";
cs-gpios = <0>, <0>;
spi_nand: spi_nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <1>;
spi-max-frequency = <20000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;
};
};
&wbsys {
status = "okay";
mediatek,mtd-eeprom = <&Factory 0x0000>;
};
&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spic_pins_g2>;
status = "okay";
};
&watchdog {
status = "okay";
};
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c_pins>;
status = "okay";
wm8960: wm8960@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
};
};
&auxadc {
status = "okay";
};

View File

@ -418,3 +418,19 @@ define Device/BPI-R3MINI-EMMC
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += BPI-R3MINI-EMMC
define Device/netcore_n60
DEVICE_VENDOR := Netcore
DEVICE_MODEL := N60
DEVICE_DTS := mt7986a-netcore-n60
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
SUPPORTED_DEVICES := netcore,n60
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += netcore_n60

View File

@ -27,6 +27,9 @@ mediatek_setup_interfaces()
bananapi,bpi-r3mini*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
netcore,n60)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
;;
*)
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3 lan4 lan5" eth1
;;
@ -38,8 +41,14 @@ mediatek_setup_macs()
local board="$1"
local lan_mac=""
local wan_mac=""
local part_name="Factory"
case $board in
*netcore,n60*)
wifi_mac=$(mtd_get_mac_binary $part_name 4)
lan_mac="$(macaddr_add $wifi_mac -1)"
wan_mac="$(macaddr_add $wifi_mac -2)"
;;
xiaomi,redmi-router-ax6000*)
wan_mac=$(mtd_get_mac_ascii Bdata ethaddr_wan)
lan_mac=$(mtd_get_mac_ascii Bdata ethaddr)

View File

@ -147,6 +147,7 @@ platform_do_upgrade() {
;;
xiaomi,redmi-router-ax6000 |\
bananapi,bpi-r3mini |\
netcore,n60|\
*snand*)
nand_do_upgrade "$1"
;;
@ -171,6 +172,7 @@ platform_check_image() {
case "$board" in
xiaomi,redmi-router-ax6000* |\
bananapi,bpi-r3mini* |\
netcore,n60|\
*snand* |\
*emmc*)
# tar magic `ustar`