<div dir="ltr"><div class="gmail_default" style="font-size:small">​Sorry the diff stat doesn't seem to match </div><div class="gmail_default" style="font-size:small">maybe I used 'diff --stat' rather than '​diff origin/master --stat'</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/base-files/etc/board.d/01_leds            |  5 ++++</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/base-files/etc/board.d/02_network         |  1 +</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/base-files/etc/diag.sh                    |  3 ++</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/base-files/lib/ar71xx.sh                  |  3 ++</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/base-files/lib/upgrade/platform.sh        |  1 +</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/config-4.1                                |  1 +</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt     | 10 +++++++</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/files/arch/mips/ath79/Makefile            |  1 +</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/files/arch/mips/ath79/mach-antrouter-r1.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/files/arch/mips/ath79/machtypes.h         |  1 +</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/generic/profiles/<a href="http://antminer.mk">antminer.mk</a>              | 11 +++++++</div><div class="gmail_default" style="font-size:small"> target/linux/ar71xx/image/Makefile                            | 10 ++++++-</div><div class="gmail_default" style="font-size:small">12 files changed, 144 insertions(+), 1 deletion(-)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Bitmain or their firmware 'team' used AA same as the antminer s1/s3</div><div class="gmail_default" style="font-size:small">and reused the 'tplink profile' for a tplink router....basically a hack job.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I have no Idea why they can't do things more properly.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 24, 2015 at 7:41 AM, Yousong Zhou <span dir="ltr"><<a href="mailto:yszhou4tech@gmail.com" target="_blank">yszhou4tech@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On 24 December 2015 at 09:32, L. D. Pinney <<a href="mailto:ldpinney@gmail.com">ldpinney@gmail.com</a>> wrote:<br>
> This patch adds support for the Bitmain Antrouter R1<br>
><br>
> <a href="http://wiki.openwrt.org/toh/bitmain/r1" rel="noreferrer" target="_blank">http://wiki.openwrt.org/toh/bitmain/r1</a><br>
><br>
> Signed-off-by: L. D. Pinney <<a href="mailto:ldpinney@gmail.com">ldpinney@gmail.com</a>><br>
> ---<br>
><br>
> V2 Corrects naming errors in Profile in V1<br>
><br>
>  target/linux/ar71xx/base-files/etc/board.d/01_leds            |  5 +++++<br>
>  target/linux/ar71xx/base-files/etc/board.d/02_network         |  1 +<br>
>  target/linux/ar71xx/base-files/etc/diag.sh                    |  3 +++<br>
>  target/linux/ar71xx/base-files/lib/ar71xx.sh                  |  3 +++<br>
>  target/linux/ar71xx/base-files/lib/upgrade/platform.sh        |  1 +<br>
>  target/linux/ar71xx/config-4.1                                |  1 +<br>
>  target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt     | 10 ++++++++++<br>
>  target/linux/ar71xx/files/arch/mips/ath79/Makefile            |  1 +<br>
>  target/linux/ar71xx/files/arch/mips/ath79/mach-antrouter-r1.c |  8 +++++++-<br>
>  target/linux/ar71xx/files/arch/mips/ath79/machtypes.h         |  1 +<br>
>  target/linux/ar71xx/generic/profiles/<a href="http://antminer.mk" rel="noreferrer" target="_blank">antminer.mk</a>              | 11 +++++++++++<br>
>  target/linux/ar71xx/image/Makefile                            | 10 +++++++++-<br>
>  12 files changed, 53 insertions(+), 2 deletions(-)<br>
><br>
<br>
The patch may be fine but the diffstat apparently does not match the patch.<br>
<br>
> diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds<br>
> index 576d45b..cfb42a5 100755<br>
> --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds<br>
> +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds<br>
> @@ -45,6 +45,11 @@ antminer-s3)<br>
>         ucidef_set_led_default "lan" "LAN" "antminer-s3:yellow:lan" "0"<br>
>         ;;<br>
><br>
> +antrouter-r1)<br>
> +       ucidef_set_led_wlan "wlan" "WLAN" "antrouter-r1:green:wlan" "phy0tpt"<br>
> +       ucidef_set_led_default "btc" "BTC" "antrouter-r1:green:btc" "0"<br>
> +       ;;<br>
> +<br>
>  arduino-yun)<br>
>         ucidef_set_led_wlan "wlan" "WLAN" "arduino:blue:wlan" "phy0tpt"<br>
>         ucidef_set_led_usbdev "usb" "USB" "arduino:white:usb" "1-1.1"<br>
> diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network<br>
> index 8c57f2b..6b6c6a4 100755<br>
> --- a/target/linux/ar71xx/base-files/etc/board.d/02_network<br>
> +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network<br>
> @@ -317,6 +317,7 @@ dlan-pro-1200-ac)<br>
>  all0305 |\<br>
>  antminer-s1 |\<br>
>  antminer-s3 |\<br>
> +antrouter-r1 |\<br>
>  aw-nr580 |\<br>
>  bullet-m |\<br>
>  c-55 |\<br>
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh<br>
> index 7e2dac8..13a0a98 100644<br>
> --- a/target/linux/ar71xx/base-files/etc/diag.sh<br>
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh<br>
> @@ -18,6 +18,9 @@ get_status_led() {<br>
>         antminer-s3)<br>
>                 status_led="antminer-s3:green:system"<br>
>                 ;;<br>
> +       antminer-r1)<br>
> +               status_led="antminer-r1:green:system"<br>
> +               ;;<br>
>         ap132)<br>
>                 status_led="ap132:green:status"<br>
>                 ;;<br>
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh<br>
> index 46e6311..61dcbba 100755<br>
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh<br>
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh<br>
> @@ -114,6 +114,9 @@ tplink_board_detect() {<br>
>         "044403"*)<br>
>                 model="ANTMINER-S3"<br>
>                 ;;<br>
> +       "44440101"*)<br>
> +               model="ANTROUTER-R1"<br>
> +               ;;<br>
<br>
Just out of curiosity, is it a design decision or just coincidence<br>
that these devices uses tplink style of firmware encapsulation?<br>
<br>
Regards,<br>
                yousong<br>
