ipq60xx: add support for CMIOT AX18

This commit is contained in:
aiamadeus 2023-12-16 23:16:29 +08:00
parent 08ebc6e104
commit e15446b4ce
4 changed files with 238 additions and 5 deletions

View File

@ -0,0 +1,218 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "ipq6018-256m.dtsi"
#include "ipq6018-ess.dtsi"
#include "ipq6000-opp.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
model = "CMIOT AX18";
compatible = "cmiot,ax18", "qcom,ipq6018";
aliases {
serial0 = &blsp1_uart3;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
label-mac-device = &dp1;
ethernet0 = &dp1;
ethernet1 = &dp2;
ethernet3 = &dp4;
ethernet4 = &dp5;
};
chosen {
stdout-path = "serial0:115200n8";
bootargs-append = " root=/dev/ubiblock0_1";
};
keys {
compatible = "gpio-keys";
wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
};
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&tlmm 60 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "blue:power";
gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
};
wan {
label = "blue:wan";
gpio = <&tlmm 74 GPIO_ACTIVE_HIGH>;
};
wlan2g {
label = "blue:wlan2g";
gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
};
wlan5g {
label = "blue:wlan5g";
gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>;
};
wps {
label = "red:wps";
gpio = <&tlmm 69 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";
};
};
};
&rpm {
status = "disabled";
};
&mdio {
status = "okay";
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 75 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_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 = <0x16>; /* 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 instance0*/
switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
qcom,port_phyinfo {
port@0 {
port_id = <1>;
phy_address = <0>;
};
port@1 {
port_id = <2>;
phy_address = <1>;
};
port@2 {
port_id = <4>;
phy_address = <3>;
};
port@3 {
port_id = <5>;
phy_address = <4>;
};
};
};
&edma {
status = "okay";
};
&dp1 {
status = "okay";
phy-handle = <&qca8075_0>;
label = "lan3";
};
&dp2 {
status = "okay";
phy-handle = <&qca8075_1>;
label = "lan2";
};
&dp4 {
status = "okay";
phy-handle = <&qca8075_3>;
label = "lan1";
};
&dp5 {
status = "okay";
phy-handle = <&qca8075_4>;
label = "wan";
};
&wifi {
status = "disabled";
qcom,ath11k-fw-memory-mode = <2>;
};

View File

@ -23,6 +23,18 @@ define Device/EmmcImage
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
endef
define Device/cmiot_ax18
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := CMIOT
DEVICE_MODEL := AX18
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@cp03-c1
SOC := ipq6000
endef
TARGET_DEVICES += cmiot_ax18
define Device/glinet_gl-ax1800
$(call Device/FitImage)
$(call Device/UbiFit)

View File

@ -11,6 +11,12 @@ ipq60xx_setup_interfaces()
local board="$1"
case "$board" in
cmiot,ax18|\
qihoo,360v6|\
redmi,ax5-*|\
xiaomi,rm1800)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
glinet,gl-ax1800|\
linksys,mr7350)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
@ -18,11 +24,6 @@ ipq60xx_setup_interfaces()
glinet,gl-axt1800)
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;;
qihoo,360v6|\
redmi,ax5-*|\
xiaomi,rm1800)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;

View File

@ -10,8 +10,10 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
cmiot,ax18|\
glinet,gl-ax1800|\
glinet,gl-axt1800|\
qihoo,360v6|\
xiaomi,rm1800)
nand_do_upgrade "$1"
;;