From patchwork Mon May 22 09:30:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 97231 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1326400vqo; Mon, 22 May 2023 02:54:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4P/SjRFlTxvpktFRppP1NOPC97QO7/4cF0aGb+nzxrMpm1mWxeLJ2U/q6zwOQ2e8x9T7KP X-Received: by 2002:a17:90a:8c10:b0:250:1905:ae78 with SMTP id a16-20020a17090a8c1000b002501905ae78mr9859707pjo.15.1684749256654; Mon, 22 May 2023 02:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684749256; cv=none; d=google.com; s=arc-20160816; b=pFl2y4FvJfjRuioldVC0Sv/qZCR+STWbE7JFMeTaN6fxlSiiwdr7/vH/bt6BfqvjV6 e8M8A46q5C37r8xDYokUNeFPU5MlCKwABaQ1p1LgwWCU8WDouAwIFaUVmfhBQO52iZti 3aCSTuuFShk7sgUhnbqsE9MnDeB5pchnnpiN01yVQBBaOf8O6CFWOe5K7Sz6uIl5Nl0a rGCQ3wugNv9Mnr+I4kVwIkG3uOdXjxS9uQxyCE6SNvQzazhQdswcRxzTN3RsiSEFZ5/T qkDfEEfIF7K6+KfiRrG9jwILQRJTXoaPWEYZebW0DwHlnChIodM4dEBuKBrFLhisbnBT eGqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rG/kvDt+szdolG4p/hjX8suZAmZTY7KUuH+I6rhGaE4=; b=PtIv7ejxCh/DvS3u4/Hu3uPrvR7djO3YzdWzQU8QcMNR3mrhPanUaKkkRG7YQF/Csf 9PQ1qo65EGcQFsebBXjllNaNed6orwvIBZwHsTAyAppKeh7R2ilRrRvq7x7vqc6xPvIE /HCPSqVEW/STSq9X3p6RAIf5ipnGWpm9nA26N7+ghEjTmP+1j7BZ8G1NRUFQ18z8Tk/X E2rxs8JIgqzEWJr7MEzpnGhrGMyPKx4x2u2FU2jcvtlMdwCTG0ZMnOiToL6R/TSvbkvD KgK95tWkm4Kl0QQFnXggmsAT7Ds1cQsMUNZpleBTHpNrIabt5Au8WvDxleYYpWknngsh qQvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AcDyWd4R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a17090a604e00b00252fc82b3afsi4394012pjm.128.2023.05.22.02.54.04; Mon, 22 May 2023 02:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AcDyWd4R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbjEVJaS (ORCPT + 99 others); Mon, 22 May 2023 05:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbjEVJaN (ORCPT ); Mon, 22 May 2023 05:30:13 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 581779D; Mon, 22 May 2023 02:30:11 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id E658166058F2; Mon, 22 May 2023 10:30:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684747809; bh=8THYe79i65UdHa2AS5CAUyFodTMPPnYlaLqy/e9sDbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AcDyWd4R9EBwLOnEZezjmVfSgRSLA2+plkuc7SNL0Bwl1urZ2d/QO4tAiqHYNfkLk iWuIB8mOVV7oO7hL0X66aiRBP97hM9uJSmjGQCFnewMqIS2+M2ACKrhWfqihUvnEkB 6wH5W1HglBuqxomb3ajCfrNo4HwQ5H5sQVX65uudy0qXV2J8vTAeu3M+sisYN3+Um8 DEDrv28AVCs14mRDrMU8iopM7v6618t+wMYUjytO9D/f1n+5NwxhtP8PRb2Qwm5pDB MpkAWXhzbM/RDLyRRppMqfhGoTkKD1NFX3IUYL4fLhfD5J/dJu7eY6dpTZet5dxnQG thtJRIMst2x0g== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, weiyi.lu@mediatek.com, ikjn@chromium.org, chun-jie.chen@mediatek.com, tinghan.shen@mediatek.com, seiya.wang@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH 1/2] arm64: dts: mediatek: mt8192: Make sure MSDCPLL's rate is 400MHz Date: Mon, 22 May 2023 11:30:01 +0200 Message-Id: <20230522093002.75137-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522093002.75137-1-angelogioacchino.delregno@collabora.com> References: <20230522093002.75137-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766587636307648518?= X-GMAIL-MSGID: =?utf-8?q?1766587636307648518?= Some bootloaders will set MSDCPLL's rate lower than 400MHz: what I have seen is this clock being set at around 384MHz. This is a performance concern (and possibly a stability one, for picky eMMC/SD cards) as the MSDC controller's internal divier will choose a frequency that is lower than expected, in the end causing a difference in the expected mmc/sd device's timings. Make sure that the MSDCPLL frequency is always set to 400MHz to both improve performance and reliability of the sd/mmc storage. Fixes: 5d2b897bc6f5 ("arm64: dts: mediatek: Add mt8192 clock controllers") Signed-off-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi b/arch/arm64/boot/dts/mediatek/mt8192.dtsi index 5c30caf74026..6fc14004f6fd 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi @@ -677,6 +677,8 @@ apmixedsys: syscon@1000c000 { compatible = "mediatek,mt8192-apmixedsys", "syscon"; reg = <0 0x1000c000 0 0x1000>; #clock-cells = <1>; + assigned-clocks = <&apmixedsys CLK_APMIXED_MSDCPLL>; + assigned-clock-rates = <400000000>; }; systimer: timer@10017000 { From patchwork Mon May 22 09:30:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 97225 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1323549vqo; Mon, 22 May 2023 02:47:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6F45UDfpTpzimV7ewAhNEsE0yG8aRwSSECQCAnkNuIxByKy08lpj+0AgDTz8kKXGzL/0J+ X-Received: by 2002:a05:6a21:3417:b0:10c:2b6b:6ec4 with SMTP id yn23-20020a056a21341700b0010c2b6b6ec4mr23632pzb.50.1684748854644; Mon, 22 May 2023 02:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684748854; cv=none; d=google.com; s=arc-20160816; b=mBfOA0whUV8DVDU4tBDR3wTvay7ULS9GRdBxzZs2/XouiwDr8PbDo/uyoDwVQd4yNI PkrdvqVGy6vIcR5p0iKRANNOo7CtDohZaHfAlTknOX4/1w94b6VkJ7jiENEC9jf29V3+ D+PxdHK36b8cpJ9gsJpaqSR6/02xnCC2qJO1zgOg4WUtZAnREsphEUsuieNhsc7Kzdaz 4/iR09x73BRHvya3bq270onZe6sYPXIdJ4KQ2ffWMmTNT56yfTwJXg0ejr+bGKIPemQ0 prKC8lLSm2YUwPPFaCmoVuYAEXXb32KpiRn0h6Syc49Rhr6WoSi7mb+rqZkRLXWJhgpD 3YQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3WQ6namd9ygJsFDnS056ahq44Mqr30BQNiwvwn0IYyg=; b=XXOxAEPyhNd2xSJBSMqrRKU/2xIjwfhNhl0vSmXbTZzeY0Ie15wCtGM022nJFCKUOD 3LPKdAwMXURRdLk6bAByFIcUag+c4dCrvwolDUOvFALvOn7XG6DH2PromD7+hcTtHckX f9eTQE86I+KYOfKKGdxxkPyjAFhAm0+HXWOZ5DZP7jWf00FQCSD24f8bt8nUH6C/tKTf QlIFahhu5NRFs76cZh9nFJUUWp6E27ocOCzPWrA2d3nREDM7FA3bEgC2wazzeKGEVhH5 tqC7/DtGsfDZpxc3E6/C/QEz4/kaqKYGBn+2d/NyYLn5aWrBdB8IHB0Flu03UCN7qQ4L dEVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mWPLKhLn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w189-20020a6382c6000000b00509461bbf1csi4731928pgd.79.2023.05.22.02.47.19; Mon, 22 May 2023 02:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mWPLKhLn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232100AbjEVJaQ (ORCPT + 99 others); Mon, 22 May 2023 05:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbjEVJaN (ORCPT ); Mon, 22 May 2023 05:30:13 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066E5B3; Mon, 22 May 2023 02:30:12 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id F32196606D84; Mon, 22 May 2023 10:30:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684747810; bh=b/HUQkVvh1ObQj0af7V3E7UOobAnX8Hp2s1B+6cZnCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWPLKhLnT8ZRtNCYMsRSGKpXXd4FG9CWuKO5XD4ito0twnfgpufEcC+bmlyIjuTvJ i2PDB4j54Y9YxKu6ksvKq8jd4Oa1MzgbEWIlcQV7g1rPBCWOeVmAev36Do3g6VAidb h0dX0d7sI2kN2i1vetcw0nvQ7+0WoJJKGc63RgRIZn7iKhImONyj4rdH0TIItekmYp nW4B4fvTST8l6tIrtP+ypCG7ba0BpEQIWry4NC8EhSh5ojUKgu8eGAN6jSkCXVjvDL g450f4/s7Tdsust1LrkuEvI0fz/qe2pL3/G4zG7EzCMdxixRtm0RarMn3UWk3GCbd6 zQkYa2JvytBQw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, weiyi.lu@mediatek.com, ikjn@chromium.org, chun-jie.chen@mediatek.com, tinghan.shen@mediatek.com, seiya.wang@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH 2/2] arm64: dts: mediatek: mt8195: Make sure MSDCPLL's rate is 400MHz Date: Mon, 22 May 2023 11:30:02 +0200 Message-Id: <20230522093002.75137-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522093002.75137-1-angelogioacchino.delregno@collabora.com> References: <20230522093002.75137-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766587214656412616?= X-GMAIL-MSGID: =?utf-8?q?1766587214656412616?= Some bootloaders will set MSDCPLL's rate lower than 400MHz: what I have seen is this clock being set at around 384MHz. This is a performance concern (and possibly a stability one, for picky eMMC/SD cards) as the MSDC controller's internal divier will choose a frequency that is lower than expected, in the end causing a difference in the expected mmc/sd device's timings. Make sure that the MSDCPLL frequency is always set to 400MHz to both improve performance and reliability of the sd/mmc storage. Fixes: 37f2582883be ("arm64: dts: Add mediatek SoC mt8195 and evaluation board") Signed-off-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index a44aae4ab953..daac8e050ce7 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -852,6 +852,8 @@ apmixedsys: syscon@1000c000 { compatible = "mediatek,mt8195-apmixedsys", "syscon"; reg = <0 0x1000c000 0 0x1000>; #clock-cells = <1>; + assigned-clocks = <&apmixedsys CLK_APMIXED_MSDCPLL>; + assigned-clock-rates = <400000000>; }; systimer: timer@10017000 {