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 5c9397f0f7..542e3ffba9 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -589,6 +589,9 @@ omy-x1) ucidef_set_led_default "power" "POWER" "omy:green:power" "1" ucidef_set_led_default "wan" "WAN" "omy:green:wan" "eth0" ;; +owl) + ucidef_set_led_netdev "wlan0" "WLAN" "$board:red:system" "wlan0" + ;; pqi-air-pen) ucidef_set_led_wlan "wlan" "WLAN" "pqi-air-pen:blue:wlan" "phy0tpt" ucidef_set_led_default "wps" "WPS" "pqi-air-pen:blue:wps" "0" diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 3c9f17d8c3..be894afb1c 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -207,7 +207,8 @@ get_status_led() { status_led="$board:green:sig4" ;; dragino2|\ - oolite-v1) + oolite-v1|\ + owl) status_led="$board:red:system" ;; dw33d|\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 96ee7550ce..4844075bd2 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -947,6 +947,9 @@ ar71xx_board_detect() { *"Oolite V1.0") name="oolite-v1" ;; + *"Owl") + name="owl" + ;; *"Packet Squirrel") name="packet-squirrel" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 21ad3075bd..9771ab0aa9 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -284,6 +284,7 @@ platform_check_image() { nanostation-m|\ nanostation-m-xw|\ nbg460n_550n_550nh|\ + owl|\ pqi-air-pen|\ r36a|\ r602n|\ diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14 index 9a524fae43..273802f082 100644 --- a/target/linux/ar71xx/config-4.14 +++ b/target/linux/ar71xx/config-4.14 @@ -164,6 +164,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_OMY_G1 is not set # CONFIG_ATH79_MACH_OMY_X1 is not set # CONFIG_ATH79_MACH_ONION_OMEGA is not set +# CONFIG_ATH79_MACH_OWL is not set # CONFIG_ATH79_MACH_PB42 is not set # CONFIG_ATH79_MACH_PB44 is not set # CONFIG_ATH79_MACH_PQI_AIR_PEN is not set diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 6f358bc842..6c80574d00 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1366,6 +1366,16 @@ config ATH79_MACH_ONION_OMEGA select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_OWL + bool "Hak5 Owl board support" + select SOC_AR933X + 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_MR12 bool "Meraki MR12 board support" select SOC_AR724X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 0265b3d818..b4440cfac5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -175,6 +175,7 @@ obj-$(CONFIG_ATH79_MACH_OM5P_ACv2) += mach-om5pacv2.o obj-$(CONFIG_ATH79_MACH_OMY_G1) += mach-omy-g1.o obj-$(CONFIG_ATH79_MACH_OMY_X1) += mach-omy-x1.o obj-$(CONFIG_ATH79_MACH_ONION_OMEGA) += mach-onion-omega.o +obj-$(CONFIG_ATH79_MACH_OWL) += mach-owl.o obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o obj-$(CONFIG_ATH79_MACH_PQI_AIR_PEN) += mach-pqi-air-pen.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-owl.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-owl.c new file mode 100644 index 0000000000..753e4fa148 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-owl.c @@ -0,0 +1,73 @@ +/* + * Hak5 Owl board support + * + * Copyright (C) 2018 Sebastian Kinne + * + * 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 "common.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 OWL_GPIO_LED_SYSTEM 27 + +#define OWL_GPIO_BTN_RESET 12 + +#define OWL_KEYS_POLL_INTERVAL 20 /* msecs */ +#define OWL_KEYS_DEBOUNCE_INTERVAL (3 * OWL_KEYS_POLL_INTERVAL) + +#define OWL_CALDATA_OFFSET 0x1000 + +static struct gpio_led owl_leds_gpio[] __initdata = { + { + .name = "owl:red:system", + .gpio = OWL_GPIO_LED_SYSTEM, + .active_low = 1, + }, +}; + +static struct gpio_keys_button owl_gpio_keys[] __initdata = { + { + .desc = "Reset Button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = OWL_KEYS_DEBOUNCE_INTERVAL, + .gpio = OWL_GPIO_BTN_RESET, + .active_low = 1, + } +}; + +static void __init owl_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f040000); + + ath79_register_m25p80(NULL); + + ath79_register_mdio(0, 0x0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(owl_leds_gpio), + owl_leds_gpio); + ath79_register_gpio_keys_polled(-1, OWL_KEYS_POLL_INTERVAL, + ARRAY_SIZE(owl_gpio_keys), + owl_gpio_keys); + + ath79_register_wmac(art + OWL_CALDATA_OFFSET, NULL); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_OWL, "OWL", "Owl", + owl_setup); \ No newline at end of file diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 974b69fda6..5e67eb96d0 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -186,6 +186,7 @@ enum ath79_mach_type { ATH79_MACH_OMY_G1, /* OMYlink OMY-G1 */ ATH79_MACH_OMY_X1, /* OMYlink OMY-X1 */ ATH79_MACH_ONION_OMEGA, /* ONION OMEGA */ + ATH79_MACH_OWL, /* Hak5 Owl */ ATH79_MACH_PACKET_SQUIRREL, /* Hak5 Packet Squirrel */ ATH79_MACH_PB42, /* Atheros PB42 */ ATH79_MACH_PB44, /* Atheros PB44 reference board */ diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default index 25b58ae91e..89216275f7 100644 --- a/target/linux/ar71xx/generic/config-default +++ b/target/linux/ar71xx/generic/config-default @@ -130,6 +130,7 @@ CONFIG_ATH79_MACH_OM5P_ACv2=y CONFIG_ATH79_MACH_OMY_G1=y CONFIG_ATH79_MACH_OMY_X1=y CONFIG_ATH79_MACH_ONION_OMEGA=y +CONFIG_ATH79_MACH_OWL=y CONFIG_ATH79_MACH_PB42=y CONFIG_ATH79_MACH_PB44=y CONFIG_ATH79_MACH_PQI_AIR_PEN=y diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 18f0379845..479b18320a 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -963,6 +963,19 @@ define Device/onion-omega endef TARGET_DEVICES += onion-omega +define Device/owl + DEVICE_TITLE := Hak5 Owl + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-ath9k-htc -swconfig + BOARDNAME := OWL + IMAGE_SIZE := 16064k + CONSOLE := ttyATH0,115200 + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + SUPPORTED_DEVICES := owl + IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += owl + define Device/sc1750 DEVICE_TITLE := Abicom SC1750 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport