qualcommax: ipq60xx: add Redmi AX5 JDCloud support

This commit is contained in:
coolsnowwolf 2024-02-19 16:07:47 +08:00
parent 2229a47aee
commit 2948e7995a
11 changed files with 269 additions and 196 deletions

View File

@ -16,10 +16,13 @@ zyxel,nbg7815)
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1" ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
;; ;;
dynalink,dl-wrx36|\ dynalink,dl-wrx36|\
glinet,gl-ax1800|\
glinet,gl-axt1800|\
netgear,rax120v2|\ netgear,rax120v2|\
netgear,wax218|\ netgear,wax218|\
netgear,wax620|\ netgear,wax620|\
netgear,wax630|\ netgear,wax630|\
xiaomi,rm1800|\
zn,m2) zn,m2)
idx="$(find_mtd_index 0:appsblenv)" idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \ [ -n "$idx" ] && \
@ -47,6 +50,11 @@ qnap,301w)
[ -n "$idx" ] && \ [ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x20000" "1" ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x20000" "1"
;; ;;
redmi,ax5-jdcloud)
mmcpart="$(find_mmc_part 0:APPSBLENV)"
[ -n "$mmcpart" ] && \
ubootenv_add_uci_config "$mmcpart" "0x0" "0x40000" "0x20000" "2"
;;
esac esac
config_load ubootenv config_load ubootenv

View File

@ -45,6 +45,7 @@ ALLWIFIBOARDS:= \
prpl_haze \ prpl_haze \
qihoo_360v6 \ qihoo_360v6 \
qnap_301w \ qnap_301w \
redmi_ax5-jdcloud \
redmi_ax6 \ redmi_ax6 \
wallys_dr40x9 \ wallys_dr40x9 \
xiaomi_ax3600 \ xiaomi_ax3600 \
@ -149,6 +150,7 @@ $(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630))
$(eval $(call generate-ipq-wifi-package,qihoo_360v6,Qihoo 360V6)) $(eval $(call generate-ipq-wifi-package,qihoo_360v6,Qihoo 360V6))
$(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w)) $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
$(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze)) $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
$(eval $(call generate-ipq-wifi-package,redmi_ax5-jdcloud,Redmi AX5 JDCloud))
$(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))

View File

@ -0,0 +1,22 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "ipq6000-xiaomi.dtsi"
/ {
model = "Redmi AX5 JDCloud";
compatible = "redmi,ax5-jdcloud", "qcom,ipq6018";
chosen {
bootargs-append = " rootfstype=squashfs,ext4 swiotlb=1 coherent_pool=2M";
};
};
&sdhc {
status = "okay";
};
&wifi {
qcom,ath11k-calibration-variant = "Redmi-AX5-JDCloud";
};

View File

