From patchwork Thu Mar 29 18:24:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscardagrach X-Patchwork-Id: 10315989 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7C57E6037E for ; Thu, 29 Mar 2018 18:25:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60D4C28402 for ; Thu, 29 Mar 2018 18:25:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5567F2A48A; Thu, 29 Mar 2018 18:25:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEE9828402 for ; Thu, 29 Mar 2018 18:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753289AbeC2SZL (ORCPT ); Thu, 29 Mar 2018 14:25:11 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:45327 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753305AbeC2SYz (ORCPT ); Thu, 29 Mar 2018 14:24:55 -0400 Received: by mail-io0-f193.google.com with SMTP id 141so8693903iou.12 for ; Thu, 29 Mar 2018 11:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edited-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=w1+FbNyUbePoYJke380V1ZyRwofp7t/IVaasIimhQDM=; b=QJV0SoiFqdrTDqwh/qojs6HbAMaDGxUPfavG8voWJ8g9Y7SnYxNAFvPVuPdZweuw2C nFNNzeviQ9PaUdOndajwgstoGI4Pf9scJ+nleh60kCt+wsPqSPT8iW5Lk7BC0zg/94Ka 4wf/YMa8o7OKeMDbE9yaJ/7HKKI4hHGCz3vm1WXGhD/DUEnratDBvHuazaYVLHK489t7 yePtzcAEqVJjY8rc/w9Lv0yX8vgwbxiWnPR19bkWElRjuXsHHtxTeVTwYXT3FJTeBW+C STwFjT6eiY5z8KyP1iZR1PjF9eTPEVF+BglNPbYXsJxIPR9aYkG46+wRQvTAbtPJ5rYs R8DA== 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; bh=w1+FbNyUbePoYJke380V1ZyRwofp7t/IVaasIimhQDM=; b=qmhI2DvSHvyOFLL+td5ep32Vic8k2/wtwHu2DB20fYWjf65aIaolIbCuH3Zi5PR22I lcaUTRKJkqKqiMTyawfNnKRZDznb0fy+D/EYh119pJROuWx5bTVIP2dDu3Q9f0HuNSz/ vpEw25z9/M42bmtSkI8xozkT1/DrXWKtb8oIH++sYSv8lzXrpb0XuhUfd9z/o22K6nHt n5w3C+uwPPj3moT7ndLS0J7gKpbY2Jl9c1VbirYAuPk0YGVBTyAIIDxRuAn9y4CeV+pZ fdsGzO5op7JkBWHpJRdc1IUqKsk2d/+QH090b9NqVUngO77cfzLQK9hDK1QgP8yZB/Ny GaYA== X-Gm-Message-State: AElRT7GWLakRvIPlpm3oy57VDrG7nixNgd2z2KU7qHfg45sZxx1pJ4VN qSxDvia+k54fktCQokEYEoRb9w== X-Google-Smtp-Source: AIpwx4/X8Vz8Hs468yBVpLteCMzMm9ufARxv62h7/4Gcb5rG6btFqQZfMzFEGVV3QoRWF/xCB6NCKw== X-Received: by 10.107.17.33 with SMTP id z33mr17521162ioi.206.1522347894655; Thu, 29 Mar 2018 11:24:54 -0700 (PDT) Received: from debian.hanksspec.com (ip-97-240-239-173.midwest.us.northamericancoax.com. [173.239.240.97]) by smtp.googlemail.com with ESMTPSA id y20sm4589128ioy.27.2018.03.29.11.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 11:24:53 -0700 (PDT) From: oscardagrach Cc: oscardagrach , Jaehoon Chung , Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmc: dw_mmc-k3: Fix DDR52 mode by setting required clock divisor Date: Thu, 29 Mar 2018 13:24:22 -0500 Message-Id: <20180329182423.21201-1-ryan@edited.us> X-Mailer: git-send-email 2.11.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: oscardagrach --- drivers/mmc/host/dw_mmc-k3.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c index 89cdb3d533bb..efc546cb4db8 100644 --- a/drivers/mmc/host/dw_mmc-k3.c +++ b/drivers/mmc/host/dw_mmc-k3.c @@ -194,8 +194,14 @@ static void dw_mci_hi6220_set_ios(struct dw_mci *host, struct mmc_ios *ios) int ret; unsigned int clock; - clock = (ios->clock <= 25000000) ? 25000000 : ios->clock; - + /* CLKDIV must be 1 for DDR52/8-bit mode */ + if (ios->bus_width == MMC_BUS_WIDTH_8 && + ios->timing == MMC_TIMING_MMC_DDR52) { + mci_writel(host, CLKDIV, 0x1); + clock = ios->clock; + } else { + clock = (ios->clock <= 25000000) ? 25000000 : ios->clock; + } ret = clk_set_rate(host->biu_clk, clock); if (ret) dev_warn(host->dev, "failed to set rate %uHz\n", clock);