I have a board using MT7628 SoC and want to enable it 1 wan port and 4 lan ports. Below is the dts file contents:
/dts-v1/;
#include "mt7628an.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "myboard", "mediatek,mt7628an-soc";
model = "myboard";
chosen {
bootargs = "console=ttyS0,115200";
};
memory@0 {
device_type = "memory";
reg = <0x0 0x8000000>; // 128MB
};
leds {
compatible = "gpio-leds";
};
gpio-export {
compatible = "gpio-export";
#size-cells = <0>;
};
};
&state_default {
gpio {
groups = "gpio", "wdt", "i2s", "wled_an", "p1led_an", "p2led_an", "p3led_en", "p4led_an";
function = "gpio";
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <32000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
};
partition@50000 {
compatible = "denx,uimage";
reg = <0x50000 0x0>;
label = "firmware";
};
};
};
};
&i2c {
status = "okay";
};
ðernet {
status = "okay";
nvmem-cells = <&macaddr_factory_28>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};
&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_factory_28: macaddr@28 {
reg = <0x28 0x6>;
};
};
&uart1 {
status = "okay";
};
&uart2 {
status = "okay";
};
&wmac {
status = "okay";
mediatek,mtd-eeprom = <&factory 0x0>;
};
&esw {
mediatek,portmap = <0x3e>;
};
&sdhci {
status = "okay";
};
&pcie {
status = "okay";
};
The 02_network
file is configured as follows:
# head -n 20 ./target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
. /lib/functions.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ramips_setup_interfaces()
{
local board="$1"
case $board in
myboard)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
...
After compiling openwrt and flashing it to the device, wan port works, but lan 1-4 ports don't work.
How can I configure it so that lan 1-4 ports can be used normally?