From patchwork Sun Oct 11 21:56:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. D. Pinney" X-Patchwork-Id: 528814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3E0801402A1 for ; Mon, 12 Oct 2015 08:56:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=m4Won4Go; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id F0CF628BB79; Sun, 11 Oct 2015 23:55:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3B8D02800D6 for ; Sun, 11 Oct 2015 23:54:58 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-ob0-f169.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 11 Oct 2015 23:54:51 +0200 (CEST) Received: by obbbh8 with SMTP id bh8so95913058obb.0 for ; Sun, 11 Oct 2015 14:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=u96W00jPM1770jkOfiJxWV2+osGkGKXz2AZlD+RHNxo=; b=m4Won4GoktAESvSKwd/9Zdo85QZixEpIZie7846glFBALJWY8pcy1Zs0+DTlgYWX3+ bjdAg4aGsMV1xOjUQdIiwD2ukDlKJVVqOMcS67Z3Ae2R+itpZ+nIDl2zXY6WdNCA05Hi MvsJf0VFpwfabwge6yfM9sWp/D6hIe6dca9hy0zpf4HXDXnttW7z1NJuCRp8Yn76QRkI 983sNQhpQXbjLM/Eh3JUS7yiWN2e0gMuYa85xSm7gfIOb7KHvJduo8BA9YdwDQh8PoiV /SwKB1agTPzv0l0xCLZIKwSXar014TToM7D52AQETrvXE572cqW2EnRTe3nLW8Zz4IPS 8RZA== X-Received: by 10.182.96.168 with SMTP id dt8mr13961884obb.36.1444600579864; Sun, 11 Oct 2015 14:56:19 -0700 (PDT) Received: from black.lan (ip70-189-80-78.ok.ok.cox.net. [70.189.80.78]) by smtp.gmail.com with ESMTPSA id f3sm6952667obm.18.2015.10.11.14.56.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Oct 2015 14:56:19 -0700 (PDT) From: "L. D. Pinney" To: OpenWrt Development List Date: Sun, 11 Oct 2015 16:56:12 -0500 Message-Id: <1444600572-14762-1-git-send-email-ldpinney@gmail.com> X-Mailer: git-send-email 2.6.1 Subject: [OpenWrt-Devel] [PATCH, v2] ar71xx: Bitmain Antminer S1 & S3 cleanup X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Sets the LEDs to boardname:color:led-name Sets the LAN to eth0 Other corrections such as the Machine Name and HWIDs v2 corrects the profile names in the Makefile and changes tabs to spaces in the Makefile 'define Device/' like the other devices. Signed-off-by: L. D. Pinney --- target/linux/ar71xx/base-files/etc/diag.sh | 6 ++++-- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 10 +++++----- target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 4 ++-- target/linux/ar71xx/base-files/lib/ar71xx.sh | 14 ++++++++++---- target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c | 6 +++--- target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c | 8 ++++---- target/linux/ar71xx/generic/profiles/antminer.mk | 16 ++++++++-------- target/linux/ar71xx/image/Makefile | 20 ++++++++++---------- target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch | 4 ++-- tools/firmware-utils/src/mktplinkfw.c | 9 +++++++-- 10 files changed, 55 insertions(+), 42 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index cfba6b4..b2f77a0 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -12,9 +12,11 @@ get_status_led() { all0305) status_led="eap7660d:green:ds4" ;; - antminer-s1|\ + antminer-s1) + status_led="antminer-s1:green:system" + ;; antminer-s3) - status_led="bitmain:green:system" + status_led="antminer-s3:green:system" ;; ap132) status_led="ap132:green:status" 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 fac4751..abed456 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -33,14 +33,14 @@ all0315n) ;; antminer-s1) - ucidef_set_led_default "sys" "SYS" "bitmain:green:sys" "0" - ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt" + ucidef_set_led_default "sys" "SYS" "antminer-s1:green:sys" "0" + ucidef_set_led_wlan "wlan" "WLAN" "antminer-s1:green:wlan" "phy0tpt" ;; antminer-s3) - ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt" - ucidef_set_led_default "sys" "SYS" "bitmain:green:sys" "0" - ucidef_set_led_default "lan" "LAN" "bitmain:yellow:lan" "0" + ucidef_set_led_wlan "wlan" "WLAN" "antminer-s3:green:wlan" "phy0tpt" + ucidef_set_led_default "sys" "SYS" "antminer-s3:green:sys" "0" + ucidef_set_led_default "lan" "LAN" "antminer-s3:yellow:lan" "0" ;; ap113) 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 880953c..40e9b30 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -339,6 +339,8 @@ dlan-pro-1200-ac) ;; all0305 |\ +antminer-s1 |\ +antminer-s3 |\ aw-nr580 |\ bullet-m |\ cap4200ag |\ @@ -384,8 +386,6 @@ wp543) ucidef_set_interface_lan "eth0" ;; -antminer-s1 |\ -antminer-s3 |\ dir-505-a1) ucidef_set_interface_lan "eth1" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 4679a4b..166e52e 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -107,11 +107,11 @@ tplink_board_detect() { "015300"*) model="EasyLink EL-MINI" ;; - "04440001"*) - model="BITMAIN ANTMINER S1" + "044401"*) + model="ANTMINER-S1" ;; - "04440003"*) - model="BITMAIN ANTMINER S3" + "044403"*) + model="ANTMINER-S3" ;; "120000"*) model="MERCURY MAC1200R" @@ -350,6 +350,12 @@ ar71xx_board_detect() { *ALL0315N) name="all0315n" ;; + *Antminer-S1) + name="antminer-s1" + ;; + *Antminer-S3) + name="antminer-s3" + ;; *AP113) name="ap113" ;; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c index 27ed760..880bc72 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c @@ -42,11 +42,11 @@ static struct flash_platform_data ANTMINER_S1_flash_data = { static struct gpio_led ANTMINER_S1_leds_gpio[] __initdata = { { - .name = "bitmain:green:system", + .name = "antminer-s1:green:system", .gpio = ANTMINER_S1_GPIO_LED_SYSTEM, .active_low = 0, },{ - .name = "bitmain:green:wlan", + .name = "antminer-s1:green:wlan", .gpio = ANTMINER_S1_GPIO_LED_WLAN, .active_low = 0, }, @@ -95,4 +95,4 @@ static void __init antminer_s1_setup(void) } MIPS_MACHINE(ATH79_MACH_ANTMINER_S1, "ANTMINER-S1", - "Bitmain Antminer S1", antminer_s1_setup); + "Antminer-S1", antminer_s1_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c index 010c461..aa54e9c 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c @@ -42,15 +42,15 @@ static struct flash_platform_data ANTMINER_S3_flash_data = { static struct gpio_led ANTMINER_S3_leds_gpio[] __initdata = { { - .name = "bitmain:green:wlan", + .name = "antminer-s3:green:wlan", .gpio = ANTMINER_S3_GPIO_LED_WLAN, .active_low = 0, },{ - .name = "bitmain:green:system", + .name = "antminer-s3:green:system", .gpio = ANTMINER_S3_GPIO_LED_SYSTEM, .active_low = 0, },{ - .name = "bitmain:yellow:lan", + .name = "antminer-s3:yellow:lan", .gpio = ANTMINER_S3_GPIO_LED_LAN, .active_low = 0, }, @@ -95,4 +95,4 @@ static void __init antminer_s3_setup(void) } MIPS_MACHINE(ATH79_MACH_ANTMINER_S3, "ANTMINER-S3", - "Bitmain Antminer S3", antminer_s3_setup); + "Antminer-S3", antminer_s3_setup); diff --git a/target/linux/ar71xx/generic/profiles/antminer.mk b/target/linux/ar71xx/generic/profiles/antminer.mk index 404133b..d59a089 100644 --- a/target/linux/ar71xx/generic/profiles/antminer.mk +++ b/target/linux/ar71xx/generic/profiles/antminer.mk @@ -5,24 +5,24 @@ # See /LICENSE for more information. # -define Profile/ANTMINER_S1 - NAME:=Antminer S1 +define Profile/ANTMINERS1 + NAME:=Antminer-S1 PACKAGES:=kmod-usb-core kmod-usb2 kmod-crypto-manager kmod-i2c-gpio-custom kmod-usb-hid endef -define Profile/ANTMINER_S1/Description +define Profile/ANTMINERS1/Description Package set optimized for the Bitmain Antminer S1. endef -$(eval $(call Profile,ANTMINER_S1)) +$(eval $(call Profile,ANTMINERS1)) -define Profile/ANTMINER_S3 - NAME:=Antminer S3 +define Profile/ANTMINERS3 + NAME:=Antminer-S3 PACKAGES:=kmod-usb-core kmod-usb2 kmod-crypto-manager kmod-i2c-gpio-custom kmod-usb-hid endef -define Profile/ANTMINER_S1/Description +define Profile/ANTMINERS3/Description Package set optimized for the Bitmain Antminer S3. endef -$(eval $(call Profile,ANTMINER_S3)) +$(eval $(call Profile,ANTMINERS3)) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 6dad0d2..24363aa 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -372,19 +372,19 @@ endef TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 define Device/antminer-s1 - $(Device/tplink-8mlzma) - BOARDNAME := ANTMINER-S1 - DEVICE_PROFILE := ANTMINER_S1 - TPLINK_HWID := 0x04440001 - CONSOLE := ttyATH0,115200 + $(Device/tplink-8mlzma) + BOARDNAME := ANTMINER-S1 + DEVICE_PROFILE := ANTMINERS1 + TPLINK_HWID := 0x04440101 + CONSOLE := ttyATH0,115200 endef define Device/antminer-s3 - $(Device/tplink-8mlzma) - BOARDNAME := ANTMINER-S3 - DEVICE_PROFILE := ANTMINER_S3 - TPLINK_HWID := 0x04440003 - CONSOLE := ttyATH0,115200 + $(Device/tplink-8mlzma) + BOARDNAME := ANTMINER-S3 + DEVICE_PROFILE := ANTMINERS3 + TPLINK_HWID := 0x04440301 + CONSOLE := ttyATH0,115200 endef define Device/el-m150 diff --git a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch index 8ee0d3f..17cabe1 100644 --- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch +++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch @@ -9,8 +9,8 @@ + ATH79_MACH_ALL0258N, /* Allnet ALL0258N */ + ATH79_MACH_ALL0305, /* Allnet ALL0305 */ + ATH79_MACH_ALL0315N, /* Allnet ALL0315N */ -+ ATH79_MACH_ANTMINER_S1, /* Bitmain Antminer S1 */ -+ ATH79_MACH_ANTMINER_S3, /* Bitmain Antminer S3 */ ++ ATH79_MACH_ANTMINER_S1, /* Antminer S1 */ ++ ATH79_MACH_ANTMINER_S3, /* Antminer S3 */ + ATH79_MACH_AP113, /* Atheros AP113 reference board */ ATH79_MACH_AP121, /* Atheros AP121 reference board */ ATH79_MACH_AP121_MINI, /* Atheros AP121-MINI reference board */ diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c index 1302d46..9ecafc6 100644 --- a/tools/firmware-utils/src/mktplinkfw.c +++ b/tools/firmware-utils/src/mktplinkfw.c @@ -31,8 +31,8 @@ #define HEADER_VERSION_V1 0x01000000 #define HEADER_VERSION_V2 0x02000000 -#define HWID_ANTMINER_S1 0x04440001 -#define HWID_ANTMINER_S3 0x04440003 +#define HWID_ANTMINER_S1 0x04440101 +#define HWID_ANTMINER_S3 0x04440301 #define HWID_GL_INET_V1 0x08000001 #define HWID_GS_OOLITE_V1 0x3C000101 #define HWID_ONION_OMEGA 0x04700001 @@ -434,6 +434,11 @@ static struct board_info boards[] = { .hw_rev = 1, .layout_id = "8Mlzma", }, { + .id = "ANTMINER-S3", + .hw_id = HWID_ANTMINER_S3, + .hw_rev = 1, + .layout_id = "8Mlzma", + }, { /* terminating entry */ } };