[OpenWrt-Devel] [RFC 3/3] ar71xx: add support for Cisco Meraki Z1 Cloud Managed Teleworker Gateway
John Crispin
blogic at openwrt.org
Wed Mar 9 00:08:30 EST 2016
On 09/03/2016 00:14, Christian Lamparter wrote:
> From: Chris Blake <chrisrblake93 at gmail.com>
>
> This patch adds support for Cisco's Z1.
> Detailed instructions for the flashing the device can
> be found in the OpenWrt wiki:
> <https://wiki.openwrt.org/toh/meraki/z1>
>
> Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
> ---
> target/linux/ar71xx/base-files/etc/board.d/01_leds | 4 +
> .../linux/ar71xx/base-files/etc/board.d/02_network | 6 +
> target/linux/ar71xx/base-files/etc/diag.sh | 3 +
> .../etc/hotplug.d/firmware/10-ath9k-eeprom | 20 +++
> .../etc/uci-defaults/03_network-switchX-migration | 1 +
> target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +
> .../base-files/lib/preinit/05_set_iface_mac_ar71xx | 4 +
> .../ar71xx/base-files/lib/upgrade/merakinand.sh | 61 ++++++--
> .../ar71xx/base-files/lib/upgrade/platform.sh | 6 +-
> target/linux/ar71xx/config-4.1 | 1 +
> target/linux/ar71xx/config-4.4 | 1 +
> .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 12 ++
> target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 +
> .../linux/ar71xx/files/arch/mips/ath79/mach-z1.c | 164 +++++++++++++++++++++
> .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 +
> target/linux/ar71xx/image/Makefile | 12 ++
> target/linux/ar71xx/nand/profiles/meraki.mk | 14 +-
> 17 files changed, 295 insertions(+), 19 deletions(-)
> create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c
>
[...]
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c
> new file mode 100644
> index 0000000..3060c2a
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c
> @@ -0,0 +1,164 @@
> +/*
> + * Cisco Meraki Z1 board support
> + *
> + * Copyright (C) 2016 Chris Blake <chrisrblake93 at gmail.com>
> + * Copyright (C) 2016 Christian Lamparter <chunkeey at googlemail.com>
> + *
> + * Based on Cisco Meraki GPL Release r23-20150601 Z1 Device Config
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published
> + * by the Free Software Foundation.
> + */
> +#include <linux/platform_device.h>
> +#include <linux/ath9k_platform.h>
> +#include <linux/ar8216_platform.h>
> +#include <linux/platform/ar934x_nfc.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include <linux/leds-nu801.h>
> +#include <linux/firmware.h>
> +#include <linux/pci.h>
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-nfc.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "dev-ap9x-pci.h"
> +#include "machtypes.h"
> +
> +#define Z1_GPIO_LED_POWER_ORANGE 17
please use tabs and not space
> +
> +#define Z1_GPIO_NU801_CKI 14
> +#define Z1_GPIO_NU801_SDI 15
> +
> +#define Z1_GPIO_XLNA0 18
> +#define Z1_GPIO_XLNA1 19
> +
> +#define Z1_GPIO_BTN_RESET 12
> +#define Z1_KEYS_POLL_INTERVAL 20 /* msecs */
> +#define Z1_KEYS_DEBOUNCE_INTERVAL (3 * Z1_KEYS_POLL_INTERVAL)
> +
> +#define Z1_ETH_SWITCH_PHY 0
> +
> +
[...]
/* Wireless */
> + ath79_register_wmac_simple();
> + ap91_pci_init_simple();
> +}
> +MIPS_MACHINE(ATH79_MACH_Z1, "Z1", "Meraki Z1", z1_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> index 97de9f0..f23ee84 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> @@ -244,6 +244,7 @@ enum ath79_mach_type {
> ATH79_MACH_WZR_HP_G300NH2, /* Buffalo WZR-HP-G300NH2 */
> ATH79_MACH_WZR_HP_G450H, /* Buffalo WZR-HP-G450H */
> ATH79_MACH_WZR_450HP2, /* Buffalo WZR-450HP2 */
> + ATH79_MACH_Z1, /* Cisco Meraki Z1 */
might be missing a tab here aswell
> ATH79_MACH_ZCN_1523H_2, /* Zcomax ZCN-1523H-2-xx */
> ATH79_MACH_ZCN_1523H_5, /* Zcomax ZCN-1523H-5-xx */
> };
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> index ca4437b..60845b5 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -2539,6 +2539,18 @@ define Device/mr18
> endef
> TARGET_DEVICES += mr18
>
> +define Device/z1
> + BOARDNAME = Z1
> + BLOCKSIZE := 64k
> + CONSOLE = ttyS0,115200
> + MTDPARTS = ar934x-nfc:128K(loader1)ro,8064K(kernel),128K(loader2)ro,8064K(recovery),114560K(ubi),128K(origcaldata)ro
> + IMAGES := sysupgrade.tar
> + KERNEL := kernel-bin | patch-cmdline | MerakiNAND
> + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | MerakiNAND
> + IMAGE/sysupgrade.tar := sysupgrade-nand
> +endef
> +TARGET_DEVICES += z1
> +
> $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
> $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
> $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
> diff --git a/target/linux/ar71xx/nand/profiles/meraki.mk b/target/linux/ar71xx/nand/profiles/meraki.mk
> index 2c848c9..f68f5b6 100644
> --- a/target/linux/ar71xx/nand/profiles/meraki.mk
> +++ b/target/linux/ar71xx/nand/profiles/meraki.mk
> @@ -1,5 +1,5 @@
> #
> -# Copyright (C) 2014-2015 Chris Blake (chrisrblake93 at gmail.com)
> +# Copyright (C) 2014-2016 Chris Blake (chrisrblake93 at gmail.com)
> #
> # This is free software, licensed under the GNU General Public License v2.
> # See /LICENSE for more information.
> @@ -15,3 +15,15 @@ define Profile/MR18/description
> endef
>
> $(eval $(call Profile,MR18))
> +
> +define Profile/Z1
> + NAME:=Meraki Z1
> + PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-spi-gpio kmod-ath9k kmod-owl-loader
> +endef
> +
> +define Profile/Z1/description
> + Package set optimized for the Cisco Meraki Z1 Teleworker Gateway.
> +endef
> +
> +
> +$(eval $(call Profile,Z1))
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list