From patchwork Sun Jul 14 16:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuanhong Guo X-Patchwork-Id: 1131756 X-Patchwork-Delegate: gch981213@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nb6vLM3U"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l9TtadNJ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45msjv6knDz9sLt for ; Mon, 15 Jul 2019 02:36:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bHy/PfxUj4r8KtYw1EFJVctvdhkGB8mP7Q6Hu2EwZTQ=; b=nb6vLM3UxtuYPl VF7PWcHV5n1PRaks61A4rhmRY8D0fAOmdvY3vJkYshFKPNM/zjViBrn5I2YchM8yfimc1ZjpTuEUl ZeA6FgdMSfRzEAbyEOjG025mynlv0h3VGRhQg9VbjYoeDX2SNaKMRdmktFSiNKxgm1fUWsPQBigkY SYiigZDGnFlke7y6tVIfZJ20sg65xc7Ttgk95AdgGsy2ROwANd4cFhy9hveJuvithRst27CWErDAG bOAFqcsI+/1u7ZpDBfQC2hHA8OZ/i0vLvTOLSOZgDXgnSdMSIS5CH61LROi5YiqXiTE7Jj4D/VG2p 4UbaVsSOqe9xS6LG9aaA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hmhTx-0001WH-ST; Sun, 14 Jul 2019 16:36:13 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hmhSn-0007zt-DX for openwrt-devel@lists.openwrt.org; Sun, 14 Jul 2019 16:35:03 +0000 Received: by mail-pg1-x544.google.com with SMTP id w10so6582940pgj.7 for ; Sun, 14 Jul 2019 09:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gjbJF2HZJwlHFJJtbHjekUdFxuipkOnBe4DLEWwGRAI=; b=l9TtadNJzKIrl5ufdtKqhlkCyuuQ+1EK2eGjs/+7NVzaz43zKXddTvhzKSLc0q33u0 36wRNyopJZGHEzy377JR7fJCgpmtM/GVUdayjfFQfQEkdv2R8ctQiD+Ns1Ueha/6sPJZ z+3slXKTFjnwC0kemN4OBBY/7h0ZihiRva7HsVDONX8tzeqwWcGxysiR3lTgss7xOcBz LqI8qJnFDSHDyubuyY7QbafeB4l2cRoq0fNQ4ACRgKeMOX2kB0DHzfYDjXLuzveYIDku MHdd4ZVCOiQZIZx5q6s+fysqWqJS4rDQ2nzuIBcOHq6YEDxymJRFiDJYcEo0HGxy1WMX 7s/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gjbJF2HZJwlHFJJtbHjekUdFxuipkOnBe4DLEWwGRAI=; b=HgkJwDYG98T/53gCLpwNOiZCGJ4AZA+/sBB2Bu0k5LqepaKPSMVb3usKZ67cZme6/8 Pg4S+F7fERzh+8WsXBdt8q44lfiuof1nUdVcCKu856TRUfsTRgoz+dy1yjkptMt/xNIp T5e8t62hKE9jTFEgmMTgTANO2q50XFoNHxRjVhPzbKjJmexjZxBrrRrSqiNji2r4esbs Zmsc8e1T327sXzoPuO3mq0LoyB66rfd7M+NBQu2lAjTjxiAwxoJn4VkBSC4PtqVDbKBu CS0MkevhzDTkKAOJgViSoYK5u6oXi8Y7EDXmoMjzznrJMWYzd8F6pNlxs4xGoUoE99By pABQ== X-Gm-Message-State: APjAAAWshys0qEpOUhDtPxRPp58lwE2wWDP4yDnifdJjRnezZEJpZR3E r+pya1I17OsgbpoS8fcfOEL/Z2/xulY= X-Google-Smtp-Source: APXvYqxFNOnAkAzej2ROhmoRXjI5daMXqzX0+UflNiacbcolRblXe0D1oygizGuZYJKUaZLNbZ74Jg== X-Received: by 2002:a63:505a:: with SMTP id q26mr21824950pgl.18.1563122096141; Sun, 14 Jul 2019 09:34:56 -0700 (PDT) Received: from guoguo-omen-lan.lan ([27.155.236.112]) by smtp.gmail.com with ESMTPSA id d17sm505805pgl.66.2019.07.14.09.34.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 14 Jul 2019 09:34:55 -0700 (PDT) From: Chuanhong Guo To: openwrt-devel@lists.openwrt.org Date: Mon, 15 Jul 2019 00:34:26 +0800 Message-Id: <20190714163428.26303-2-gch981213@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190714163428.26303-1-gch981213@gmail.com> References: <20190714163428.26303-1-gch981213@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190714_093501_466090_0129B191 X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (gch981213[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gch981213[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH RFC 1/3] ramips: mtk-mmc: mt76x8: check ESD_MODE before applying AGPIO_CFG X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chuanhong Guo Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Since mt76x8an ver1 eco2, SDXC pins can be switched to the following pinmap: sd_d1 -> PAD_I2S_SDI sd_d0 -> PAD_I2S_WS sd_cmd -> PAD_I2S_CLK sd_d3 -> PAD_I2C_SCLK sd_d2 -> PAD_I2C_SD sd_clk -> PAD_GPIO0 sd_wp -> PAD_TXD1 sd_cd -> PAD_RXD1 To use this pinmap, one would need to set ESD_MODE bit (bit 15) to 1 in GPIO1_MODE and switch other used pads into GPIO mode. In this mode, we don't need to switch ethernet pins to digital pad. Check ESD_MODE bit before applying AGPIO_CFG and use rt_sysc_m32 to set it. Signed-off-by: Chuanhong Guo --- .../ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c index 4ced4b6605..cb0aa4231a 100644 --- a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c +++ b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c @@ -2205,16 +2205,12 @@ static int msdc_drv_probe(struct platform_device *pdev) struct msdc_host *host; struct msdc_hw *hw; int ret; - u32 reg; //FIXME: this should be done by pinconf and not by the sd driver - if (ralink_soc == MT762X_SOC_MT7688 || - ralink_soc == MT762X_SOC_MT7628AN) { - /* set EPHY pads to digital mode */ - reg = sdr_read32((void __iomem *)(RALINK_SYSCTL_BASE + 0x3c)); - reg |= 0x1e << 16; - sdr_write32((void __iomem *)(RALINK_SYSCTL_BASE + 0x3c), reg); - } + if ((ralink_soc == MT762X_SOC_MT7688 || + ralink_soc == MT762X_SOC_MT7628AN) && + (!(rt_sysc_r32(0x60) & BIT(15)))) + rt_sysc_m32(0xf << 17, 0xf << 17, 0x3c); hw = &msdc0_hw; From patchwork Sun Jul 14 16:34:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuanhong Guo X-Patchwork-Id: 1131754 X-Patchwork-Delegate: gch981213@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VEesf805"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TcttI57v"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45msjD14C7z9sLt for ; Mon, 15 Jul 2019 02:35:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dDpG80fItmKR/aiTVnmGAFJNbzixqv96QdBmAoO7A9k=; b=VEesf805T7Jyn6 qToMVRGLoOWMZ6EC4Muk29AA5YNQlVWbXfZcm6jJg1fMN4+lnRDT7B4kcPrSmwXhG+5nt5o0BZn+W ugKGkZwurJMvCW3LEe38IBw7OwSGfWpQqBkRqTX0toqDFjXtyobIG2rZ/UMnIyF0WvKECyuihjXgT gARHCAvUYZX5uDOMUK3P137kM6PjRWvzEiAotv9cIEHBuqzgvkND1lEnWKEyFwrzSvYqs+SKB7Hc9 b5li9WKoN5A4nT91++yQxr2jyE+A1LvktzqCUGJOYYbcqi+yBhW7vgdx2HeyDVVT6n8Qt4dUT/8U4 CNw5F1Nd5betDDQeZ4KA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hmhTF-0000vp-3Z; Sun, 14 Jul 2019 16:35:29 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hmhSm-0007zv-1O for openwrt-devel@lists.openwrt.org; Sun, 14 Jul 2019 16:35:02 +0000 Received: by mail-pf1-x442.google.com with SMTP id g2so6342571pfq.0 for ; Sun, 14 Jul 2019 09:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/wT+GtzOuq2kiXQFoVZ+bW5avJCos8jADO+SBtV8lAM=; b=TcttI57voo1/EziL0bmywY1DNhamYoE0YWwZNOQtLJLyqHoSyMAgx+nTyjwz1RpCcR C+Xpnc52in8zFY6HB/Xpd3sNpyFM5CKe/6vf4bl4lF748ueMiiEmhIs8OTRF43dAMDRN XOBrCyKlByBUf2I/I+JnGGn/ZulzKEfwUsvlXW0voeVXN8WibhiL6gC4LSEoVIUQ4yXW 56ogG6sej4OHSzh9LxfoM+7bubjj3iWrl58UDEn8GCHKzyyGIRMnXb5MAmXbil9qF7Qc 3bHUhNOXZI7AfJyRfCuc2CWCirHJ3a1z28mXUKS2494Ne4xickfTy0Uf4B6joY2c06vP 9ugQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/wT+GtzOuq2kiXQFoVZ+bW5avJCos8jADO+SBtV8lAM=; b=DC5rDlCOxBBSEK1EzlRP753jqUTJ5IUXcFgNakh+uabRDavKiJxu6gTkZiXNJQ34/k jasufokilqvGVD8QIYX2vZEF1HrSpDFyWbW+cnVGtFtRao8ZFwT+PEIqUxvRojAqEbKy x4CzPzs3C/ndmarB4/nCbnut8irbGnoqUuUSnw+J/Md/2eX+is7D4sZfMaERfowoLjgR na4NDwWjF6B5LKPjptSXEmzidsKR9y2DBBTWJTPEsjtrRGyvPabirgyCXTeV00/+K5dp Sfyee0/a98klAcC+tyajV+HN6BzurzSNCgEfDIyyd6sLWdnUeWioCAgAhQOpqQuYK9+I Ntlw== X-Gm-Message-State: APjAAAWgGlIGttme5TzL2ELPkqwQPdzb4dThWBCUKaFy0WaPGghbQq8T sIhVtCUP1dXZhLzUdp7Ou5Tewle5lqg= X-Google-Smtp-Source: APXvYqyTtN7R62OYlqUL90DKfWStVYtR3k03+sB+SasuxbBMTmlVurUBa+wsVhntxbQ+PXyCXgXhCA== X-Received: by 2002:a17:90a:360b:: with SMTP id s11mr24129809pjb.51.1563122097876; Sun, 14 Jul 2019 09:34:57 -0700 (PDT) Received: from guoguo-omen-lan.lan ([27.155.236.112]) by smtp.gmail.com with ESMTPSA id d17sm505805pgl.66.2019.07.14.09.34.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 14 Jul 2019 09:34:57 -0700 (PDT) From: Chuanhong Guo To: openwrt-devel@lists.openwrt.org Date: Mon, 15 Jul 2019 00:34:27 +0800 Message-Id: <20190714163428.26303-3-gch981213@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190714163428.26303-1-gch981213@gmail.com> References: <20190714163428.26303-1-gch981213@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190714_093500_086188_4A399808 X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (gch981213[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gch981213[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH RFC 2/3] ramips: mt76x8: pinctrl: add a hack for ESD_MODE bit in GPIO1_MODE X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chuanhong Guo Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This bit is used to specify sdxc pinmap for mt76x8. Details available in patch description. To properly solve this problem and the other pinctrl hack in mtk-mmc driver we'll need to write a dedicated pinctrl driver for mt76x8, with the support for configuring AGPIO_MODE and RGCTL registers as well as specially handling GPIO reservation/pinctrl setup for ESDMODE. Signed-off-by: Chuanhong Guo --- .../500-hack-mt76x8-pinctrl-esdmode.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 target/linux/ramips/patches-4.14/500-hack-mt76x8-pinctrl-esdmode.patch diff --git a/target/linux/ramips/patches-4.14/500-hack-mt76x8-pinctrl-esdmode.patch b/target/linux/ramips/patches-4.14/500-hack-mt76x8-pinctrl-esdmode.patch new file mode 100644 index 0000000000..af8ce1257a --- /dev/null +++ b/target/linux/ramips/patches-4.14/500-hack-mt76x8-pinctrl-esdmode.patch @@ -0,0 +1,55 @@ +From: Chuanhong Guo +Date: Sat, 13 Jul 2019 17:59:03 +0800 +Subject: [PATCH] ramips: hack: add esdmode pinctrl group + +Since mt76x8an ver1 eco2, SDXC pins can be switched to the +following pinmap: +sd_d1 -> PAD_I2S_SDI +sd_d0 -> PAD_I2S_WS +sd_cmd -> PAD_I2S_CLK +sd_d3 -> PAD_I2C_SCLK +sd_d2 -> PAD_I2C_SD +sd_clk -> PAD_GPIO0 +sd_wp -> PAD_TXD1 +sd_cd -> PAD_RXD1 + +To use this pinmap, one would need to set ESD_MODE bit (bit 15) +to 1 in GPIO1_MODE and switch other used pads into GPIO mode. + +MTK called this pinmap "router mode" and the pinmap described +in their datasheed is called "iot mode". + +This patch is hacky because: +1. pinmux-rt2880 doesn't support reserving noncontiguous GPIO + pins so those GPIOs can't be properly reserved. +2. it misused "gpio" function for "iot mode", due to the fact + that this mode doesn't reserve any GPIOs. + +Signed-off-by: Chuanhong Guo +--- +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -149,6 +149,7 @@ static struct rt2880_pmx_func refclk_grp + static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) }; + static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; + static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; ++static struct rt2880_pmx_func esd_mode_grp_mt7628[] = { FUNC("sdxc", 1, 0, 0) }; + + static struct rt2880_pmx_func sd_mode_grp_mt7628[] = { + FUNC("jtag", 3, 22, 8), +@@ -297,6 +298,7 @@ static struct rt2880_pmx_func wled_an_gr + #define MT7628_GPIO_MODE_I2C 20 + #define MT7628_GPIO_MODE_REFCLK 18 + #define MT7628_GPIO_MODE_PERST 16 ++#define MT7628_GPIO_MODE_ESDMODE 15 + #define MT7628_GPIO_MODE_WDT 14 + #define MT7628_GPIO_MODE_SPI 12 + #define MT7628_GPIO_MODE_SDMODE 10 +@@ -319,6 +321,7 @@ static struct rt2880_pmx_group mt7628an_ + 1, MT7628_GPIO_MODE_I2C), + GRP("refclk", refclk_grp_mt7628, 1, MT7628_GPIO_MODE_REFCLK), + GRP("perst", perst_grp_mt7628, 1, MT7628_GPIO_MODE_PERST), ++ GRP_G("esdmode", esd_mode_grp_mt7628, 1, 0, MT7628_GPIO_MODE_ESDMODE), + GRP("wdt", wdt_grp_mt7628, 1, MT7628_GPIO_MODE_WDT), + GRP("spi", spi_grp_mt7628, 1, MT7628_GPIO_MODE_SPI), + GRP_G("sdmode", sd_mode_grp_mt7628, MT7628_GPIO_MODE_MASK, From patchwork Sun Jul 14 16:34:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuanhong Guo X-Patchwork-Id: 1131755 X-Patchwork-Delegate: gch981213@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LILS8c0/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IMrOxRQV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45msjg02nCz9sLt for ; Mon, 15 Jul 2019 02:36:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1grhscpkdHau3PpTtDqjuqEFntzVG9/B8q+G/amS7Vs=; b=LILS8c0/WadTZw NVsZASNf5buUlqzfm6p6H17iImuAPQKrK4HUfDJkIfGaMVaxXqqXUW1J05rP2vg7zLM/og1k7xiYX k4wIb8dJluFAqE/elTD+z8etz8WgK56898q3beJrGBi+Ljw/ti/Yh3Ux/CBNwmhSABrJWVoTEPS/G 9cF6hOF+WHXTPMCOq/hNWjkCOANd/2auESBJkfiscz3XwQeINsH134+cV15YnherEGIGjaIC3PYTm AibK54iFeDTjWTPIQN/NJlgyHiRaJZDrCNbptOcUHCX5h5mwLYk8jF0zD7nh9dbOmmjrmx2W1tp2a GpiMpAQW+B96p0GyIz/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hmhTc-0001Ec-Ec; Sun, 14 Jul 2019 16:35:52 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hmhSn-00080R-Dy for openwrt-devel@lists.openwrt.org; Sun, 14 Jul 2019 16:35:03 +0000 Received: by mail-pg1-x543.google.com with SMTP id s1so275250pgr.2 for ; Sun, 14 Jul 2019 09:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IbTZ/30uCARBLb5uo433NADgPHOJN452tnY7aqyYaX0=; b=IMrOxRQVwjNQC48f+vkTAdHvnnVO8FpP7AIQTGu/K4dMjZgDXPBYLUxE55SFjy0XvR 6RILAideY2F6rrOb8WpCfGS6VAWyALwr7tdu/MZtnCWey4Ztly4X5KCQOLHu+ulrIMaX uKsvI+B/DN3We7oJ5bUKPNI3LjG89/oq0QKB+8jIHX0jEsrcP7QPlcAVHhVzLM0CFDNi PC4JhtIofJ9zRLwSAiFan3BxD2nG4bt2CD3fztgOjk1SbJvfEAI++C4+8b5qXrU1Luhw mBVCg7t9WfxS9icHdw6oRROdb9Z29wi2pp5zmoZfZeMzxN+0F6+Hadncv8FV7NieUhC1 0TWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IbTZ/30uCARBLb5uo433NADgPHOJN452tnY7aqyYaX0=; b=hr2tpohAMFBns6RceQoGf5mRRIV0h3wdc4KOITPV9U8MDKWV+wbMSnFr9sr21HqLia CKNWHTsphitXwHMlotwUNImxNHaR6Md+nb46tpZyN5quZS/+80P+ElV8h2A2MoW8ZFcu GNHbXBzp+RlElDWEy8gSFs5lvvEDtbVIm65U+x7n425t/YpLTad9XGxQ7gpmfWb+TDWA HnzXWgwADRu+D1NLakaEZ/nOlEwsl5TrZ60I22dO85I1W7m2MidytGdH8fSdF+e3dtly xz9wi85B3owk4WeiqjemQYKvE8Ho8VMEU5d11iE3UyAfk2WNa8MvnedYwWxTfmoPJ1tm KaPg== X-Gm-Message-State: APjAAAV3T2AS4ch139FoUAloUq3zp69DUTusi9N7iP4VQ5op4Wxxb2Gh wLaian6d98THdHjnsl+i9YGCs0FTKN8= X-Google-Smtp-Source: APXvYqwV2cd8+guq7T2EaP2+6kxBqKfHgKIMzibkseLVqhxPerM2RvBzxOzkg5zfuYPPddbf3CLZxg== X-Received: by 2002:a63:4f5b:: with SMTP id p27mr22052227pgl.273.1563122099415; Sun, 14 Jul 2019 09:34:59 -0700 (PDT) Received: from guoguo-omen-lan.lan ([27.155.236.112]) by smtp.gmail.com with ESMTPSA id d17sm505805pgl.66.2019.07.14.09.34.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 14 Jul 2019 09:34:59 -0700 (PDT) From: Chuanhong Guo To: openwrt-devel@lists.openwrt.org Date: Mon, 15 Jul 2019 00:34:28 +0800 Message-Id: <20190714163428.26303-4-gch981213@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190714163428.26303-1-gch981213@gmail.com> References: <20190714163428.26303-1-gch981213@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190714_093501_474517_9E59ADC1 X-CRM114-Status: UNSURE ( 8.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (gch981213[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gch981213[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH RFC 3/3] ramips: enable sdxc driver for hc5661a X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chuanhong Guo Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Since we've fixed AGPIO_MODE setup in sdxc driver, we can enable SDXC interface for HC5661A now. Signed-off-by: Chuanhong Guo --- pinctrl disallows "double enable" for a function (meaning can't set a group to gpio twice), so the gpio group needs to be specified for every dts and can't be put into mt7628.dtsi .../ramips/dts/mt7628an_hiwifi_hc5661a.dts | 17 +++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 1 + 2 files changed, 18 insertions(+) diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts index df239e1fb8..3ba3774f1c 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5661a.dts @@ -50,6 +50,18 @@ }; &pinctrl { + sdxc_router_pins: sdxc_router_mode { + gpio { + ralink,group = "i2s", "sdmode", "uart1", "gpio"; + ralink,function = "gpio"; + }; + + esdmode { + ralink,group = "esdmode"; + ralink,function = "sdxc"; + }; + }; + state_default: pinctrl0 { gpio { ralink,group = "i2c", "refclk", "wled_an"; @@ -58,6 +70,11 @@ }; }; +&sdhci { + status = "okay"; + pinctrl-0 = <&sdxc_router_pins>; +}; + &spi0 { status = "okay"; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index fae9fb03cf..033cc7527d 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -97,6 +97,7 @@ define Device/hiwifi_hc5661a DEVICE_VENDOR := HiWiFi DEVICE_MODEL := HC5661A SUPPORTED_DEVICES += hc5661a + DEVICE_PACKAGES := kmod-sdhci-mt7620 endef TARGET_DEVICES += hiwifi_hc5661a