From: Boken Lin b...@onion.io
Add support for Onion Omega.
Signed-off-by: Boken Lin b...@onion.io
---
target/linux/ar71xx/base-files/etc/diag.sh | 3 +
.../ar71xx/base-files/etc/uci-defaults/02_network | 1 +
target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +
.../ar71xx/base-files/lib/upgrade/platform.sh | 1 +
target/linux/ar71xx/config-3.18| 1 +
.../files/arch/mips/ath79/mach-onion-omega.c | 85 ++
target/linux/ar71xx/generic/profiles/onion.mk | 16
target/linux/ar71xx/image/Makefile | 9 +++
.../610-MIPS-ath79-openwrt-machines.patch | 24 --
tools/firmware-utils/src/mktplinkfw.c | 8 +-
10 files changed, 144 insertions(+), 7 deletions(-)
create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
create mode 100644 target/linux/ar71xx/generic/profiles/onion.mk
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
b/target/linux/ar71xx/base-files/etc/diag.sh
index ce2b9ba..0015d4c 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -167,6 +167,9 @@ get_status_led() {
om5p-an)
status_led=om5p:blue:power
;;
+onion-omega)
+status_led=onion:amber:system
+;;
pb44)
status_led=pb44:amber:jump1
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index ec709a0..6e9185c 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -313,6 +313,7 @@ mr600 |\
mr600v2 |\
mr900 |\
mr900v2 |\
+onion-omega |\
rb-411 |\
rb-911g-2hpnd |\
rb-911g-5hpacd |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index dd13948..e23ed74 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -550,6 +550,9 @@ ar71xx_board_detect() {
*OM5P AN)
name=om5p-an
;;
+*Onion Omega)
+name=onion-omega
+;;
*PB42)
name=pb42
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 73d8b0d..b045a33 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -312,6 +312,7 @@ platform_check_image() {
gl-inet | \
mc-mac1200r | \
oolite | \
+onion-omega | \
smart-300 | \
tl-mr10u | \
tl-mr11u | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 02857d5..388cb2b 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -86,6 +86,7 @@ CONFIG_ATH79_MACH_NBG460N=y
CONFIG_ATH79_MACH_NBG6716=y
CONFIG_ATH79_MACH_OM2P=y
CONFIG_ATH79_MACH_OM5P=y
+CONFIG_ATH79_MACH_ONION_OMEGA=y
CONFIG_ATH79_MACH_PB42=y
CONFIG_ATH79_MACH_PB44=y
CONFIG_ATH79_MACH_PB92=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
new file mode 100644
index 000..177e76f
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-onion-omega.c
@@ -0,0 +1,85 @@
+/*
+ * Onion Omega board support
+ *
+ * Copyright (C) 2015 Boken Lin b...@onion.io
+ *
+ * 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/gpio.h
+
+#include asm/mach-ath79/ath79.h
+
+#include dev-eth.h
+#include dev-gpio-buttons.h
+#include dev-leds-gpio.h
+#include dev-m25p80.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+
+#define OMEGA_GPIO_LED_SYSTEM 27
+#define OMEGA_GPIO_BTN_RESET11
+
+#define OMEGA_GPIO_USB_POWER8
+
+#define OMEGA_KEYS_POLL_INTERVAL20 /* msecs */
+#define OMEGA_KEYS_DEBOUNCE_INTERVAL(3 * OMEGA_KEYS_POLL_INTERVAL)
+
+static const char *omega_part_probes[] = {
+tp-link,
+NULL,
+};
+
+static struct flash_platform_data omega_flash_data = {
+.part_probes= omega_part_probes,
+};
+
+static struct gpio_led omega_leds_gpio[] __initdata = {
+{
+.name = onion:amber:system,
+.gpio = OMEGA_GPIO_LED_SYSTEM,
+.active_low = 1,
+},
+};
+
+static struct gpio_keys_button omega_gpio_keys[] __initdata = {
+{
+.desc = reset,
+.type = EV_KEY,
+.code = KEY_RESTART,
+.debounce_interval = OMEGA_KEYS_DEBOUNCE_INTERVAL,
+.gpio = OMEGA_GPIO_BTN_RESET,
+.active_low = 0,
+}
+};
+
+static void __init onion_omega_setup(void)
+{
+u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+u8 *ee