ramips: add support for JCG JHR-AC945M

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-18 23:10:40 +08:00
parent 04de9d5b37
commit dd4890c9a4
3 changed files with 122 additions and 1 deletions

View File

@ -0,0 +1,106 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#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";
chosen {
bootargs = "console=ttyS0,57600";
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 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>;
};
};
&ethernet {
mtd-mac-address = <&factory 0xe000>;
};
&state_default {
gpio {
ralink,group = "jtag", "wdt";
ralink,function = "gpio";
};
};

View File

@ -445,6 +445,18 @@ define Device/jcg_jhr-ac876m
endef
TARGET_DEVICES += jcg_jhr-ac876m
define Device/jcg_jhr-ac945m
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-usb3 wpad-openssl
endef
TARGET_DEVICES += jcg_jhr-ac945m
define Device/jcg_y2
IMAGE_SIZE := 16064k
IMAGES += factory.bin
@ -461,7 +473,8 @@ define Device/jdcloud_re-sp-01b
IMAGE_SIZE := 27328k
DEVICE_VENDOR := JDCloud
DEVICE_MODEL := RE-SP-01B
DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-sdhci-mt7620 kmod-usb3 wpad-openssl
DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-sdhci-mt7620 \
kmod-usb3 wpad-openssl
endef
TARGET_DEVICES += jdcloud_re-sp-01b

View File

@ -14,6 +14,7 @@ ramips_setup_interfaces()
d-team,pbr-m1|\
firefly,firewrt|\
jcg,jhr-ac876m|\
jcg,jhr-ac945m|\
mediatek,ap-mt7621a-v60|\
mediatek,mt7621-eval-board|\
mqmaker,witi|\
@ -272,6 +273,7 @@ ramips_setup_macs()
label_mac=$(mtd_get_mac_binary factory 0x4)
wan_mac=$label_mac
;;
jcg,jhr-ac945m|\
jcg,y2|\
zbtlink,zbt-we1326)
wan_mac=$(mtd_get_mac_binary factory 0xe006)