Skip to content

Commit

Permalink
ipq40xx: add support for Asus Lyra Mini (MAP-AC1300)
Browse files Browse the repository at this point in the history
Hardware
CHIPSET: IPQ4018 + QCA8072
LAN: 2x 1G
FLASH: GD5F1GQ4X 128 MiB + MX25L165D 2 MiB
RAM: 256 MiB
IO: Reset + WPS button
LED: Single Bright RGB led
POWER: 5V 2A

Flash layout similar to other asus brand routers.
Mac adresses extarcted from same mtd adress.
Created common .dtsi files as similar devices.

Orginal -> Openwrt
ath0 2C:FD:A1:8D:80:B8 -> phy0-ap0 2C:FD:A1:8D:80:B8
ath1 2C:FD:A1:8D:80:BA -> phy1-ap0 2C:FD:A1:8D:80:BA
br0  2C:FD:A1:8D:80:B9 -> br-lan   2C:FD:A1:8D:80:B9
eth0 2C:FD:A1:8D:80:B9 -> lan      2C:FD:A1:8D:80:B9
eth1 2C:FD:A1:8D:80:BB -> wan      2C:FD:A1:8D:80:BB

Status:
Lan ports: Configured as oem port closer to power jack as wan and other as lan
Wlan: radio1@5Ghz 300 Mbps trouhgput. [email protected] 50Mbps troughput
Led: works
Buttons: reset works, wps untested.

Installation:

1.  Reset device to orginal settings and enable ssh, set username and password: admin/password
2.  Upload openwrt-ipq40xx-generic-asus_map-ac1300-initramfs-uImage.itb
    scp openwrt-ipq40xx-generic-asus_map-ac1300-initramfs-uImage.itb [email protected]:/tmp
3.  ssh to router:
    ssh [email protected]
4.  run in router:
    mtd-write -d linux -i /tmp/openwrt-ipq40xx-generic-asus_map-ac1300-initramfs-uImage.itb
5.  Reboot with command or with powercycling device
6.  OpenWrt should boot and is ready after sort brust of flashing blue light
7.  wget/scp openwrt-ipq40xx-generic-asus_map-ac1300-squashfs-sysupgrade.bin to /tmp dir of device
    scp openwrt-ipq40xx-generic-asus_map-ac1300-initramfs-uImage.itb [email protected]:/tmp
8.  ssh to OpenWrt device.
    ssh [email protected]
9.  run in router:
    sysupgrade -n /tmp/openwrt-ipq40xx-generic-asus_map-ac2200-squashfs-sysupgrade.bin
10. After reboot OpenWrt is installed to device.

Signed-off-by: Erkki Hietaranta <[email protected]>
  • Loading branch information
sbeach92 authored and robimarko committed Feb 17, 2024
1 parent aa6819c commit 42e8d94
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 0 deletions.
6 changes: 6 additions & 0 deletions target/linux/ipq40xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ipq40xx_setup_interfaces()
;;
8dev,jalapeno|\
alfa-network,ap120c-ac|\
asus,map-ac1300|\
asus,map-ac2200|\
cilab,meshpoint-one|\
edgecore,ecw5211|\
Expand Down Expand Up @@ -161,6 +162,11 @@ ipq40xx_setup_macs()
8dev,habanero-dvk)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
asus,map-ac1300)
label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
lan_mac=$(macaddr_add "$label_mac" 1)
wan_mac=$(macaddr_add "$label_mac" 3)
;;
asus,rt-ac42u)
label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ case "$FIRMWARE" in
;;
"ath10k/pre-cal-ahb-a000000.wifi.bin")
case "$board" in
asus,map-ac1300|\
asus,map-ac2200|\
asus,rt-ac42u|\
asus,rt-ac58u)
Expand Down Expand Up @@ -150,6 +151,7 @@ case "$FIRMWARE" in
;;
"ath10k/pre-cal-ahb-a800000.wifi.bin")
case "$board" in
asus,map-ac1300|\
asus,map-ac2200|\
asus,rt-ac58u)
caldata_extract_ubi "Factory" 0x5000 0x2f20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ preinit_set_mac_address() {
ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
;;
asus,map-ac1300)
base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
ip link set dev lan address $(macaddr_add "$base_mac" 1)
ip link set dev wan address $(macaddr_add "$base_mac" 3)
;;
asus,rt-ac42u)
base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
ip link set dev eth0 address $base_mac
Expand Down
2 changes: 2 additions & 0 deletions target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'

