Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
//Thanks Zy143L's work
/dts-v1/;
#include "mt7981.dtsi"

/ {
model = "NRadio C8-660-2nd";
compatible = "nradio,wt9103", "mediatek,mt7981";

aliases {
led-boot = &status_blue;
led-failsafe = &status_blue;
led-running = &status_blue;
led-upgrade = &status_blue;
};

chosen {
bootargs = "console=ttyS0,115200n1 loglevel=8 \
earlycon=uart8250,mmio32,0x11002000";
};

gpio-export {
compatible = "gpio-export";

cpepower {
gpio-export,name = "cpe-pwr";
gpio-export,output = <0>;
gpios = <&pio 25 GPIO_ACTIVE_LOW>;
};

cpesel0 {
gpio-export,name = "cpe-sel0";
gpio-export,output = <1>;
gpios = <&pio 24 GPIO_ACTIVE_HIGH>;
};
};

gpio-keys {
compatible = "gpio-keys";

button-reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
};

button-wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
};
};

gpio-leds {
compatible = "gpio-leds";

status_blue: status {
label = "hc:blue:status";
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
};

cmode5 {
label = "hc:blue:cmode5";
gpios = <&pio 11 GPIO_ACTIVE_LOW>;
};

cmode4 {
label = "hc:blue:cmode4";
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};

wifi {
label = "hc:blue:wifi";
gpios = <&pio 13 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>;
};

partition@180000 {
label = "factory";
reg = <0x180000 0x0180000>;
};

partition@300000 {
label = "bdinfo";
reg = <0x300000 0x0080000>;
};

partition@380000 {
label = "FIP";
reg = <0x380000 0x0200000>;
};

partition@580000 {
label = "ubi_1st";
reg = <0x580000 0x4000000>;
};

partition@4580000 {
label = "app_data";
reg = <0x4580000 0x1000000>;
};

partition@5580000 {
label = "ubi";
reg = <0x5580000 0x18A80000>;
};
};
};
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
status = "okay";
spi_nand: spi_nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
reg = <0>;
spi-max-frequency = <52000000>;
spi-tx-buswidth = <4>;
spi-rx-buswidth = <4>;
};
};

&pio {
status = "okay";
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};

conf-pu {
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};

conf-pd {
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
drive-strength = <MTK_DRIVE_8mA>;
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
};
};
};

&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";
compatible = "ethernet-phy-id67c9.de0a";
reg = <5>;
reset-gpios = <&pio 7 1>;
reset-assert-us = <600>;
reset-deassert-us = <20000>;
phy-mode = "2500base-x";
};

phy6: phy@6 {
// compatible = "ethernet-phy-ieee802.3-c45";
compatible = "ethernet-phy-id67c9.de0a";
reg = <21>;
reset-gpios = <&pio 8 1>;
reset-assert-us = <600>;
reset-deassert-us = <20000>;
phy-mode = "2500base-x";
};

switch@0 {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 39 0>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@1 {
reg = <1>;
label = "lan1";
};

port@2 {
reg = <2>;
label = "lan2";
};

port@3 {
reg = <3>;
label = "lan3";
};

port@5 {
reg = <5>;
label = "lan4";
phy-mode = "2500base-x";
phy-handle = <&phy5>;
};

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";
};

&uart0 {
status = "okay";
};

&watchdog {
status = "okay";
};
17 changes: 17 additions & 0 deletions target/linux/mediatek/image/mt7981.mk
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,23 @@ define Device/nradio_wt9103_512m
endef
TARGET_DEVICES += nradio_wt9103_512m

define Device/nradio_wt9103_2nd
DEVICE_VENDOR := NRADIO
DEVICE_MODEL := WT9103 (with Second System)
DEVICE_DTS := mt7981-nradio-wt9103-2nd
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
SUPPORTED_DEVICES := nradio,wt9103
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 131072k
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 += nradio_wt9103_2nd

define Device/routerich_ax3000
DEVICE_VENDOR := Routerich
DEVICE_MODEL := AX3000
Expand Down