<br>
>         "120000"*)<br>
>                 model="MERCURY MAC1200R"<br>
>                 ;;<br>
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh<br>
> index e8998f4..cff7dfe 100755<br>
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh<br>
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh<br>
> @@ -323,6 +323,7 @@ platform_check_image() {<br>
><br>
>         antminer-s1 | \<br>
>         antminer-s3 | \<br>
> +       antrouter-r1 | \<br>
>         archer-c5 | \<br>
>         archer-c7 | \<br>
>         el-m150 | \<br>
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1<br>
> index 7845aa2..fe1dd68 100644<br>
> --- a/target/linux/ar71xx/config-4.1<br>
> +++ b/target/linux/ar71xx/config-4.1<br>
> @@ -35,6 +35,7 @@ CONFIG_ATH79_MACH_ALL0258N=y<br>
>  CONFIG_ATH79_MACH_ALL0315N=y<br>
>  CONFIG_ATH79_MACH_ANTMINER_S1=y<br>
>  CONFIG_ATH79_MACH_ANTMINER_S3=y<br>
> +CONFIG_ATH79_MACH_ANTROUTER_R1=y<br>
>  CONFIG_ATH79_MACH_AP113=y<br>
>  CONFIG_ATH79_MACH_AP121=y<br>
>  CONFIG_ATH79_MACH_AP132=y<br>
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt<br>
> index 84d22fe..cdd4fa2 100644<br>
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt<br>
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt<br>
> @@ -72,6 +72,16 @@ config ATH79_MACH_ANTMINER_S3<br>
>         select ATH79_DEV_USB<br>
>         select ATH79_DEV_WMAC<br>
><br>
> +config ATH79_MACH_ANTROUTER_R1<br>
> +       bool "Bitmain Antrouter R1 support"<br>
> +       select SOC_AR933X<br>
> +       select ATH79_DEV_ETH<br>
> +       select ATH79_DEV_GPIO_BUTTONS<br>
> +       select ATH79_DEV_LEDS_GPIO<br>
> +       select ATH79_DEV_M25P80<br>
> +       select ATH79_DEV_USB<br>
> +       select ATH79_DEV_WMAC<br>
> +<br>
>  config ATH79_MACH_ARDUINO_YUN<br>
>         bool "Arduino Yun"<br>
>         select SOC_AR933X<br>
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile<br>
> index 2d45225..991f6f2 100644<br>
> --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile<br>
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile<br>
> @@ -44,6 +44,7 @@ obj-$(CONFIG_ATH79_MACH_ALL0258N)     += mach-all0258n.o<br>
>  obj-$(CONFIG_ATH79_MACH_ALL0315N)      += mach-all0315n.o<br>
>  obj-$(CONFIG_ATH79_MACH_ANTMINER_S1)+= mach-antminer-s1.o<br>
>  obj-$(CONFIG_ATH79_MACH_ANTMINER_S3)+= mach-antminer-s3.o<br>
> +obj-$(CONFIG_ATH79_MACH_ANTROUTER_R1)  += mach-antrouter-r1.o<br>
>  obj-$(CONFIG_ATH79_MACH_ARDUINO_YUN)   += mach-arduino-yun.o<br>
>  obj-$(CONFIG_ATH79_MACH_AP113)         += mach-ap113.o<br>
>  obj-$(CONFIG_ATH79_MACH_AP121)         += mach-ap121.o<br>
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-antrouter-r1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-antrouter-r1.c<br>
> new file mode 100644<br>
> index 0000000..a8f7b5d<br>
> --- /dev/null<br>
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-antrouter-r1.c<br>
> @@ -0,0 +1,98 @@<br>
> +/*<br>
> + *  Bitmain Antrouter R1 board support<br>
> + *<br>
> + *  Copyright (C) 2015 L. D. Pinney <<a href="mailto:ldpinney@gmail.com">ldpinney@gmail.com</a>><br>
> + *<br>
> + *  This program is free software; you can redistribute it and/or modify it<br>
> + *  under the terms of the GNU General Public License version 2 as published<br>
> + *  by the Free Software Foundation.<br>
> + */<br>
> +<br>
> +#include <linux/gpio.h><br>
> +<br>
> +#include <asm/mach-ath79/ath79.h><br>
> +#include <asm/mach-ath79/ar71xx_regs.h><br>
> +<br>
> +#include "common.h"<br>
> +#include "dev-eth.h"<br>
> +#include "dev-gpio-buttons.h"<br>
> +#include "dev-leds-gpio.h"<br>
> +#include "dev-m25p80.h"<br>
> +#include "dev-wmac.h"<br>
> +#include "machtypes.h"<br>
> +#include "dev-usb.h"<br>
> +<br>
> +#define ANTROUTER_R1_GPIO_BTN_RESET            11<br>
> +<br>
> +#define ANTROUTER_R1_GPIO_LED_WLAN             0<br>
> +#define ANTROUTER_R1_GPIO_LED_BTC              22<br>
> +#define ANTROUTER_R1_GPIO_USB_POWER            18<br>
> +<br>
> +#define ANTROUTER_R1_KEYSPOLL_INTERVAL 44      /* msecs */<br>
> +#define ANTROUTER_R1_KEYSDEBOUNCE_INTERVAL (4 * ANTROUTER_R1_KEYSPOLL_INTERVAL)<br>
> +<br>
> +static const char *ANTROUTER_R1_part_probes[] = {<br>
> +       "tp-link",<br>
> +       NULL,<br>
> +};<br>
> +<br>
> +static struct flash_platform_data ANTROUTER_R1_flash_data = {<br>
> +       .part_probes    = ANTROUTER_R1_part_probes,<br>
> +};<br>
> +<br>
> +static struct gpio_led ANTROUTER_R1_leds_gpio[] __initdata = {<br>
> +       {<br>
> +               .name           = "antrouter-r1:green:wlan",<br>
> +               .gpio           = ANTROUTER_R1_GPIO_LED_WLAN,<br>
> +               .active_low     = 0,<br>
> +       },{<br>
> +               .name           = "antrouter-r1:green:system",<br>
> +               .gpio           = ANTROUTER_R1_GPIO_LED_BTC,<br>
> +               .active_low     = 0,<br>
> +       },<br>
> +};<br>
> +<br>
> +static struct gpio_keys_button ANTROUTER_R1_GPIO_keys[] __initdata = {<br>
> +       {<br>
> +               .desc           = "reset",<br>
> +               .type           = EV_KEY,<br>
> +               .code           = KEY_RESTART,<br>
> +               .debounce_interval = ANTROUTER_R1_KEYSDEBOUNCE_INTERVAL,<br>
> +               .gpio           = ANTROUTER_R1_GPIO_BTN_RESET,<br>
> +               .active_low     = 0,<br>
> +       },<br>
> +};<br>
> +<br>
> +static void __init antrouter_r1_setup(void)<br>
> +{<br>
> +       u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);<br>
> +       u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);<br>
> +<br>
> +       /* disable PHY_SWAP and PHY_ADDR_SWAP bits */<br>
> +       ath79_setup_ar933x_phy4_switch(false, false);<br>
> +<br>
> +       ath79_register_leds_gpio(-1, ARRAY_SIZE(ANTROUTER_R1_leds_gpio),<br>
> +                                ANTROUTER_R1_leds_gpio);<br>
> +<br>
> +       ath79_register_gpio_keys_polled(-1, ANTROUTER_R1_KEYSPOLL_INTERVAL,<br>
> +                                       ARRAY_SIZE(ANTROUTER_R1_GPIO_keys),<br>
> +                                       ANTROUTER_R1_GPIO_keys);<br>
> +<br>
> +       gpio_request_one(ANTROUTER_R1_GPIO_USB_POWER,<br>
> +                        GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,<br>
> +                        "USB power");<br>
> +       ath79_register_usb();<br>
> +<br>
> +       ath79_register_m25p80(&ANTROUTER_R1_flash_data);<br>
> +       ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);<br>
> +       ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);<br>
> +<br>
> +       ath79_register_mdio(0, 0x0);<br>
> +       ath79_register_eth(0);<br>
> +       ath79_register_eth(1);<br>
> +<br>
> +       ath79_register_wmac(ee, mac);<br>
> +}<br>
> +<br>
> +MIPS_MACHINE(ATH79_MACH_ANTROUTER_R1, "ANTROUTER-R1",<br>
> +            "Antrouter-R1", antrouter_r1_setup);<br>
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h<br>
> index c32d44a..1b1c51a 100644<br>
> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h<br>
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h<br>
> @@ -23,6 +23,7 @@ enum ath79_mach_type {<br>
>         ATH79_MACH_ALL0315N,            /* Allnet ALL0315N */<br>
>         ATH79_MACH_ANTMINER_S1, /* Antminer S1 */<br>
>         ATH79_MACH_ANTMINER_S3, /* Antminer S3 */<br>
> +       ATH79_MACH_ANTROUTER_R1,        /* Antrouter R1 */<br>
>         ATH79_MACH_ARDUINO_YUN,         /* Yun */<br>
>         ATH79_MACH_AP113,               /* Atheros AP113 reference board */<br>
>         ATH79_MACH_AP121,               /* Atheros AP121 reference board */<br>
> diff --git a/target/linux/ar71xx/generic/profiles/<a href="http://antminer.mk" rel="noreferrer" target="_blank">antminer.mk</a> b/target/linux/ar71xx/generic/profiles/<a href="http://antminer.mk" rel="noreferrer" target="_blank">antminer.mk</a><br>
> index d59a089..72019e3 100644<br>
> --- a/target/linux/ar71xx/generic/profiles/<a href="http://antminer.mk" rel="noreferrer" target="_blank">antminer.mk</a><br>
> +++ b/target/linux/ar71xx/generic/profiles/<a href="http://antminer.mk" rel="noreferrer" target="_blank">antminer.mk</a><br>
> @@ -26,3 +26,14 @@ define Profile/ANTMINERS3/Description<br>
>         Package set optimized for the Bitmain Antminer S3.<br>
>  endef<br>
>  $(eval $(call Profile,ANTMINERS3))<br>
> +<br>
> +define Profile/ANTROUTERR1<br>
> +       NAME:=Antrouter-R1<br>
> +       PACKAGES:=kmod-usb-core kmod-usb2<br>
> +endef<br>
> +<br>
> +<br>
> +define Profile/ANTROUTERR1/Description<br>
> +       Package set optimized for the Bitmain Antrouter R1.<br>
> +endef<br>
> +$(eval $(call Profile,ANTROUTERR1))<br>
> diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile<br>
> index d214eae..182fb4d 100644<br>
> --- a/target/linux/ar71xx/image/Makefile<br>
> +++ b/target/linux/ar71xx/image/Makefile<br>
> @@ -461,6 +461,14 @@ define Device/antminer-s3<br>
>      CONSOLE := ttyATH0,115200<br>
>  endef<br>
><br>
> +define Device/antrouter-r1<br>
> +    $(Device/tplink-8mlzma)<br>
> +    BOARDNAME := ANTROUTER-R1<br>
> +    DEVICE_PROFILE := ANTROUTERR1<br>
> +    TPLINK_HWID := 0x44440101<br>
> +    CONSOLE := ttyATH0,115200<br>
> +endef<br>
> +<br>
>  define Device/el-m150<br>
>      $(Device/tplink-8mlzma)<br>
>      BOARDNAME := EL-M150<br>
> @@ -476,7 +484,7 @@ define Device/el-mini<br>
>      TPLINK_HWID := 0x01530001<br>
>      CONSOLE := ttyATH0,115200<br>
>  endef<br>
> -TARGET_DEVICES += antminer-s1 antminer-s3 el-m150 el-mini<br>
> +TARGET_DEVICES += antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini<br>
><br>
>  define Device/gl-inet-6408A-v1<br>
>      $(Device/tplink-8mlzma)<br>
> _______________________________________________<br>
> openwrt-devel mailing list<br>
> <a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br>
> <a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div><br></div>