1
1
openwrt/target/linux/qualcommax/image/ipq50xx.mk
Taiga Ogawa 587a1a8872 qualcommax: ipq50xx: add support for ELECOM WRC-X3000GST2
ELECOM WRC-X3000GST2 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router based on
IPQ5018. The only hardware difference from the WRC-X3000GS2 is the RAM
capacity; all other peripherals are identical. This port therefore
reuses the GS2 board-2.bin (ipq-wifi-elecom_wrc-x3000gs2) and ath11k
calibration variant.

Specification:

- SoC             : Qualcomm IPQ5018
- RAM             : DDR3 512 MiB (Kingston Technology D2516ECMDXGJD)
- Flash           : SPI-NAND 128 MiB (Macronix MX35UF1G24AD-Z4I)
- WLAN            : 2.4/5 GHz 2T2R
  - 2.4 GHz       : Qualcomm IPQ5018 (SoC)
  - 5 GHz         : Qualcomm QCN6122
- Ethernet        : 5x 10/100/1000 Mbps
  - wan (phy)     : Qualcomm IPQ5018 (SoC)
  - lan (switch)  : Qualcomm Atheros QCA8337
- LEDs/Keys (GPIO): 8x / 3x (reset, WPS, router/AP slide switch)
- UART            : through-hole on PCB, 4pins near the barcode
  - assignment    : 3.3V, TX, RX, NC, GND from the barcode side
  - settings      : 115200n8
- Power           : 12 VDC, 1 A (Max. 11.5W)

Flash instruction using factory.bin image:

1. Boot WRC-X3000GST2 normally in router mode
2. Access the WebUI ("http://192.168.2.1/") and open the firmware
   update page ("ファームウェア更新")
3. Select the OpenWrt factory.bin image and click apply ("適用")
4. After the device reboots automatically, wait until the green power LED
   stops blinking and stays solid
5. When the green power LED is solid, hold the reset button until the red
   LED starts blinking to clear remaining stock firmware settings

Switching to the stock firmware:

1. Load the elecom.sh script

   . /lib/upgrade/elecom.sh

2. Check the current index of rootfs

   bootconfig_rw_index 0:bootconfig rootfs

3. Set the index to inverted value

   bootconfig_rw_index 0:bootconfig rootfs <value>
   bootconfig_rw_index 0:bootconfig1 rootfs <value>

   example:

   - step2 returned "0":

     bootconfig_rw_index 0:bootconfig rootfs 1
     bootconfig_rw_index 0:bootconfig1 rootfs 1

   - step2 returned "1":

     bootconfig_rw_index 0:bootconfig rootfs 0
     bootconfig_rw_index 0:bootconfig1 rootfs 0

4. Reboot

Partition Layout (Stock FW):

0x000000000000-0x000000080000 : "0:SBL1"
0x000000080000-0x000000100000 : "0:MIBIB"
0x000000100000-0x000000140000 : "0:BOOTCONFIG"
0x000000140000-0x000000180000 : "0:BOOTCONFIG1"
0x000000180000-0x000000280000 : "0:QSEE"
0x000000280000-0x000000380000 : "0:QSEE_1"
0x000000380000-0x0000003c0000 : "0:DEVCFG"
0x0000003c0000-0x000000400000 : "0:DEVCFG_1"
0x000000400000-0x000000440000 : "0:CDT"
0x000000440000-0x000000480000 : "0:CDT_1"
0x000000480000-0x000000500000 : "0:APPSBLENV"
0x000000500000-0x000000640000 : "0:APPSBL"
0x000000640000-0x000000780000 : "0:APPSBL_1"
0x000000780000-0x000000880000 : "0:ART"
0x000000880000-0x000000900000 : "0:TRAINING"
0x000000900000-0x000003c40000 : "rootfs"
0x000003c40000-0x000003fc0000 : "Config"
0x000003fc0000-0x000007300000 : "rootfs_1"
0x000007300000-0x000007680000 : "Config_2"
0x000007680000-0x000007b80000 : "Reserved"
0x000007b80000-0x000007c00000 : "FWHEADER"
0x000007c00000-0x000007c80000 : "Factory"

Notes:

- This device has dual-boot feature and it's managed by the index in the
  0:bootconfig and 0:bootconfig1 partitions.

- Wi-Fi BDF is shared with WRC-X3000GS2 (ipq-wifi-elecom_wrc-x3000gs2)
  as the hardware (SoC, QCN6122, antennas) is identical between the two
  models.

