Skip to content

Commit

Permalink
qualcommax:ipq60xx: add Redmi AX5、Xiaomi AX1800
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenWrt Builder committed Mar 12, 2024
1 parent d71ea99 commit aa79059
Show file tree
Hide file tree
Showing 21 changed files with 352 additions and 2 deletions.
2 changes: 2 additions & 0 deletions feeds.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git targets https://github.com/openwrt/targets.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed
src-git kenzo https://github.com/kenzok8/openwrt-packages
src-git small https://github.com/kenzok8/small
2 changes: 2 additions & 0 deletions package/boot/uboot-envtools/files/qualcommax_ipq60xx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ case "$board" in
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
;;
redmi,ax5|\
xiaomi,ax1800|\
netgear,wax214)
idx="$(find_mtd_index 0:appsblenv)"
[ -n "$idx" ] && \
Expand Down
4 changes: 4 additions & 0 deletions package/firmware/ipq-wifi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ ALLWIFIBOARDS:= \
netgear_wax630 \
prpl_haze \
qnap_301w \
redmi_ax5
redmi_ax6 \
wallys_dr40x9 \
xiaomi_ax1800
xiaomi_ax3600 \
xiaomi_ax9000 \
yyets_le1 \
Expand Down Expand Up @@ -163,8 +165,10 @@ $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620))
$(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630))
$(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,redmi_ax5,Redmi AX5))
$(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,xiaomi_ax1800,Xiaomi AX1800))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
$(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
$(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1))
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions target/linux/qualcommax/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ KERNELNAME:=Image dtbs
CPU_TYPE:=cortex-a53
SUBTARGETS:=ipq807x ipq60xx

KERNEL_PATCHVER:=6.1
KERNEL_TESTING_PATCHVER:=6.6
KERNEL_PATCHVER:=6.6

include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include "ipq6018-xiaomi.dtsi"

/ {
model = "Xiaomi AX1800";
compatible = "xiaomi,ax1800", "qcom,ipq6018";
};

&wifi {
qcom,ath11k-calibration-variant = "Xiaomi-AX1800";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include "ipq6018-xiaomi.dtsi"

/ {
model = "Redmi AX5";
compatible = "redmi,ax5", "qcom,ipq6018";
};

&wifi {
qcom,ath11k-calibration-variant = "Redmi-AX5";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include "ipq6018.dtsi"
#include "ipq6018-cp-cpu.dtsi"
#include "ipq6018-ess.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
qcom,msm-id = <0x192 0x0>;

aliases {
serial0 = &blsp1_uart3;
led-boot = &led_yellow;
led-failsafe = &led_blue;
led-running = &led_blue;
led-upgrade = &led_yellow;

/* Aliases as required by u-boot to patch MAC addresses */
//ethernet0 = &dp1;
ethernet1 = &dp2;
ethernet2 = &dp3;
ethernet3 = &dp4;
ethernet4 = &dp5;

label-mac-device = &dp5;
};

chosen {
bootargs-append = " root=/dev/ubiblock0_1 swiotlb=1 coherent_pool=2M";
};

leds {
compatible = "gpio-leds";
pinctrl-0 = <&leds_pins>;
pinctrl-names = "default";

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>;
};
};

keys {
compatible = "gpio-keys";
pinctrl-0 = <&button_pins>;
pinctrl-names = "default";

reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
linux,input-type = <1>;
debounce-interval = <60>;
};
};
};

// Overclock CPU frequency to 1.6GHz
&cpu_opp_table {
opp-1608000000 {
opp-supported-hw = <0x3>;
};
};

&tlmm {
leds_pins: leds_pins {
mux {
pins = "gpio29", "gpio30", "gpio31", "gpio32";
function = "gpio";
drive-strength = <8>;
bias-pull-down;
};
};

button_pins: button_pins {
reset_button {
pins = "gpio19";
function = "gpio";
drive-strength = <8>;
bias-pull-up;
};
};

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>;

ethernet-phy-package@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "qcom,qca8075-package";
reg = <0>;

qcom,package-mode = "psgmii";

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_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
switch_mac_mode = <MAC_MODE_PSGMII>; /* mac mode for uniphy 0 */

qcom,port_phyinfo {
port@2 {
port_id = <2>;
phy_address = <1>;
};
port@3 {
port_id = <3>;
phy_address = <2>;
};
port@4 {
port_id = <4>;
phy_address = <3>;
};
port@5 {
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>;
phy-mode = "psgmii";
label = "wan";
};

&wifi {
status = "okay";

qcom,ath11k-fw-memory-mode = <1>;
};

&qusb_phy_0 {
status = "ok";
};

&ssphy_0 {
status = "ok";
};

&usb2 {
status = "okay";
};

&usb3 {
status = "ok";
};
26 changes: 26 additions & 0 deletions target/linux/qualcommax/image/ipq60xx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,29 @@ define Device/netgear_wax214
DEVICE_PACKAGES := ipq-wifi-netgear_wax214
endef
TARGET_DEVICES += netgear_wax214

define Device/redmi_ax5
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Redmi
DEVICE_MODEL := AX5
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@cp03-c1
SOC := ipq6018
DEVICE_PACKAGES := ipq-wifi-redmi_ax5
endef
TARGET_DEVICES += redmi_ax5

define Device/xiaomi_ax1800
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := AX1800
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@cp03-c1
SOC := ipq6018
DEVICE_PACKAGES := ipq-wifi-xiaomi_ax1800
endef
TARGET_DEVICES += xiaomi_ax1800
20 changes: 20 additions & 0 deletions target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

. /lib/functions/uci-defaults.sh

board_config_update

board=$(board_name)

case "$board" in
redmi,ax5|\
xiaomi,ax1800)
ucidef_set_led_netdev "internet" "Internet" "blue:network" "wan"
;;

*)
;;
esac

board_config_flush

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ ipq60xx_setup_interfaces()
netgear,wax214)
ucidef_set_interfaces_lan_wan "lan"
;;
redmi,ax5|\
xiaomi,ax1800)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
Expand Down
Loading

0 comments on commit aa79059

Please sign in to comment.