From patchwork Mon Jul 8 04:10:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1128864 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="RcJHINWP"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="sxgPmewK"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45hsV66Fgnz9s3l for ; Mon, 8 Jul 2019 14:12:14 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3DEF8C21D9A; Mon, 8 Jul 2019 04:11:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 073B9C21D8A; Mon, 8 Jul 2019 04:11:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 47988C21DA6; Mon, 8 Jul 2019 04:10:49 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lists.denx.de (Postfix) with ESMTPS id 6889FC21DC1 for ; Mon, 8 Jul 2019 04:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1562559046; x=1594095046; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=lLycTni9dcAGeoVr+MWiWdRoyLAav7MAbXHxnlf2PDA=; b=RcJHINWP7wIhQB90UuosO2m3hMTorOLrSumUn5ukLl3s9sKDgzSCAz4r NidlTGyqQKuOaBaWYoNvMS7cbWbW9rUtY6K6tDWoC2cof+6WGk50hKsxp sCrGMhRzF009VUxbLwFWCrkvWznH+VQOatjebw6l7hnkGkWQL06ntF7xC yR/giLq/FS4E4XPWD6TmSqaz0dO/tkgwCI9a2O0qZ2OnEpKWXbB3h+Blx Zdvj4rxiF/Nq6PQWSXRREsbBl5PXyeUmCn5XNtZepgKgCs/KXx0tWHRdk e8RLpi8gWUeKzEt0+AD5IM7wGbd1xJKipMCEy9srV85Dg1Rl5iisLUdxP A==; IronPort-SDR: tdSUgeZQqaOK7IBsiOG3M40eEOpaiT7dM/cDIOmgHiRJ9tejmG/tJzF+Pij43PNkHo44tHrfMP v6Vt6xkNYTCdPUDcYdzVH5fqFrrnoaDhq+19c8MUhMVg1BT47vr0PpS8YV9xrPXnVWp/fp8ic8 D4xTAx6vu4TSshLKFpOcr3eqgRCWDNTIZ05vWPyXckGZaYDZ3k7BqolOB/XzJfGVpFO4Ywu253 o8LrglRtXSweKFxQ+y5CWwhxiZkWv8dTsGQQuMVCVkrc0Cnhixb0+jcOD73R5hgAn6Jq7btyiT PWc= X-IronPort-AV: E=Sophos;i="5.63,465,1557158400"; d="scan'208";a="112409373" Received: from mail-by2nam01lp2059.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([104.47.34.59]) by ob1.hgst.iphmx.com with ESMTP; 08 Jul 2019 12:10:44 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cIlaCN7KKtd3SupjMvOOwD1ngZlzWuFl+6+q1EocmvQ=; b=sxgPmewKtVgfUyt0JHk8UeKkAw2QqoxMuCG/3ISIu0+gXwNXQ6jZ2OdRuhAekhMcDH4O8QhG1uLaViITB0GrF8cPmls1mNWNVuPaLANTtz0swp1ZKk3nyNk0cA0Qn64EP3qzVlld90wvsh5uBAHDpaQ/uv0weYJq1XhXkqV5Kcc= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6720.namprd04.prod.outlook.com (10.186.145.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Mon, 8 Jul 2019 04:10:43 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::1d4a:f9e2:5761:dcb9]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::1d4a:f9e2:5761:dcb9%3]) with mapi id 15.20.2052.020; Mon, 8 Jul 2019 04:10:43 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Lukas Auer , Peng Fan , Jagan Teki , Oleksandr Zhadan and Michael Durrant Thread-Topic: [PATCH v3 2/6] mmc: skip select_mode_and_width for MMC SPI host Thread-Index: AQHVNUMcrEa5thw1QECic+QCNcFJ5w== Date: Mon, 8 Jul 2019 04:10:43 +0000 Message-ID: <20190708041004.6252-3-anup.patel@wdc.com> References: <20190708041004.6252-1-anup.patel@wdc.com> In-Reply-To: <20190708041004.6252-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00::16) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [129.253.179.161] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2fd578c1-35c8-4620-4b59-08d7035a3e6a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:MN2PR04MB6720; x-ms-traffictypediagnostic: MN2PR04MB6720: x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 00922518D8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(189003)(199004)(6506007)(386003)(256004)(110136005)(478600001)(52116002)(81166006)(81156014)(8936002)(54906003)(26005)(6486002)(72206003)(6436002)(6512007)(316002)(53936002)(102836004)(76176011)(4326008)(36756003)(5660300002)(66476007)(7736002)(1076003)(66556008)(3846002)(64756008)(66446008)(6116002)(305945005)(73956011)(66946007)(7416002)(486006)(68736007)(14454004)(44832011)(99286004)(66066001)(2906002)(11346002)(186003)(86362001)(71190400001)(71200400001)(2616005)(25786009)(50226002)(8676002)(446003)(476003); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6720; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: cE3ioL1HQu9cxGVU1v06Dn5lL3MDvEZ9kZcoXzaEPVzO0AOQQEYYlTfROTuZcXBHDcu2GiV9RtQL540WZEAXvZdtzCum2KMm512IMyQX9M52zxplfbFa51jTDai2leuGxIkhyE0NDLsbX7FGTpjWLnfaiOtJOV3T/vRaIbjglYD/Qu08JmoduO/9GSdzvsPlGxpgG6GDs+nt4FLMG3c1tl9HDlMYpjX2OCeNReJk8SD3DnhyK/vGNOFHho9w3c7I2aa/Gc/5b+lK1zAFOtRTE913k3Bjb3HEDmbq+fN1x+4/ABuw6SmiLuexseA+P7BpbmBfFsmHFiOzwSJzFcUJdtXsBKv59iGEJMMG/CDcSNZ6rhVePn8iK1vSKNdpOZEWn7t8evY8ur4sYHbE1VJsTp0B0ahDEA+FaKEhSdG7uSY= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fd578c1-35c8-4620-4b59-08d7035a3e6a X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2019 04:10:43.0774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Anup.Patel@wdc.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6720 Cc: Palmer Dabbelt , U-Boot Mailing List Subject: [U-Boot] [PATCH v3 2/6] mmc: skip select_mode_and_width for MMC SPI host X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The MMC mode and width are fixed for MMC SPI host hence we skip sd_select_mode_and_width() and mmc_select_mode_and_width() for MMC SPI host. Signed-off-by: Anup Patel Reviewed-by: Bin Meng Tested-by: Bin Meng --- drivers/mmc/mmc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 456c1b4cc9..95008c72c3 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1672,6 +1672,13 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps) mmc_dump_capabilities("host", mmc->host_caps); #endif + if (mmc_host_is_spi(mmc)) { + mmc_set_bus_width(mmc, 1); + mmc_select_mode(mmc, SD_LEGACY); + mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE); + return 0; + } + /* Restrict card's capabilities by what the host can do */ caps = card_caps & mmc->host_caps; @@ -1934,6 +1941,13 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps) mmc_dump_capabilities("host", mmc->host_caps); #endif + if (mmc_host_is_spi(mmc)) { + mmc_set_bus_width(mmc, 1); + mmc_select_mode(mmc, MMC_LEGACY); + mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE); + return 0; + } + /* Restrict card's capabilities by what the host can do */ card_caps &= mmc->host_caps;