diff mbox series

phy: sun4i-usb: Align H6 initialization logic with the kernel

Message ID 20200512182449.3000065-1-r.stratiienko@gmail.com
State Accepted
Commit 462a9c7a9ccec444ecb5b8bc3ee3edecbab7e18c
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series phy: sun4i-usb: Align H6 initialization logic with the kernel | expand

Commit Message

Roman Stratiienko May 12, 2020, 6:24 p.m. UTC
H6 SOC needs additional initialization of PHY registers. Corresponding
changes can be found in the kernel patch [1].

Without this changes there is no enumeration of 'musb' gadget.

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae409cc7c3cdb9ac4a1dba3eae70efec3d6b6c79

Fixes: 35fa673e0e5f ("sunxi: phy: Add USB PHY support for Allwinner H6")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
---
CC: Ondrej Jirman <megous@megous.com>
CC: Icenowy Zheng <icenowy@aosc.io>
CC: Marek Vasut <marex@denx.de>
CC: linux-sunxi@googlegroups.com
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Roman Stratiienko May 14, 2020, 6:43 a.m. UTC | #1
CC: jagan@amarulasolutions.com


вт, 12 мая 2020 г. в 21:25, Roman Stratiienko <r.stratiienko@gmail.com>:
>
> H6 SOC needs additional initialization of PHY registers. Corresponding
> changes can be found in the kernel patch [1].
>
> Without this changes there is no enumeration of 'musb' gadget.
>
> [1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae409cc7c3cdb9ac4a1dba3eae70efec3d6b6c79
>
> Fixes: 35fa673e0e5f ("sunxi: phy: Add USB PHY support for Allwinner H6")
> Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
> ---
> CC: Ondrej Jirman <megous@megous.com>
> CC: Icenowy Zheng <icenowy@aosc.io>
> CC: Marek Vasut <marex@denx.de>
> CC: linux-sunxi@googlegroups.com
> ---
>  drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
> index 612c428cf5..688ee7d4cc 100644
> --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> @@ -279,7 +279,8 @@ static int sun4i_usb_phy_init(struct phy *phy)
>                 return ret;
>         }
>
> -       if (data->cfg->type == sun8i_a83t_phy) {
> +       if (data->cfg->type == sun8i_a83t_phy ||
> +           data->cfg->type == sun50i_h6_phy) {
>                 if (phy->id == 0) {
>                         val = readl(data->base + data->cfg->phyctl_offset);
>                         val |= PHY_CTL_VBUSVLDEXT;
> @@ -321,7 +322,8 @@ static int sun4i_usb_phy_exit(struct phy *phy)
>         int ret;
>
>         if (phy->id == 0) {
> -               if (data->cfg->type == sun8i_a83t_phy) {
> +               if (data->cfg->type == sun8i_a83t_phy ||
> +                   data->cfg->type == sun50i_h6_phy) {
>                         void __iomem *phyctl = data->base +
>                                 data->cfg->phyctl_offset;
>
> --
> 2.25.1
>
Jagan Teki June 1, 2020, 4:51 p.m. UTC | #2
On Wed, May 13, 2020 at 2:22 AM Roman Stratiienko
<r.stratiienko@gmail.com> wrote:
>
> H6 SOC needs additional initialization of PHY registers. Corresponding
> changes can be found in the kernel patch [1].
>
> Without this changes there is no enumeration of 'musb' gadget.
>
> [1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae409cc7c3cdb9ac4a1dba3eae70efec3d6b6c79
>
> Fixes: 35fa673e0e5f ("sunxi: phy: Add USB PHY support for Allwinner H6")
> Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
> ---

Applied to u-boot-sunxi/master
diff mbox series

Patch

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 612c428cf5..688ee7d4cc 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -279,7 +279,8 @@  static int sun4i_usb_phy_init(struct phy *phy)
 		return ret;
 	}
 
-	if (data->cfg->type == sun8i_a83t_phy) {
+	if (data->cfg->type == sun8i_a83t_phy ||
+	    data->cfg->type == sun50i_h6_phy) {
 		if (phy->id == 0) {
 			val = readl(data->base + data->cfg->phyctl_offset);
 			val |= PHY_CTL_VBUSVLDEXT;
@@ -321,7 +322,8 @@  static int sun4i_usb_phy_exit(struct phy *phy)
 	int ret;
 
 	if (phy->id == 0) {
-		if (data->cfg->type == sun8i_a83t_phy) {
+		if (data->cfg->type == sun8i_a83t_phy ||
+		    data->cfg->type == sun50i_h6_phy) {
 			void __iomem *phyctl = data->base +
 				data->cfg->phyctl_offset;