* [U-Boot] [PATCH] sunxi: usb_phy: Swap check for disconnect threshold
@ 2015-06-01 15:01 Hans de Goede
2015-06-01 18:09 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2015-06-01 15:01 UTC (permalink / raw)
To: u-boot
Before this commit the code for determining the disconnect threshold was
checking for sun4i or sun6i assuming that those where the exception and
that newer SoCs use a disconnect threshold of 2 like sun7i does.
But it turns out that newer SoCs actually use a disconnect threshold of 3
and sun5i and sun7i are the exceptions, so check for those instead.
Here are the settings from the various Allwinner SDK sources:
sun4i-a10: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
sun5i-a13: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
sun6i-a31: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
sun7i-a20: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
sun8i-a23: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
sun8i-h3: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
sun9i-a80: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
Note this commit makes no functional changes for sun4i - sun7i, and
changes the disconnect threshold for sun8i to match what Allwinner uses.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/cpu/armv7/sunxi/usb_phy.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/armv7/sunxi/usb_phy.c b/arch/arm/cpu/armv7/sunxi/usb_phy.c
index 410669e..b07d67f 100644
--- a/arch/arm/cpu/armv7/sunxi/usb_phy.c
+++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c
@@ -128,10 +128,10 @@ static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy)
usb_phy_write(phy, 0x20, 0x14, 5);
/* threshold adjustment disconnect */
-#if defined CONFIG_MACH_SUN4I || defined CONFIG_MACH_SUN6I
- usb_phy_write(phy, 0x2a, 3, 2);
-#else
+#if defined CONFIG_MACH_SUN5I || defined CONFIG_MACH_SUN7I
usb_phy_write(phy, 0x2a, 2, 2);
+#else
+ usb_phy_write(phy, 0x2a, 3, 2);
#endif
return;
--
2.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] sunxi: usb_phy: Swap check for disconnect threshold
2015-06-01 15:01 [U-Boot] [PATCH] sunxi: usb_phy: Swap check for disconnect threshold Hans de Goede
@ 2015-06-01 18:09 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-06-01 18:09 UTC (permalink / raw)
To: u-boot
On Mon, 2015-06-01 at 17:01 +0200, Hans de Goede wrote:
> Before this commit the code for determining the disconnect threshold was
> checking for sun4i or sun6i assuming that those where the exception and
> that newer SoCs use a disconnect threshold of 2 like sun7i does.
>
> But it turns out that newer SoCs actually use a disconnect threshold of 3
> and sun5i and sun7i are the exceptions, so check for those instead.
>
> Here are the settings from the various Allwinner SDK sources:
> sun4i-a10: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
> sun5i-a13: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
> sun6i-a31: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
> sun7i-a20: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
> sun8i-a23: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
> sun8i-h3: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
> sun9i-a80: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
>
> Note this commit makes no functional changes for sun4i - sun7i, and
> changes the disconnect threshold for sun8i to match what Allwinner uses.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-01 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 15:01 [U-Boot] [PATCH] sunxi: usb_phy: Swap check for disconnect threshold Hans de Goede
2015-06-01 18:09 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox