ipq60xx: add GL.iNet GL-AX1800 support

This commit is contained in:
aiamadeus 2023-12-10 23:25:08 +08:00
parent e4dedaf402
commit 6c52d1ded1
9 changed files with 460 additions and 0 deletions

View File

@ -0,0 +1,51 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "ipq6000-glinet.dtsi"
/ {
model = "GL.iNet GL-AX1800";
compatible = "glinet,gl-ax1800", "qcom,ipq6018";
aliases {
ethernet0 = &dp1;
ethernet1 = &dp2;
label-mac-device = &dp1;
};
};
&switch {
switch_lan_bmp = <0x3c>; /* lan port bitmap */
switch_wan_bmp = <0x02>; /* wan port bitmap */
};
&dp1 {
status = "okay";
phy-handle = <&qca8075_0>;
label = "wan";
};
&dp2 {
status = "okay";
phy-handle = <&qca8075_1>;
label = "lan1";
};
&dp3 {
status = "okay";
phy-handle = <&qca8075_2>;
label = "lan2";
};
&dp4 {
status = "okay";
phy-handle = <&qca8075_3>;
label = "lan3";
};
&dp5 {
status = "okay";
phy-handle = <&qca8075_4>;
label = "lan4";
};

View File

@ -0,0 +1,117 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "ipq6000-glinet.dtsi"
/ {
model = "GL.iNet GL-AXT1800";
compatible = "glinet,gl-axt1800", "qcom,ipq6018";
aliases {
ethernet0 = &dp1;
ethernet1 = &dp3;
label-mac-device = &dp1;
};
vcc_sd: regulator-vcc-sd {
compatible = "regulator-fixed";
regulator-name = "vcc_sd";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpios = <&tlmm 66 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-always-on;
};
vcc_fan: regulator-vcc-fan {
compatible = "regulator-fixed";
regulator-name = "vcc_fan";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&tlmm 29 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-boot-on;
};
fan: pwm-fan {
compatible = "pwm-fan";
fan-supply = <&vcc_fan>;
pwms = <&pwm 1 40000 0>;
pinctrl-0 = <&fan_pins>;
pinctrl-names = "default";
cooling-levels = <36 128 192 255>;
#cooling-cells = <2>;
};
};
&tlmm {
fan_pins: fan-pins {
speed {
pins = "gpio31";
function = "gpio";
drive-strength = <8>;
bias-pull-down;
};
};
pwm_pins: pwm-pins {
pwm {
pins = "gpio30";
function = "pwm13";
drive-strength = <8>;
};
};
sd_pins: sd-pins {
sd {
pins = "gpio62";
function = "sd_card";
bias-pull-up;
};
ldo {
pins = "gpio66";
function = "gpio";
bias-pull-up;
};
};
};
&pwm {
pinctrl-0 = <&pwm_pins>;
pinctrl-names = "default";
status = "okay";
};
&sdhc {
mmc-ddr-1_8v;
bus-width = <4>;
cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&sd_pins>;
pinctrl-names = "default";
vqmmc-supply = <&vcc_sd>;
status = "okay";
};
&switch {
switch_lan_bmp = <0x0c>; /* lan port bitmap */
switch_wan_bmp = <0x02>; /* wan port bitmap */
};
&dp1 {
status = "okay";
phy-handle = <&qca8075_0>;
label = "wan";
};
&dp2 {
status = "okay";
phy-handle = <&qca8075_1>;
label = "lan2";
};
&dp3 {
status = "okay";
phy-handle = <&qca8075_2>;
label = "lan1";
};

View File

