diff options
author | Martin Kennedy <hurricos@gmail.com> | 2020-08-29 00:22:53 -0400 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-08-31 17:41:21 +0200 |
commit | af9dee336dacbc61e056bce0c0dbf508dd7453a2 (patch) | |
tree | f95506ab2544daa22b19054146e097d7f174b736 /target/linux/ath79/dts | |
parent | e8688098616edb64b0e75dc53e2dbe24c985c1ca (diff) | |
download | upstream-af9dee336dacbc61e056bce0c0dbf508dd7453a2.tar.gz upstream-af9dee336dacbc61e056bce0c0dbf508dd7453a2.tar.bz2 upstream-af9dee336dacbc61e056bce0c0dbf508dd7453a2.zip |
ath79: add support for Meraki MR16
Port device support for Meraki MR16 from the ar71xx target to ath79.
Specifications:
* AR7161 CPU, 16 MiB Flash, 64 MiB RAM
* One PoE-capable Gigabit Ethernet Port
* AR9220 / AR9223 (2x2 11an / 11n) WLAN
Installation:
* Requires TFTP server at 192.168.1.101, w/ initramfs & sysupgrade .bins
* Open shell case and connect a USB to TTL cable to upper serial headers
* Power on the router; connect to U-boot over 115200-baud connection
* Interrupt U-boot process to boot Openwrt by running:
setenv bootcmd bootm 0xbf0a0000; saveenv;
tftpboot 0c00000 <filename-of-initramfs-kernel>.bin;
bootm 0c00000;
* Copy sysupgrade image to /tmp on MR16
* sysupgrade /tmp/<filename-of-sysupgrade>.bin
Notes:
- There are two separate ARTs in the partition (offset 0x1000/0x5000 and
0x11000/0x15000) in the OEM device. I suspect this is an OEM artifact;
possibly used to configure the radios for different regions,
circumstances or RF frontends. Since the ar71xx target uses the
second offsets, use that second set (0x11000 and 0x15000) for the ART.
- kmod-owl-loader is still required to load the ART partition into the
driver.
- The manner of storing MAC addresses is updated from ar71xx; it is
at 0x66 of the 'config' partition, where it was discovered that the
OEM firmware stores it. This is set as read-only. If you are
migrating from ar71xx and used the method mentioned above to
upgrade, use kmod-mtd-rw or UCI to add the MAC back in. One more
method for doing this is described below.
- Migrating directly from ar71xx has not been thoroughly tested, but
one method has been used a couple of times with good success,
migrating 18.06.2 to a full image produced as of this commit. Please
note that these instructions are only for experienced users, and/or
those still able to open their device up to flash it via the serial
headers should anything go wrong.
1) Install kmod-mtd-rw and uboot-envtools
2) Run `insmod mtd-rw.ko i_want_a_brick=1`
3) Modify /etc/fw_env.config to point to the u-boot-env partition.
The file /etc/fw_env.config should contain:
# MTD device env offset env size sector size
/dev/mtd1 0x00000 0x10000 0x10000
See https://openwrt.org/docs/techref/bootloader/uboot.config
for more details.
4) Run `fw_printenv` to verify everything is correct, as per the
link above.
5) Run `fw_setenv bootcmd bootm 0xbf0a0000` to set a new boot address.
6) Manually modify /lib/upgrade/common.sh's get_image function:
Change ...
cat "$from" 2>/dev/null | $cmd
... into ...
(
dd if=/dev/zero bs=1 count=$((0x66)) ; # Pad the first 102 bytes
echo -ne '\x00\x18\x0a\x12\x34\x56' ; # Add in MAC address
dd if=/dev/zero bs=1 count=$((0x20000-0x66-0x6)) ; # Pad the rest
cat "$from" 2>/dev/null | $cmd
)
... which, during the upgrade process, will pad the image by
128K of zeroes-plus-MAC-address, in order for the ar71xx's
firmware partition -- which starts at 0xbf080000 -- to be
instead aligned with the ath79 firmware partition, which
starts 128K later at 0xbf0a0000.
7) Copy the sysupgrade image into /tmp, as above
8) Run `sysupgrade -F /tmp/<sysupgrade>.bin`, then wait
Again, this may BRICK YOUR DEVICE, so make *sure* to have your
serial cable handy.
Addenda:
- The MR12 should be able to be migrated in a nearly identical manner as
it shares much of its hardware with the MR16.
- Thank-you Chris B for copious help with this port.
Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[fix typo in compat message, drop art DT label,
move 05_fix-compat-version to subtarget]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ath79/dts')
-rw-r--r-- | target/linux/ath79/dts/ar7161_meraki_mr16.dts | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts new file mode 100644 index 0000000000..cc1cd223e0 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +#include "ar7100.dtsi" + +/ { + compatible = "meraki,mr16", "qca,ar7161"; + model = "Meraki MR16"; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_green; + led-upgrade = &led_power_orange; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "ref"; + clock-frequency = <40000000>; + }; + + leds { + compatible = "gpio-leds"; + + wifi1 { + label = "mr16:green:wifi1"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + wifi2 { + label = "mr16:green:wifi2"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wifi3 { + label = "mr16:green:wifi3"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + wifi4 { + label = "mr16:green:wifi4"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "mr16:green:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_power_orange: power_orange { + label = "mr16:orange:power"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_power_green: power_green { + label = "mr16:green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = <KEY_RESTART>; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { /* 2.4 GHz */ + compatible = "pci168c,0029"; + reg = <0x8800 0 0 0 0>; + qca,no-eeprom; + mtd-mac-address = <&config 0x66>; + mtd-mac-address-increment = <1>; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { /* 5 GHz */ + compatible = "pci168c,0029"; + reg = <0x9000 0 0 0 0>; + qca,no-eeprom; + mtd-mac-address = <&config 0x66>; + mtd-mac-address-increment = <2>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&pll { + clocks = <&extosc>; +}; + +&uart { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&config 0x66>; + + pll-data = <0x00110000 0x00001099 0x00991099>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x40000>; + read-only; + }; + + config: partition@80000 { + label = "config"; + reg = <0x80000 0x20000>; + read-only; + }; + + partition@a0000 { + label = "firmware"; + reg = <0xa0000 0xf40000>; + compatible = "denx,uimage"; + }; + + partition@fe0000 { + label = "art"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; |