From patchwork Wed Jan 19 13:49:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 12717559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DF4CC433EF for ; Wed, 19 Jan 2022 13:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=gcf8ZVbJMXrJFfBUZzjRyXXLfa/wepdWYYvlt9RKXP0=; b=HnjsMTnp6ZjTOl cgCNtn6grTobFM89fB1Gr3D+dnAXUJNfoEQ0D/nJTr4jdP82isUUHjReP4z/nByvTU926tds6M8IV 6GTGoIL+UI5itKjGHzuWC8Zgg/DslNfVyweiUCrxdOyoM2yCS/vaB263TDNLFybYZ+W5AHkP+egAM rhoPyo4dpSHKjCn42J+9TuO/3zakED5BP+F+AyQOR3F+RSKXGRe1/gA+v3GuKqZdz9ngJvQ61uhiQ Kb4viwP8CY9Ija7Ex7etcxzmRYA/fsIe1ytxJ+AlunJpfFcqFt4+Rjd6OPmeVjedQdEPEGn3WxWEX w9JO3MTCijSGN3vt7LTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nABMR-005kvY-VV; Wed, 19 Jan 2022 13:50:52 +0000 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nABML-005kp4-So; Wed, 19 Jan 2022 13:50:48 +0000 Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 3930EFF802; Wed, 19 Jan 2022 13:50:35 +0000 (UTC) From: quentin.schulz@theobroma-systems.com To: robh+dt@kernel.org, heiko@sntech.de Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jakob Unterwurzacher , Quentin Schulz , Quentin Schulz Subject: [PATCH] arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity Date: Wed, 19 Jan 2022 14:49:48 +0100 Message-Id: <20220119134948.1444965-1-quentin.schulz@theobroma-systems.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220119_055046_159343_BF746AFD X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jakob Unterwurzacher There are signal integrity issues running the eMMC at 200MHz on Puma RK3399-Q7. Similar to the work-around found for RK3399 Gru boards, lowering the frequency to 100MHz made the eMMC much more stable, so let's lower the frequency to 100MHz. It might be possible to run at 150MHz as on RK3399 Gru boards but only 100MHz was extensively tested. Cc: Quentin Schulz Signed-off-by: Jakob Unterwurzacher Signed-off-by: Quentin Schulz --- Note/RFC: as opposed to gru DTSI, max-frequency is used here instead of assigned-clock-rates. AFAIU, max-frequency applies to the SD bus rate, while assigned-clock-rates applies to the clock fed to the SD host controller inside the SoC. max-frequency does not interact with the clock subsystem AFAICT. assigned-clock-rates sets the clock rate at probe, regardless of eMMC tuning. Technically, the Arasan SDHC IP supports silicon-hardcoded clock multiplier so I think setting assigned-clock-rates as a way of rate limiting the eMMC block is incorrect and max-frequency should be used instead (as done in this patch). Otherwise the SDHC could still potentially derive a 200MHz clock from a lower rate clock thanks to its multiplier. arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index fb67db4619ea..a6108578aae0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -425,6 +425,12 @@ vcc5v0_host_en: vcc5v0-host-en { }; &sdhci { + /* + * Signal integrity isn't great at 200MHz but 100MHz has proven stable + * enough. + */ + max-frequency = <100000000>; + bus-width = <8>; mmc-hs400-1_8v; mmc-hs400-enhanced-strobe;