wpj344)
status_led="wpj344:green:status"
;;
+ wpj531)
+ status_led="wpj531:green:sig3"
+ ;;
wpj558)
status_led="wpj558:green:sig3"
;;
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"
*WPJ344)
name="wpj344"
;;
+ *WPJ531)
+ name="wpj531"
+ ;;
*WPJ558)
name="wpj558"
;;
rocket-m-xw | \
nanostation-m-xw | \
rw2458n | \
+ wpj531 | \
wndap360 | \
wpj344 | \
wzr-hp-g300nh2 | \
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
--- /dev/null
+/*
+ * 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);
$(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
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
$(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 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)))
--- 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,
+ 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 */
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_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_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.
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
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
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
#
+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