public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/3] phy: phy-sun4i-usb: add allwinner f1c100s configuration
@ 2023-06-09 14:11 路辉
  2023-06-10  0:14 ` Andre Przywara
  0 siblings, 1 reply; 2+ messages in thread
From: 路辉 @ 2023-06-09 14:11 UTC (permalink / raw)
  To: u-boot

From 09a85536f92cfd22f2a6feba8ea91fae4bc41ed8 Mon Sep 17 00:00:00 2001
From: Lu Hui <luhux76@gmail.com>
Date: Fri, 9 Jun 2023 22:04:56 +0800
Subject: [PATCH 1/3] phy: phy-sun4i-usb: add allwinner f1c100s configuration

---
 drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c
b/drivers/phy/allwinner/phy-sun4i-usb.c
index 6428163c18..8425a83c84 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -4,6 +4,7 @@
  * Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
  * Copyright (C) 2015 Hans de Goede <hdegoede@redhat.com>
  * Copyright (C) 2014 Roman Byshko <rbyshko@gmail.com>
+ * Copyright (C) 2023 Lu Hui <luhux76@gmail.com>
  *
  * Modelled arch/arm/mach-sunxi/usb_phy.c to compatible with generic-phy.
  *
@@ -83,6 +84,7 @@ enum sun4i_usb_phy_type {
     sun8i_v3s_phy,
     sun50i_a64_phy,
     sun50i_h6_phy,
+    suniv_f1c100s_phy,
 };

 struct sun4i_usb_phy_cfg {
@@ -372,8 +374,9 @@ static int sun4i_usb_phy_xlate(struct phy *phy,
 {
     struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);

-    if (args->args_count >= data->cfg->num_phys)
+    if (args->args_count > data->cfg->num_phys) {
         return -EINVAL;
+    }

     if (data->cfg->missing_phys & BIT(args->args[0]))
         return -ENODEV;
@@ -531,6 +534,14 @@ static int sun4i_usb_phy_probe(struct udevice *dev)
     return 0;
 }

+static const struct sun4i_usb_phy_cfg suniv_f1c100s_cfg = {
+    .num_phys = 1,
+    .type = suniv_f1c100s_phy,
+    .disc_thresh = 3,
+    .phyctl_offset = REG_PHYCTL_A10,
+    .dedicated_clocks = true,
+};
+
 static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = {
     .num_phys = 3,
     .type = sun4i_a10_phy,
@@ -659,6 +670,7 @@ static const struct udevice_id sun4i_usb_phy_ids[] = {
     { .compatible = "allwinner,sun20i-d1-usb-phy", .data =
(ulong)&sun20i_d1_cfg },
     { .compatible = "allwinner,sun50i-a64-usb-phy", .data =
(ulong)&sun50i_a64_cfg},
     { .compatible = "allwinner,sun50i-h6-usb-phy", .data =
(ulong)&sun50i_h6_cfg},
+    { .compatible = "allwinner,suniv-f1c100s-usb-phy", .data =
(ulong)&suniv_f1c100s_cfg},
     { }
 };

-- 
2.40.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] phy: phy-sun4i-usb: add allwinner f1c100s configuration
  2023-06-09 14:11 [PATCH 1/3] phy: phy-sun4i-usb: add allwinner f1c100s configuration 路辉
@ 2023-06-10  0:14 ` Andre Przywara
  0 siblings, 0 replies; 2+ messages in thread
From: Andre Przywara @ 2023-06-10  0:14 UTC (permalink / raw)
  To: 路辉; +Cc: u-boot, linux-sunxi

On Fri, 9 Jun 2023 14:11:07 +0000
路辉 <luhux76@gmail.com> wrote:

Hi,

> From 09a85536f92cfd22f2a6feba8ea91fae4bc41ed8 Mon Sep 17 00:00:00 2001
> From: Lu Hui <luhux76@gmail.com>
> Date: Fri, 9 Jun 2023 22:04:56 +0800
> Subject: [PATCH 1/3] phy: phy-sun4i-usb: add allwinner f1c100s configuration

I sent a similar patch literally just a few hours ago:
https://lore.kernel.org/u-boot/20230609105621.1410483-1-andre.przywara@arm.com/T/

Can you please check whether this works for you as well? My series
missed the final MUSB enablement (because I wanted to test host mode
first), but at least the PHY part should work. 

In the future, please add a commit message, describing your patch, and
also your Signed-off-by: line, otherwise the patch cannot be merged.

Cheers,
Andre


> 
> ---
>  drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c
> b/drivers/phy/allwinner/phy-sun4i-usb.c
> index 6428163c18..8425a83c84 100644
> --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> @@ -4,6 +4,7 @@
>   * Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
>   * Copyright (C) 2015 Hans de Goede <hdegoede@redhat.com>
>   * Copyright (C) 2014 Roman Byshko <rbyshko@gmail.com>
> + * Copyright (C) 2023 Lu Hui <luhux76@gmail.com>
>   *
>   * Modelled arch/arm/mach-sunxi/usb_phy.c to compatible with generic-phy.
>   *
> @@ -83,6 +84,7 @@ enum sun4i_usb_phy_type {
>      sun8i_v3s_phy,
>      sun50i_a64_phy,
>      sun50i_h6_phy,
> +    suniv_f1c100s_phy,
>  };
> 
>  struct sun4i_usb_phy_cfg {
> @@ -372,8 +374,9 @@ static int sun4i_usb_phy_xlate(struct phy *phy,
>  {
>      struct sun4i_usb_phy_data *data = dev_get_priv(phy->dev);
> 
> -    if (args->args_count >= data->cfg->num_phys)
> +    if (args->args_count > data->cfg->num_phys) {
>          return -EINVAL;
> +    }
> 
>      if (data->cfg->missing_phys & BIT(args->args[0]))
>          return -ENODEV;
> @@ -531,6 +534,14 @@ static int sun4i_usb_phy_probe(struct udevice *dev)
>      return 0;
>  }
> 
> +static const struct sun4i_usb_phy_cfg suniv_f1c100s_cfg = {
> +    .num_phys = 1,
> +    .type = suniv_f1c100s_phy,
> +    .disc_thresh = 3,
> +    .phyctl_offset = REG_PHYCTL_A10,
> +    .dedicated_clocks = true,
> +};
> +
>  static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = {
>      .num_phys = 3,
>      .type = sun4i_a10_phy,
> @@ -659,6 +670,7 @@ static const struct udevice_id sun4i_usb_phy_ids[] = {
>      { .compatible = "allwinner,sun20i-d1-usb-phy", .data =
> (ulong)&sun20i_d1_cfg },
>      { .compatible = "allwinner,sun50i-a64-usb-phy", .data =
> (ulong)&sun50i_a64_cfg},
>      { .compatible = "allwinner,sun50i-h6-usb-phy", .data =
> (ulong)&sun50i_h6_cfg},
> +    { .compatible = "allwinner,suniv-f1c100s-usb-phy", .data =
> (ulong)&suniv_f1c100s_cfg},
>      { }
>  };
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-10  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 14:11 [PATCH 1/3] phy: phy-sun4i-usb: add allwinner f1c100s configuration 路辉
2023-06-10  0:14 ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox