ar71xx: add support for compex wpj531
authorJohn Crispin <john@openwrt.org>
Thu, 18 Jun 2015 18:21:15 +0000 (18:21 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 18 Jun 2015 18:21:15 +0000 (18:21 +0000)
tftpboot 0x80500000 openwrt-ar71xx-generic-wpj531-16M-squashfs-sysupgrade.bin
erase 0x9f030000 +$filesize
erase 0x9f680000 +1
cp.b $fileaddr 0x9f030000 $filesize

Signed-off-by: Christian Mehlis <christian@m3hlis.de>
SVN-Revision: 46045

target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/etc/uci-defaults/02_network
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/config-3.18
target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c [new file with mode: 0644]
target/linux/ar71xx/generic/profiles/compex.mk
target/linux/ar71xx/image/Makefile
target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch

index f6e4a875fc1a7043933b5b91cf5ae669f8f3cc5b..4bdb53db93548dba442331c79ccb5c929cd9acbe 100644 (file)
@@ -311,6 +311,9 @@ get_status_led() {
        wpj344)
                status_led="wpj344:green:status"
                ;;
        wpj344)
                status_led="wpj344:green:status"
                ;;
+       wpj531)
+               status_led="wpj531:green:sig3"
+               ;;
        wpj558)
                status_led="wpj558:green:sig3"
                ;;
        wpj558)
                status_led="wpj558:green:sig3"
                ;;
index 9fdaca07212d39213a812abb432708eb07f654cc..4fe951e3caf5e8598a2d436074dd9d8da66c2136 100644 (file)
@@ -369,6 +369,10 @@ wpj344)
        ucidef_add_switch_vlan "switch0" "2" "0t 2"
        ;;
 
        ucidef_add_switch_vlan "switch0" "2" "0t 2"
        ;;
 
+wpj531)
+       ucidef_set_interfaces_lan_wan "eth0" "eth1"
+       ;;
+
 wpj558)
        ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
        ucidef_add_switch "switch0" "1" "1"
 wpj558)
        ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
        ucidef_add_switch "switch0" "1" "1"
index 4a4101de3342d2aa73c1a6106d6a2227587dcba1..85258d2fef7293c9762d84aecccb0796b63d84fb 100755 (executable)
@@ -820,6 +820,9 @@ ar71xx_board_detect() {
        *WPJ344)
                name="wpj344"
                ;;
        *WPJ344)
                name="wpj344"
                ;;
+       *WPJ531)
+               name="wpj531"
+               ;;
        *WPJ558)
                name="wpj558"
                ;;
        *WPJ558)
                name="wpj558"
                ;;
