From patchwork Tue Jul 25 00:59:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 13325503 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 13D36C0015E for ; Tue, 25 Jul 2023 01:00:54 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FQg1ahSSjll5Xr5rlqJEUaeCfdj4HWONTDkyuQFXqjs=; b=sL5UQYSuNdkfXp TvaT6nV+zwm5GSxjh07eT7iezxPkAYez3W0/WePx7+jjAYVYLqk/dHBzGiO205KgZPjWqXXb+/wvg OoaiaxpDLGeEW558y6jwckoGzZXUC5DJDnONGSSOLBx7vIht4ss5xsHtMSefZI6SXOVsiRmPcjpYk TAX/wHkCiHUgIWU3CW2ZLRwk6/5800aoD6YTa1G/ohmjxcC1mXvGXs7TxWxJyD3i+zDD8cHyJ3zrC nDhfyz38UGEz/ElaTueNUZix7MdC2GKK3MoWwHUFn5EAbFqapSa2s7b2EYLvkpV3mc6UKK65n5+eo 32lDr92PhPkxwYcvi1yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Py-005nW1-2Z; Tue, 25 Jul 2023 01:00:50 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Pu-005nTo-0Y for linux-riscv@lists.infradead.org; Tue, 25 Jul 2023 01:00:47 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1bb575a6ed3so1529737fac.2 for ; Mon, 24 Jul 2023 18:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690246845; x=1690851645; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=GEp58o5jHhf4WpbbQN22nWQx0p8/zKOYMNnof7eHdFk=; b=vQYUIaP3UkOWg+UUsUvtJtrQeBkFRh2XYqhD/95/TJDC5tf8+Sxd4VYFWC5Qzp/DEa 1+J3CECCqJYhp6+EgvglH4ZqQ0VBS168afINnhIjGsD5jZUh9tdtFonMC3JwySuSgkP0 kdHC0TcCRCsnjY0EOZrhB3MFX/e6Gwf7UuEsCfMXSkHKkJ7g+Ht+16r5YgJdFstm2sE/ vdBabJh+hBe0a/u3QHX92/XIRR3HGtSY4N82AJLpFMIZJP8KAM76Bi+b6OqGHsP5uaxx YTcNykj6Tplcgg0qhI7b4Twowz7OWDbyWitEkx0TdwG0P70Er1rDwN8BW6EkJJBM23Z8 nz1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690246845; x=1690851645; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GEp58o5jHhf4WpbbQN22nWQx0p8/zKOYMNnof7eHdFk=; b=IPgEDuHubXF/sXwxQJLx41r4B0qV2o4U/OSxCsFPy7rzsLV8TJYOum//rg3UX53Y6R NxkWd6nyQUoSfqXx9XAPoDCFcG6+8mJDIN/a8nHBQLFit45ltQWZiFNFFgEPECN4NX3S wt+cB2NyjwYHPVRj/TmEFsviImuQcDeDS4+7pU8maPPN/8XF4dQTk7/gw64GApkB/EiP v343hOEr0K1wgeRBn95F3hq1bm71XNhl1a0Pb1N8cuS7ZBLYD7XvDg3AEkzfqaLGdotF wbwAFihizOSPKB+wv0rJWWsYUE8EJPGC94KEVjlf7ArCrK7QkK1fyHddalwePZbxkOnK +qnw== X-Gm-Message-State: ABy/qLb9TPyOWNtpm6WgokWxrS/nCcJt3KWjOQHPyWZj9OoSjs4fTfRJ 8zlzLVxKkLXCQEDKH3ld3u/byMCPPRLl/XDBMv8OOA== X-Google-Smtp-Source: APBJJlGYcDIG17o3mn7rt/BZ3kSGI2riAzNxr3+T4CZvjH8BN0WgGybsiUplpUKV0LnPk51YAiQb0Q== X-Received: by 2002:a05:6870:a2cd:b0:1ba:9a49:d967 with SMTP id w13-20020a056870a2cd00b001ba9a49d967mr12042723oak.23.1690246845066; Mon, 24 Jul 2023 18:00:45 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1800:f680:2cbf:9196:a906:e222]) by smtp.gmail.com with ESMTPSA id h18-20020a62b412000000b00682a75a50e3sm8576900pfn.17.2023.07.24.18.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 18:00:43 -0700 (PDT) From: Drew Fustini Date: Mon, 24 Jul 2023 17:59:15 -0700 Subject: [PATCH RFC 1/4] dt-bindings: mmc: sdhci-of-dwcmhsc: Add T-Head TH1520 compatible MIME-Version: 1.0 Message-Id: <20230724-th1520-emmc-v1-1-cca1b2533da2@baylibre.com> References: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> In-Reply-To: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Adrian Hunter , Ulf Hansson Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Robert Nelson , Jason Kridner , Drew Fustini X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690246840; l=752; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=N4XyeVof9hR52mLfjwIJ/Ek5oPrydhGBm0Gy7EtJsFw=; b=0OVYnsUPwsHTJB6utTUVvs+L8qB3QLAy9tLpLZXXUDTXz4CyeazHaGQ1XaIA7MYQNO7XeP0HB NVJqdcnkvQpAIxMHf7GEH1Vd/Pyve0bmoxyOFWcaiQtG8jPD3agvxxh X-Developer-Key: i=dfustini@baylibre.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230724_180046_211245_3A875C40 X-CRM114-Status: UNSURE ( 8.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add compatible value for the T-Head TH1520 dwcmshc controller. Signed-off-by: Drew Fustini Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml index a43eb837f8da..42804d955293 100644 --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml @@ -19,6 +19,7 @@ properties: - rockchip,rk3568-dwcmshc - rockchip,rk3588-dwcmshc - snps,dwcmshc-sdhci + - thead,th1520-dwcmshc reg: maxItems: 1 From patchwork Tue Jul 25 00:59:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 13325504 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 D363AEB64DD for ; Tue, 25 Jul 2023 01:00:55 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SfZGpxZEKwB2nGzhuADozqrHDhsHbBSNX9LC5i9/Tws=; b=MXkNkeh1ZIi1fe A5eVaTQimYH62Sbysi+s4tHhnT3e1+uG097dyUX0L/DyPkW2kpjLFnSF7flBcChjFquW30Q6HCOq8 3VWqKeV7I46u5l8F2Js4KqYllUVQanDcnWyQLks+j7hNjtzEAKjoaOUsaqTkdeWdfU/2FAeJfa1u+ Gkf+oCE0aBJpm9jaEssVStLMyrs4SYHaCAWyGdazu12dNEAsNjuRgXvbgIELV4ug39f+FwA73CcJg oJuTkhXj9yvucZ1syLDuVzn3J2Pa2spYPCVLtlw6SyE7HmLSR/ZLa8tNDnybLdZR8DEPpkwBWBoyi hxlUUPejZ5abLvT5rFUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Pz-005nWd-1B; Tue, 25 Jul 2023 01:00:51 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Pw-005nUP-2h for linux-riscv@lists.infradead.org; Tue, 25 Jul 2023 01:00:50 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-68336d06620so4670632b3a.1 for ; Mon, 24 Jul 2023 18:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690246847; x=1690851647; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vubcOJoroAr2qpLW2iybw1ATfvK07sgIvUXsKV/dGPo=; b=ZdxNwW6iD+ATHVZZmgMI/K5jv3cH2Ujnpa1n4KF84BDR/TFSOAgnarse9TTxC1kVHW xqBDH5rfDJk7lEaPUaVKWLlKqeZAlNF29DCSuXXiQyo5L3nvzeoUUq/9qe1Y0BSiJfzm 1C9AS63LVx0DIY0JJfZkSjBJ/T9s6e7yPM//pm91rXImPCUIDMJISbUUboI3IapNhzBk 0aQYmbQX7yeZcu2vlGe7QfCW5B8UjmClt7XtvwAa28hca7hr1AJ0/KAWYXrv0WRRKIVO oyZ8IFYxB/66dZR4O9OkKlipdd4bGMWHqmQLrQ1By1Uozf8yhIxDXeyFxKOFpQx3sRP1 mPfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690246847; x=1690851647; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vubcOJoroAr2qpLW2iybw1ATfvK07sgIvUXsKV/dGPo=; b=G/MaWf67k0cJnHHqefrO2/nRosbm074ayDpM4qIsIcs35QHNLz9coQodrNngt7c/R3 W8AhjcznVY2DLtkPdwx5UOYhmFmCKY7ElP6PiMZKRDMMs+Vd5Ifx8S8ISinE6i+M9G5u ++T6LT1UxFm0pS7+VrH8FIIEhICJUv2jsFeCnZw80BydHZSDDVnLV5lAGwksfGlOyZvm Z6ypx+KZ01CPbN/ejc29M4kn6Cw+u+1CJtifN5yDML/RGqWeomnjSYRWbSqzWiQbFxgT 9/xWJ61erTIU4VDQalzqnVCfXsSZhnc+rREeLTF3QajT26y18LTqf3pcs2Q3by0tiHxD w05A== X-Gm-Message-State: ABy/qLarvCW2ohZ0UprDPEKDwsIB63iTEtC+0YPrTA78OJynyS/DQgR+ Afqj350CBqP7t8GPGX8bSL3/kRTqro1ixj40ygkAMg== X-Google-Smtp-Source: APBJJlEAhjbsPgk3JD0vupzmDd8EQKw4DMuvw92Ytu2yFQiDXb5Y2QzGEzDlhzbWXyacnSEsLpMj0w== X-Received: by 2002:aa7:88d5:0:b0:63a:ea82:b7b7 with SMTP id k21-20020aa788d5000000b0063aea82b7b7mr13452644pff.28.1690246847286; Mon, 24 Jul 2023 18:00:47 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1800:f680:2cbf:9196:a906:e222]) by smtp.gmail.com with ESMTPSA id h18-20020a62b412000000b00682a75a50e3sm8576900pfn.17.2023.07.24.18.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 18:00:45 -0700 (PDT) From: Drew Fustini Date: Mon, 24 Jul 2023 17:59:16 -0700 Subject: [PATCH RFC 2/4] riscv: dts: thead: Add TH1520 mmc controller and sdhci clock MIME-Version: 1.0 Message-Id: <20230724-th1520-emmc-v1-2-cca1b2533da2@baylibre.com> References: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> In-Reply-To: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Adrian Hunter , Ulf Hansson Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Robert Nelson , Jason Kridner , Drew Fustini X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690246840; l=1329; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=6awbEzIrA6nzn4c2XYrw0EelLQcw8R2AyCuPywQYMDA=; b=K/Sjhx5qpvJO6IrC2wQpAqRt+DIritcPNunTAz3bS4QTSmeXIj/8HZ8iSzjVoM9e4wViBk+q+ s1qzxGvdPrQB5vXLmlawMw5qj8+rijZgtPdfrY4hxhbHh7fXpKK1n+2 X-Developer-Key: i=dfustini@baylibre.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230724_180048_876562_07DE4CE0 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add nodes for the SDHCI fixed clock and the first mmc controller which is typically connected to the eMMC device. Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index 56a73134b49e..b33bfb04c955 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -134,6 +134,13 @@ uart_sclk: uart-sclk-clock { #clock-cells = <0>; }; + sdhci_clk: sdhci-clock { + compatible = "fixed-clock"; + clock-frequency = <198000000>; + clock-output-names = "sdhci_clk"; + #clock-cells = <0>; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&plic>; @@ -291,6 +298,16 @@ dmac0: dma-controller@ffefc00000 { status = "disabled"; }; + mmc0: mmc@ffe7080000 { + compatible = "thead,th1520-dwcmshc"; + reg = <0xff 0xe7080000 0x0 0x10000 + 0xff 0xef014060 0x0 0x4>; + interrupts = <62 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "sdhciirq"; + clocks = <&sdhci_clk>; + clock-names = "core"; + }; + timer0: timer@ffefc32000 { compatible = "snps,dw-apb-timer"; reg = <0xff 0xefc32000 0x0 0x14>; From patchwork Tue Jul 25 00:59:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 13325505 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 D511BEB64DD for ; Tue, 25 Jul 2023 01:01:00 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3B9bewMV6kDI0tWFKZmSoG2zFuS0UkzHCir1RMhQzo8=; b=ArAP07nebYxOjR bRS1BkYIFfDGG1vVSAXTklI7MxOej1Eum4BkDOrLvcZzy6+Lxb+XtdXDAWzJjOrDBXoDQAoEfhALB oFU4vgFv5CCXO4NhYhIbAoT0tXtLeJVbf89vgE972XLkdz3ALKYit/Awgqn6ZLCHHdmuEbsDHHqYn GvRFUltyvDeBXLErlGCPucSSAnbPpM/g6g78N/dNGkK8OwkjqAj4aSDKtA9tuIEVmOFB62V02JbUX i3Jd08gYMekcWja7MM9s+wJ9dR/8/1PLUU5F0VOlgikgfoKgXBYpItz5p/DFP1iPU5rm93QcXcnAd 7GrNt0N3JiQTKVF+ar5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Q4-005nYE-1i; Tue, 25 Jul 2023 01:00:56 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Px-005nV4-2I for linux-riscv@lists.infradead.org; Tue, 25 Jul 2023 01:00:50 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-55b1238a013so3513267a12.3 for ; Mon, 24 Jul 2023 18:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690246849; x=1690851649; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ll0Z6sPfoNlYpMsjwTyfIvK2krIfZa7HiWUCwQnkPdA=; b=Qu+lOJSyR4OxlZZGUVqXiRX+LDk5oh9uv+g4FjzcapO3UEOndSDi8uoP6AxzAt/ZO4 AnPiggOfo+Jl5RcIG6rVXHL88EDLcI00pdFfoaY/Eyyr324sIbdNaxsKTCgCRLcjY+12 n3xOi+AaqVDjPL0tlC0crgKrr/QEZa7VTXtt7S9SEFoDpRyK9LTewNotXjx9i1EXyMVc A2K/NMAUjhM1tWw7P4iBY8fdfQebIk9f1MgGceUiwoWnWtnnA6kNj7x7cRHvX/uJGFVx JusGpwjhrPq4RjJpng4h7XkiaKHWXWTjm38FPi8G/RpJMC6u2cNen18Mp+I3DCTxweyn 3onw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690246849; x=1690851649; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ll0Z6sPfoNlYpMsjwTyfIvK2krIfZa7HiWUCwQnkPdA=; b=fQybRSArRMwRIuSAjtiMpUhzbyPpiuP7lQz5fcyWCr+kfC2LAboVLzk2quHIqlRVYG lhLfFw2gNbXX5UupQRuGRBu7LtKDIsKy9Oatd07RB5h1JJ0rkvskLbu66P/MH7LE3ns2 hGJ+UZqLRbW/5GchUV/OFHeeG+B09Fq9H2Pn2ebtjmJEQuDhWmRqs4oJ6OIb4jwpsSdY X8MGtUYYEFwbagWgGhEHaHBQ4898Mel4mh0l8xsZ0sSR9crux3Z4+DWCBHbBQZDwUu5M QzpMznT3SMaoNzVEG5VMVa4wnQHK1PhoHknU5K0bMij6nrRui1h4KhfAr41hGqIRtVV7 nn8A== X-Gm-Message-State: ABy/qLaG9Uqtp9ghTCb0Y3n3H0Mo5b4vg4F3FH8zSh7xEQgHgwgn8QN8 8DphpKRXtDaOH28bvNBo5Lg6PbFh62n1IDnwSF20uw== X-Google-Smtp-Source: APBJJlEJfbDJNH608pWUheZz5f97FYPk5RB/uAh2UtiLf7o4tdIdOe44w9xO37Xlj4wo9DuSj9jq8A== X-Received: by 2002:a05:6a20:12d3:b0:12f:bc36:4c67 with SMTP id v19-20020a056a2012d300b0012fbc364c67mr15897632pzg.61.1690246848782; Mon, 24 Jul 2023 18:00:48 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1800:f680:2cbf:9196:a906:e222]) by smtp.gmail.com with ESMTPSA id h18-20020a62b412000000b00682a75a50e3sm8576900pfn.17.2023.07.24.18.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 18:00:48 -0700 (PDT) From: Drew Fustini Date: Mon, 24 Jul 2023 17:59:17 -0700 Subject: [PATCH RFC 3/4] riscv: dts: thead: Enable BeagleV Ahead eMMC controller MIME-Version: 1.0 Message-Id: <20230724-th1520-emmc-v1-3-cca1b2533da2@baylibre.com> References: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> In-Reply-To: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Adrian Hunter , Ulf Hansson Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Robert Nelson , Jason Kridner , Drew Fustini X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690246840; l=933; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=vzPbiAqekRJrMwxZ/WMGUL3NDV27jNZgpcUxGuUx06o=; b=mnelfhkyum4sqvxQ4+7or/rnFxuZiOWaKusz28UsOyv+ffJpB1LIb1d/3yMhoePbv89hmvonH cSBi299EoneDiFg4Z7DO4In9ih5HiOMUBSPxPdlO+rJCS0RH4MHJTJX X-Developer-Key: i=dfustini@baylibre.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230724_180049_750658_2B335F6B X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add properties to the emmc node and enable it and set the frequency for the sdhci clock. Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts index c315e5bd3d2d..140f5d5c8c97 100644 --- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts @@ -52,6 +52,10 @@ &uart_sclk { clock-frequency = <100000000>; }; +&sdhci_clk { + clock-frequency = <198000000>; +}; + &dmac0 { status = "okay"; }; @@ -59,3 +63,13 @@ &dmac0 { &uart0 { status = "okay"; }; + +&mmc0 { + max-frequency = <198000000>; + non-removable; + mmc-hs400-1_8v; + no-sdio; + no-sd; + bus-width = <8>; + status = "okay"; +}; From patchwork Tue Jul 25 00:59:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 13325506 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 D3991C0015E for ; Tue, 25 Jul 2023 01:01:10 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nKQ5UdJgRggziroMCcMg19Wik3XU01G80QAUZkGDPUA=; b=2SX/iudQl0JCen zU+xDwHkE5KOyilQXDbHRYHtkN6flNfQts5KKvgXMeQmp+ACnJdqGOqbpted3UbRUL5/9X3wAn9cV i5/D3RjXngxwU753Lp39sHruQ/PLbDGqppJ1ayCdthsujOkJ/IOVPYm6Jj3i0cgWOaA3Pl6ita0Bf wmJ9I5EIFxg/PqpcBciT26AcCpvJZd1TAXnK/+ZNjABbU7Ufbd6dbULOuFaiejCjSCtAubAkojfQ6 HHS9h+iyi4e8lDQe25rW/StvbhIo2h3Pwt1DhjYbi02ucfDWXFXMfgPLzUrkqydAdM2znOXdvoFzQ 1WdUlmBoOowgp+KT6YFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Q5-005nYi-0K; Tue, 25 Jul 2023 01:00:57 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qO6Pz-005nW3-2E for linux-riscv@lists.infradead.org; Tue, 25 Jul 2023 01:00:53 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6b9a2416b1cso4132077a34.2 for ; Mon, 24 Jul 2023 18:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690246850; x=1690851650; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=opvEmLJsr/QQbcAlYd7WXi8TiNCEs7ncHrT0RHmS9/8=; b=QGoe5U/cP6/JbKqJ2W5R5HXMdXWcI91myJmhZF1IcmmVVSMcPgkKaeSWv5OJfkEccC yp/s4zDNIarGcJiUYx5+ZTwZ5UIX4G3IcMzxlJs4feySRwTBUTjqTYA27/yaDEy3V8CY abf2t/PC6WmZY90evepLw57upZ9kjMa3Jg5S1Ff9GpkANmpR5hoJiBHAbanMqK3mmr6O 5NxG83iWzYRgIzALFAGGsLa+gMzAbKY2MkB3OGhyZMD0UZfQMXhv3Pm+YmCIAIVbDcbE BPMqRONQbROtaXI3POURwQI+4nj0zo3tX/P3mS967ApjQYEjlNoRkIpTgT7WTm+kWLez xaxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690246850; x=1690851650; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=opvEmLJsr/QQbcAlYd7WXi8TiNCEs7ncHrT0RHmS9/8=; b=BV53KR3ZYVd5BQ5hVvL24k2osF+J+H6rZAzeWxBndUjyznvyam68YQ4EYQxWzXv+P7 o1V4taW3uKcWatDKcykpG40vCjBicIwulcB5OH/8YWFm3paDEEmW+B+ewOumEYm6MJIz kwZtWVMjIWx6z8A0+HZQaI6Urg+a8r0ZNOQocxYnfV8ReqakxfCCccbBU5+DKre9PDB2 4gqZRT5dwEwnufSKTque1jIjMyxXPpF24Xp4rt3JB3If97uIZVMvRgJtaI34wJFoTCKi 2sTP4HhtHQxmP+I933EaIbPWTusd1U+nbWmKAetR/3g5iBKWg4qbVGNl1pJB//moQm6H I8jQ== X-Gm-Message-State: ABy/qLaAeeYX9VQ1pi1aSEklbfU7VbUHVvlKsqiENQKtFYo7XlUWYOJ+ a0jSYYUWCJRy97LBmx3nASUOi33uXM/WHgWtWS9Jig== X-Google-Smtp-Source: APBJJlFDeeobTYnzUvjxmtkYRP6WYbZgY+v3A6Ooy7WVq5IX/yf+RwYi1xQ5rYaKoTw+cyA52VX00Q== X-Received: by 2002:a05:6358:921c:b0:133:84c:183b with SMTP id d28-20020a056358921c00b00133084c183bmr6561984rwb.3.1690246850219; Mon, 24 Jul 2023 18:00:50 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1800:f680:2cbf:9196:a906:e222]) by smtp.gmail.com with ESMTPSA id h18-20020a62b412000000b00682a75a50e3sm8576900pfn.17.2023.07.24.18.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 18:00:49 -0700 (PDT) From: Drew Fustini Date: Mon, 24 Jul 2023 17:59:18 -0700 Subject: [PATCH RFC 4/4] mmc: sdhci-of-dwcmshc: Add support for T-Head TH1520 MIME-Version: 1.0 Message-Id: <20230724-th1520-emmc-v1-4-cca1b2533da2@baylibre.com> References: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> In-Reply-To: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Adrian Hunter , Ulf Hansson Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Robert Nelson , Jason Kridner , Drew Fustini X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690246840; l=3367; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=WInr0KFI/7RNGf1vlxj94FbnpVdO/HALVPPXj1tclFA=; b=CBoelk9cIZQkR6tFrZ3ZtNCai9EU670gQqx42gBZSNRwfdFkWvgCd5AOai2jGe9yXUz2Wgg+S 2UO2u/9flbcAZY3uJy/ldFwYzG2mR59LbFDFIOO1M0zIiBQxWyaI9oW X-Developer-Key: i=dfustini@baylibre.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230724_180051_730968_93ED4D50 X-CRM114-Status: GOOD ( 18.47 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add basic support for the T-Head TH1520 SoC mmc controller. The new compatible "thead,th1520-dwcmshc" enables basic support by: - Enabling v4 mode to properly communicate with the mmc device - Setting quirk to disable ADMA - Setting flag to disable SDMA and force PIO mode - Turing .reset op into a no-op as the driver does not yet know how to configure the phy. Rely on the vendor u-boot to have configured the phy and do not reset the controller in Linux. Signed-off-by: Drew Fustini --- drivers/mmc/host/sdhci-of-dwcmshc.c | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c index e68cd87998c8..8573aff25a81 100644 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c @@ -337,6 +337,14 @@ static void rk35xx_sdhci_reset(struct sdhci_host *host, u8 mask) sdhci_reset(host, mask); } +static void th1520_sdhci_reset(struct sdhci_host *host, u8 mask) +{ + /* + * MMC controller and phy is configured by vendor u-boot so + * take the simplistic approach of not doing reset in Linux. + */ +} + static const struct sdhci_ops sdhci_dwcmshc_ops = { .set_clock = sdhci_set_clock, .set_bus_width = sdhci_set_bus_width, @@ -355,6 +363,15 @@ static const struct sdhci_ops sdhci_dwcmshc_rk35xx_ops = { .adma_write_desc = dwcmshc_adma_write_desc, }; +static const struct sdhci_ops sdhci_dwcmshc_th1520_ops = { + .set_clock = sdhci_set_clock, + .set_bus_width = sdhci_set_bus_width, + .set_uhs_signaling = dwcmshc_set_uhs_signaling, + .get_max_clock = dwcmshc_get_max_clock, + .reset = th1520_sdhci_reset, + .adma_write_desc = dwcmshc_adma_write_desc, +}; + static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = { .ops = &sdhci_dwcmshc_ops, .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, @@ -378,6 +395,13 @@ static const struct sdhci_pltfm_data sdhci_dwcmshc_rk35xx_pdata = { SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN, }; +static const struct sdhci_pltfm_data sdhci_dwcmshc_th1520_pdata = { + .ops = &sdhci_dwcmshc_th1520_ops, + .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | SDHCI_QUIRK_BROKEN_DMA | + SDHCI_QUIRK_BROKEN_ADMA, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, +}; + static int dwcmshc_rk35xx_init(struct sdhci_host *host, struct dwcmshc_priv *dwc_priv) { int err; @@ -434,6 +458,10 @@ static void dwcmshc_rk35xx_postinit(struct sdhci_host *host, struct dwcmshc_priv } static const struct of_device_id sdhci_dwcmshc_dt_ids[] = { + { + .compatible = "thead,th1520-dwcmshc", + .data = &sdhci_dwcmshc_th1520_pdata, + }, { .compatible = "rockchip,rk3588-dwcmshc", .data = &sdhci_dwcmshc_rk35xx_pdata, @@ -546,6 +574,20 @@ static int dwcmshc_probe(struct platform_device *pdev) sdhci_enable_v4_mode(host); #endif + if (pltfm_data == &sdhci_dwcmshc_th1520_pdata) { + /* + * The controller needs v4 mode enabled to properly + * communicate with the mmc device. + */ + sdhci_enable_v4_mode(host); + + /* + * Set flag so the SDHCI host core will disable DMA + * and use PIO mode. + */ + host->flags &= ~SDHCI_USE_SDMA; + } + host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; err = sdhci_setup_host(host);