@ -0,0 +1,231 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ipq6018-512m.dtsi"
#include "ipq6018-ess.dtsi"
#include "ipq6000-opp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_run;
led-failsafe = &led_run;
led-running = &led_run;
led-upgrade = &led_run;
serial0 = &blsp1_uart3;
serial1 = &blsp1_uart4;
serial2 = &blsp1_uart5;
};
chosen {
stdout-path = "serial0:115200n8";
bootargs-append = " root=/dev/ubiblock0_1";
};
keys {
compatible = "gpio-keys";
switch {
label = "switch";
linux,code = <BTN_0>;
linux,input-type = <EV_SW>;
gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
};
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led_run: run {
label = "blue:run";
gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
};
system {
label = "white:system";
gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>;
};
};
reg_usb_vbus: regulator-usb-vbus {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&tlmm 0 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-always-on;
};
};
&tlmm {
mdio_pins: mdio-pins {
mdc {
pins = "gpio64";
function = "mdc";
drive-strength = <8>;
bias-pull-up;
};
mdio {
pins = "gpio65";
function = "mdio";
drive-strength = <8>;
bias-pull-up;
};
};
tluart_pins: tluart-pins {
mux {
pins = "gpio75", "gpio76";
function = "blsp3_uart";
drive-strength = <8>;
bias-disable;
};
};
hsuart_pins: hsuart-pins {
mux {
pins = "gpio57", "gpio58";
function = "blsp4_uart";
drive-strength = <8>;
bias-disable;
};
};
};
&blsp1_uart3 {
pinctrl-0 = <&serial_3_pins>;
pinctrl-names = "default";
status = "okay";
};
&blsp1_uart4 {
pinctrl-0 = <&tluart_pins>;
pinctrl-names = "default";
status = "okay";
};
&blsp1_uart5 {
pinctrl-0 = <&hsuart_pins>;
pinctrl-names = "default";
status = "okay";
};
&qpic_bam {
status = "okay";
};
&qpic_nand {
status = "okay";
nand@0 {
reg = <0>;
nand-ecc-strength = <4>;
nand-ecc-step-size = <512>;
nand-bus-width = <8>;
partitions {
compatible = "qcom,smem-part";
};
};
};
&qusb_phy_0 {
status = "okay";
};
&ssphy_0 {
status = "okay";
};
&usb3 {
vbus-supply = <&reg_usb_vbus>;
status = "okay";
};
&rpm {
status = "disabled";
};
&mdio {
status = "okay";
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 74 GPIO_ACTIVE_LOW>;
qca8075_0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};
qca8075_1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};
qca8075_2: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <2>;
};
qca8075_3: ethernet-phy@3 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <3>;
};
qca8075_4: ethernet-phy@4 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <4>;
};
};
&switch {
status = "okay";
switch_cpu_bmp = <0x1>; /* cpu port bitmap */
switch_mac_mode = <0x0>; /* mac mode for uniphy 0*/
switch_mac_mode1 = <0xff>; /* mac mode for uniphy 1*/
switch_mac_mode2 = <0xff>; /* mac mode for uniphy 2*/
qcom,port_phyinfo {
port@0 {
port_id = <1>;
phy_address = <0>;
};
port@1 {
port_id = <2>;
phy_address = <1>;
};
port@2 {
port_id = <3>;
phy_address = <2>;
};
port@3 {
port_id = <4>;
phy_address = <3>;
};
port@4 {
port_id = <5>;
phy_address = <4>;
};
};
};
&edma {
status = "okay";
};
&wifi {
status = "okay";
qcom,ath11k-fw-memory-mode = <1>;
};

View File

@ -17,6 +17,32 @@ define Device/UbiFit
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/glinet_gl-ax1800
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-AX1800
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@cp03-c1
SOC := ipq6000
DEVICE_PACKAGES := ipq-wifi-glinet_gl-ax1800
endef
TARGET_DEVICES += glinet_gl-ax1800
define Device/glinet_gl-axt1800
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-AXT1800
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@cp03-c1
SOC := ipq6000
DEVICE_PACKAGES := ipq-wifi-glinet_gl-axt1800 kmod-hwmon-gpiofan
endef
TARGET_DEVICES += glinet_gl-axt1800
define Device/linksys_mr7350
$(call Device/FitImage)
DEVICE_VENDOR := Linksys

View File

@ -11,9 +11,13 @@ ipq60xx_setup_interfaces()
local board="$1"
case "$board" in
glinet,gl-ax1800|\
linksys,mr7350)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
glinet,gl-axt1800)
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;;
qihoo,360v6|\
xiaomi,rm1800)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"

View File

@ -9,6 +9,8 @@ board=$(board_name)
case "$FIRMWARE" in
"ath11k/IPQ6018/hw1.0/cal-ahb-c000000.wifi.bin")
case "$board" in
glinet,gl-ax1800|\
glinet,gl-axt1800|\
linksys,mr7350|\
qihoo,360v6)
caldata_extract "0:art" 0x1000 0x20000

View File

@ -10,6 +10,11 @@ PHYNBR=${DEVPATH##*/phy}
board=$(board_name)
case "$board" in
glinet,gl-ax1800|\
glinet,gl-axt1800)
[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
;;
linksys,mr7350)
addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress

View File

@ -10,6 +10,10 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
glinet,gl-ax1800|\
glinet,gl-axt1800)
nand_do_upgrade "$1"
;;
linksys,mr7350)
boot_part="$(fw_printenv -n boot_part)"
if [ "$boot_part" -eq "1" ]; then

View File

@ -0,0 +1,20 @@
--- a/drivers/mtd/nand/raw/internals.h
+++ b/drivers/mtd/nand/raw/internals.h
@@ -18,6 +18,7 @@
*/
#define NAND_MFR_AMD 0x01
#define NAND_MFR_ATO 0x9b
+#define NAND_MFR_DOSILICON 0xf8
#define NAND_MFR_EON 0x92
#define NAND_MFR_ESMT 0xc8
#define NAND_MFR_FUJITSU 0x04
--- a/drivers/mtd/nand/raw/nand_ids.c
+++ b/drivers/mtd/nand/raw/nand_ids.c
@@ -178,6 +178,7 @@ struct nand_flash_dev nand_flash_ids[] =
static const struct nand_manufacturer_desc nand_manufacturer_descs[] = {
{NAND_MFR_AMD, "AMD/Spansion", &amd_nand_manuf_ops},
{NAND_MFR_ATO, "ATO"},
+ {NAND_MFR_DOSILICON, "Dosilicon"},
{NAND_MFR_EON, "Eon"},
{NAND_MFR_ESMT, "ESMT", &esmt_nand_manuf_ops},
{NAND_MFR_FUJITSU, "Fujitsu"},