@ -2,207 +2,14 @@
/dts-v1/; /dts-v1/;
#include "ipq6018-512m.dtsi" #include "ipq6000-xiaomi.dtsi"
#include "ipq6018-ess.dtsi"
#include "ipq6018-opp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ { / {
model = "Xiaomi RM1800"; model = "Xiaomi RM1800";
compatible = "xiaomi,rm1800", "qcom,ipq6018"; compatible = "xiaomi,rm1800", "qcom,ipq6018";
aliases {
serial0 = &blsp1_uart3;
led-boot = &led_yellow;
led-failsafe = &led_yellow;
led-running = &led_blue;
led-upgrade = &led_yellow;
label-mac-device = &dp2;
ethernet1 = &dp2;
ethernet2 = &dp3;
ethernet3 = &dp4;
ethernet4 = &dp5;
};
chosen {
stdout-path = "serial0:115200n8";
bootargs-append = " root=/dev/ubiblock0_1";
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led_blue: system-blue {
label = "blue:system";
gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
};
led_yellow: system-yellow {
label = "yellow:system";
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
};
network-blue {
label = "blue:network";
gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
};
network-yellow {
label = "yellow:network";
gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
};
};
};
&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;
};
};
};
&blsp1_uart3 {
pinctrl-0 = <&serial_3_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";
};
};
};
&mdio {
status = "okay";
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
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_lan_bmp = <0x1e>; /* lan port bitmap */
switch_wan_bmp = <0x20>; /* wan port bitmap */
switch_inner_bmp = <0xc0>; /*inner 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";
};
&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 = "wan";
}; };
&wifi { &wifi {
status = "okay"; status = "okay";
qcom,ath11k-fw-memory-mode = <1>; qcom,ath11k-fw-memory-mode = <1>;
}; };

View File

@ -0,0 +1,206 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "ipq6018-512m.dtsi"
#include "ipq6018-ess.dtsi"
#include "ipq6018-opp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
serial0 = &blsp1_uart3;
led-boot = &led_yellow;
led-failsafe = &led_yellow;
led-running = &led_blue;
led-upgrade = &led_yellow;
label-mac-device = &dp2;
ethernet1 = &dp2;
ethernet2 = &dp3;
ethernet3 = &dp4;
ethernet4 = &dp5;
};
chosen {
stdout-path = "serial0:115200n8";
bootargs-append = " root=/dev/ubiblock0_1";
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led_blue: system-blue {
label = "blue:system";
gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
};
led_yellow: system-yellow {
label = "yellow:system";
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
};
network-blue {
label = "blue:network";
gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
};
network-yellow {
label = "yellow:network";
gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
};
};
};
&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;
};
};
};
&blsp1_uart3 {
pinctrl-0 = <&serial_3_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";
};
};
};
&mdio {
status = "okay";
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
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_lan_bmp = <0x1e>; /* lan port bitmap */
switch_wan_bmp = <0x20>; /* wan port bitmap */
switch_inner_bmp = <0xc0>; /*inner 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";
};
&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 = "wan";
};
&wifi {
status = "okay";
qcom,ath11k-fw-memory-mode = <1>;
};

View File

@ -17,6 +17,12 @@ define Device/UbiFit
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef endef
define Device/EmmcImage
IMAGES += factory.bin sysupgrade.bin
IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
endef
define Device/glinet_gl-ax1800 define Device/glinet_gl-ax1800
$(call Device/FitImage) $(call Device/FitImage)
$(call Device/UbiFit) $(call Device/UbiFit)
@ -43,6 +49,17 @@ define Device/glinet_gl-axt1800
endef endef
TARGET_DEVICES += glinet_gl-axt1800 TARGET_DEVICES += glinet_gl-axt1800
define Device/redmi_ax5-jdcloud
$(call Device/FitImage)
$(call Device/EmmcImage)
DEVICE_VENDOR := Redmi
DEVICE_MODEL := AX5 JDCloud
DEVICE_DTS_CONFIG := config@cp03-c1
SOC := ipq6000
DEVICE_PACKAGES := ipq-wifi-redmi_ax5-jdcloud
endef
TARGET_DEVICES += redmi_ax5-jdcloud
define Device/linksys_mr7350 define Device/linksys_mr7350
$(call Device/FitImage) $(call Device/FitImage)
DEVICE_VENDOR := Linksys DEVICE_VENDOR := Linksys

View File

@ -6,6 +6,7 @@ board_config_update
board=$(board_name) board=$(board_name)
case "$board" in case "$board" in
redmi,ax5-jdcloud|\
xiaomi,rm1800) xiaomi,rm1800)
ucidef_set_led_netdev "internet" "Internet" "blue:network" "wan" ucidef_set_led_netdev "internet" "Internet" "blue:network" "wan"
;; ;;

View File

@ -18,6 +18,7 @@ ipq60xx_setup_interfaces()
glinet,gl-axt1800) glinet,gl-axt1800)
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;; ;;
redmi,ax5-jdcloud|\
qihoo,360v6|\ qihoo,360v6|\
xiaomi,rm1800|\ xiaomi,rm1800|\
zn,m2) zn,m2)

View File

@ -16,6 +16,9 @@ case "$FIRMWARE" in
zn,m2) zn,m2)
caldata_extract "0:art" 0x1000 0x20000 caldata_extract "0:art" 0x1000 0x20000
;; ;;
redmi,ax5-jdcloud)
caldata_extract_mmc "0:ART" 0x1000 0x20000
;;
esac esac
;; ;;
*) *)

View File

@ -11,7 +11,8 @@ platform_check_image() {
platform_do_upgrade() { platform_do_upgrade() {
case "$(board_name)" in case "$(board_name)" in
glinet,gl-ax1800|\ glinet,gl-ax1800|\
glinet,gl-axt1800) glinet,gl-axt1800|\
xiaomi,rm1800)
nand_do_upgrade "$1" nand_do_upgrade "$1"
;; ;;
linksys,mr7350) linksys,mr7350)
@ -28,6 +29,11 @@ platform_do_upgrade() {
fw_setenv auto_recovery yes fw_setenv auto_recovery yes
nand_do_upgrade "$1" nand_do_upgrade "$1"
;; ;;
redmi,ax5-jdcloud)
kernelname="0:HLOS"
rootfsname="rootfs"
mmc_do_upgrade "$1"
;;
*) *)
default_do_upgrade "$1" default_do_upgrade "$1"
;; ;;