index 3dbd91cfc7e9fec69d8973542754faa0ce12bea9..ade47fb8522591b56bb47a3a70a472e2dbf1911c 100755 (executable)
@@ -229,6 +229,7 @@ platform_check_image() {
        rocket-m-xw | \
        nanostation-m-xw | \
        rw2458n | \
        rocket-m-xw | \
        nanostation-m-xw | \
        rw2458n | \
+       wpj531 | \
        wndap360 | \
        wpj344 | \
        wzr-hp-g300nh2 | \
        wndap360 | \
        wpj344 | \
        wzr-hp-g300nh2 | \
index 196006016f933c9816271cfc29ccc2c13a7d8059..05c98ebf699d72b1885e99f3b5f2b50c28943b0e 100644 (file)
@@ -140,6 +140,7 @@ CONFIG_ATH79_MACH_WNR2200=y
 CONFIG_ATH79_MACH_WP543=y
 CONFIG_ATH79_MACH_WPE72=y
 CONFIG_ATH79_MACH_WPJ344=y
 CONFIG_ATH79_MACH_WP543=y
 CONFIG_ATH79_MACH_WPE72=y
 CONFIG_ATH79_MACH_WPJ344=y
+CONFIG_ATH79_MACH_WPJ531=y
 CONFIG_ATH79_MACH_WPJ558=y
 CONFIG_ATH79_MACH_WRT160NL=y
 CONFIG_ATH79_MACH_WRT400N=y
 CONFIG_ATH79_MACH_WPJ558=y
 CONFIG_ATH79_MACH_WRT160NL=y
 CONFIG_ATH79_MACH_WRT400N=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
new file mode 100644 (file)
index 0000000..bc13d70
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Compex WPJ531 board support
+ *
+ * Copyright (c) 2012 Qualcomm Atheros
+ * Copyright (c) 2012 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/ar8216_platform.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "pci.h"
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-gpio-buttons.h"
+#include "dev-eth.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define WPJ531_GPIO_LED_SIG1    14
+#define WPJ531_GPIO_LED_SIG2    15
+#define WPJ531_GPIO_LED_SIG3    22
+#define WPJ531_GPIO_LED_SIG4    23
+#define WPJ531_GPIO_BUZZER      4
+
+#define WPJ531_GPIO_BTN_RESET   17
+
+#define WPJ531_KEYS_POLL_INTERVAL      20      /* msecs */
+#define WPJ531_KEYS_DEBOUNCE_INTERVAL  (3 * WPJ531_KEYS_POLL_INTERVAL)
+
+#define WPJ531_MAC0_OFFSET             0x10
+#define WPJ531_MAC1_OFFSET             0x18
+#define WPJ531_WMAC_CALDATA_OFFSET     0x1000
+#define WPJ531_PCIE_CALDATA_OFFSET     0x5000
+
+#define WPJ531_ART_SIZE                0x8000
+
+static struct gpio_led wpj531_leds_gpio[] __initdata = {
+       {
+               .name           = "wpj531:red:sig1",
+               .gpio           = WPJ531_GPIO_LED_SIG1,
+               .active_low     = 1,
+       },
+       {
+               .name           = "wpj531:yellow:sig2",
+               .gpio           = WPJ531_GPIO_LED_SIG2,
+               .active_low     = 1,
+       },
+       {
+               .name           = "wpj531:green:sig3",
+               .gpio           = WPJ531_GPIO_LED_SIG3,
+               .active_low     = 1,
+       },
+       {
+               .name           = "wpj531:green:sig4",
+               .gpio           = WPJ531_GPIO_LED_SIG4,
+               .active_low     = 1,
+       },
+       {
+               .name           = "wpj531:buzzer",
+               .gpio           = WPJ531_GPIO_BUZZER,
+               .active_low     = 0,
+       }
+};
+
+static struct gpio_keys_button wpj531_gpio_keys[] __initdata = {
+       {
+               .desc           = "reset",
+               .type           = EV_KEY,
+               .code           = KEY_RESTART,
+               .debounce_interval = WPJ531_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = WPJ531_GPIO_BTN_RESET,
+               .active_low     = 1,
+       },
+};
+
+static void __init common_setup(void)
+{
+       u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+       u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+       u8 tmpmac[ETH_ALEN];
+
+       ath79_register_m25p80(NULL);
+
+       ath79_setup_ar933x_phy4_switch(false, false);
+
+       ath79_register_mdio(0, 0x0);
+
+       /* LAN */
+       ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+       ath79_register_eth(0);
+
+       /* WAN */
+       ath79_switch_data.phy4_mii_en = 1;
+       ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+       ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
+       ath79_register_eth(1);
+
+       ath79_register_wmac(ee, tmpmac);
+
+       ath79_register_pci();
+}
+
+static void __init wpj531_setup(void)
+{
+       common_setup();
+
+       ath79_register_leds_gpio(-1,
+                               ARRAY_SIZE(wpj531_leds_gpio),
+                               wpj531_leds_gpio);
+
+       ath79_register_gpio_keys_polled(-1,
+                                       WPJ531_KEYS_POLL_INTERVAL,
+                                       ARRAY_SIZE(wpj531_gpio_keys),
+                                       wpj531_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_WPJ531, "WPJ531", "Compex WPJ531", wpj531_setup);
index 6528d4a19786cabd2892c94087465438528831ca..2f6e0b221161228bfc3e9175f8573ab33782cb23 100644 (file)
@@ -37,6 +37,16 @@ endef
 
 $(eval $(call Profile,WPJ344))
 
 
 $(eval $(call Profile,WPJ344))
 
+define Profile/WPJ531
+       NAME:=Compex WPJ531
+endef
+
+define Profile/WPJ531/Description
+       Package set optimized for the Compex WPJ531 board.
+endef
+
+$(eval $(call Profile,WPJ531))
+
 define Profile/WPJ558
        NAME:=Compex WPJ558
 endef
 define Profile/WPJ558
        NAME:=Compex WPJ558
 endef
index 5a82b7caf0b754d273afa8bc7958e60e4135c3f4..57c58ace7942f868a63d027043589ca69da5f002 100644 (file)
@@ -1164,6 +1164,7 @@ ubdev_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware)
 whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
 wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware)
 wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
 whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
 wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware)
 wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
+wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
 wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
 wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel),6016k(rootfs),64k(nvram)ro,64k(art)ro,7744k@0x50000(firmware)
 wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
 wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
 wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel),6016k(rootfs),64k(nvram)ro,64k(art)ro,7744k@0x50000(firmware)
 wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
@@ -1970,6 +1971,7 @@ $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdl
 $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
+$(eval $(call SingleProfile,AthLzma,64k,WPJ531_16M,wpj531-16M,WPJ531,ttyS0,115200,$$(wpj531_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
 
 $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
 $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
 
 $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
@@ -2126,6 +2128,7 @@ $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
 $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
 $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
 $(eval $(call MultiProfile,WPJ344,WPJ344_16M))
 $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
 $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
 $(eval $(call MultiProfile,WPJ344,WPJ344_16M))
+$(eval $(call MultiProfile,WPJ531,WPJ531_16M))
 $(eval $(call MultiProfile,WPJ558,WPJ558_16M))
 
 $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
 $(eval $(call MultiProfile,WPJ558,WPJ558_16M))
 
 $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
index f8a561c0b0a456f197a2b1207e316b833acade7e..d3749666e367ad012e78f964403158346cfe152c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,191 @@
+@@ -16,22 +16,192 @@
  
  enum ath79_mach_type {
        ATH79_MACH_GENERIC = 0,
  
  enum ath79_mach_type {
        ATH79_MACH_GENERIC = 0,
 +      ATH79_MACH_WP543,               /* Compex WP543 */
 +      ATH79_MACH_WPE72,               /* Compex WPE72 */
 +      ATH79_MACH_WPJ344,              /* Compex WPJ344 */
 +      ATH79_MACH_WP543,               /* Compex WP543 */
 +      ATH79_MACH_WPE72,               /* Compex WPE72 */
 +      ATH79_MACH_WPJ344,              /* Compex WPJ344 */
++      ATH79_MACH_WPJ531,              /* Compex WPJ531 */
 +      ATH79_MACH_WPJ558,              /* Compex WPJ558 */
 +      ATH79_MACH_WRT160NL,            /* Linksys WRT160NL */
 +      ATH79_MACH_WRT400N,             /* Linksys WRT400N */
 +      ATH79_MACH_WPJ558,              /* Compex WPJ558 */
 +      ATH79_MACH_WRT160NL,            /* Linksys WRT160NL */
 +      ATH79_MACH_WRT400N,             /* Linksys WRT400N */
  config ATH79_MACH_AP121
        bool "Atheros AP121 reference board"
        select SOC_AR933X
  config ATH79_MACH_AP121
        bool "Atheros AP121 reference board"
        select SOC_AR933X
-@@ -11,62 +75,986 @@ config ATH79_MACH_AP121
+@@ -11,62 +75,996 @@ config ATH79_MACH_AP121
        select ATH79_DEV_M25P80
        select ATH79_DEV_USB
        select ATH79_DEV_WMAC
        select ATH79_DEV_M25P80
        select ATH79_DEV_USB
        select ATH79_DEV_WMAC
 +      select ATH79_DEV_USB
 +      select ATH79_DEV_WMAC
 +
 +      select ATH79_DEV_USB
 +      select ATH79_DEV_WMAC
 +
++config ATH79_MACH_WPJ531
++       bool "Compex WPJ531 board support"
++       select SOC_QCA953X
++       select ATH79_DEV_ETH
++       select ATH79_DEV_GPIO_BUTTONS
++       select ATH79_DEV_LEDS_GPIO
++       select ATH79_DEV_M25P80
++       select ATH79_DEV_USB
++       select ATH79_DEV_WMAC
++
 +config ATH79_MACH_WPJ558
 +      bool "Compex WPJ558 board support"
 +      select SOC_QCA955X
 +config ATH79_MACH_WPJ558
 +      bool "Compex WPJ558 board support"
 +      select SOC_QCA955X
  
  config ATH79_MACH_UBNT_XM
        bool "Ubiquiti Networks XM/UniFi boards"
  
  config ATH79_MACH_UBNT_XM
        bool "Ubiquiti Networks XM/UniFi boards"
-@@ -83,6 +1071,97 @@ config ATH79_MACH_UBNT_XM
+@@ -83,6 +1081,97 @@ config ATH79_MACH_UBNT_XM
          Say 'Y' here if you want your kernel to support the
          Ubiquiti Networks XM (rev 1.0) board.
  
          Say 'Y' here if you want your kernel to support the
          Ubiquiti Networks XM (rev 1.0) board.
  
  endmenu
  
  config SOC_AR71XX
  endmenu
  
  config SOC_AR71XX
-@@ -124,7 +1203,10 @@ config ATH79_DEV_DSA
+@@ -124,7 +1213,10 @@ config ATH79_DEV_DSA
  config ATH79_DEV_ETH
        def_bool n
  
  config ATH79_DEV_ETH
        def_bool n
  
        def_bool n
  
  config ATH79_DEV_GPIO_BUTTONS
        def_bool n
  
  config ATH79_DEV_GPIO_BUTTONS
-@@ -154,6 +1236,11 @@ config ATH79_PCI_ATH9K_FIXUP
+@@ -154,6 +1246,11 @@ config ATH79_PCI_ATH9K_FIXUP
        def_bool n
  
  config ATH79_ROUTERBOOT
        def_bool n
  
  config ATH79_ROUTERBOOT
  endif
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
  endif
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,120 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)             += route
+@@ -38,9 +48,121 @@ obj-$(CONFIG_ATH79_ROUTERBOOT)             += route
  #
  # Machines
  #
  #
  # Machines
  #
 +obj-$(CONFIG_ATH79_MACH_WP543)                += mach-wp543.o
 +obj-$(CONFIG_ATH79_MACH_WPE72)                += mach-wpe72.o
 +obj-$(CONFIG_ATH79_MACH_WPJ344)       += mach-wpj344.o
 +obj-$(CONFIG_ATH79_MACH_WP543)                += mach-wp543.o
 +obj-$(CONFIG_ATH79_MACH_WPE72)                += mach-wpe72.o
 +obj-$(CONFIG_ATH79_MACH_WPJ344)       += mach-wpj344.o
++obj-$(CONFIG_ATH79_MACH_WPJ531)       += mach-wpj531.o
 +obj-$(CONFIG_ATH79_MACH_WPJ558)       += mach-wpj558.o
 +obj-$(CONFIG_ATH79_MACH_WRT160NL)     += mach-wrt160nl.o
 +obj-$(CONFIG_ATH79_MACH_WRT400N)      += mach-wrt400n.o
 +obj-$(CONFIG_ATH79_MACH_WPJ558)       += mach-wpj558.o
 +obj-$(CONFIG_ATH79_MACH_WRT160NL)     += mach-wrt160nl.o
 +obj-$(CONFIG_ATH79_MACH_WRT400N)      += mach-wrt400n.o