diff --git a/target/linux/ramips/dts/mt7621_leigod_a7000.dts b/target/linux/ramips/dts/mt7621_leigod_a7000.dts new file mode 100644 index 000000000..292d22f71 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_leigod_a7000.dts @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "leigod,a7000", "mediatek,mt7621-soc"; + model = "Leigod A7000"; + + aliases { + led-boot = &status_white; + led-failsafe = &status_red; + led-running = &status_orange; + led-upgrade = &status_white; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + status_red: status_red { + label = "leigod:red:status"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + status_orange: status_orange { + label = "leigod:orange:status"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + status_white: status_white { + label = "leigod:white:status"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <30000000>; + + 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>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1e00000>; + }; + + partition@1f00000 { + label = "sysinfo"; + reg = <0x1f00000 0x10000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0x4>; +}; + +&gmac1 { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <1>; + status = "okay"; +}; + +&gsw { + mediatek,portmap = "llllw"; + status = "okay"; +}; + +&hnat { + mtketh-wan = "eth1"; + mtketh-ppd = "eth0"; + mtketh-lan = "eth0"; + mtketh-max-gmac = <2>; + /delete-property/ mtkdsa-wan-port; +}; + +&switch0 { + status = "disabled"; +}; + +&state_default { + gpio { + groups = "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index de2625e96..669bf3fa0 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -537,17 +537,6 @@ define Device/dlink_dir-882-r1 endef TARGET_DEVICES += dlink_dir-882-r1 -define Device/d-team_newifi-d2 - $(Device/uimage-lzma-loader) - IMAGE_SIZE := 32448k - DEVICE_VENDOR := Newifi - DEVICE_MODEL := D2 - DEVICE_COMPAT_VERSION := 1.1 - DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e kmod-usb3 \ - kmod-usb-ledtrig-usbport luci-app-mtwifi -wpad-openssl -endef -TARGET_DEVICES += d-team_newifi-d2 - define Device/d-team_pbr-m1 $(Device/dsa-migration) IMAGE_SIZE := 32448k @@ -979,18 +968,6 @@ define Device/jdcloud_re-sp-01b endef TARGET_DEVICES += jdcloud_re-sp-01b -define Device/lenovo_newifi-d1 - $(Device/dsa-migration) - $(Device/uimage-lzma-loader) - IMAGE_SIZE := 32448k - DEVICE_VENDOR := Newifi - DEVICE_MODEL := D1 - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 \ - kmod-usb-ledtrig-usbport - SUPPORTED_DEVICES += newifi-d1 -endef -TARGET_DEVICES += lenovo_newifi-d1 - define Device/linksys_e5600 $(Device/dsa-migration) $(Device/uimage-lzma-loader) @@ -1339,6 +1316,29 @@ define Device/netis_wf2881 endef TARGET_DEVICES += netis_wf2881 +define Device/lenovo_newifi-d1 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Newifi + DEVICE_MODEL := D1 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 \ + kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += newifi-d1 +endef +TARGET_DEVICES += lenovo_newifi-d1 + +define Device/d-team_newifi-d2 + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Newifi + DEVICE_MODEL := D2 + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e kmod-usb3 \ + kmod-usb-ledtrig-usbport luci-app-mtwifi -wpad-openssl +endef +TARGET_DEVICES += d-team_newifi-d2 + define Device/oraybox_x3a $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index e1d817614..37037c666 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -77,6 +77,7 @@ ramips_setup_interfaces() ;; jcg,y2|\ phicomm,k2p|\ + leigod,a7000|\ xiaoyu,xy-c5) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6u@eth0" "5u@eth1" @@ -198,6 +199,11 @@ ramips_setup_macs() lan_mac=$label_mac wan_mac=$label_mac ;; + leigod,a7000) + label_mac=$(mtd_get_mac_binary factory 0x4) + lan_mac=$(macaddr_add $label_mac 1) + wan_mac=$(macaddr_add $lan_mac 1) + ;; linksys,e5600|\ linksys,ea7300-v1|\ linksys,ea7300-v2|\