diff --git a/target/linux/ramips/dts/mt7621_cudy_c200p.dts b/target/linux/ramips/dts/mt7621_cudy_c200p.dts new file mode 100644 index 0000000000..df1b923f93 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_c200p.dts @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "cudy,c200p", "mediatek,mt7621-soc"; + model = "Cudy C200P"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <1000>; + always-running; + }; + + reg_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + output-reg-vbus { + compatible = "regulator-output"; + vout-supply = <®_vbus>; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + pse { + gpio-export,name = "pse"; + gpio-export,output = <1>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: status { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_poe { + color = ; + function = LED_FUNCTION_INDICATOR; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&xhci { + vbus-supply = <®_vbus>; +}; + +&i2c { + status = "okay"; +}; + +&gmac0 { + nvmem-cells = <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "mac-address"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + 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; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfa0000>; + }; + + partition@ff0000 { + label = "bdinfo"; + reg = <0xff0000 0x10000>; + 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>; + }; + }; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "uart2", "uart3", "wdt"; + function = "gpio"; + }; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_bdinfo_de00 1>; + nvmem-cell-names = "mac-address"; +}; + +ðphy4 { + /delete-property/ interrupts; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan5"; + }; + + port@1 { + status = "okay"; + label = "lan4"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan2"; + }; + + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 28745e9e82..83b8767622 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -716,6 +716,16 @@ define Device/cudy_ap1300-outdoor-v1 endef TARGET_DEVICES += cudy_ap1300-outdoor-v1 +define Device/cudy_c200p + $(Device/dsa-migration) + DEVICE_VENDOR := Cudy + DEVICE_MODEL := C200P + IMAGE_SIZE := 15872k + UIMAGE_NAME := R74 + DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3 +endef +TARGET_DEVICES += cudy_c200p + define Device/cudy_m1300-v2 $(Device/dsa-migration) IMAGE_SIZE := 15872k 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 9d2f119c7e..15c98242ad 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 @@ -115,6 +115,10 @@ ramips_setup_interfaces() uci add_list firewall.@zone[1].network='eth_data' uci add_list firewall.@zone[1].network='eth_om' ;; + cudy,c200p|\ + mikrotik,routerboard-750gr3) + ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan" + ;; dlink,covr-x1860-a1) ucidef_set_interfaces_lan_wan "ethernet" "internet" ;; @@ -133,9 +137,6 @@ ramips_setup_interfaces() gnubee,gb-pc2) ucidef_set_interface_lan "ethblack ethblue ethyellow" ;; - mikrotik,routerboard-750gr3) - ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan" - ;; mikrotik,routerboard-760igs) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp" ;;