Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4112119ybi; Mon, 29 Jul 2019 19:31:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIDXR+336p4bfqclgW8iHmS1/frocslE3FAoXtU77LDmeE3dy9vep8NWaqcJPugbNRcrtK X-Received: by 2002:a62:1616:: with SMTP id 22mr40318717pfw.120.1564453900434; Mon, 29 Jul 2019 19:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564453900; cv=none; d=google.com; s=arc-20160816; b=da5oOY8Yd/zqZBXHcBTW7BcALvv3iU31JGG+Ps/qia6JXPFr823LP05V4qvyzvdUuZ WBai4hlqwzNxczd60e9R8JB78EUvlyPNnWSZrUUlWEW/5tOF2dXkGBNXXMDYIbIm6xem kKc5DqNTbNOPg0m6d3CLsm6q4R8vCorZIzVgIMBzAbZeqgf7LY7aJ/dn2tGiWDycTqSA 0dbIvJOBDRGRM4G78322ULVoCbekyN3dxg6ZGKAWUtNG/q9JRL8c2IrEOZA1i2rp5ZYl yGi/+3Awb5Xye0AD/UouxSCr+1Xacw8jky3WE3z9Q0NCYJVOUQwqE++ueRqqrrId/sQw yMmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fmTfGEmtzlaGawCGkotcVWFUgr4IqvybibknLt1y6Ds=; b=MdO0sMtCMEyk2a0mJRJ4adGbEqrzOsgtDMxHJOj8IzXrPeP9Nc1B1n0ugN4QtHvTVt hd48qZXR7+5VizH4L40Frkuotxh/jrmH8baYwttUm6wYWS31Lioht23HzlDDjYwP8oGi 7L9/CrODy3CEjcMsrNk6SSsddIALvKPibK/PkcV4l5IoJUkM1wt5kYT4sZikbn592aR4 UXgPqORa1s7TPVBnrRUqdLqUAI+CNF3KxqsT9VWcw7CKGMpPVb3NVdAEHr1Squ2y9Xgi zU6YWNkCPWdbtRxlhM0kIqqHORCBhM/bP5ctJ9gjWGVsUxTcy0ehDEoX7VLXicWeywOp 9o9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KOBt2WFT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si27437726pll.333.2019.07.29.19.31.24; Mon, 29 Jul 2019 19:31:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KOBt2WFT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389539AbfG2Tml (ORCPT + 99 others); Mon, 29 Jul 2019 15:42:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:58542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389526AbfG2Tmj (ORCPT ); Mon, 29 Jul 2019 15:42:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B72C1217F5; Mon, 29 Jul 2019 19:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429358; bh=dEuEHs4GsP7bekn11dR5FNyO4oT3Y+XEYEwe9AxXBDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KOBt2WFTpVyryW444mWcZdFHstlzelwSUIXhnGRZVAq164Hbgc9Zi857GHSKqI9Rs eJS4hfzTE9doJyDWb7I1DipLLCW2J/FtYrC/O4aLmAIZOggy+2C5fGcFaCcjbEsvv3 MOXqAVNuVRBIlgE7LmYv0Bz5EQDOVeiYlszZcjVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raul E Rangel , Adrian Hunter , Ulf Hansson , Sasha Levin Subject: [PATCH 4.19 035/113] mmc: sdhci: sdhci-pci-o2micro: Check if controller supports 8-bit width Date: Mon, 29 Jul 2019 21:22:02 +0200 Message-Id: <20190729190704.162266984@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit de23f0b757766d9fae59df97da6e8bdc5b231351 ] The O2 controller supports 8-bit EMMC access. JESD84-B51 section A.6.3.a defines the bus testing procedure that `mmc_select_bus_width()` implements. This is used to determine the actual bus width of the eMMC. Signed-off-by: Raul E Rangel Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-pci-o2micro.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c index fa8d9da2ab7f..e248d7945c06 100644 --- a/drivers/mmc/host/sdhci-pci-o2micro.c +++ b/drivers/mmc/host/sdhci-pci-o2micro.c @@ -290,11 +290,21 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot) { struct sdhci_pci_chip *chip; struct sdhci_host *host; - u32 reg; + u32 reg, caps; int ret; chip = slot->chip; host = slot->host; + + caps = sdhci_readl(host, SDHCI_CAPABILITIES); + + /* + * mmc_select_bus_width() will test the bus to determine the actual bus + * width. + */ + if (caps & SDHCI_CAN_DO_8BIT) + host->mmc->caps |= MMC_CAP_8_BIT_DATA; + switch (chip->pdev->device) { case PCI_DEVICE_ID_O2_SDS0: case PCI_DEVICE_ID_O2_SEABIRD0: -- 2.20.1