Re: [OpenWrt-Devel] [PATCH 1/3] ar71xx: add GL-AR150 support V2

2015-11-21 Thread John Crispin
Hi

comment 1 inline

On 17/11/2015 04:37, alzhao wrote:
> Added GL-AR150 support to latest trunk. Tested and works good.
> 
> Signed-off-by: Alzhao
> ---
>  .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
>  .../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-4.1 |   1 +
>  .../ar71xx/files/arch/mips/ath79/mach-gl-ar150.c   | 125 
> +
>  target/linux/ar71xx/generic/profiles/gl-connect.mk |  17 ---
>  target/linux/ar71xx/generic/profiles/gli.mk|  27 +
>  target/linux/ar71xx/image/Makefile |   8 ++
>  .../patches-4.1/911-MIPS-ath79-add-gl_ar150.patch  |  39 +++
>  10 files changed, 209 insertions(+), 17 deletions(-)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
>  delete mode 100644 target/linux/ar71xx/generic/profiles/gl-connect.mk
>  create mode 100644 target/linux/ar71xx/generic/profiles/gli.mk
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/911-MIPS-ath79-add-gl_ar150.patch
> 
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> index 39f472a..25f9d13 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> @@ -211,6 +211,10 @@ dlan-pro-1200-ac)
>   ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
>   ;;
>  
> +gl-ar150)
> + ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt"
> + ;;
> +
>  gl-inet)
>   ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
>   ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
> 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 2765adb..2ba1fbd 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -396,6 +396,7 @@ dir-505-a1)
>  alfa-ap96 |\
>  alfa-nx |\
>  ap83 |\
> +gl-ar150 |\
>  gl-inet |\
>  jwap003 |\
>  pb42 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 0e92ee7..9848906 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -478,6 +478,9 @@ ar71xx_board_detect() {
>   name="gl-inet"
>   gl_inet_board_detect
>   ;;
> + *"GL AR150")
> +name="gl-ar150"
> +;;

it looks like the indenting is wrong here. please fix and resend the patch

John



>   *"EnGenius EPG5000")
>   name="epg5000"
>   ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index b97c076..8ea11b4 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -219,6 +219,7 @@ platform_check_image() {
>   esr900 | \
>   ew-dorin | \
>   ew-dorin-router | \
> + gl-ar150 | \
>   hiwifi-hc6361 | \
>   hornet-ub-x2 | \
>   mzk-w04nu | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 08e252d..72b47eb 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -75,6 +75,7 @@ CONFIG_ATH79_MACH_ESR1750=y
>  CONFIG_ATH79_MACH_ESR900=y
>  CONFIG_ATH79_MACH_EW_DORIN=y
>  CONFIG_ATH79_MACH_F9K1115V2=y
> +CONFIG_ATH79_MACH_GL_AR150=y
>  CONFIG_ATH79_MACH_GL_INET=y
>  CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_GS_OOLITE=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> new file mode 100644
> index 000..310182c
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> @@ -0,0 +1,125 @@
> +/*
> + *  GL_ar150 board support
> + *
> + *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
> + *  Copyright (C) 2011-2012 Gabor Juhos 
> + *  Copyright (C) 2013 alzhao 
> + *  Copyright (C) 2014 Michel Stempin 
> + *
> + *  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 "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 GL_AR150_GPIO_LED_WLAN  0
> +#define GL_AR150_GPIO_LED_LAN

[OpenWrt-Devel] [PATCH 1/3] ar71xx: add GL-AR150 support V2

2015-11-16 Thread alzhao
Added GL-AR150 support to latest trunk. Tested and works good.

Signed-off-by: Alzhao
---
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
 .../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-4.1 |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-ar150.c   | 125 +
 target/linux/ar71xx/generic/profiles/gl-connect.mk |  17 ---
 target/linux/ar71xx/generic/profiles/gli.mk|  27 +
 target/linux/ar71xx/image/Makefile |   8 ++
 .../patches-4.1/911-MIPS-ath79-add-gl_ar150.patch  |  39 +++
 10 files changed, 209 insertions(+), 17 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
 delete mode 100644 target/linux/ar71xx/generic/profiles/gl-connect.mk
 create mode 100644 target/linux/ar71xx/generic/profiles/gli.mk
 create mode 100644 
target/linux/ar71xx/patches-4.1/911-MIPS-ath79-add-gl_ar150.patch

diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 39f472a..25f9d13 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -211,6 +211,10 @@ dlan-pro-1200-ac)
ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
;;
 
+gl-ar150)
+   ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt"
+   ;;
+
 gl-inet)
ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
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 2765adb..2ba1fbd 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -396,6 +396,7 @@ dir-505-a1)
 alfa-ap96 |\
 alfa-nx |\
 ap83 |\
+gl-ar150 |\
 gl-inet |\
 jwap003 |\
 pb42 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 0e92ee7..9848906 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -478,6 +478,9 @@ ar71xx_board_detect() {
name="gl-inet"
gl_inet_board_detect
;;
+   *"GL AR150")
+name="gl-ar150"
+;;
*"EnGenius EPG5000")
name="epg5000"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index b97c076..8ea11b4 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -219,6 +219,7 @@ platform_check_image() {
esr900 | \
ew-dorin | \
ew-dorin-router | \
+   gl-ar150 | \
hiwifi-hc6361 | \
hornet-ub-x2 | \
mzk-w04nu | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 08e252d..72b47eb 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -75,6 +75,7 @@ CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
+CONFIG_ATH79_MACH_GL_AR150=y
 CONFIG_ATH79_MACH_GL_INET=y
 CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
new file mode 100644
index 000..310182c
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
@@ -0,0 +1,125 @@
+/*
+ *  GL_ar150 board support
+ *
+ *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
+ *  Copyright (C) 2011-2012 Gabor Juhos 
+ *  Copyright (C) 2013 alzhao 
+ *  Copyright (C) 2014 Michel Stempin 
+ *
+ *  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 "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 GL_AR150_GPIO_LED_WLAN0
+#define GL_AR150_GPIO_LED_LAN 13
+#define GL_AR150_GPIO_LED_WAN 15 
+
+#define GL_AR150_GPIO_BIN_USB 6
+#define GL_AR150_GPIO_BTN_MANUAL  7
+#define GL_AR150_GPIO_BTN_AUTO8
+#define GL_AR150_GPIO_BTN_RESET   11
+
+#define GL_AR150_KEYS_POLL_INTERVAL   20   /* msecs */
+#define GL_AR150_KEYS_DEBOUNCE_INTERVAL(3 * 
GL_AR150_KEYS_POLL_INTERVAL)