From patchwork Mon Mar 22 18:58:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12155941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5066FC433C1 for ; Mon, 22 Mar 2021 19:01:40 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC3DF61992 for ; Mon, 22 Mar 2021 19:01:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC3DF61992 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=CRicwOU2cTOvqvSP59UsLJ5ns45lUuX48h//X9VpwPk=; b=pdy7WrWgBCSy59Tvw34JZHH24 23q2OkmJkOHUjf1+OCkidRAsALxC5vIwLNHMLVgj7lGxEJl8u7/lGYEQQti0FNDXn8RquPWtOQVF3 R/FHvZXI4rPnbQhHIcqpmVvncxIBY0DpvYYbT35A+/c7MiU655RRyR2Efm3DrpAyknLcGTtzOYGoS 2ZNh6DvHRLubo6wtb08qfsiqHGwrks1eS4fTFaomXf8xy1K56A3uOc3gJff9IVlaNQMOhnIIH4pwh c0B/HrZn1yMDU5YRnuSxSp78T0zobYbVqTT+W4uphhGFpjNNfGNjnlsf52vamMxcsuTn+WjHagsGQ pAeATzpSg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOPm4-00CN7e-2c; Mon, 22 Mar 2021 18:59:36 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOPls-00CN3S-4Y; Mon, 22 Mar 2021 18:59:26 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF46E6199F; Mon, 22 Mar 2021 18:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616439562; bh=y1ZkXj1p9qb2LpsafIaIzi+n5YFdfgSKB2+GzEoekEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rGZp0km82YYtIIZJ1y3Eqz/ipHYqARAf4K34McixWHy3ntDWvuqi29tI6ScpjeRL5 emytAe/owDssH0WhKUJa4RNP9uxv0P1KQl96j+GpZTbudc6i8hP4fMuzR0oAaAPY+K BpnsNRcKu+g5QC6YrzFSZNQY4ffg5EMRdsxVTvkbxT80XAM/89yOb0Qpwt7LDO/Swo d3EuzOmDOSmcThb78/R1mi29tTAXxf77izAoVF4BlNvgxFCY7/BAFHbwYZNdxL2ECz FZgs0wollp1HKmNUi71ETvdJ6yZRJg3cymEwo9tidjvlEJmQiI0uDxYMxDFdzzZH96 tHBbtwFWGh30A== From: Nicolas Saenz Julienne To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Saenz Julienne , Ulf Hansson , Ray Jui , Scott Branden Cc: f.fainelli@gmail.com, phil@raspberrypi.com, tim.gover@raspberrypi.com, adrian.hunter@intel.com, alcooperx@gmail.com, nsaenzjulienne@suse.de, linux-kernel@vger.kernel.org, Rob Herring Subject: [PATCH 1/4] dt-bindings: mmc: iproc-sdhci: Convert to json-schema Date: Mon, 22 Mar 2021 19:58:14 +0100 Message-Id: <20210322185816.27582-2-nsaenz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322185816.27582-1-nsaenz@kernel.org> References: <20210322185816.27582-1-nsaenz@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_185924_594082_0F537F2B X-CRM114-Status: GOOD ( 13.48 ) 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 Convert the brcm,iproc-sdhci binding to DT schema format using json-schema Signed-off-by: Nicolas Saenz Julienne --- .../bindings/mmc/brcm,iproc-sdhci.yaml | 58 +++++++++++++++++++ .../bindings/mmc/brcm,sdhci-iproc.txt | 37 ------------ 2 files changed, 58 insertions(+), 37 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml delete mode 100644 Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml new file mode 100644 index 000000000000..19d84f3ef9e6 --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/brcm,iproc-sdhci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Broadcom IPROC SDHCI controller + +maintainers: + - Nicolas Saenz Julienne + +allOf: + - $ref: mmc-controller.yaml# + +properties: + compatible: + enum: + - brcm,bcm2835-sdhci + - brcm,bcm2711-emmc2 + - brcm,sdhci-iproc-cygnus + - brcm,sdhci-iproc + + reg: + minItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + description: + Handle to core clock for the sdhci controller. + + sdhci,auto-cmd12: + type: boolean + description: Specifies that controller should use auto CMD12 + +required: + - compatible + - reg + - interrupts + - clocks + +unevaluatedProperties: false + +examples: + - | + sdhci0: sdhci@18041000 { + compatible = "brcm,sdhci-iproc-cygnus"; + reg = <0x18041000 0x100>; + interrupts = ; + clocks = <&lcpll0_clks BCM_CYGNUS_LCPLL0_SDIO_CLK>; + bus-width = <4>; + sdhci,auto-cmd12; + no-1-8-v; + }; + +... diff --git a/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt b/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt deleted file mode 100644 index 09d87cc1182a..000000000000 --- a/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt +++ /dev/null @@ -1,37 +0,0 @@ -Broadcom IPROC SDHCI controller - -This file documents differences between the core properties described -by mmc.txt and the properties that represent the IPROC SDHCI controller. - -Required properties: -- compatible : Should be one of the following - "brcm,bcm2835-sdhci" - "brcm,bcm2711-emmc2" - "brcm,sdhci-iproc-cygnus" - "brcm,sdhci-iproc" - -Use brcm2835-sdhci for the eMMC controller on the BCM2835 (Raspberry Pi) and -bcm2711-emmc2 for the additional eMMC2 controller on BCM2711. - -Use sdhci-iproc-cygnus for Broadcom SDHCI Controllers -restricted to 32bit host accesses to SDHCI registers. - -Use sdhci-iproc for Broadcom SDHCI Controllers that allow standard -8, 16, 32-bit host access to SDHCI register. - -- clocks : The clock feeding the SDHCI controller. - -Optional properties: - - sdhci,auto-cmd12: specifies that controller should use auto CMD12. - -Example: - -sdhci0: sdhci@18041000 { - compatible = "brcm,sdhci-iproc-cygnus"; - reg = <0x18041000 0x100>; - interrupts = ; - clocks = <&lcpll0_clks BCM_CYGNUS_LCPLL0_SDIO_CLK>; - bus-width = <4>; - sdhci,auto-cmd12; - no-1-8-v; -}; From patchwork Mon Mar 22 18:58:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12155939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5732CC433E0 for ; Mon, 22 Mar 2021 19:01:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8D08619A0 for ; Mon, 22 Mar 2021 19:01:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8D08619A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=jjYN6O0YV7TiLnxcQsFL9bMTFfG5mXx16nnv3BACMww=; b=Dfh/YDuCGyeyixhVYYYPIvYIk /ijVACvrrVNVnGQQVTCGY8Ye5+o4dfkgxuS53P/GRb1VPb531dj/sVwx2OYYj+I9zmhxvgJbvj4ND aVPNnl7pXVwqpSeDXp46qq8RtjpxNsTCaeP8jguUAm3RlurWgxbft41KcYMU2HOLcF/97J0ZhxR6V PkUWJjK16a+1YgOfgfgnqGQg7X9N3Bx7vbgrvWGOODw15GBrQWIGeb465SqjYe1T7KUDuQU9/ZUzn Sws3eDplE4ammy3wL5r6PrL32WQEr3OWaggt4b9wV/Q3hfOOyGO+zKuUbUPcSNCFpNLLHIQHUfxMm ocw24LZlw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOPmE-00CNAH-HE; Mon, 22 Mar 2021 18:59:46 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOPlv-00CN4Y-Jm; Mon, 22 Mar 2021 18:59:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FCCB61994; Mon, 22 Mar 2021 18:59:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616439566; bh=WlVTEDge8a2sWi1YSIL9GHQT08rBMoQZeeSuGahDmm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RaAg53L+LqoHwm+LT0HjGQ5rYxsxUuMG1d3ilweQGgHiRWwxLmzJ36II9eMGyzm96 V388kwNmgSef90LURzrBpjCBWx2tPd8yXqEjsgqAdPg8UEGOFeu9QA8XaCkHYwWdz/ htR5BgjklZO2zE4Kxrj52RJuejuYDYGwGV2I2ftvTVLPZIuSKbkBYmXOtRiquGmsng YcCHCGE2oohWT80QPiRpMrbz6JNqKZiWLTuqjUdhjkkkUhpD6lkdaMIErbPkx2yxjY CWxtKooosprYVrOLH4gYb5kKA5A7TkbGWuELuRCJeVoyt2uxL62CoJPnninquorhig up+/dd/Tm63TA== From: Nicolas Saenz Julienne To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Saenz Julienne , Ulf Hansson , Ray Jui , Scott Branden Cc: f.fainelli@gmail.com, phil@raspberrypi.com, tim.gover@raspberrypi.com, adrian.hunter@intel.com, alcooperx@gmail.com, nsaenzjulienne@suse.de, linux-kernel@vger.kernel.org, Rob Herring Subject: [PATCH 2/4] dt-bindings: mmc: iproc-sdhci: Add clock-frequency support Date: Mon, 22 Mar 2021 19:58:15 +0100 Message-Id: <20210322185816.27582-3-nsaenz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322185816.27582-1-nsaenz@kernel.org> References: <20210322185816.27582-1-nsaenz@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_185927_883874_68597248 X-CRM114-Status: UNSURE ( 8.80 ) X-CRM114-Notice: Please train this message. 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 Users might want to choose a different clock frequency than whatever the bootloader provided at probe time. Add 'clock-frequency' bindings. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml index 19d84f3ef9e6..9d0d97b2c0a7 100644 --- a/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml +++ b/Documentation/devicetree/bindings/mmc/brcm,iproc-sdhci.yaml @@ -35,6 +35,12 @@ properties: type: boolean description: Specifies that controller should use auto CMD12 + clock-frequency: + description: + Should be the frequency (in Hz) of the core clock. If this is specified + and the core clock is specified then we'll try to set the core clock to + this at probe time. + required: - compatible - reg From patchwork Mon Mar 22 18:58:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12155943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EB22C433C1 for ; Mon, 22 Mar 2021 19:01:45 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20CE061994 for ; Mon, 22 Mar 2021 19:01:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20CE061994 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=TLEUQLYLsgFPMGh7+ai3WnjCM/FdGUM7hQQL1cnDuhE=; b=XH9bySh+grYvcoms9BhNP2c+2 wK4zjIgN4CkK3lhsz4vkXreplsAAg3Mg0pyJ/38uNjnSMH8kCiIuTVjmQesiIlABBrcEkAeISRUsm kEJ199WvBCJtQEf/m8CXwIxcuqsbQ3FiSZpnLtTdVhG135njhoUhlBRfUTE0G3RDPJEqwqWoYGU3s 3QPJJqqanF7G2KyGalv8uBRw4ijLetLLhIeSgUvDvHpWc9aeJAZGNZ4aZyDobHcdfQkPakjkL4VyP KyMJQvbCAkiGrzge++DnexYXV9Z1XVIgN2wjLUTEUs6ZfSPBujtzpV2QbbT1Nsts3bbg0Fvi6DSH2 kBbVvcvTQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOPmW-00CNFT-Bu; Mon, 22 Mar 2021 19:00:04 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOPly-00CN5d-JO; Mon, 22 Mar 2021 18:59:32 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B935D619A8; Mon, 22 Mar 2021 18:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616439569; bh=3WJZ+xKT9j6gw9UE+xMc27OkZKOFyhJ+cIpSqbqXuBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EKELXgM3XqhR4YSRZUHp5ZU6eoD1pjbdwmVJcdeBhnjS6ry1K/Zby/24yCwTti9tC 49eVr4lL9glgiM0uCESrbFBnqB3BDEE5nlOIl2RXQjFgebnynbMb/dOQZOv65rYyFf B1C6TuoB6PfEsXbCR+wvFspZy7Vt7m8sTxlvADHvo8g4t1uZRdEmCUq4n7lkzklP4/ 17o5pgqN5D4ce2YUnXcVrUE7fu8iqUESqsfX6Xwn7k5WzM3xUMz9c515t5Zs3J+IX6 iJ4IxHf67yTSbrML4p5LpYTZMwfXX5+Oj29sAys1IKKYMLUy5cnQhUMzyyUEkcKknc zNI95nDugy+xg== From: Nicolas Saenz Julienne To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Saenz Julienne , Adrian Hunter , Ray Jui , Scott Branden Cc: f.fainelli@gmail.com, phil@raspberrypi.com, tim.gover@raspberrypi.com, alcooperx@gmail.com, nsaenzjulienne@suse.de, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org Subject: [PATCH 3/4] mmc: sdhci-iproc: Set clock frequency as per DT Date: Mon, 22 Mar 2021 19:58:16 +0100 Message-Id: <20210322185816.27582-4-nsaenz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322185816.27582-1-nsaenz@kernel.org> References: <20210322185816.27582-1-nsaenz@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_185931_226446_02860553 X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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: Nicolas Saenz Julienne devicetree might request a clock frequency different from whatever is set-up by the bootloader. Make sure to setup the new rate. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-iproc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index ddeaf8e1f72f..536c382e2486 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -358,6 +358,16 @@ static int sdhci_iproc_probe(struct platform_device *pdev) ret = PTR_ERR(pltfm_host->clk); goto err; } + + if (pltfm_host->clock) { + ret = clk_set_rate(pltfm_host->clk, pltfm_host->clock); + if (ret) { + dev_err(dev, "failed to set host clk at %u Hz\n", + pltfm_host->clock); + goto err; + } + } + ret = clk_prepare_enable(pltfm_host->clk); if (ret) { dev_err(dev, "failed to enable host clk\n"); From patchwork Mon Mar 22 18:58:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12155965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36D21C433DB for ; Mon, 22 Mar 2021 19:02:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B69CD61994 for ; Mon, 22 Mar 2021 19:02:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B69CD61994 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=vfPBXUg/fTgkYdj2hO20h0wtlIPwIcYL85TTj/SKDbM=; b=JQbrc+wrlmUFt8WunpzYmkLMm HhVsr+nH/gfAppiBQw29iCFduQwVYBvPFLwIbaCubD/40pM5t4ir/PwA8eZT2XpyXGRNsHwBtdTHt uLZ/AOjtH3ZaKLetMtZXi9Ue1pm4MvxQ2dWMOGMuMWNjlyq7DZryn8ZsygVRIYKFdiOWC72VAU75f ES0zNaGOpBgur3pEG9PjnxZf0hHklsEPb4gMguoSrT2k1UJuRxCym50nLMAHx9YcbtdmUcMe/Fyqc QKJodUcfclsAbuxsqKXpq82UtJNschkGoGQjormWGWL0eOsAk8rf6a7nAS0tA2rHfiCxRcpi/pYni Mp1IwowGQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOPmk-00CNKf-Fj; Mon, 22 Mar 2021 19:00:20 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOPm2-00CN6l-1e; Mon, 22 Mar 2021 18:59:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E84396199F; Mon, 22 Mar 2021 18:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616439572; bh=s6ymiQxwePb20Kp2RAPsG0nP87bGAxMicsdfeJT0mC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ihW3OvOyJmZH+nfKxl3tTK7pmHcaotogYNZlucLYTpV+bfEmX8LFahc17He9AAf/m JYU76wRHhuZgoXBcm81UnVqOTWBZ7QZThqPjO/4o4m2uv3HZ6WNpmnNdzByFxdAbOa pCwMes1lQIQe1TQCu8sZKhVP9oXMINdp0rSi2DAkN+ZCzhG9xl1FueQeS7894UsLjE WRKkaByrfxKF3JudCMmXsq/0BfMly+vdsq6CPGsIJg2k7fJ8HB1lR1B5s5AgCPSPIY EPehDR2OZqWhTDuYF86UL5dX8fuH5bVa4VQo97ErS7g8gf1X86AP/Ax1gzrlWGgzvc unuKPEE9P1JFQ== From: Nicolas Saenz Julienne To: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Saenz Julienne , Rob Herring , Nicolas Saenz Julienne Cc: f.fainelli@gmail.com, phil@raspberrypi.com, tim.gover@raspberrypi.com, adrian.hunter@intel.com, sbranden@broadcom.com, alcooperx@gmail.com, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org Subject: [PATCH 4/4] ARM: dts: Fix-up EMMC2 controller's frequency Date: Mon, 22 Mar 2021 19:58:17 +0100 Message-Id: <20210322185816.27582-5-nsaenz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322185816.27582-1-nsaenz@kernel.org> References: <20210322185816.27582-1-nsaenz@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_185934_576419_8496137C X-CRM114-Status: UNSURE ( 8.23 ) X-CRM114-Notice: Please train this message. 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: Nicolas Saenz Julienne Force emmc2's frequency to 150MHz as the default 100MHz (set by FW) seems to interfere with the VPU clock when setup at frequencies bigger than 500MHz (a pretty common case). This ends up causing unwarranted SDHCI CMD hangs when no SD card is present. Signed-off-by: Nicolas Saenz Julienne --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index 3b4ab947492a..9aa8408d9960 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -257,6 +257,12 @@ &emmc2 { vqmmc-supply = <&sd_io_1v8_reg>; vmmc-supply = <&sd_vcc_reg>; broken-cd; + /* + * Force the frequency to 150MHz as the default 100MHz seems to + * interfere with the VPU clock when setup at frequencies bigger than + * 500MHz, causing unwarranted CMD hangs. + */ + clock-frequency = <150000000>; status = "okay"; };