From patchwork Thu May 19 18:20:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 624182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r9fd76Q13z9sdg for ; Fri, 20 May 2016 04:25:31 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=biFVnDZL; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id ECF12B92008; Thu, 19 May 2016 20:22:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Thu, 19 May 2016 20:22:17 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id F22C7B91FB1 for ; Thu, 19 May 2016 20:21:51 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .open-mesh. - helo: .mail-wm0-f51.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 19 May 2016 20:21:51 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id n129so242727788wmn.1 for ; Thu, 19 May 2016 11:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fD5x1vFfwB0wtdAqfz2eiUN131W+5+dAm61X3NDRVag=; b=biFVnDZLBs0mTCRX/qI88tinKBf2W94BqJCOCtSnBc6myLh1iRz0R7cFM8QC7m1qLR 9fBNOu2RC1u9dVuHf5g3u0vOC93IkJCczcqOhc+C0T0szYkztDQ0fVArXrDpfxvkAPFY eXxH05i5Mh44dIPFbaQMyQrDsnVRaAUO4uNPGeZa7tOlFSYPTRCLlk7Shb2p4bDiTShB Xnhu6xA57rTuj6pnVJw6xeVzEmSXLUGMV/bbF9WDoTLlIiRKWCVPYbOtVUVSNGjL+Fzy rdSnx1i4py827UjsdLXYdt+YPQzH0SdA6xXviOwTH2JeYIqyKGa3XlnSd/x9d6sGEAR1 sutw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fD5x1vFfwB0wtdAqfz2eiUN131W+5+dAm61X3NDRVag=; b=cJnk4sHTuURBQyMBR16MVFeEVRsLr7OMqQmXd1YcGaHEM9+0Kmez6qr7T9t70qVUcn KMip5aXVkeXe13QaG6W9yHNx1RaNmX7pnBM14cU+d51euYg40im5Ajcy3lRj/t28IAX/ hlsHu4QpTstBFdOfxjtY3fziNPyCPfum+I4vBSknhKk5LQpiKcohpcBimKf2vSlc4+Mt FUKljeRpdmLS0PLhTAieukRETUO85/OARNzc0tKklh10Bt1/EZ4wBTo3thHO6ZeiU7Gt nMDzcwXvpKVXtqBfiPKyNeJRf3QwAcAPD4pHC0RNk9GE8JU31muRECIJcb8+Pnly2v0N WPng== X-Gm-Message-State: AOPr4FVWfnA0eBAVWtCTOZuZJETNCTBObuDFfabj23FccLXlzIG9gpN9+XzOIjoiHj9bfxJ8 X-Received: by 10.28.15.79 with SMTP id 76mr15748399wmp.53.1463682111386; Thu, 19 May 2016 11:21:51 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p579E6DC9.dip0.t-ipconnect.de. [87.158.109.201]) by smtp.gmail.com with ESMTPSA id c7sm10219143wji.38.2016.05.19.11.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 11:21:50 -0700 (PDT) From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Date: Thu, 19 May 2016 20:20:54 +0200 Message-Id: <1463682077-19339-11-git-send-email-sven.eckelmann@open-mesh.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1463682077-19339-1-git-send-email-sven.eckelmann@open-mesh.com> References: <1463682077-19339-1-git-send-email-sven.eckelmann@open-mesh.com> Subject: [OpenWrt-Devel] [PATCH CC 11/34] ar71xx: Allow to use ath79_gpio_output_select on QCA955x X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Sven Eckelmann Backport of r46459 --- ...79-add-gpio-func-register-for-QCA955x-SoC.patch | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch new file mode 100644 index 0000000..24ce7d8 --- /dev/null +++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch @@ -0,0 +1,60 @@ +--- a/arch/mips/ath79/gpio.c ++++ b/arch/mips/ath79/gpio.c +@@ -185,15 +185,27 @@ void __init ath79_gpio_output_select(uns + { + void __iomem *base = ath79_gpio_base; + unsigned long flags; +- unsigned int reg; ++ unsigned int reg, reg_base; ++ unsigned long gpio_count; + u32 t, s; + +- BUG_ON(!soc_is_ar934x() && !soc_is_qca953x()); ++ if (soc_is_ar934x()) { ++ gpio_count = AR934X_GPIO_COUNT; ++ reg_base = AR934X_GPIO_REG_OUT_FUNC0; ++ } else if (soc_is_qca953x()) { ++ gpio_count = QCA953X_GPIO_COUNT; ++ reg_base = QCA953X_GPIO_REG_OUT_FUNC0; ++ } else if (soc_is_qca955x()) { ++ gpio_count = QCA955X_GPIO_COUNT; ++ reg_base = QCA955X_GPIO_REG_OUT_FUNC0; ++ } else { ++ BUG(); ++ } + +- if (gpio >= AR934X_GPIO_COUNT) ++ if (gpio >= gpio_count) + return; + +- reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); ++ reg = reg_base + 4 * (gpio / 4); + s = 8 * (gpio % 4); + + spin_lock_irqsave(&ath79_gpio_lock, flags); +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -868,6 +868,14 @@ + #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 + #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 + ++#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c ++#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 ++#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 ++#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 ++#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c ++#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 ++#define QCA955X_GPIO_REG_FUNC 0x6c ++ + #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c + #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 + #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 +@@ -1007,6 +1015,8 @@ + #define AR934X_GPIO_OUT_EXT_LNA0 46 + #define AR934X_GPIO_OUT_EXT_LNA1 47 + ++#define QCA955X_GPIO_OUT_GPIO 0 ++ + /* + * MII_CTRL block + */