ramips: add support for JCG JHR-AC945M (#7900)

Hardware specs:
  SoC: MediaTek MT7621AT
  Flash: SPI NOR 16MB
  RAM: DDR3 256MB
  2.4GHz: MT7615N bgn 4x4
  5GHz: MT7615N nac 4x4
  Ethernet: 1 x WAN and 4 x LAN
  USB: 1 x 3.0
  Button: Reset, WPS

Unsupported chips:
  ATMEGA328P-AU
  HCLTEK HT1621B

Flash instructions:
  Upload factory.bin in stock firmware's upgrade page.

Signed-off-by: AmadeusGhost <amadeus@jmu.edu.cn>
This commit is contained in:
AmadeusGhost 2021-09-23 00:46:42 +08:00 committed by GitHub
parent c2309f3515
commit 69b0f1cf68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 145 additions and 0 deletions

View File

@ -0,0 +1,131 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "jcg,jhr-ac945m", "mediatek,mt7621-soc";
model = "JCG JHR-AC945M";
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&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>;
ieee80211-freq-limit = <2400000 2500000>;
};
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
};
port@1 {
status = "okay";
label = "lan2";
};
port@2 {
status = "okay";
label = "lan3";
};
port@3 {
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};
&state_default {
gpio {
groups = "jtag", "wdt";
function = "gpio";
};
};

View File

@ -759,6 +759,19 @@ define Device/jcg_jhr-ac876m
endef
TARGET_DEVICES += jcg_jhr-ac876m
define Device/jcg_jhr-ac945m
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 16064k
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | jcg-header 91.1
JCG_MAXSIZE := 16064k
DEVICE_VENDOR := JCG
DEVICE_MODEL := JHR-AC945M
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3
endef
TARGET_DEVICES += jcg_jhr-ac945m
define Device/jcg_q20
$(Device/dsa-migration)
BLOCKSIZE := 128k

View File

@ -165,6 +165,7 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac
;;
jcg,jhr-ac945m|\
jcg,y2|\
wavlink,wl-wn531a6|\
winstars,ws-wn583a6|\