linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Cody Eksal <masterr3c0rd@epochal.quest>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-phy@lists.infradead.org, linux-usb@vger.kernel.org,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Yangtao Li <frank@allwinnertech.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Parthiban <parthiban@linumiz.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Thierry Reding <treding@nvidia.com>,
	Maxime Ripard <mripard@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yangtao Li <tiny.windzz@gmail.com>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH 06/13] phy: sun4i-usb: add support for A100 USB PHY
Date: Thu, 24 Oct 2024 20:22:33 +0100	[thread overview]
Message-ID: <20241024202216.6cded8c4@minigeek.lan> (raw)
In-Reply-To: <20241024170540.2721307-7-masterr3c0rd@epochal.quest>

On Thu, 24 Oct 2024 14:05:24 -0300
Cody Eksal <masterr3c0rd@epochal.quest> wrote:

Hi,

> From: Yangtao Li <frank@allwinnertech.com>
> 
> Add support for a100's usb phy, which with 2 PHYs.
> 
> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> [masterr3c0rd@epochal.quest: modified to use quirk flags]
> Signed-off-by: Cody Eksal <masterr3c0rd@epochal.quest>
> ---
>  drivers/phy/allwinner/phy-sun4i-usb.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
> index b0f19e950601..a3942b2ee90b 100644
> --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> @@ -1006,6 +1006,16 @@ static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = {
>  	.phy0_dual_route = true,
>  };
>  
> +static const struct sun4i_usb_phy_cfg sun50i_a100_cfg = {
> +	.num_phys = 2,
> +	.disc_thresh = 3,

This member is never used when .siddq_in_base is true (and yes, this is
wrong for the H616 too), ...

> +	.phyctl_offset = REG_PHYCTL_A33,
> +	.dedicated_clocks = true,
> +	.hci_phy_ctl_clear = PHY_CTL_SIDDQ,
> +	.phy0_dual_route = true,
> +	.siddq_in_base = true,

... which makes this whole description identical to the D1 version.
So at the very least we wouldn't this new a100_cfg, but instead just
point to the existing d1_cfg.

> +};
> +
>  static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = {
>  	.num_phys = 4,
>  	.phyctl_offset = REG_PHYCTL_A33,
> @@ -1040,6 +1050,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = {
>  	{ .compatible = "allwinner,sun20i-d1-usb-phy", .data = &sun20i_d1_cfg },
>  	{ .compatible = "allwinner,sun50i-a64-usb-phy",
>  	  .data = &sun50i_a64_cfg},
> +	{ .compatible = "allwinner,sun50i-a100-usb-phy", .data = &sun50i_a100_cfg },

And this also brings up the question whether we need a new compatible
string. As it stands now, we could also use:
	compatible = "allwinner,sun50i-a100-usb-phy",
		     "allwinner,sun20i-d1-usb-phy";

and wouldn't need any driver changes at all. Which would have the neat
side effect to make USB work already with v5.18 kernels.

The only downside is the somewhat weird ordering of the compatible
strings, with the much newer chip as the fallback.

What do other people think here?

Cheers,
Andre


>  	{ .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg },
>  	{ .compatible = "allwinner,sun50i-h616-usb-phy", .data = &sun50i_h616_cfg },
>  	{ .compatible = "allwinner,suniv-f1c100s-usb-phy",



  reply	other threads:[~2024-10-24 20:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 17:05 [PATCH 00/13] sunxi: A100/A133 second stage support Cody Eksal
2024-10-24 17:05 ` [PATCH 01/13] arm64: dts: allwinner: A100: Add PMU mode Cody Eksal
2024-10-24 17:05 ` [PATCH 02/13] arm64: dts: allwinner: a100: add watchdog node Cody Eksal
2024-10-24 17:05 ` [PATCH 03/13] dt-bindings: phy: sun50i-a64: add a100 compatible Cody Eksal
2024-10-27 21:11   ` Rob Herring (Arm)
2024-10-28 16:40     ` Cody Eksal
2024-10-24 17:05 ` [PATCH 04/13] dt-bindings: usb: Add A100 compatible string Cody Eksal
2024-10-25 10:09   ` Andre Przywara
2024-10-27 21:12   ` Rob Herring (Arm)
2024-10-27 21:22     ` Rob Herring
2024-10-28 16:02       ` Cody Eksal
2024-10-24 17:05 ` [PATCH 05/13] dt-bindings: usb: sunxi-musb: " Cody Eksal
2024-10-27 20:47   ` Krzysztof Kozlowski
2024-10-28 16:06     ` Cody Eksal
2024-10-24 17:05 ` [PATCH 06/13] phy: sun4i-usb: add support for A100 USB PHY Cody Eksal
2024-10-24 19:22   ` Andre Przywara [this message]
2024-10-28 16:15     ` Cody Eksal
2024-10-24 17:05 ` [PATCH 07/13] arm64: dts: allwinner: a100: add usb related nodes Cody Eksal
2024-10-26  0:44   ` Andre Przywara
2024-10-28 16:31     ` Cody Eksal
2024-10-26  1:29   ` Chen-Yu Tsai
2024-10-28 16:35     ` Cody Eksal
2024-10-24 17:05 ` [PATCH 08/13] arm64: allwinner: A100: enable EHCI, OHCI and USB PHY nodes in Perf1 Cody Eksal
2024-10-24 17:05 ` [PATCH 09/13] arm64: allwinner: a100: Add MMC related nodes Cody Eksal
2024-10-24 17:05 ` [PATCH 10/13] arm64: dts: allwinner: a100: perf1: Add eMMC and MMC node Cody Eksal
2024-10-24 17:05 ` [PATCH 11/13] dt-bindings: opp: h6: Add A100 operating points Cody Eksal
2024-10-27 20:47   ` Krzysztof Kozlowski
     [not found]     ` <13a5e833ce19df20b0420d7f1052fd96@epochal.quest>
2024-10-27 21:17       ` Krzysztof Kozlowski
2024-10-28 16:18         ` Cody Eksal
2024-10-24 17:05 ` [PATCH 12/13] cpufreq: sun50i: add a100 cpufreq support Cody Eksal
2024-10-24 17:05 ` [PATCH 13/13] arm64: dts: allwinner: a100: Add CPU Operating Performance Points table Cody Eksal
2024-10-25 12:27   ` Andre Przywara
2024-10-28 16:42     ` Cody Eksal
2024-10-25 13:55 ` [PATCH 00/13] sunxi: A100/A133 second stage support Rob Herring (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241024202216.6cded8c4@minigeek.lan \
    --to=andre.przywara@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=frank@allwinnertech.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-usb@vger.kernel.org \
    --cc=masterr3c0rd@epochal.quest \
    --cc=mripard@kernel.org \
    --cc=nm@ti.com \
    --cc=parthiban@linumiz.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=sboyd@kernel.org \
    --cc=tiny.windzz@gmail.com \
    --cc=treding@nvidia.com \
    --cc=vireshk@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).