From: Chukun Pan Date: Mon, 8 Feb 2021 08:28:10 +0000 (+0800) Subject: ramips: add support for JCG Y2 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fstaging%2Fmkresin.git;a=commitdiff_plain;h=82032f350991af08a918f0fcaac81ff82e836d88 ramips: add support for JCG Y2 JCG Y2 is an AC1300M router Hardware specs: SoC: MediaTek MT7621AT Flash: Winbond W25Q128JVSQ 16MiB RAM: Nanya NT5CB128M16 256MiB WLAN: 2.4/5 GHz 2T2R (1x MediaTek MT7615) Ethernet: 10/100/1000 Mbps x5 LED: POWER, INTERNET, 2.4G, 5G Button: Reset Power: DC 12V,1A Flash instructions: Upload factory.bin in stock firmware's upgrade page. MAC addresses map: 0x0004 *:c8 wlan2g/wlan5g/label 0xe000 *:c7 lan 0xe006 *:c6 wan Signed-off-by: Chukun Pan --- diff --git a/target/linux/ramips/dts/mt7621_jcg_y2.dts b/target/linux/ramips/dts/mt7621_jcg_y2.dts new file mode 100644 index 0000000000..06d6579aaa --- /dev/null +++ b/target/linux/ramips/dts/mt7621_jcg_y2.dts @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "jcg,y2", "mediatek,mt7621-soc"; + model = "JCG Y2"; + + aliases { + led-boot = &led_internet; + led-failsafe = &led_internet; + led-upgrade = &led_internet; + }; + + leds { + compatible = "gpio-leds"; + + led_internet: internet { + label = "blue:internet"; + gpios = <&gpio 15 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 = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&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 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + wan: port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + }; +}; + +&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 3aaa8f28ad..39a4d03a42 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -684,6 +684,19 @@ define Device/jcg_jhr-ac876m endef TARGET_DEVICES += jcg_jhr-ac876m +define Device/jcg_y2 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | jcg-header 95.1 + JCG_MAXSIZE := 16064k + DEVICE_VENDOR := JCG + DEVICE_MODEL := Y2 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 +endef +TARGET_DEVICES += jcg_y2 + define Device/lenovo_newifi-d1 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 8d91b36346..5fa9ad3fe8 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -19,6 +19,7 @@ d-team,newifi-d2) ;; d-team,pbr-m1|\ gehua,ghl-r-001|\ +jcg,y2|\ xzwifi,creativebox-v1) ucidef_set_led_netdev "internet" "internet" "blue:internet" "wan" ;; 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 dbb8e04abb..46cb65ffbe 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -113,6 +113,14 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; + jcg,y2|\ + wavlink,wl-wn531a6|\ + winstars,ws-wn583a6|\ + zbtlink,zbt-we1326|\ + zbtlink,zbt-wg3526-16m|\ + zbtlink,zbt-wg3526-32m) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2) @@ -128,13 +136,6 @@ ramips_setup_macs() wan_mac=$label_mac lan_mac=$(macaddr_add $label_mac 1) ;; - wavlink,wl-wn531a6|\ - winstars,ws-wn583a6|\ - zbtlink,zbt-we1326|\ - zbtlink,zbt-wg3526-16m|\ - zbtlink,zbt-wg3526-32m) - label_mac=$(mtd_get_mac_binary factory 0x4) - ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac