From patchwork Sat Oct 24 09:15:34 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: 535375 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 1C0761402CC for ; Sat, 24 Oct 2015 20:16:46 +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=BeYhLUD+; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1A8082803D9; Sat, 24 Oct 2015 11:15:00 +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 F29D32800BA for ; Sat, 24 Oct 2015 11:14:52 +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-oi0-f42.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 24 Oct 2015 11:14:51 +0200 (CEST) Received: by oiad129 with SMTP id d129so77825184oia.0 for ; Sat, 24 Oct 2015 02:16:30 -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=sXJfVA05uuRj4MEXAUd/mztzX8ioMnE1gkQFa8gyZLc=; b=BeYhLUD+H2FkBAMc4aS9WXpAUyo4UuAjtYdCcgO866A4fuBRcuMt2yEhY8qW6bDxlw na7MNsbmSw8jZJJY8XeBo7R1mhmmEvetsVaiLhl/2O18JIDKTD3fxCmPwTA5ow1ULQ+H NR/XOz7A3zr0P7jAA2nYONzACnFIccuGMUc6IZiYJvYDx1np9PL8GN4rUTBiv2HL2rod AFj4wDNBGOV0C18oe4EoC5OO8C+4EmkJ2b/G5qFdDaqV+2u0OX3Xq0MkVJR88N4vhO0j AXygGvHBzDD3U57YLNAqtcNtw1F18BXcGMAjbigiKJJy82QZ2TzOQWG2SyH5ckVASvvd tuOQ== X-Received: by 10.202.201.200 with SMTP id z191mr17303884oif.112.1445678189806; Sat, 24 Oct 2015 02:16:29 -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 w139sm3492144oiw.16.2015.10.24.02.16.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Oct 2015 02:16:29 -0700 (PDT) From: "L. D. Pinney" To: OpenWrt Development List Date: Sat, 24 Oct 2015 04:15:34 -0500 Message-Id: <1445678134-2671-1-git-send-email-ldpinney@gmail.com> X-Mailer: git-send-email 2.6.1 Subject: [OpenWrt-Devel] [PATCH] ar71xx: Bitmain Antminer S1/S3 set GPIO for USB Power 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" Antminers using the stock bootloader will not hash without this GPIO set. Applies to DD and CC Signed-off-by: L. D. Pinney --- target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c | 2 +- target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s3.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 880bc72..0a81227 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 @@ -26,7 +26,7 @@ #define ANTMINER_S1_GPIO_LED_SYSTEM 23 #define ANTMINER_S1_GPIO_LED_WLAN 0 -#define ANTMINER_S1_GPIO_USB_POWER 8 +#define ANTMINER_S1_GPIO_USB_POWER 26 #define ANTMINER_S1_KEYSPOLL_INTERVAL 20 /* msecs */ #define ANTMINER_S1_KEYSDEBOUNCE_INTERVAL (3 * ANTMINER_S1_KEYSPOLL_INTERVAL) 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 aa54e9c..b77a6cc 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 @@ -25,6 +25,7 @@ #define ANTMINER_S3_GPIO_LED_WLAN 0 #define ANTMINER_S3_GPIO_LED_SYSTEM 17 #define ANTMINER_S3_GPIO_LED_LAN 22 +#define ANTMINER_S3_GPIO_USB_POWER 26 #define ANTMINER_S3_GPIO_BTN_RESET 11 @@ -81,6 +82,10 @@ static void __init antminer_s3_setup(void) ath79_register_gpio_keys_polled(-1, ANTMINER_S3_KEYSPOLL_INTERVAL, ARRAY_SIZE(ANTMINER_S3_GPIO_keys), ANTMINER_S3_GPIO_keys); + + gpio_request_one(ANTMINER_S3_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); ath79_register_usb(); ath79_register_m25p80(&ANTMINER_S3_flash_data);