From patchwork Sat Oct 1 16:33:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 677380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3smYqF4hsCz9s9Y for ; Sun, 2 Oct 2016 03:36:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=sJmsvCk2; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bqNFA-0003MO-NV; Sat, 01 Oct 2016 16:34:32 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bqNF2-0003Kv-Kc for lede-dev@lists.infradead.org; Sat, 01 Oct 2016 16:34:28 +0000 Received: by mail-wm0-x241.google.com with SMTP id p138so7802992wmb.0 for ; Sat, 01 Oct 2016 09:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=EMcOi9TkVWvwNF1cVTUbuzghLydaXA02hFc/yfIuVOk=; b=sJmsvCk2ap/4dp6aPEk0zSN6HhNAzb/Fz/2OgAmKHAp8XtagE5D+fvbXKQ10S5jrUA 9WV/8gkyAErjCJeTyUl9hX+NfX4IPsF/FhSkXXRgtXKwp7WN/wbeV6z8YXwh4VSC+f3U SQMmakE/wN2MbFhWEHCwY5BaodNISdNf4ebNXo7CC+Hp6HCEXMD6pInnDQ9nSYHzwjwZ DBFxO9bH9BLZo6jC6uRaODjh3UpvWrF2sxaeNi1FztgkebagYZe13pNxsEmiTUvH6N+Q Yuo+Lg+ca8Cs/tQ9HdO3Aj81kszAtAGgUSUvcPwUmh9ZJhBlAtbAtsizPwTvlYcgWKL5 LAGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=EMcOi9TkVWvwNF1cVTUbuzghLydaXA02hFc/yfIuVOk=; b=TybnIEsjgeozFNabFuNpq070fWbRXPh4Lu+TR8/IlYAitZiOK/Q0+Bumf5bDjvAbgJ 3LsxnfqdoTEl8ODxOk49lmj+gYDE7GnCOvwMEQOZsjGZq6pj+Ul5vzBYxdqCvX3p15oO hIK9sYEurMUMdjL5bFx1Ts/ZWtv89E80U0N400SktU5H8dKuKR/N1TiL6p/o91Kdvb0q JNMjcgEGA7jkZF2nir8AAV+KOhJFAwwHnfGtjBri/yXKgmJFcgxTGW3stgHE3fwHLWkI bXrW4J124A/BvY/U57Od5B8ft3piqPOsz+/0ROaNURj+yEaztEcpLdIUGp7EFZcUcKqM Xo3A== X-Gm-Message-State: AA6/9RmQ/GVVL2jJ9yIzoRuYPy+MCwKeM1vzOh0RIQmjgizbQswHMkU6RjeaWPDMAj0ikA== X-Received: by 10.194.148.146 with SMTP id ts18mr1675460wjb.91.1475339642265; Sat, 01 Oct 2016 09:34:02 -0700 (PDT) Received: from debian64.daheim (pD9F890AD.dip0.t-ipconnect.de. [217.248.144.173]) by smtp.gmail.com with ESMTPSA id o196sm8969189wmg.8.2016.10.01.09.34.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Oct 2016 09:34:00 -0700 (PDT) From: Christian Lamparter X-Google-Original-From: Christian Lamparter Received: from chuck by debian64.daheim with local (Exim 4.87) (envelope-from ) id 1bqNEd-0008IL-UF; Sat, 01 Oct 2016 18:33:59 +0200 To: lede-dev@lists.infradead.org Date: Sat, 1 Oct 2016 18:33:59 +0200 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: <8e08cb676011aefb69a3fbf9ccdd5a529e289c09.1475339604.git.chunkeey@gmail.com> References: <8e08cb676011aefb69a3fbf9ccdd5a529e289c09.1475339604.git.chunkeey@gmail.com> In-Reply-To: <8e08cb676011aefb69a3fbf9ccdd5a529e289c09.1475339604.git.chunkeey@gmail.com> References: <8e08cb676011aefb69a3fbf9ccdd5a529e289c09.1475339604.git.chunkeey@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161001_093425_063298_8DE7CBD1 X-CRM114-Status: GOOD ( 20.71 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]googlemail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH 2/2] ar71xx: add support for the Airtight C-60 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Blake MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch adds support for the Airtight C-60. SOC: Atheros AR9344 rev 2 (CPU:560.000MHz) RAM: 128 MiB NOR: MX25L3205D 4MiB NAND: ST Micro NAND 32MiB 3,3V 8-bit SW-NET: AR8327N (2 Ports) WLAN1: Dual-Band AR9340 Rev:2 (built-in SoC) WLAN2: Dual-Band AR9300 Rev:4 PCIe Chip The switch is setup for an accesspoint: LAN1: (gigabit) is the wan-port. LAN2: (fast ethernet) is bridged with the br-lan. Flashing Guide (via initramfs): 1. Connect a PC to the serial port of the C-60. power up the C-60. Enter u-boot command prompt: #> nand erase #> setenv bootcmd "bootm 0x9f060000" #> saveenv #> setenv ipaddr 192.168.1.1 #> setenv netmask 255.255.255.0 #> setenv serverip 192.168.1.100 #> setenv bootfile lede-ar71xx-nand-c-60-initramfs-kernel.bin #> tftpboot #> bootm 2. Wait for the C-60 to boot LEDE. On the root prompt. Enter: # ubiformat /dev/mtd4 # ubiattach -p /dev/mtd4 3. After that copy the sysupgrade.tar onto the router and run: # sysupgrade sysupgrade.tar to flash the image. Special thanks to Chris Blake . He provided a C-60 unit and he helped with debugging the switch, LEDs and platfrom support. Signed-off-by: Christian Lamparter --- target/linux/ar71xx/base-files/etc/board.d/01_leds | 5 + .../linux/ar71xx/base-files/etc/board.d/02_network | 5 + target/linux/ar71xx/base-files/etc/diag.sh | 3 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 3 +- target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../base-files/lib/preinit/05_set_iface_mac_ar71xx | 3 +- .../ar71xx/base-files/lib/upgrade/platform.sh | 2 + 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-c60.c | 203 +++++++++++++++++++++ .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/nand.mk | 15 ++ 13 files changed, 255 insertions(+), 2 deletions(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 7551455..7aa35a0 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -109,6 +109,11 @@ c-55) ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "c-55:green:wlan" "phy1tpt" ;; +c-60) + ucidef_set_led_wlan "wlan1_green" "WLAN1_GREEN" "$board:green:wlan1" "phy0tpt" + ucidef_set_led_wlan "wlan2_green" "WLAN2_GREEN" "$board:green:wlan2" "phy1tpt" + ;; + cap4200ag) ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1" ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber:wlan" "phy0tpt" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 2a50c9d..f36db19 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -289,6 +289,11 @@ onion-omega) ucidef_set_interface_lan "wlan0" ;; +c-60) + ucidef_add_switch "switch0" \ + "0@eth0" "3:wan" "4:lan" + ;; + dhp-1565-a1 |\ dir-835-a1 |\ wndr3700v4 | \ diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 6ce49b0..4e009e7 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -64,6 +64,9 @@ get_status_led() { c-55) status_led="c-55:green:pwr" ;; + c-60) + status_led="c-60:green:pwr" + ;; cap4200ag) status_led="senao:green:pwr" ;; diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 3141625..a034349 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -53,7 +53,8 @@ board=$(ar71xx_board_name) case "$FIRMWARE" in "soc_wmac.eeprom") case $board in - c-55) + c-55 | \ + c-60) ath9k_eeprom_extract "art" 4096 2048 ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1) ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index dae6fb2..22e5f5c 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -482,6 +482,9 @@ ar71xx_board_detect() { *C-55) name="c-55" ;; + *C-60) + name="c-60" + ;; *CAP4200AG) name="cap4200ag" ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx index 60e2787..07b7c02 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx @@ -22,7 +22,8 @@ fetch_mac_from_mtd() { preinit_set_mac_address() { case $(ar71xx_board_name) in - c-55) + c-55 | \ + c-60) mac_lan=$(mtd_get_mac_binary art 0) [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index c78d1fb..6b26548 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -477,6 +477,7 @@ platform_check_image() { merakinand_do_platform_check $board $1 return $?; ;; + c-60 | \ nbg6716 | \ r6100 | \ wndr3700v4 | \ @@ -538,6 +539,7 @@ platform_pre_upgrade() { local board=$(ar71xx_board_name) case "$board" in + c-60 | \ nbg6716 | \ r6100 | \ wndr3700v4 | \ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index f81a74c..fdda6e5 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -56,6 +56,7 @@ CONFIG_ATH79_MACH_AW_NR580=y CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y CONFIG_ATH79_MACH_BSB=y CONFIG_ATH79_MACH_C55=y +CONFIG_ATH79_MACH_C60=y CONFIG_ATH79_MACH_CAP324=y CONFIG_ATH79_MACH_CAP4200AG=y CONFIG_ATH79_MACH_CARAMBOLA2=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 4cefde1..5556a51 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -210,6 +210,18 @@ config ATH79_MACH_C55 select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_C60 + bool "AirTight Networks C-60 support" + select SOC_AR934X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + select ATH79_DEV_NFC + select ATH79_DEV_USB + config ATH79_MACH_AW_NR580 bool "AzureWave AW-NR580 board support" select SOC_AR71XX diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index a0f8d99..a7f2526 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -128,6 +128,7 @@ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o obj-$(CONFIG_ATH79_MACH_PB92) += mach-pb92.o obj-$(CONFIG_ATH79_MACH_C55) += mach-c55.o +obj-$(CONFIG_ATH79_MACH_C60) += mach-c60.o obj-$(CONFIG_ATH79_MACH_QIHOO_C301) += mach-qihoo-c301.o obj-$(CONFIG_ATH79_MACH_R6100) += mach-r6100.o obj-$(CONFIG_ATH79_MACH_RB4XX) += mach-rb4xx.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c new file mode 100644 index 0000000..26930a9 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c @@ -0,0 +1,203 @@ +/* + * AirTight Networks C-60 board support + * + * Copyright (C) 2016 Christian Lamparter + * + * Based on AirTight Networks C-55 board support + * + * Copyright (C) 2014-2015 Chris Blake + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "common.h" +#include "pci.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-spi.h" +#include "dev-wmac.h" +#include "dev-usb.h" +#include "dev-nfc.h" +#include "machtypes.h" + +#define C60_GPIO_LED_PWR_AMBER 11 +#define C60_GPIO_LED_WLAN2_GREEN 12 +#define C60_GPIO_LED_WLAN2_AMBER 13 +#define C60_GPIO_LED_PWR_GREEN 16 + +#define C60_GPIO_BTN_RESET 17 + +/* can be used to "lock" the console port */ +#define C60_GPIO_LOCK_CONSOLE_PORT 9 + +/* GPIOs of the AR9300 PCIe chip */ +#define C60_GPIO_WMAC_LED_WLAN1_AMBER 0 +#define C60_GPIO_WMAC_LED_WLAN1_GREEN 3 + +#define C60_KEYS_POLL_INTERVAL 20 /* msecs */ +#define C60_KEYS_DEBOUNCE_INTERVAL (3 * C60_KEYS_POLL_INTERVAL) + +#define C60_ART_ADDR 0x1f7f0000 +#define C60_ART_SIZE 0xffff +#define C60_MAC_OFFSET 0 +#define C60_WMAC_CALDATA_OFFSET 0x1000 +#define C60_PCIE_CALDATA_OFFSET 0x5000 + +static struct gpio_led c60_leds_gpio[] __initdata = { + { + .name = "c-60:amber:pwr", + .gpio = C60_GPIO_LED_PWR_AMBER, + .active_low = 1, + }, + { + .name = "c-60:green:pwr", + .gpio = C60_GPIO_LED_PWR_GREEN, + .active_low = 1, + }, + { + .name = "c-60:green:wlan2", + .gpio = C60_GPIO_LED_WLAN2_GREEN, + .active_low = 1, + }, + { + .name = "c-60:amber:wlan2", + .gpio = C60_GPIO_LED_WLAN2_AMBER, + .active_low = 1, + }, +}; + +static struct gpio_keys_button c60_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = C60_KEYS_DEBOUNCE_INTERVAL, + .gpio = C60_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct ar8327_pad_cfg c60_ar8327_pad0_cfg = { + .mode = AR8327_PAD_MAC_RGMII, + .txclk_delay_en = true, + .rxclk_delay_en = true, + .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, +}; + +static struct ar8327_platform_data c60_ar8327_data = { + .pad0_cfg = &c60_ar8327_pad0_cfg, + .port0_cfg = { + .force_link = 1, + .speed = AR8327_PORT_SPEED_1000, + .duplex = 1, + .txpause = 1, + .rxpause = 1, + } +}; + +static struct mdio_board_info c60_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = &c60_ar8327_data, + }, +}; + +static struct nand_ecclayout c60_nand_ecclayout = { + .eccbytes = 7, + .eccpos = { 4, 8, 9, 10, 13, 14, 15 }, + .oobavail = 9, + .oobfree = { { 0, 3 }, { 6, 2 }, { 11, 2 }, } +}; + +static int c60_nand_scan_fixup(struct mtd_info *mtd) +{ + struct nand_chip *chip = mtd->priv; + + chip->ecc.size = 512; + chip->ecc.strength = 4; + chip->ecc.layout = &c60_nand_ecclayout; + return 0; +} + +static struct gpio_led c60_wmac0_leds_gpio[] = { + { + .name = "c-60:amber:wlan1", + .gpio = C60_GPIO_WMAC_LED_WLAN1_AMBER, + .active_low = 1, + }, + { + .name = "c-60:green:wlan1", + .gpio = C60_GPIO_WMAC_LED_WLAN1_GREEN, + .active_low = 1, + }, +}; + +static void __init c60_setup(void) +{ + u8 tmpmac[6]; + u8 *art = (u8 *) KSEG1ADDR(C60_ART_ADDR); + + /* NAND */ + ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_SOFT_BCH); + ath79_nfc_set_scan_fixup(c60_nand_scan_fixup); + ath79_register_nfc(); + + /* SPI Storage*/ + ath79_register_m25p80_large(NULL); + + /* AR8327 Switch Ethernet */ + + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0); + + mdiobus_register_board_info(c60_mdio0_info, + ARRAY_SIZE(c60_mdio0_info)); + + ath79_register_mdio(0, 0x0); + + /* GMAC0 is connected to an AR8327N switch */ + ath79_init_mac(ath79_eth0_data.mac_addr, art + C60_MAC_OFFSET, 0); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_pll_data.pll_1000 = 0x06000000; + ath79_register_eth(0); + + /* LEDs & GPIO */ + ath79_register_leds_gpio(-1, ARRAY_SIZE(c60_leds_gpio), + c60_leds_gpio); + ath79_register_gpio_keys_polled(-1, C60_KEYS_POLL_INTERVAL, + ARRAY_SIZE(c60_gpio_keys), + c60_gpio_keys); + ap9x_pci_setup_wmac_leds(0, c60_wmac0_leds_gpio, + ARRAY_SIZE(c60_wmac0_leds_gpio)); + /* USB */ + ath79_register_usb(); + + /* WiFi */ + ath79_init_mac(tmpmac, art + C60_MAC_OFFSET, 1); + ap91_pci_init(art + C60_PCIE_CALDATA_OFFSET, tmpmac); + ath79_init_mac(tmpmac, art + C60_MAC_OFFSET, 2); + ath79_register_wmac(art + C60_WMAC_CALDATA_OFFSET, tmpmac); +} +MIPS_MACHINE(ATH79_MACH_C60, "C-60", "AirTight Networks C-60", + c60_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 87acc4a..e6a3d4f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -47,6 +47,7 @@ enum ath79_mach_type { ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */ ATH79_MACH_BSB, /* Smart Electronics Black Swift board */ ATH79_MACH_C55, /* AirTight Networks C-55 */ + ATH79_MACH_C60, /* AirTight Networks C-60 */ ATH79_MACH_CAP324, /* PowerCloud CAP324 */ ATH79_MACH_CAP4200AG, /* Senao CAP4200AG */ ATH79_MACH_CARAMBOLA2, /* 8devices Carambola2 */ diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk index aa431ac..c08081b 100644 --- a/target/linux/ar71xx/image/nand.mk +++ b/target/linux/ar71xx/image/nand.mk @@ -1,3 +1,18 @@ +define Device/c-60 + DEVICE_TITLE := AirTight C-60 + DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-core kmod-usb2 kmod-ath9k + BOARDNAME = C-60 + BLOCKSIZE := 64k + KERNEL_SIZE = 3648k + IMAGE_SIZE = 32m + IMAGES := sysupgrade.tar + MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,3648k(kernel),64k(art)ro;ar934x-nfc:32m(ubi) + KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma + IMAGE/sysupgrade.tar := sysupgrade-tar +endef + +TARGET_DEVICES += c-60 + define Build/MerakiNAND -$(STAGING_DIR_HOST)/bin/mkmerakifw \ -B $(BOARDNAME) -s \