From: Hal Martin Date: Tue, 12 May 2026 17:21:38 +0000 (+0200) Subject: ipq40xx: add support for Cisco Meraki Z3C X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0ce075e675de03cf63f34b192daa33000b30fe;p=thirdparty%2Fopenwrt.git ipq40xx: add support for Cisco Meraki Z3C This commit adds support for the Meraki Z3C "Teleworker" device with 802.11ac, LTE Cat 3 modem, and an integrated 5 port Gigabit switch. Port 5 has POE output (802.3af). The WAN port is used for tftp booting in U-Boot. This device ships with secure boot, and cannot be flashed without an external programmer. ||| |--|--| |Model|Z3C| |CPU|Qualcomm Atheros IPQ4029| |Flash MB|128 NAND| |RAM MB|512| |WLAN Hardware|Qualcomm Atheros IPQ4029| |WLAN 2.4GHz|b/g/n 2x2| |WLAN 5.0GHz|a/n/ac 2x2| |WWAN|LTE Cat 3| |Ethernet 1Gbit ports|5| The LAN/WiFi MAC addresses are sourced from an internal I2C EEPROM. Z3C-HW-NA (NA: North America) supports LTE bands: 2,4,5,13,17 Z3C-HW-WW (WW: World-wide) supports LTE bands: 1,3,7,8,20 Disassembly: Remove the four T8 screws on the bottom of the device under the rubber feet. Using a guitar pick or similar plastic tool, insert it on the side between the bottom case and the side, pry up gently. The plastic bottom has 18 latches around the perimeter (but none on the rear by the Ethernet ports). Remember to remove the SIM tray! Gently remove the metal RF shield on the bottom of the PCB. The TSOP48 NAND flash (U30, Spansion S34ML01G200TFV00) is located on the bottom side of the PCB (facing you as you remove the bottom plastic). To flash, you will need to desolder the TSOP48. Attempts to flash in-circuit using a 360 clip were unsuccessful. The SOIC8 I2C EEPROM (U32, Atmel 24C64) is located on the bottom side of the PCB under a metal RF shield. It can be flashed in circuit using a chip clip. You may have to bend the RF shield up to fit the chip clip. The UART header is on the top (opposite) side of the PCB. You do not need to remove any more screws to remove the PCB. The PCB has some thermal interface material for heat dissipation and will be slightly difficult to remove the first time. Gently pry up on the green PCB from one of the front corners until the thermal pads break contact with the top case. You can then lift out the entire PCB, including the attached LTE/WiFi antennas. Installation: The dumps to flash can be found in this repository: https://github.com/halmartin/meraki-openwrt-docs/tree/main/z3c The device has the following flash layout (offsets with OOB data): ``` 0x000000000000-0x000000100000 : "sbl1" 0x000000100000-0x000000200000 : "mibib" 0x000000200000-0x000000300000 : "bootconfig" 0x000000300000-0x000000400000 : "qsee" 0x000000400000-0x000000500000 : "qsee_alt" 0x000000500000-0x000000580000 : "cdt" 0x000000580000-0x000000600000 : "cdt_alt" 0x000000600000-0x000000680000 : "ddrparams" 0x000000700000-0x000000900000 : "u-boot" 0x000000900000-0x000000b00000 : "u-boot-backup" 0x000000b00000-0x000000b80000 : "ART" 0x000000c00000-0x000007c00000 : "ubi" ``` * Dump your original NAND (if using nanddump, include OOB data). * Decompress `u-boot.bin.gz` dump (contains OOB data) and overwrite the `u-boot` portion of NAND from `0x738000-0x948000` (length `0x210000`). * Decompress `ubi.bin.gz` dump (contains OOB data) and overwrite the `ubi` portion of NAND from `0xc60000-0x8400000` (length `0x77a0000`). * Dump your original EEPROM. Change the byte at offset `0x49` to `0x1e` (originally `0x2a`). Remember to re-write the EEPROM with the modified data. * This can be done on Linux via the following command: `printf "\x1e" | dd of=/tmp/eeprom.bin bs=1 seek=$((0x49)) conv=notrunc` **Note**: the device will not boot if you modify the board major number and have not yet overwritten the `ubi` and `u-boot` regions of NAND. * Resolder the NAND after overwriting the `u-boot` and `ubi` regions. OpenWrt Installation: * After flashing NAND and EEPROM with external programmers. Plug in an Ethernet cable and power up the device. * The new U-Boot build uses the space character `" "` (without quotes) to interrupt boot. * Interrupt U-Boot and `tftpboot` the OpenWrt initramfs image from your tftp server ``` dhcp setenv serverip tftpboot openwrt-ipq40xx-generic-meraki_z3c-initramfs-uImage.itb ``` * Once booted into the OpenWrt initramfs, created the `ART` ubivol with the WiFi radio calibration from the mtd partition: ``` cat /dev/mtd10 > /tmp/ART.bin ubiupdatevol /dev/ubi0_1 /tmp/ART.bin ``` * `scp` the `sysupgrade` image to the device and run the normal `sysupgrade` procedure: ``` scp -O openwrt-ipq40xx-generic-meraki_z3c-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/ ssh root@192.168.1.1 "sysupgrade -n /tmp/openwrt-ipq40xx-generic-meraki_z3c-squashfs-sysupgrade.bin" ``` * OpenWrt should now be installed on the device. * Note: To use the LTE modem as a WWAN, you must install `modemmanager` (you probably also want `luci-proto-modemmanager`) and then configure the modem for your provider. Due to OpenWrt policies these packages are not included in the initramfs/sysupgrade image. Signed-off-by: Hal Martin Link: https://github.com/openwrt/openwrt/pull/23307 Signed-off-by: Robert Marko --- diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds index eee259b8727..78d84d562d7 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -60,7 +60,8 @@ mikrotik,lhgg-60ad) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" ;; meraki,gx20|\ -meraki,z3) +meraki,z3|\ +meraki,z3c) ucidef_set_led_netdev "wan_link" "WAN (link)" "green:wan-0" "wan" "link" ucidef_set_led_netdev "wan_act" "WAN (txrx)" "green:wan-1" "wan" "tx rx" ucidef_set_led_netdev "lan1_link" "LAN2 (link)" "green:lan-2" "lan2" "link" diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 77749e3f0cb..183f039e8bf 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -108,7 +108,8 @@ ipq40xx_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; meraki,gx20|\ - meraki,z3) + meraki,z3|\ + meraki,z3c) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan" ;; meraki,mr30h) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches index 003fd685b98..37884f5bb26 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches @@ -22,7 +22,8 @@ compex,wpj428) ucidef_add_gpio_switch "sim_card_select" "SIM card select" "3" "0" ;; meraki,gx20|\ -meraki,z3) +meraki,z3|\ +meraki,z3c) ucidef_add_gpio_switch "lan5_poe_disable" "LAN5 PoE disable" "540" "0" ;; mikrotik,cap-ac) diff --git a/target/linux/ipq40xx/base-files/etc/init.d/modem_switch b/target/linux/ipq40xx/base-files/etc/init.d/modem_switch index 9aeeec8dad0..e66a0a10075 100755 --- a/target/linux/ipq40xx/base-files/etc/init.d/modem_switch +++ b/target/linux/ipq40xx/base-files/etc/init.d/modem_switch @@ -19,6 +19,15 @@ boot() { sleep 1 echo "1" > /sys/class/gpio/lte_pwrkey/value ;; + meraki,z3c) + echo "0" > /sys/class/gpio/lte_estop/value + sleep 1 + echo "1" > /sys/class/gpio/lte_en/value + sleep 1 + echo "1" > /sys/class/gpio/lte_rst/value + sleep 1 + echo "0" > /sys/class/gpio/lte_rst/value + ;; esac } @@ -30,5 +39,9 @@ shutdown() { echo "1" > /sys/class/gpio/lte_pwrkey/value sleep 10 ;; + meraki,z3c) + echo "1" > /sys/class/gpio/lte_estop/value + echo "0" > /sys/class/gpio/lte_en/value + ;; esac } diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 4b50575d695..25b4e009395 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -191,7 +191,8 @@ platform_do_upgrade() { meraki,mr20|\ meraki,mr70|\ meraki,gx20|\ - meraki,z3) + meraki,z3|\ + meraki,z3c) # DO NOT set CI_KERNPART to part.safe, # that is used for chain-loading an unlocked u-boot # if part.safe is overwritten, then u-boot is lost! diff --git a/target/linux/ipq40xx/dts/qcom-ipq4029-z3c.dts b/target/linux/ipq40xx/dts/qcom-ipq4029-z3c.dts new file mode 100644 index 00000000000..90c21715a7a --- /dev/null +++ b/target/linux/ipq40xx/dts/qcom-ipq4029-z3c.dts @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Device Tree Source for Meraki Z3C (Heart of Gold) + +#include "qcom-ipq4029-meraki-insect.dtsi" + +/ { + model = "Meraki Z3C LTE Router"; + compatible = "meraki,z3c"; + + soc { + ess_tcsr@1953000 { + qcom,ess-interface-select = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + power_orange: power { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led-1 { + /* WAN left */ + color = ; + function = LED_FUNCTION_WAN; + function-enumerator = <0>; + gpios = <&tlmm 46 GPIO_ACTIVE_LOW>; + }; + + led-2 { + /* WAN right */ + color = ; + function = LED_FUNCTION_WAN; + function-enumerator = <1>; + gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; + }; + + led-3 { + /* port 2 left */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&tlmm 23 GPIO_ACTIVE_LOW>; + }; + + led-4 { + /* port 2 right */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + }; + + led-5 { + /* port 3 left */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; + }; + + led-6 { + /* port 3 right */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <5>; + gpios = <&tlmm 24 GPIO_ACTIVE_LOW>; + }; + + led-7 { + /* port 4 left */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <6>; + gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; + }; + + led-8 { + /* port 4 right */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <7>; + gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; + }; + + led-9 { + /* port 5 left */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <8>; + gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; + }; + + led-10 { + /* port 5 right */ + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <9>; + gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + + lte_en { + gpio-export,name = "lte_en"; + gpio-export,output = <1>; + gpios = <&tlmm 39 GPIO_ACTIVE_LOW>; + }; + + lte_rst { + gpio-export,name = "lte_rst"; + gpio-export,output = <0>; + gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>; + }; + + ble_rst { + gpio-export,name = "ble_rst"; + gpio-export,output = <0>; + gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>; + }; + + pse_det { + gpio-export,name = "pse_det"; + gpio-export,input = <0>; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + }; + + ble_load { + gpio-export,name = "ble_load"; + gpio-export,output = <1>; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + }; + + lte_estop { + gpio-export,name = "lte_estop"; + gpio-export,output = <0>; + gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb2 { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3 { + status = "okay"; +}; + +&swport1 { + label = "wan"; + status = "okay"; +}; + +&swport2 { + label = "lan2"; + status = "okay"; +}; + +&swport3 { + label = "lan3"; + status = "okay"; +}; + +&swport4 { + label = "lan4"; + status = "okay"; +}; + +&swport5 { + label = "lan5"; + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "Meraki-Z3"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "Meraki-Z3"; +}; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index c93c3779540..6a8d06e1a34 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -885,6 +885,14 @@ define Device/meraki_gx20 endef TARGET_DEVICES += meraki_gx20 +define Device/meraki_z3c + $(call Device/meraki_common) + DEVICE_MODEL := Z3C + DEVICE_DTS_CONFIG := config@3 + DEVICE_PACKAGES := kmod-usb-acm kmod-usb-net kmod-usb-net-cdc-ether -ath10k-firmware-qca9887-ct +endef +TARGET_DEVICES += meraki_z3c + define Device/mobipromo_cm520-79f $(call Device/FitzImage) $(call Device/UbiFit)