From patchwork Thu Nov 14 12:54:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Mikhaylov X-Patchwork-Id: 11243679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDC8313BD for ; Thu, 14 Nov 2019 12:55:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBDF620715 for ; Thu, 14 Nov 2019 12:55:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="na9kAOKU"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=yadro.com header.i=@yadro.com header.b="SfYLtX1T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBDF620715 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=yadro.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WmzlLtuAJjw+O8jvKm8AEzP5aTTQP9w7zq/4MwLfcqQ=; b=na9kAOKU37eacX EU3c905E6w1g8RDcsMhGgfXc/JL6sJAS0lb8zea5LIMZEwdemaAG1Bq3azhv6wSIo7wgyoDw71sYM nmufGlgDucykp2D3oJrE5dkUXXCvnn308SjojlalCebvudxezl1TM6aO6jjD/pTIYQvLPfLGQkjdH qDQxumPVgts4EMp/wb/VtHeuFTQYzMQP6vEfXQi8DQph0XLp3/KBN1yHTyHn6vnHJ+IIrGlfVeWDH ZPfgYJrAN3AsQ+QynS6VjILQx9FPRGG2ZutiHJx8k148+PGZACtAoMMtTUnppBy5VSFNa+3mjTQot MgoPmCoZ6G6JLhck+D+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVEeb-00040K-LV; Thu, 14 Nov 2019 12:55:17 +0000 Received: from mta-02.yadro.com ([89.207.88.252] helo=mta-01.yadro.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVEeJ-0002X0-73 for linux-arm-kernel@lists.infradead.org; Thu, 14 Nov 2019 12:55:00 +0000 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id B971B42F12; Thu, 14 Nov 2019 12:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1573736096; x=1575550497; bh=GLiHq3+6zZ2/iuahpZbFing2AcId/JGBvnZ w1df2dRQ=; b=SfYLtX1TNz7/hcmnP+PKryBn/Oxb9OKW6m6FPYOIhZr5slz6Sxb Ji1QSkoBFLCV9yv7rKFBVkQLYeor8ay7VubmDnupHzT4o3jIOAtP7lMmCqkpw4Q4 a8WUdpbmqIK7heqwMzP9Ob72XKeMHYN5yWYH+tXigEDR15bHabeZ4spI= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EfH77rqwKRmS; Thu, 14 Nov 2019 15:54:56 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 72BD142E7D; Thu, 14 Nov 2019 15:54:55 +0300 (MSK) Received: from localhost.dev.yadro.com (172.17.15.69) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Thu, 14 Nov 2019 15:54:53 +0300 From: Ivan Mikhaylov To: Subject: [PATCH v2 1/2] aspeed: dts: add sd card for vesnin Date: Thu, 14 Nov 2019 15:54:34 +0300 Message-ID: <20191114125435.27756-2-i.mikhaylov@yadro.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191114125435.27756-1-i.mikhaylov@yadro.com> References: <20191114125435.27756-1-i.mikhaylov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.15.69] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191114_045459_429248_E92A311D X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Ulf Hansson , linux-aspeed@lists.ozlabs.org, Andrew Jeffery , openbmc@lists.ozlabs.org, linux-mmc@vger.kernel.org, Adrian Hunter , linux-kernel@vger.kernel.org, Rob Herring , Joel Stanley , Ivan Mikhaylov , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Presence signal is inverted for vesnin boards, 'cd-inverted' added for invertion signal enablement. Vesnin BMC uses microSD, there is no WP switch, 'disable-wp' is used for this purpose. Signed-off-by: Ivan Mikhaylov diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts b/arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts index a27c88d23056..7ae3436e0d99 100644 --- a/arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts +++ b/arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts @@ -232,3 +232,16 @@ &wdt2 { aspeed,alt-boot; }; + +&sdmmc { + status = "okay"; +}; + +&sdhci1 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sd2_default>; + cd-inverted; + disable-wp; +}; From patchwork Thu Nov 14 12:54:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Mikhaylov X-Patchwork-Id: 11243681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E0AB138C for ; Thu, 14 Nov 2019 12:55:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04777206E1 for ; Thu, 14 Nov 2019 12:55:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DofwPVIn"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=yadro.com header.i=@yadro.com header.b="TYwELifC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04777206E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=yadro.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Km2fc0R8ddkZLtChEQPppy2RNSIv4ar9ffatCB7Ub2M=; b=DofwPVInKqv5o9 kfcjDgydlJqROD70bjM5ThwflhRXW70uPrFzyNv44LGo+K7rgJM7+ANElUas290S3MCT0gmY32dY4 U3ZRUl8N+Q+9IZWv4bQfMw+Afx6MBTdh2U3AoEu7cowpA+r8QIHxVYwK5UKpQGqJTryOJQ4eAq9Z1 w0clTok/fhrAz158AVBjvalNNfV+oj7HDGsjtW/Ni+i1ixKe/J0b8oPMdPJnjMggNoQg01c/YweRE mIoOnkZ7HODXZJlG8v35k/T91b6kYhoIggwLseaTzpHTIyHKotwwHVw/qfIznrBXDMFnLoeIk1was 8fhPrDrHau58TqAVyk8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVEeo-0004Dc-Kn; Thu, 14 Nov 2019 12:55:30 +0000 Received: from mta-02.yadro.com ([89.207.88.252] helo=mta-01.yadro.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVEeJ-0002X1-9L for linux-arm-kernel@lists.infradead.org; Thu, 14 Nov 2019 12:55:01 +0000 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id CA19F42E7D; Thu, 14 Nov 2019 12:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1573736096; x=1575550497; bh=dU4Qiqla3HKSYHl+Wvu4W3/EUd/15lXXOMG hZ+0TFuQ=; b=TYwELifC+V6L9QXxu43Q+9Yb+OUpSBpe54G2+CyEmgWgETwHWzf UXlGzzAs6uUbCl1/40s4dDmR9VX+FHGxDmXYAyB5NNIY7SPhQo+wKgKDg2BPfkmh lco3HU0GxT55/NUNuIZ3pCfXX49Dtz1HS9colU5+EsxcDCT1WZ2As1rQ= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QNR538L5M_zS; Thu, 14 Nov 2019 15:54:56 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id CE144411D9; Thu, 14 Nov 2019 15:54:56 +0300 (MSK) Received: from localhost.dev.yadro.com (172.17.15.69) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Thu, 14 Nov 2019 15:54:54 +0300 From: Ivan Mikhaylov To: Subject: [PATCH v2 2/2] mmc: sdhci-of-aspeed: add inversion signal presence Date: Thu, 14 Nov 2019 15:54:35 +0300 Message-ID: <20191114125435.27756-3-i.mikhaylov@yadro.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191114125435.27756-1-i.mikhaylov@yadro.com> References: <20191114125435.27756-1-i.mikhaylov@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.15.69] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191114_045459_507717_DDCDEDCF X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Ulf Hansson , linux-aspeed@lists.ozlabs.org, Andrew Jeffery , openbmc@lists.ozlabs.org, linux-mmc@vger.kernel.org, Adrian Hunter , linux-kernel@vger.kernel.org, Rob Herring , Joel Stanley , Ivan Mikhaylov , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Change the default .get_cd callback. Add inverted signal card detection check. Signed-off-by: Ivan Mikhaylov diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index 8962f6664381..186559ee8fcc 100644 --- a/drivers/mmc/host/sdhci-of-aspeed.c +++ b/drivers/mmc/host/sdhci-of-aspeed.c @@ -143,6 +143,19 @@ static inline int aspeed_sdhci_calculate_slot(struct aspeed_sdhci *dev, return (delta / 0x100) - 1; } +static int aspeed_get_cd(struct mmc_host *mmc) +{ + struct sdhci_host *host = mmc_priv(mmc); + + int present = !!(sdhci_readl(host, SDHCI_PRESENT_STATE) + & SDHCI_CARD_PRESENT); + + if (mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) + present = !present; + + return present; +} + static int aspeed_sdhci_probe(struct platform_device *pdev) { struct sdhci_pltfm_host *pltfm_host; @@ -183,6 +196,10 @@ static int aspeed_sdhci_probe(struct platform_device *pdev) goto err_pltfm_free; } + host->mmc_host_ops.get_cd = aspeed_get_cd; + if (of_property_read_bool(pdev->dev.of_node, "cd-inverted")) + dev_info(&pdev->dev, "aspeed: sdhci: presence signal inversion enabled\n"); + ret = mmc_of_parse(host->mmc); if (ret) goto err_sdhci_add;