Skip to content

Commit 5a7fb83

Browse files
1715173329hauke
authored andcommitted
mediatek: update openembed som7981 support
The board has been redesigned due to previous hardware bugs (with other reasons maybe). Changes in new board: - Added a gpio beeper - Added a Atmel i2c eeprom - Added a Atmel i2c ECC accelerator - Added a Philips RTC module - Added two RS485 - Removed WPS button - Replaced USB3 port with M.2 B-key for LTE modules - Swapped GbE LEDs gpio Also assigned wifi mac with nvmem binding, added iface setup for failsafe, increased phy assert time for rtl8221b, and updated LED labels. Keeping compatibility for old version is not necessary here as only few samples were sent to those interested in it. Signed-off-by: Tianling Shen <[email protected]> Link: openwrt#17253 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 9d434a8 commit 5a7fb83

File tree

5 files changed

+99
-27
lines changed

5 files changed

+99
-27
lines changed

target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ set_preinit_iface() {
22
case $(board_name) in
33
cudy,m3000-v1|\
44
cudy,tr3000-v1|\
5-
glinet,gl-mt3000)
5+
glinet,gl-mt3000|\
6+
openembed,som7981)
67
ip link set eth1 up
78
ifname=eth1
89
;;

target/linux/mediatek/dts/mt7981b-openembed-som7981.dts

+91-20
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
compatible = "openembed,som7981", "mediatek,mt7981";
1313

1414
aliases {
15-
led-boot = &wlan2g_led;
16-
led-failsafe = &wlan2g_led;
17-
led-upgrade = &wlan2g_led;
15+
led-boot = &act_led;
16+
led-failsafe = &act_led;
17+
led-running = &act_led;
18+
led-upgrade = &act_led;
1819
serial0 = &uart0;
1920
};
2021

@@ -26,6 +27,11 @@
2627
reg = <0 0x40000000 0 0x40000000>;
2728
};
2829

30+
beeper {
31+
compatible = "gpio-beeper";
32+
gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
33+
};
34+
2935
gpio-keys {
3036
compatible = "gpio-keys";
3137

@@ -34,41 +40,34 @@
3440
linux,code = <KEY_RESTART>;
3541
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
3642
};
37-
38-
button-wps {
39-
label = "wps";
40-
linux,code = <KEY_WPS_BUTTON>;
41-
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
42-
};
4343
};
4444

4545
gpio-leds {
4646
compatible = "gpio-leds";
4747

4848
led-0 {
4949
function = LED_FUNCTION_LAN;
50-
color = <LED_COLOR_ID_AMBER>;
50+
color = <LED_COLOR_ID_GREEN>;
5151
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
5252
};
5353

5454
led-1 {
5555
function = LED_FUNCTION_LAN;
56-
color = <LED_COLOR_ID_GREEN>;
56+
color = <LED_COLOR_ID_AMBER>;
5757
gpios = <&pio 13 GPIO_ACTIVE_LOW>;
5858
};
5959

60-
wlan2g_led: led-2 {
61-
function = LED_FUNCTION_WLAN_2GHZ;
62-
color = <LED_COLOR_ID_RED>;
60+
led-2 {
61+
function = LED_FUNCTION_PANIC;
62+
color = <LED_COLOR_ID_GREEN>;
6363
gpios = <&pio 34 GPIO_ACTIVE_LOW>;
64-
linux,default-trigger = "phy0tpt";
64+
panic-indicator;
6565
};
6666

67-
led-3 {
68-
function = LED_FUNCTION_WLAN_5GHZ;
67+
act_led: led-3 {
68+
function = LED_FUNCTION_ACTIVITY;
6969
color = <LED_COLOR_ID_RED>;
7070
gpios = <&pio 35 GPIO_ACTIVE_LOW>;
71-
linux,default-trigger = "phy1tpt";
7271
};
7372
};
7473
};
@@ -97,14 +96,38 @@
9796
};
9897
};
9998

99+
&i2c0 {
100+
clock-frequency = <400000>;
101+
pinctrl-names = "default";
102+
pinctrl-0 = <&i2c0_pins>;
103+
status = "okay";
104+
105+
eeprom@50 {
106+
compatible = "atmel,24c64";
107+
reg = <0x50>;
108+
page-size = <32>;
109+
};
110+
111+
rtc@51 {
112+
compatible = "nxp,pcf8563";
113+
reg = <0x51>;
114+
#clock-cells = <0>;
115+
};
116+
117+
crypto@60 {
118+
compatible = "atmel,atecc508a";
119+
reg = <0x60>;
120+
};
121+
};
122+
100123
&mdio_bus {
101124
phy0: ethernet-phy@5 {
102125
reg = <5>;
103126
compatible = "ethernet-phy-ieee802.3-c45";
104127
phy-mode = "2500base-x";
105128
reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
106-
reset-assert-us = <10000>;
107-
reset-deassert-us = <50000>;
129+
reset-assert-us = <15000>;
130+
reset-deassert-us = <68000>;
108131
realtek,aldps-enable;
109132
};
110133
};
@@ -184,6 +207,13 @@
184207
};
185208

