ramips: add support for FCJ G-AX1800-F (#13535)

This commit is contained in:
Free Here 2025-06-05 13:18:23 +08:00 committed by GitHub
parent 9b78d2969a
commit ec104e953b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 175 additions and 6 deletions

View File

@ -0,0 +1,141 @@
// 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 = "fcj,g-ax1800-f", "mediatek,mt7621-soc";
model = "FCJ G-AX1800-F";
aliases {
led-boot = &led_sys_red;
led-failsafe = &led_sys_red;
led-running = &led_sys_green;
led-upgrade = &led_sys_green;
label-mac-device = &gmac0;
};
chosen {
bootargs = "console=ttyS0,115200";
bootargs-override = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_sys_red: red {
label = "red:sys";
gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
};
led_sys_green: green {
label = "green:sys";
gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&nand {
status = "okay";
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;
mediatek,bmt-remap-range = <0x0000000 0x0a00000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0000000 0x0080000>;
read-only;
};
partition@80000 {
label = "Config";
reg = <0x0080000 0x0080000>;
};
factory: partition@100000 {
label = "Factory";
reg = <0x0100000 0x0080000>;
read-only;
};
partition@180000 {
label = "kernel";
reg = <0x180000 0x800000>;
};
partition@980000 {
label = "ubi";
reg = <0x980000 0x6e80000>;
};
};
};
&pcie {
status = "okay";
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};
&gmac0 {
mtd-mac-address = <&factory 0x3fff4>;
};
&gmac1 {
mtd-mac-address = <&factory 0x3fffa>;
status = "okay";
};
&gsw {
mediatek,portmap = "lllwl";
status = "okay";
};
&hnat {
mtketh-wan = "eth1";
mtketh-ppd = "eth0";
mtketh-lan = "eth0";
mtketh-max-gmac = <2>;
/delete-property/ mtkdsa-wan-port;
};
&switch0 {
status = "disabled";
};
&state_default {
gpio {
groups = "jtag", "uart3", "wdt";
function = "gpio";
};
};

View File

@ -713,6 +713,24 @@ define Device/elecom_wrc-2533gst2
endef
TARGET_DEVICES += elecom_wrc-2533gst2
define Device/fcj_g-ax1800-f
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := FCJ
DEVICE_MODEL := G-AX1800-F
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
KERNEL_SIZE := 8192k
IMAGE_SIZE := 121344k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
endef
TARGET_DEVICES += fcj_g-ax1800-f
define Device/firefly_firewrt
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
@ -1426,7 +1444,7 @@ define Device/openfi_5pro
$(Device/dsa-migration)
IMAGE_SIZE := 63448k
DEVICE_VENDOR := OpenFi
DEVICE_MODEL := 5Pro
DEVICE_MODEL := 5Pro
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb3
endef
TARGET_DEVICES += openfi_5pro

View File

@ -59,6 +59,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
;;
fcj,g-ax1800-f)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:wan" "6u@eth0" "5u@eth1"
;;
gehua,ghl-r-001)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "4:wan" "6u@eth0" "5u@eth1"
@ -97,7 +101,7 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6u@eth0" "5u@eth1"
ucidef_set_interfaces_lan_wan "eth0" "eth1 eth2"
;;
;;
oraybox,x3a)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "4:wan" "6u@eth0" "5u@eth1"
@ -190,6 +194,11 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac
;;
fcj,g-ax1800-f|\
xiaomi,mi-router-cr660x)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" -1)
;;
h3c,tx1800-plus|\
h3c,tx1801-plus|\
h3c,tx1806)
@ -255,10 +264,6 @@ ramips_setup_macs()
lan_mac=$(macaddr_add "$wan_mac" -3)
label_mac=$lan_mac
;;
xiaomi,mi-router-cr660x)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" -1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac

View File

@ -27,6 +27,10 @@ case "$board" in
macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
fi
;;
fcj,g-ax1800-f)
[ "$PHYNBR" = "1" ] && \
macaddr_add "$(mtd_get_mac_binary Factory 0x4)" 5 > /sys${DEVPATH}/macaddress
;;
glinet,gl-mt1300)
[ "$PHYNBR" = "1" ] && \
macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress

View File

@ -82,6 +82,7 @@ platform_do_upgrade() {
dlink,dir-2640-a1|\
dlink,dir-2660-a1|\
dlink,dir-853-a3|\
fcj,g-ax1800-f|\
h3c,tx1800-plus|\
h3c,tx1801-plus|\
h3c,tx1806|\