Skip to content

Commit

Permalink
ath79: add Cisco Meraki MR18
Browse files Browse the repository at this point in the history
Specifications:

SOC:    Atheros/Qualcomm QCA9557-AT4A @ 720MHz
RAM:    2x Winbond W9751G6KB-25 (128 MiB)
FLASH:  Hynix H27U1G8F2BTR-BC TSOP48 ONFI NAND (128 MiB)
WIFI1:  Atheros AR9550 5.0GHz (SoC)
WIFI2:  Atheros AR9582-AR1A 2.4GHz
WIFI2:  Atheros AR9582-AR1A 2.4GHz + 5GHz
PHYETH: Atheros AR8035-A, 802.3af PoE capable Atheros (1x Gigabit LAN)
LED:    1x Power-LED, 1 x RGB Tricolor-LED
INPUT:  One Reset Button
UART:   JP1 on PCB (Labeled UART), 3.3v-Level, 115200n8
        (VCC, RX, TX, GND - VCC is closest to the boot set jumper
	 under the console pins.)

Flashing instructions:

Depending on the installed firmware, there are vastly different
methods to flash a MR18. These have been documented on:
<https://openwrt.org/toh/meraki/mr18>

Tip:
Use an initramfs from a previous release and then use sysupgrade
to get to the later releases. This is because the initramfs can
no longer be built by the build-bots due to its size (>8 MiB).

Note on that:
Upgrades from AR71XX releases are possible, but they will
require the force sysupgrade option ( -F ).

Please backup your MR18's configuration before starting the
update. The reason here is that a lot of development happend
since AR71XX got removed, so I do advise to use the ( -n )
option for sysupgrade as well. This will cause the device
to drop the old AR71xx configuration and make a new
configurations from scratch.

Note on LEDs:
The LEDs has changed since AR71XX. The white LED is now used during
the boot and when upgrading instead of the green tricolor LED. The
technical reason is that currently the RGB-LED is brought up later
by a userspace daemon.

(added warning note about odm-caldata partition. remove initramfs -
it's too big to be built by the bots. MerakiNAND -> meraki-header.
sort nu801's targets)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
  • Loading branch information
chunkeey committed May 13, 2023
1 parent cb9ccd6 commit 1d49310
Show file tree
Hide file tree
Showing 7 changed files with 428 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package/system/gpio-cdev/nu801/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define Package/nu801
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Userspace GPIO Drivers
DEPENDS:=@(TARGET_x86||TARGET_bcm53xx)
DEPENDS:=@(TARGET_ath79_nand||TARGET_bcm53xx||TARGET_x86)
KCONFIG:=CONFIG_GPIO_CDEV=y
TITLE:=NU801 LED Driver
endef
Expand Down
203 changes: 203 additions & 0 deletions target/linux/ath79/dts/qca9557_meraki_mr18.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qca955x.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
compatible = "meraki,mr18", "qca,qca9558";
model = "Meraki MR18";

aliases {
label-mac-device = &eth0;
led-boot = &white;
led-failsafe = &orange;
led-running = &green;
led-upgrade = &white;
};

leds {
compatible = "gpio-leds";

white: white {
label = "white:power";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
};

orange: orange {
label = "orange:power";
gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
panic-indicator;
};
};

uleds {
compatible = "virtual-leds";
#if 0
/*
* RGB leds are not supported by uleds driver.
* but this is what the definitions for a as
* of yet unwritten leds_nu801 would look like.
*/

rgbled-0 {
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_RGB>;
#address-cells = <1>;
#size-cells = <0>;

led@0 {
reg = <0>;
color = <LED_COLOR_ID_RED>;
};

green: led@1 {
reg = <1>;
color = <LED_COLOR_ID_GREEN>;
};

led@2 {
reg = <2>;
color = <LED_COLOR_ID_BLUE>;
};
};

#else
red {
label = "red:tricolor";
color = <LED_COLOR_ID_RED>;
};

green: green {
label = "green:tricolor";
color = <LED_COLOR_ID_GREEN>;
};

blue {
label = "blue:tricolor";
color = <LED_COLOR_ID_BLUE>;
};
#endif
};

button {
compatible = "gpio-keys";

reset {
label = "Reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};

};
};

&nand {
status = "okay";

nand-ecc-mode = "soft";
nand-ecc-algo = "bch";
nand-ecc-strength = <4>;
nand-ecc-step-size = <512>;
nand-is-boot-medium;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "nandloader";
reg = <0x0 0x80000>;
read-only;
};

partition@80000 {
label = "kernel";
reg = <0x80000 0x800000>;
};

partition@880000 {
label = "recovery";
reg = <0x880000 0x800000>;
};

partition@1080000 {
label = "ubi";
reg = <0x1080000 0x6f00000>;
};

partition@7fe0000 {
/*
* This is not always present. And if
* it is, then Meraki (or contractor)
* used a different ecc method than
* the one we need for the UBI partition.
* Reading this causes various reading
* errors.
*
* As a result: Please don't convert
* this to nvmem-cells. Instead there's
* a ubi-volume "caldata" that has the
* necessary data.
*/

label = "odm-caldata";
reg = <0x7fe0000 0x20000>;
read-only;
};
};
};

