diff --git a/target/linux/mediatek/dts/mt7981b-cudy-ap3000wall-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-ap3000wall-v1.dts new file mode 100644 index 0000000000..adcbfdd9c5 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-ap3000wall-v1.dts @@ -0,0 +1,276 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include + +#include "mt7981b.dtsi" + +/ { + model = "Cudy AP3000 Wall v1"; + compatible = "cudy,ap3000wall-v1", "mediatek,mt7981"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_white; + led-upgrade = &led_status_red; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + lights_toggle { + label = "lights_toggle"; + linux,code = ; + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led_status_red: led@0 { + label = "red:status"; + function = LED_FUNCTION_POWER; + color = ; + gpios = <&pio 4 GPIO_ACTIVE_LOW>; + }; + + led_status_white: led@1 { + label = "white:status"; + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + }; + + gpio_export { + compatible = "gpio-export"; + + poe_passthrough { + gpio-export,name = "poe-passthrough"; + gpio-export,output = <0>; + gpios = <&pio 12 GPIO_ACTIVE_HIGH>; + }; + }; + + watchdog-hw { + compatible = "linux,wdt-gpio"; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + hw_algo = "level"; + hw_margin_ms = <10000>; + always-running; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 0>; + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + + 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>; + + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + 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>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "bdinfo"; + reg = <0x380000 0x0040000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@3c0000 { + label = "FIP"; + reg = <0x3c0000 0x0200000>; + read-only; + }; + + partition@5c0000 { + label = "ubi"; + reg = <0x5c0000 0x4000000>; + compatible = "linux,ubi"; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@4 { + reg = <4>; + label = "lan5"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index c465a97022..c69bd3abcb 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -106,6 +106,9 @@ mediatek_setup_interfaces() comfast,cf-e393ax) ucidef_set_interfaces_lan_wan "lan1" eth1 ;; + cudy,ap3000wall-v1) + ucidef_set_interface_lan "lan1 lan2 lan3 lan4 lan5" + ;; cudy,ap3000outdoor-v1|\ cudy,ap3000-v1|\ cudy,re3000-v1|\ diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 60d4528227..937f4f49c0 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -84,6 +84,7 @@ case "$board" in [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress ;; cudy,ap3000outdoor-v1|\ + cudy,ap3000wall-v1|\ cudy,ap3000-v1|\ cudy,m3000-v1|\ cudy,re3000-v1|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index b395f5f907..86e3e095b1 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1027,6 +1027,23 @@ define Device/cudy_ap3000outdoor-v1 endef TARGET_DEVICES += cudy_ap3000outdoor-v1 +define Device/cudy_ap3000wall-v1 + DEVICE_VENDOR := Cudy + DEVICE_MODEL := AP3000 Wall + DEVICE_VARIANT := v1 + DEVICE_DTS := mt7981b-cudy-ap3000wall-v1 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += R68 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +endef +TARGET_DEVICES += cudy_ap3000wall-v1 + define Device/cudy_ap3000-v1 DEVICE_VENDOR := Cudy DEVICE_MODEL := AP3000