From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4720C001DE for ; Tue, 25 Jul 2023 15:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232653AbjGYPyQ (ORCPT ); Tue, 25 Jul 2023 11:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbjGYPyP (ORCPT ); Tue, 25 Jul 2023 11:54:15 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 400B5210A for ; Tue, 25 Jul 2023 08:54:13 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b8ad356fe4so35645775ad.2 for ; Tue, 25 Jul 2023 08:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690300452; x=1690905252; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yPT2stxFChZpMg6h3D81cBqzyJBn0I25fZ2MBYv8irM=; b=eD7kANSdAAjiTC37YAfsbtVn214CSpat8MudtF+68viBVkhN/n+RrCvV36qnEGHl6Y nPebh5ij0FBewMkONhjPgvJZC1dy3YYTeJj/WbGwNjGt//VUvZZnpFFjuOZ+Jxc7x2/Q LLaf3ZHb7stUjV+a5Q2DT8P4+CRldCPKRmMD4L8hmsnPTzdQitjoNc+c2p51Whq66UNz M5WVBLSdvJ1IOe1y045VZw1aOsQt+Ql4RV1Y9MEanRKF2Y3PSxcQ/ZlZ028Xp4OYNcqw ACrcWe+xfjoNI+FnSZNTcGxVsLK54BAtURKW2yGIqMWSZyMWvupBPMHG9Et+JrFPr/YL S1Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690300452; x=1690905252; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yPT2stxFChZpMg6h3D81cBqzyJBn0I25fZ2MBYv8irM=; b=IMURYZSxaaeXow5Q7njP/7XcE+JXqgHWbWZJN4Sqj2hSYAUATcaSUFHrfTKYID+XYF pBAIdi4mNXs7+CV5O3OgohW3w4zpoHOwLszM00bxbtVSC+QRJbzgEP7tTntTsV94R4kt a9OcaJPo3OT771MpMAC6KlU71QWwkDI6JLOPaO2H/n9m8w5fYubt8c0rRBxUxj06dmvS i3L/HC+BLGjvLkgcxbBe0UID6mBG3trP4VbVDdgL8Tfe3JJvlb6f/ahlgqiV76LVpaTn A4ELCx0HmhJ8MElN5xbDnZRMoY+XvHhrr5Vmoc3s9oY/KfCoUveZmjTjWpgPNFuk6fda BSCA== X-Gm-Message-State: ABy/qLaC+jy8YmlyoNcnrHMUwbqGSMI5GiQ//vRTgNu1SqHXP/tOaX/I wsVvpvJVRmgtVyKimPCsHb63tg== X-Google-Smtp-Source: APBJJlH+vInGZEOGDW0JESmSk+/b0VDKB7Yl0EonVeDj+0oEV2iQCQjLxobPmSDkYNEnTf2Bdija5g== X-Received: by 2002:a17:90b:4c51:b0:263:5702:d4c5 with SMTP id np17-20020a17090b4c5100b002635702d4c5mr11605845pjb.19.1690300452577; Tue, 25 Jul 2023 08:54:12 -0700 (PDT) Received: from x1 ([2601:1c2:1800:f680:2cbf:9196:a906:e222]) by smtp.gmail.com with ESMTPSA id gf4-20020a17090ac7c400b00263d15f0e87sm8225180pjb.42.2023.07.25.08.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 08:54:12 -0700 (PDT) Date: Tue, 25 Jul 2023 08:54:10 -0700 From: Drew Fustini To: Jisheng Zhang Cc: Guo Ren , Fu Wei , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Adrian Hunter , Ulf Hansson , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Robert Nelson , Jason Kridner Subject: Re: [PATCH RFC 4/4] mmc: sdhci-of-dwcmshc: Add support for T-Head TH1520 Message-ID: References: <20230724-th1520-emmc-v1-0-cca1b2533da2@baylibre.com> <20230724-th1520-emmc-v1-4-cca1b2533da2@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Jul 25, 2023 at 11:03:44PM +0800, Jisheng Zhang wrote: > On Mon, Jul 24, 2023 at 05:59:18PM -0700, Drew Fustini wrote: > > Add basic support for the T-Head TH1520 SoC mmc controller. The new > > compatible "thead,th1520-dwcmshc" enables basic support by: > > Hi Drew, > > > > > - 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. > > The last three itmes are not acceptable. The controller supports ADMA > well, can you plz bring in the phy driver? We can't rely on bootloader to > configure phy. Yes, that makes sense that this is not acceptable. The T-Head vendor kernel seems to contain all the necessary information needed to add the phy configuration to sdhci-of-dwcmshc. The shipping kernel for the BeagleV Ahead [1] is based on the T-Head SDK releases. I looked at changes to drivers/mmc and found that key changes are from Linux_SDK_V0.9.5 [2] and Linux_SDK_V1.0.2 [3]. That kernel contains drivers/mmc/host/sdhci-of-dwcmshc.h [4] which seems to define information about the phy registers. The version of drivers/mmc/host/sdhci-of-dwcmshc.h in that kernel defines several functions for the phy config and controller reset: sdhci_phy_1_8v_init_no_pull sdhci_phy_3_3v_init_no_pull snps_phy_1_8v_init snps_phy_3_3v_init snps_sdhci_set_phy snps_sdhci_reset I'll look into adapting that code into the upstream sdhci-of-dwcmshc. Thanks, Drew [1] https://git.beagleboard.org/beaglev-ahead/beaglev-ahead-linux [2] https://gist.github.com/pdp7/8d85d736dea24957c017eefdeb882668 [3] https://gist.github.com/pdp7/c1d3a18f9b7c25e630573d5953a58c99 [4] https://git.beagleboard.org/beaglev-ahead/beaglev-ahead-linux/-/blob/beaglev-v5.10.113-1.1.2/drivers/mmc/host/sdhci-of-dwcmshc.h [5] https://git.beagleboard.org/beaglev-ahead/beaglev-ahead-linux/-/blob/beaglev-v5.10.113-1.1.2/drivers/mmc/host/sdhci-of-dwcmshc.c