- GST2 stock firmware keeps its configuration even when sysupgrade is
  called with -n. When installing from the OEM WebUI, those stock
  settings can be restored into OpenWrt overlay, so settings must be
  initialized after the first OpenWrt boot.

MAC Addresses:

LAN    : 38:97:A4:xx:xx:40 (0:APPSBLENV, "eth1addr"/"ethaddr"  (text))
WAN    : 38:97:A4:xx:xx:43 (0:APPSBLENV, "eth0addr" (text))
2.4 GHz: 38:97:A4:xx:xx:41 (0:APPSBLENV, "wifi0"    (text))
5 GHz  : 38:97:A4:xx:xx:42 (0:APPSBLENV, "wifi1"    (text))

Signed-off-by: Taiga Ogawa <zectaiga@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23471
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-26 18:56:17 +02:00

287 lines
7.4 KiB
Makefile

DTS_DIR := $(DTS_DIR)/qcom
DEVICE_VARS += BOOT_SCRIPT
define Build/mstc-header
$(eval version=$(word 1,$(1)))
$(eval hdrlen=$(if $(word 2,$(1)),$(word 2,$(1)),0x400))
gzip -c $@ | tail -c8 > $@.crclen
( \
printf "CMOC"; \
tail -c+5 $@.crclen; head -c4 $@.crclen; \
printf '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' | \
dd bs=64 count=1 conv=sync 2>/dev/null; \
printf "$(version)" | \
dd bs=64 count=1 conv=sync 2>/dev/null; \
dd if=/dev/zero bs=$$(($(hdrlen) - 0x8c)) count=1 2>/dev/null; \
cat $@; \
) > $@.new
mv $@.new $@
rm -f $@.crclen
endef
define Device/cmcc_mr3000d-ci
$(call Device/FitImageLzma)
$(call Device/UbiFit)
DEVICE_VENDOR := CMCC
DEVICE_MODEL := MR3000D-CI
DEVICE_DTS_CONFIG := config@mp03.3-m1
SOC := ipq5018
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 59392k
NAND_SIZE := 128m
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-cmcc_mr3000d-ci
endef
TARGET_DEVICES += cmcc_mr3000d-ci
define Device/cmcc_pz-l8
$(call Device/FitImageLzma)
$(call Device/UbiFit)
DEVICE_VENDOR := CMCC
DEVICE_MODEL := PZ-L8
DEVICE_DTS_CONFIG := config@mp02.1
SOC := ipq5018
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 59392k
NAND_SIZE := 128m
endef
TARGET_DEVICES += cmcc_pz-l8
define Device/elecom_wrc-x3000gs2
$(call Device/FitImageLzma)
DEVICE_VENDOR := ELECOM
DEVICE_MODEL := WRC-X3000GS2
DEVICE_DTS_CONFIG := config@mp03.3
SOC := ipq5018
KERNEL_IN_UBI := 1
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 52480k
NAND_SIZE := 128m
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand | \
mstc-header 4.04(XZF.0)b90 | elecom-product-header WRC-X3000GS2
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-elecom_wrc-x3000gs2
endef
TARGET_DEVICES += elecom_wrc-x3000gs2
define Device/elecom_wrc-x3000gst2
$(call Device/FitImageLzma)
DEVICE_VENDOR := ELECOM
DEVICE_MODEL := WRC-X3000GST2
DEVICE_DTS_CONFIG := config@mp03.3
SOC := ipq5018
KERNEL_IN_UBI := 1
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 52480k
NAND_SIZE := 128m
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand | \
mstc-header 4.04(XZP.0)b90 | elecom-product-header WRC-X3000GST2
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-elecom_wrc-x3000gs2
endef
TARGET_DEVICES += elecom_wrc-x3000gst2
define Device/glinet_gl-b3000
$(call Device/FitImage)
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-B3000
SOC := ipq5018
KERNEL_IN_UBI := 1
BLOCKSIZE := 128k
PAGESIZE := 2048
NAND_SIZE := 128m
DEVICE_DTS_CONFIG := config@mp03.5-c1
SUPPORTED_DEVICES += b3000
BOOT_SCRIPT:= glinet_gl-b3000.bootscript
IMAGES := factory.img sysupgrade.bin
IMAGE/factory.img := append-ubi | gl-qsdk-factory | append-metadata
DEVICE_PACKAGES := \
ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-glinet_gl-b3000 \
dumpimage
endef
TARGET_DEVICES += glinet_gl-b3000
define Device/iodata_wn-dax3000gr
$(call Device/FitImageLzma)
DEVICE_VENDOR := I-O DATA
DEVICE_MODEL := WN-DAX3000GR
DEVICE_DTS_CONFIG := config@mp03.3
SOC := ipq5018
KERNEL_IN_UBI := 1
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 52480k
NAND_SIZE := 128m
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand | \
mstc-header 4.04(XZH.1)b90 0x480
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-iodata_wn-dax3000gr
endef
TARGET_DEVICES += iodata_wn-dax3000gr
define Device/linksys_ipq50xx_mx_base
$(call Device/FitImageLzma)
DEVICE_VENDOR := Linksys
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 8192k
IMAGE_SIZE := 83968k
NAND_SIZE := 256m
SOC := ipq5018
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=$$$$(DEVICE_MODEL)
endef
define Device/linksys_mr5500
$(call Device/linksys_ipq50xx_mx_base)
DEVICE_MODEL := MR5500
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
ipq-wifi-linksys_mr5500 \
kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += linksys_mr5500
define Device/linksys_mx2000
$(call Device/linksys_ipq50xx_mx_base)
DEVICE_MODEL := MX2000
DEVICE_DTS_CONFIG := config@mp03.5-c1
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-linksys_mx2000
endef
TARGET_DEVICES += linksys_mx2000
define Device/linksys_mx5500
$(call Device/linksys_ipq50xx_mx_base)
DEVICE_MODEL := MX5500
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
ipq-wifi-linksys_mx5500
endef
TARGET_DEVICES += linksys_mx5500
define Device/linksys_mx6200
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Linksys
DEVICE_MODEL := MX6200
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_DTS_CONFIG := config@mp03.5-c1
KERNEL_SIZE := 8192k
IMAGE_SIZE := 51200k
NAND_SIZE := 256m
SOC := ipq5018
IMAGE/factory.ubi := append-ubi | linksys-image type=$$$$(DEVICE_MODEL)
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-linksys_mx6200
endef
TARGET_DEVICES += linksys_mx6200
define Device/linksys_spnmx56
$(call Device/linksys_ipq50xx_mx_base)
DEVICE_MODEL := SPNMX56
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
ipq-wifi-linksys_spnmx56
endef
TARGET_DEVICES += linksys_spnmx56
define Device/xiaomi_ipq50xx_ax_base
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Xiaomi
BLOCKSIZE := 128k
PAGESIZE := 2048
SOC := ipq5018
KERNEL_SIZE := 36864k
NAND_SIZE := 128m
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
ARTIFACTS := initramfs-factory.ubi
ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
endif
endef
define Device/xiaomi_ax6000
$(call Device/xiaomi_ipq50xx_ax_base)
DEVICE_MODEL := AX6000
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
kmod-ath10k-ct-smallbuffers \
ath10k-firmware-qca9887-ct \
ipq-wifi-xiaomi_ax6000
endef
TARGET_DEVICES += xiaomi_ax6000
define Device/xiaomi_redmi-ax5400
$(call Device/xiaomi_ipq50xx_ax_base)
DEVICE_MODEL := Redmi AX5400
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
ipq-wifi-xiaomi_redmi-ax5400
endef
TARGET_DEVICES += xiaomi_redmi-ax5400
define Device/yuncore_ax830
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Yuncore
DEVICE_MODEL := AX830
BLOCKSIZE := 128k
PAGESIZE := 2048
SOC := ipq5018
DEVICE_DTS_CONFIG := config@mp03.5-c1
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-yuncore_ax830
endef
TARGET_DEVICES += yuncore_ax830
define Device/yuncore_ax850
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Yuncore
DEVICE_MODEL := AX850
BLOCKSIZE := 128k
PAGESIZE := 2048
SOC := ipq5018
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := ath11k-firmware-ipq5018 \
kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
ipq-wifi-yuncore_ax850
endef
TARGET_DEVICES += yuncore_ax850
define Device/zyxel_scr50axe
$(call Device/FitImage)
$(call Device/UbiFit)
DEVICE_VENDOR := Zyxel
DEVICE_MODEL := SCR50AXE
SOC := ipq5018
BLOCKSIZE := 128k
PAGESIZE := 2048
NAND_SIZE := 256m
DEVICE_DTS_CONFIG := config@mp03.5-c1
DEVICE_PACKAGES := ath11k-firmware-ipq5018-qcn6122 \
ipq-wifi-zyxel_scr50axe
endef
TARGET_DEVICES += zyxel_scr50axe