Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1238218imm; Tue, 2 Oct 2018 05:13:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV61tV6ZFhbnaDpFOfET5D8A44hWgN4gVRt96kumUZlbYQ22VR+KAEVZNEL94R7NS7U5lOOPc X-Received: by 2002:a17:902:6843:: with SMTP id f3-v6mr16536326pln.64.1538482408644; Tue, 02 Oct 2018 05:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482408; cv=none; d=google.com; s=arc-20160816; b=gJRp8LpQQAft6BPEPceO9NYkLiKFb7X1OKcOMkbDtx+AnzHBI8zVqvSrGQ7XVnvbMn X5byaLglG7DXFHie2Xh2wKf6BsdIlo0JKEFbUlvaXzv20/yxfiOJVHxuy0GEC27TJU+t uGRLQxQDIWa0qdhr1g7KeZRxw0O2BKgQl/3LSE6V8yyx6Oxf0+VVJZpx3iJ2bW3yQS1T N/ds8I5OkgoRCahGWR4emVRBYX8Ed08oY4RD+JIiscAouHmmCPCHEqJUmwUJKwz+ZpKZ J70oRX6RE+gH0IGkHMo87VChTT+Towffwba/lwi9avF+R8hpPcG+oB8w8dObJiaKX5Wv 6Opw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=gX0qRWV7Utdg7z0XvPpUprYPERIzZQrgLJ5cog+/CiM=; b=FXG7D3zXHL4+BpESaHVfWkXCIU+epox+3Z7TtUtBVrp14FE7ddhbEhygwZgYh+Eu8c BlJfh6Q2JX4mBZfunkdaSPv5Ee7EHnh34Oo0r2+NnmiGCmeZbr1dJJza/PtXgvU/j+qI 6Y+/bdR2n2q2VWhNWmKpTgf7EgIlkZSHsbogZu/GCwW8/CZIfnyCT4RydBuDex4YQfH4 TuW7KdV1MBWTFN31ReUVyKXNYtttAQSwsriLJCfPKN9pbFdh6cq8xq4s724rlaDFd7I/ 0KCNRebolpo76Y+vaIwh86EalcrautXux1iNLKFjn7qn0lhhxwLqYZcoVNcH2Fmi4wpk 5qwg== ARC-Authentication-Results: i=1; mx.google.com; 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 h90-v6si16305929plb.64.2018.10.02.05.13.13; Tue, 02 Oct 2018 05:13:28 -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; 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 S1728201AbeJBSyM (ORCPT + 99 others); Tue, 2 Oct 2018 14:54:12 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:13547 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727809AbeJBSxN (ORCPT ); Tue, 2 Oct 2018 14:53:13 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w92C8gou013788; Tue, 2 Oct 2018 14:10:07 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2msxh6gsnp-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 02 Oct 2018 14:10:07 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4072A31; Tue, 2 Oct 2018 12:10:06 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 043792A42; Tue, 2 Oct 2018 12:10:06 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:10:05 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:10:05 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , , Gerald Baeza , Loic Pallardy , , , , , , Ludovic Barre Subject: [PATCH V4 22/25] mmc: mmci: add clock divider for stm32 sdmmc Date: Tue, 2 Oct 2018 14:09:24 +0200 Message-ID: <1538482167-13819-23-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> References: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-02_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre The STM32 sdmmc variant has a different clock divider. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 2 ++ drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 0898cc9..0421e18 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1857,6 +1857,8 @@ static int mmci_probe(struct amba_device *dev, */ if (variant->st_clkdiv) mmc->f_min = DIV_ROUND_UP(host->mclk, 257); + else if (variant->stm32_clkdiv) + mmc->f_min = DIV_ROUND_UP(host->mclk, 2046); else if (variant->explicit_mclk_control) mmc->f_min = clk_round_rate(host->clk, 100000); else diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index f793426..1520289 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -216,6 +216,7 @@ struct mmci_host; * @data_cmd_enable: enable value for data commands. * @st_sdio: enable ST specific SDIO logic * @st_clkdiv: true if using a ST-specific clock divider algorithm + * @stm32_clkdiv: true if using a STM32-specific clock divider algorithm * @datactrl_mask_ddrmode: ddr mode mask in datactrl register. * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register * @blksz_datactrl4: true if Block size is at b4..b16 position in datactrl @@ -269,6 +270,7 @@ struct variant_data { u8 datacnt_useless:1; u8 st_sdio:1; u8 st_clkdiv:1; + u8 stm32_clkdiv:1; u8 blksz_datactrl16:1; u8 blksz_datactrl4:1; u32 pwrreg_powerup; -- 2.7.4