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: 12717558 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 4B076C433F5 for ; Wed, 19 Jan 2022 13:51:19 +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=GwK5+s8990QbWAK717rnpyYf3bIrWFuZeyP6AKqiFXY=; b=xly327MSHCPYMD 7Y+haI71FMww+Ndf0FAuo7E5SIjKPHrqx4jSmdc5Sup1o0DGjFSHeJ8taRZ0ocQZu8iSokgCiZf12 UYM7BInqTxm3G7jPyNGXhaGAyS/00LnPMuWDdL22z32BDwKdWe3odxz+kXP6UkH9/6VQpcJaFlOe1 2sf/nDHcMKdFnyAYImvs+Ags65SYDp8JAw83s0oD83WVTxO1MCIeyDo96BaQr+A1dZDk0NgIqO5AZ +WrZHZubYjUbjuEGyc/x7ejrRbgQcd2Gy5VNHR+8AT6K05lReRbbaZ9jMlvsggKD3iLIei6CWEe8e f8hiZauRL6xd8EcJzw5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nABMp-005l5U-FU; Wed, 19 Jan 2022 13:51:15 +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-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=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;