platform_check_image() {
case "$(board_name)" in
asus,map-ac1300 |\
asus,rt-ac42u |\
asus,rt-ac58u)
local ubidev=$(nand_find_ubi $CI_UBIPART)
Expand Down Expand Up @@ -148,6 +149,7 @@ platform_do_upgrade() {
CI_KERNPART="linux"
nand_do_upgrade "$1"
;;
asus,map-ac1300 |\
asus,rt-ac42u |\
asus,rt-ac58u)
CI_KERNPART="linux"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qcom-ipq4019.dtsi"
#include <dt-bindings/leds/common.h>
#include "qcom-ipq4018-asus.dtsi"
#include "qcom-ipq401x-map-acxx00.dtsi"

/ {
model = "ASUS Lyra Mini";
compatible = "asus,map-ac1300";

aliases {
led-boot = &led_blue0;
led-failsafe = &led_red0;
led-running = &led_blue0;
led-upgrade = &led_red0;
};

keys {
compatible = "gpio-keys";

reset-button {
label = "reset-button";
gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};

wps-button {
label = "wps-button";
gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};

};

&tlmm {
i2c_0_pins: i2c_0_pinmux {
pinmux {
function = "blsp_i2c0";
pins = "gpio58", "gpio59";
drive-strength = <16>;
bias-disable;
};
};

serial_pins: serial_pinmux {
mux {
pins = "gpio60", "gpio61";
function = "blsp_uart0";
bias-disable;
};
};

spi_0_pins: spi_0_pinmux {
mux {
function = "blsp_spi0";
pins = "gpio55", "gpio56", "gpio57";
drive-strength = <12>;
bias-disable;
};

mux_cs {
function = "gpio";
pins = "gpio54", "gpio1";
drive-strength = <2>;
bias-disable;
output-high;
};

};
};

&blsp1_spi1 { /* BLSP1 QUP1 */
cs-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>,
<&tlmm 1 GPIO_ACTIVE_LOW>;
};

&swport4 {
status = "okay";
label = "wan";
};

&swport5 {
status = "okay";
label = "lan";
};

&wifi0 {
status = "okay";
qcom,ath10k-calibration-variant = "ASUS-MAP-AC1300";
};

&wifi1 {
status = "okay";
qcom,ath10k-calibration-variant = "ASUS-MAP-AC1300";
};
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,41 @@
};
};
};

&blsp1_uart1 {
pinctrl-0 = <&serial_pins>;
pinctrl-names = "default";
status = "okay";
};

&blsp_dma {
status = "okay";
};

&crypto {
status = "okay";
};

&cryptobam {
status = "okay";
};

&gmac {
status = "okay";
};

&mdio {
status = "okay";
};

&prng {
status = "okay";
};

&switch {
status = "okay";
};

&watchdog {
status = "okay";
};
13 changes: 13 additions & 0 deletions target/linux/ipq40xx/image/generic.mk
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ define Device/aruba_ap-365
endef
TARGET_DEVICES += aruba_ap-365

define Device/asus_map-ac1300
$(call Device/FitImageLzma)
DEVICE_VENDOR := ASUS
DEVICE_MODEL := Lyra Mini (MAP-AC1300)
SOC := qcom-ipq4018
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 131072k
KERNEL_INSTALL := 1

endef
TARGET_DEVICES += asus_map-ac1300

define Device/asus_map-ac2200
$(call Device/FitImageLzma)
DEVICE_VENDOR := ASUS
Expand Down

0 comments on commit 42e8d94

Please sign in to comment.