From patchwork Mon May 4 16:31:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 467722 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C4F701402D5 for ; Tue, 5 May 2015 02:41:36 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id AB5061A17B3 for ; Tue, 5 May 2015 02:41:36 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 456 seconds by postgrey-1.35 at bilbo; Tue, 05 May 2015 02:39:20 AEST Received: from smtp.transmode.se (smtp.transmode.se [31.15.61.139]) by lists.ozlabs.org (Postfix) with ESMTP id 1CCF31A024B for ; Tue, 5 May 2015 02:39:20 +1000 (AEST) Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [172.20.4.10]) by smtp.transmode.se (Postfix) with ESMTP id 42A6D1186FC6; Mon, 4 May 2015 18:31:37 +0200 (CEST) Received: from gentoo-jocke.transmode.se (localhost [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.9/8.14.9) with ESMTP id t44GVbYc015924; Mon, 4 May 2015 18:31:37 +0200 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.9/8.14.9/Submit) id t44GVacB015923; Mon, 4 May 2015 18:31:36 +0200 From: Joakim Tjernlund To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/2] sdhci-of-esdhc: Support 8BIT bus width. Date: Mon, 4 May 2015 18:31:31 +0200 Message-Id: <1430757092-15847-1-git-send-email-joakim.tjernlund@transmode.se> X-Mailer: git-send-email 2.3.6 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Signed-off-by: Joakim Tjernlund --- drivers/mmc/host/sdhci-of-esdhc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 22e9111..7130130 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -82,6 +82,10 @@ static u8 esdhc_readb(struct sdhci_host *host, int reg) /* fixup the result */ ret &= ~SDHCI_CTRL_DMA_MASK; ret |= dma_bits; + + /* 8BIT is bit 29 in Control register */ + ret |= ((ret << 3) & SDHCI_CTRL_8BITBUS); + ret &= ~(SDHCI_CTRL_8BITBUS >> 3); } return ret; @@ -134,6 +138,10 @@ static void esdhc_writeb(struct sdhci_host *host, u8 val, int reg) dma_bits); val &= ~SDHCI_CTRL_DMA_MASK; val |= in_be32(host->ioaddr + reg) & SDHCI_CTRL_DMA_MASK; + + /* 8BIT is bit 29 in Control register */ + val |= ((val & SDHCI_CTRL_8BITBUS) >> 3); + val = (val & ~SDHCI_CTRL_8BITBUS); } /* Prevent SDHCI core from writing reserved bits (e.g. HISPD). */ @@ -252,6 +260,8 @@ static void esdhc_of_platform_init(struct sdhci_host *host) if (vvn > VENDOR_V_22) host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ; + + host->mmc->caps |= MMC_CAP_8_BIT_DATA; } static void esdhc_pltfm_set_bus_width(struct sdhci_host *host, int width)