&pcie0 {
status = "okay";

wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
};
};

&pcie1 {
status = "okay";

wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
};
};

&uart {
status = "okay";
};

&mdio0 {
status = "okay";

phy: ethernet-phy@3 {
reg = <3>;
};
};

&eth0 {
status = "okay";
pll-data = <0xa6000000 0xa0000101 0x80001313>;
phy-handle = <&phy>;

gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
rxd-delay = <3>;
rxdv-delay = <3>;
};
};

&wmac {
status = "okay";
qca,no-eeprom;
};
17 changes: 17 additions & 0 deletions target/linux/ath79/image/lzma-loader/src/ar71xx_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@
#define AR9300_OTP_STATUS_SM_BUSY 0x1
#define AR9300_OTP_READ_DATA 0x15f1c

#define QCA955X_OTP_BASE (AR71XX_APB_BASE + 0x00130000)
#define QCA955X_OTP_REG_MEM_0 0x0000
#define QCA955X_OTP_REG_INTF2 0x1008
#define QCA955X_OTP_REG_STATUS0 0x1018
#define QCA955X_OTP_STATUS0_EFUSE_VALID BIT(2)

#define QCA955X_OTP_REG_STATUS1 0x101c
#define QCA955X_OTP_REG_LDO_CTRL 0x1024
#define QCA955X_OTP_REG_LDO_STATUS 0x102c
#define QCA955X_OTP_LDO_STATUS_POWER_ON BIT(0)

/*
* DDR_CTRL block
*/
Expand Down Expand Up @@ -344,6 +355,7 @@

#define QCA955X_RESET_REG_BOOTSTRAP 0xb0
#define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
#define QCA955X_RESET_REG_RESET_MODULE 0x1c

#define MISC_INT_ETHSW BIT(12)
#define MISC_INT_TIMER4 BIT(10)
Expand Down Expand Up @@ -436,6 +448,9 @@
#define AR934X_RESET_MBOX BIT(1)
#define AR934X_RESET_I2S BIT(0)

#define QCA955X_RESET_SGMII_ANALOG BIT(12)
#define QCA955X_RESET_SGMII BIT(8)

#define AR933X_BOOTSTRAP_MDIO_GPIO_EN BIT(18)
#define AR933X_BOOTSTRAP_EEPBUSY BIT(4)
#define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)
Expand Down Expand Up @@ -722,4 +737,6 @@
#define QCA955X_ETH_CFG_RGMII_GMAC0 BIT(0)
#define QCA955X_ETH_CFG_SGMII_GMAC0 BIT(6)

#define QCA955X_GMAC_REG_SGMII_SERDES 0x0018

#endif /* __ASM_MACH_AR71XX_REGS_H */
Loading

0 comments on commit 1d49310

Please sign in to comment.