diff options
author | Matthew Hagan <mnhagan88@gmail.com> | 2021-05-09 23:28:04 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2021-11-28 17:51:52 +0100 |
commit | 67f52012760ce553ba6393aaba77359a458deeda (patch) | |
tree | 81f4063bef17e16f9986bf57bff4601fc9b68cb3 /target/linux/ipq806x/base-files | |
parent | 6e5b8c6300019e8148008060dfbabb008c2a5ec5 (diff) | |
download | upstream-67f52012760ce553ba6393aaba77359a458deeda.tar.gz upstream-67f52012760ce553ba6393aaba77359a458deeda.tar.bz2 upstream-67f52012760ce553ba6393aaba77359a458deeda.zip |
ipq806x: add support for Cisco Meraki MR42/MR52
The MR42 and MR52 are two similar IPQ806x based devices from the Cisco
Meraki "Cryptid" series.
MR42 main features:
- IPQ8068 1.4GHz
- 512MB RAM
- 128MB NAND
- 2x QCA9992 (2.4 & 5GHz)
- 1x QCA9889 (2.4 & 5GHz)
- 1x AR8033 PHY
- PoE/AC power
MR52 main features:
- IPQ8068 1.4GHz
- 512MB RAM
- 128MB NAND
- 2x QCA9994 (2.4 & 5GHz)
- 1x QCA9889 (2.4 & 5GHz)
- 2x AR8033 PHYs
- PoE/AC power
(MR42 Only) Installation via diagnostic mode:
If you can successfully complete step 1 then you can continue to install
via this method without having to open the device. Otherwise please use
the standard UART method. Please note that when booting via TFTP, some
Ethernet devices, in particular those on laptops, will not connect in
time, resulting in TFTP boot not succeeding. In this instance it is
advised to connect via a switch.
1. Hold down reset at power on and keep holding, after around 10 seconds
if the orange LED changes behaviour to begin flashing, proceed to
release reset, then press reset two times. Ensure that the LED has
turned blue. Note that flashing will occur on some devices, but it
will not be possible to change the LED colour using the reset button.
In this case it will still be possible to continue with this install
method.
2. Set your IP to 192.168.1.250. Set up a TFTP server serving
mr42_u-boot.mbn and
openwrt-ipq806x-generic-meraki_mr42-initramfs-fit-uImage.itb, obtained
from [1].
3. Use telnet and connect to 192.168.1.1. Run the following commands to
install u-boot. Note that all these commands are critical, an error
will likely render the device unusable.
Option 3.1:
If you are sure you have set up the TFTP server correctly you can
run this script on the device. This will download and flash the
u-boot image immediately:
`/etc/update_uboot.sh 192.168.1.250 mr42_u-boot.mbn`
Once completed successfully, power off the device.
Option 3.2:
If you are unsure the TFTP server is correctly set up you can
obtain the image and flash manually:
3.2.1. `cd /tmp`
3.2.2. `tftp-hpa 192.168.1.250 -m binary -c get mr42_u-boot.mbn`
3.2.3. Confirm file has downloaded correctly by comparing the
md5sum:
`md5sum mr42_u-boot.mbn`
3.2.4. The following are the required commands to write the image.
`echo 1 > /sys/devices/platform/msm_nand/boot_layout
mtd erase /dev/mtd1
nandwrite -pam /dev/mtd1 mr42_u-boot.mbn
echo 0 > /sys/devices/platform/msm_nand/boot_layout`
Important: You must observe the output of the `nandwrite`
command. Look for the following to verify writing is occurring:
`Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000`
If you do not see this then do not power off the device. Check
your previous commands and that mr42_u-boot.mbn was downloaded
correctly. Once you are sure the image has been written you
can proceed to power off the device.
4. Hold the reset button and power on the device. This will immediately
begin downloading the appropriate initramfs image and boot into it.
Note: If the device does not download the initramfs, this is likely
due to the interface not being brought up in time. Changing Ethernet
source to a router or switch will likely resolve this. You can also
try manually setting the link speed to 10Mb/s Half-Duplex.
5. Once a solid white LED is displayed on the device, continue to the
UART installation method, step 6.
Standard installation via UART - MR42 & MR52
1. Disassemble the device and connect a UART header. The header pinout
is as follows:
1 - 3.3v
2 - TXD
3 - RXD
4 - GND
Important: You should only connect TXD, RXD and GND. Connecting
3.3v may damage the device.
2. Set your IP to 192.168.1.250. Set up a TFTP server serving
openwrt-ipq806x-generic-meraki_(mr42|mr52)-initramfs-fit-uImage.itb.
Separately obtain the respective sysupgrade image.
3. Run the following commands, preferably from a Linux host. The
mentioned files, including ubootwrite.py and u-boot images, can be
obtained from [1].
`python ubootwrite.py --write=(mr42|mr52)_u-boot.bin`
The default for "--serial" option is /dev/ttyUSB0.
4. Power on the device. The ubootwrite script will upload the image to
the device and launch it. The second stage u-boot will in turn load
the initramfs image by TFTP, provided the TFTP server is running
correctly. This process will take about 13 minutes. Once a solid
white LED is displayed, the image has successfully finished
loading. Note: If the image does not load via TFTP, try again with
the Ethernet link to 10Mb/s Half-Duplex.
5. (MR42 only) Do not connect over the network. Instead connect over
the UART using minicom or similar tool. To replace u-boot with
the network enabled version, please run the following commands.
Note that in the provided initramfs images, the u-boot.mbn file
is located in /root:
If you have not used the provided initramfs, you must ensure you
are using an image with "boot_layout" ECC configuration enabled in
the Kernel. This will be version 5.10 or higher. If you do not do
this correctly the device will be bricked.
`insmod mtd-rw i_want_a_brick=1
mtd erase /dev/mtd8
nandwrite -pam /dev/mtd8 /root/mr42_u-boot.mbn`
After running nandwrite, ensure you observe the following output:
`Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000`
6. (Optional) If you have no further use for the Meraki OS, you can
remove all other UBI volumes on ubi0 (mtd11), including diagnostic1,
part.old, storage and part.safe. You must not remove the ubi1 ART
partition (mtd12).
`for i in diagnostic1 part.old storage part.safe ; do
ubirmvol /dev/ubi0 -N $i
done`
7. Proceed to flash the sysupgrade image via luci, or else download or
scp the image to /tmp and use the sysupgrade command.
[1] The mentioned images and ubootwrite.py script can be found in this repo:
https://github.com/clayface/openwrt-cryptid
[2] The modified u-boot sources for the MR42 and MR52 are available:
https://github.com/clayface/U-boot-MR52-20200629
Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/base-files')
4 files changed, 44 insertions, 0 deletions
diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 097ba0afe1..2b259b9036 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -21,6 +21,10 @@ edgecore,ecw5410) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt" ;; +meraki,mr52) + ucidef_set_led_netdev "eth0" "eth0" "green:lan1" "eth0" + ucidef_set_led_netdev "eth1" "eth1" "green:lan2" "eth1" + ;; nec,wg2600hp) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 65a0e98b3b..4cb691f32e 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -44,6 +44,12 @@ linksys,ea8500) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$hw_mac_addr" ;; +meraki,mr42) + ucidef_set_interface_lan "eth0" + ;; +meraki,mr52) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; nec,wg2600hp3) ucidef_add_switch "switch0" \ "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0" diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 8de4e052cc..78315d4516 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -7,6 +7,14 @@ board=$(board_name) case "$FIRMWARE" in +"ath10k/cal-pci-0000:01:00.0.bin") + case "$board" in + meraki,mr52) + CI_UBIPART=art + caldata_extract_ubi "ART" 0x1000 0x844 + ;; + esac + ;; "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in askey,rt4230w-rev6) @@ -26,6 +34,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1) ;; + meraki,mr42) + CI_UBIPART=art + caldata_extract_ubi "ART" 0x1000 0x2f20 + ;; netgear,d7800 |\ netgear,r7500v2 |\ netgear,r7800 |\ @@ -64,6 +76,11 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2) ;; + meraki,mr42 |\ + meraki,mr52) + CI_UBIPART=art + caldata_extract_ubi "ART" 0x5000 0x2f20 + ;; netgear,d7800 |\ netgear,r7500v2 |\ netgear,r7800 |\ @@ -80,11 +97,23 @@ case "$FIRMWARE" in ;; esac ;; +"ath10k/cal-pci-0002:01:00.0.bin") + case "$board" in + meraki,mr42) + CI_UBIPART=art + caldata_extract_ubi "ART" 0x9000 0x844 + ;; + esac + ;; "ath10k/pre-cal-pci-0002:01:00.0.bin") case $board in edgecore,ecw5410) caldata_extract "0:art" 0x5000 0x2f20 ;; + meraki,mr52) + CI_UBIPART=art + caldata_extract_ubi "ART" 0x9000 0x2f20 + ;; esac ;; *) diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 308d7017b3..3d96457dbd 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -45,6 +45,11 @@ platform_do_upgrade() { linksys,ea8500) platform_do_upgrade_linksys "$1" ;; + meraki,mr42 |\ + meraki,mr52) + CI_KERNPART="bootkernel2" + nand_do_upgrade "$1" + ;; tplink,ad7200 |\ tplink,c2600) PART_NAME="os-image:rootfs" |