Skip to content

Commit 23ecef0

Browse files
nradio test
1 parent f648c6a commit 23ecef0

File tree

4 files changed

+282
-1
lines changed

4 files changed

+282
-1
lines changed

.github/workflows/build_image_mt7981.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,34 @@ jobs:
314314
mkdir -p $VOLUME_HOME/mypackages
315315
mv $VOLUME_HOME/*.ipk $VOLUME_HOME/mypackages/
316316
317+
- name: Prepare DTS
318+
run: |
319+
cat << EOF >> /openwrt_base/target/linux/mediatek/image/filogic.mk
320+
321+
define Device/nradio_c8-668
322+
DEVICE_VENDOR := NRadio
323+
DEVICE_MODEL := C8-668
324+
DEVICE_DTS := mt7981-nradio-wt9108
325+
DEVICE_DTS_DIR := ../dts
326+
UBINIZE_OPTS := -E 5
327+
BLOCKSIZE := 128k
328+
PAGESIZE := 2048
329+
IMAGE_SIZE := 65536k
330+
KERNEL_IN_UBI := 1
331+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
332+
DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware mt7981-wo-firmware
333+
endef
334+
TARGET_DEVICES += nradio_c8-668
335+
336+
EOF
337+
338+
cat /openwrt_base/target/linux/mediatek/image/filogic.mk
339+
340+
cp $VOLUME_HOME/nradio/dts/* /openwrt_base/target/linux/mediatek/dts/
341+
317342
- name: Set profile
318343
run: |
319-
echo "profile=confiabits_mt7981" >> $GITHUB_ENV
344+
echo "profile=nradio_c8-668" >> $GITHUB_ENV
320345
- name: Make Image
321346
run: |
322347
export VOLUME_HOME=${{ github.workspace }}

nradio/dts/mt7981-nradio-common.dtsi

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include "mt7981.dtsi"
2+
3+
/ {
4+
chosen {
5+
bootargs = "console=ttyS0,115200n1 loglevel=8 \
6+
earlycon=uart8250,mmio32,0x11002000";
7+
};
8+
9+
gpio-keys {
10+
compatible = "gpio-keys";
11+
reset {
12+
label = "reset";
13+
linux,code = <KEY_RESTART>;
14+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
15+
};
16+
17+
wps {
18+
label = "wps";
19+
linux,code = <KEY_WPS_BUTTON>;
20+
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
21+
};
22+
};
23+
};
24+
25+
&uart0 {
26+
status = "okay";
27+
};
28+
29+
&watchdog {
30+
status = "okay";
31+
};

nradio/dts/mt7981-nradio-emmc.dtsi

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#include "mt7981-nradio-common.dtsi"
2+
3+
/ {
4+
compatible = "HCMT7981-EMMC", "mediatek,mt7981-emmc-rfb";
5+
chosen {
6+
bootargs = "console=ttyS0,115200n1 loglevel=8 \
7+
earlycon=uart8250,mmio32,0x11002000 \
8+
root=PARTLABEL=rootfs rootfstype=squashfs,f2fs";
9+
};
10+
memory {
11+
// fpga ddr4: 1GB
12+
reg = <0 0x40000000 0 0x40000000>;
13+
};
14+
};
15+
16+
&mmc0 {
17+
pinctrl-names = "default", "state_uhs";
18+
pinctrl-0 = <&mmc0_pins_default>;
19+
pinctrl-1 = <&mmc0_pins_uhs>;
20+
bus-width = <8>;
21+
max-frequency = <52000000>;
22+
cap-mmc-highspeed;
23+
vmmc-supply = <&reg_3p3v>;
24+
non-removable;
25+
status = "okay";
26+
};
27+
28+
&spi1 {
29+
pinctrl-names = "default";
30+
pinctrl-0 = <&spic_pins>;
31+
status = "disabled";
32+
};
33+
34+
&pio {
35+
36+
spic_pins: spi1-pins {
37+
mux {
38+
function = "spi";
39+
groups = "spi1_1";
40+
};
41+
};
42+
43+
mmc0_pins_default: mmc0-pins-default {
44+
mux {
45+
function = "flash";
46+
groups = "emmc_45";
47+
};
48+
};
49+
50+
mmc0_pins_uhs: mmc0-pins-uhs {
51+
mux {
52+
function = "flash";
53+
groups = "emmc_45";
54+
};
55+
};
56+
};
57+
58+
&eth {
59+
status = "okay";
60+
61+
gmac0: mac@0 {
62+
compatible = "mediatek,eth-mac";
63+
reg = <0>;
64+
phy-mode = "2500base-x";
65+
66+
fixed-link {
67+
speed = <2500>;
68+
full-duplex;
69+
pause;
70+
};
71+
};
72+
73+
gmac1: mac@1 {
74+
compatible = "mediatek,eth-mac";
75+
reg = <1>;
76+
phy-mode = "2500base-x";
77+
78+
fixed-link {
79+
speed = <2500>;
80+
full-duplex;
81+
pause;
82+
};
83+
};
84+
85+
mdio: mdio-bus {
86+
#address-cells = <1>;
87+
#size-cells = <0>;
88+
89+
phy5: phy@5 {
90+
compatible = "ethernet-phy-id67c9.de0a";
91+
reg = <5>;
92+
reset-gpios = <&pio 7 1>;
93+
reset-assert-us = <600>;
94+
reset-deassert-us = <20000>;
95+
phy-mode = "2500base-x";
96+
};
97+
98+
phy6: phy@6 {
99+
compatible = "ethernet-phy-id67c9.de0a";
100+
reg = <21>;
101+
reset-gpios = <&pio 8 1>;
102+
reset-assert-us = <600>;
103+
reset-deassert-us = <20000>;
104+
phy-mode = "2500base-x";
105+
};
106+
107+
switch@0 {
108+
compatible = "mediatek,mt7531";
109+
reg = <31>;
110+
reset-gpios = <&pio 39 0>;
111+
112+
ports {
113+
#address-cells = <1>;
114+
#size-cells = <0>;
115+
116+
port@1 {
117+
reg = <1>;
118+
label = "port1";
119+
};
120+
121+
port@2 {
122+
reg = <2>;
123+
label = "port2";
124+
};
125+
126+
port@3 {
127+
reg = <3>;
128+
label = "port3";
129+
};
130+
131+
port@5 {
132+
reg = <5>;
133+
label = "port5";
134+
phy-mode = "2500base-x";
135+
phy-handle = <&phy5>;
136+
};
137+
138+
port@6 {
139+
reg = <6>;
140+
label = "cpu";
141+
ethernet = <&gmac0>;
142+
phy-mode = "2500base-x";
143+
144+
fixed-link {
145+
speed = <2500>;
146+
full-duplex;
147+
pause;
148+
};
149+
};
150+
};
151+
};
152+
};
153+
};
154+
155+
&xhci {
156+
status = "okay";
157+
};
158+
159+
&hnat {
160+
mtketh-wan = "eth1";
161+
mtketh-lan = "port";
162+
mtketh-max-gmac = <2>;
163+
status = "okay";
164+
};

nradio/dts/mt7981-nradio-wt9108.dts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/dts-v1/;
2+
3+
#include "mt7981-nradio-emmc.dtsi"
4+
5+
/ {
6+
model = "HC-WT9108";
7+
8+
aliases {
9+
led-boot = &led_status;
10+
led-failsafe = &led_status;
11+
led-running = &led_status;
12+
led-upgrade = &led_status;
13+
};
14+
15+
gpio_export {
16+
compatible = "gpio-export";
17+
#size-cells = <0>;
18+
19+
cpepower {
20+
gpio-export,name = "cpe-pwr";
21+
gpio-export,output = <0>;
22+
gpios = <&pio 31 GPIO_ACTIVE_LOW>;
23+
};
24+
25+
usbpower {
26+
gpio-export,name = "usb-pwr";
27+
gpio-export,output = <0>;
28+
gpios = <&pio 27 GPIO_ACTIVE_LOW>;
29+
};
30+
31+
cpesel0 {
32+
gpio-export,name = "cpe-sel0";
33+
gpio-export,output = <1>;
34+
gpios = <&pio 30 GPIO_ACTIVE_HIGH>;
35+
};
36+
};
37+
38+
gpio-leds {
39+
compatible = "gpio-leds";
40+
41+
led_status: status {
42+
label = "hc:blue:status";
43+
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
44+
};
45+
46+
cmode5 {
47+
label = "hc:blue:cmode5";
48+
gpios = <&pio 11 GPIO_ACTIVE_LOW>;
49+
};
50+
51+
cmode4 {
52+
label = "hc:blue:cmode4";
53+
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
54+
};
55+
56+
wifi {
57+
label = "hc:blue:wifi";
58+
gpios = <&pio 13 GPIO_ACTIVE_LOW>;
59+
};
60+
};
61+
};

0 commit comments

Comments
 (0)