186209
&pio {
210+
i2c0_pins: i2c0-pins {
211+
mux {
212+
function = "i2c";
213+
groups = "i2c0_1";
214+
};
215+
};
216+
187217
spi0_flash_pins: spi0-pins {
188218
mux {
189219
function = "spi";
@@ -202,12 +232,45 @@
202232
mediatek,pull-down-adv = <0>;
203233
};
204234
};
235+
236+
uart1_pins: uart1-pins {
237+
mux {
238+
function = "uart";
239+
groups = "uart1_3";
240+
};
241+
};
242+
243+
uart2_pins: uart2-pins {
244+
mux {
245+
function = "uart";
246+
groups = "uart2_0_tx_rx";
247+
};
248+
};
249+
250+
wwan_rst_h: wwan-rst-h {
251+
pins = "GPIO_WPS";
252+
drive-strength = <8>;
253+
mediatek,pull-down-adv = <0>;
254+
output-low;
255+
};
205256
};
206257

207258
&uart0 {
208259
status = "okay";
209260
};
210261

262+
&uart1 {
263+
pinctrl-names = "default";
264+
pinctrl-0 = <&uart1_pins>;
265+
status = "okay";
266+
};
267+
268+
&uart2 {
269+
pinctrl-names = "default";
270+
pinctrl-0 = <&uart2_pins>;
271+
status = "okay";
272+
};
273+
211274
&usb_phy {
212275
status = "okay";
213276
};
@@ -220,8 +283,16 @@
220283
nvmem-cells = <&eeprom_factory_0>;
221284
nvmem-cell-names = "eeprom";
222285
status = "okay";
286+
287+
band@1 {
288+
reg = <1>;
289+
nvmem-cells = <&macaddr_factory_a 0>;
290+
nvmem-cell-names = "mac-address";
291+
};
223292
};
224293

225294
&xhci {
295+
pinctrl-names = "default";
296+
pinctrl-0 = <&wwan_rst_h>;
226297
status = "okay";
227298
};

target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ nradio,c8-668gl)
7171
ucidef_set_led_netdev "5g" "5G" "blue:indicator-0" "eth1" "link"
7272
;;
7373
openembed,som7981)
74-
ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx"
75-
ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link"
74+
ucidef_set_led_netdev "lanact" "LANACT" "amber:lan" "eth1" "rx tx"
75+
ucidef_set_led_netdev "lanlink" "LANLINK" "green:lan" "eth1" "link"
7676
;;
7777
openwrt,one)
7878
ucidef_set_led_netdev "wanact" "WANACT" "mdio-bus:0f:green:wan" "eth0" "rx tx"

target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

-3
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ case "$board" in
141141
[ "$PHYNBR" = "0" ] && echo "$hw_mac_addr" > /sys${DEVPATH}/macaddress
142142
[ "$PHYNBR" = "1" ] && macaddr_setbit_la $hw_mac_addr > /sys${DEVPATH}/macaddress
143143
;;
144-
openembed,som7981)
145-
[ "$PHYNBR" = "1" ] && cat /sys/class/net/eth0/address > /sys${DEVPATH}/macaddress
146-
;;
147144
qihoo,360t7)
148145
addr=$(mtd_get_mac_ascii factory lanMac)
149146
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress

target/linux/mediatek/image/filogic.mk

+4-1
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,10 @@ define Device/openembed_som7981
12151215
DEVICE_MODEL := SOM7981
12161216
DEVICE_DTS := mt7981b-openembed-som7981
12171217
DEVICE_DTS_DIR := ../dts
1218-
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3
1218+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \
1219+
kmod-crypto-hw-atmel kmod-eeprom-at24 kmod-gpio-beeper kmod-rtc-pcf8563 \
1220+
kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan kmod-usb-serial-option \
1221+
kmod-usb3 uqmi
12191222
UBINIZE_OPTS := -E 5
12201223
BLOCKSIZE := 128k
12211224
PAGESIZE := 2048

0 commit comments

Comments
 (0)