Skip to contentSkip to conversation

sunxi: usb_phy: invert the USB phy_ctl condition

PATCH New Maxime Ripard 2 participants 3 messages Aug 23, 2017 – Aug 26, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunxi: usb_phy: invert the USB phy_ctl condition

All the new SoCs from Allwinner since the A33 have had the phy_ctl offset at 0x410 instead of 0x404 that was used on the previous SoCs.

Instead of adding more and more special cases as the number of SoCs grow, let's invert the test to have 0x410 by default, and the (hopefully) fixed number of old SoCs being the exception.

---
 arch/arm/mach-sunxi/usb_phy.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
arch/arm/mach-sunxi/usb_phy.c +10 -4
index 9bf0b5633d4a..2f1cad1aad9e 100644
@@ -18,12 +18,18 @@
 #include <asm/io.h>
 #include <errno.h>
 
-#define SUNXI_USB_PMU_IRQ_ENABLE	0x800
-#ifdef CONFIG_MACH_SUN8I_A33
-#define SUNXI_USB_CSR			0x410
-#else
+#if defined(CONFIG_MACH_SUN4I) ||		   \
+	defined(CONFIG_MACH_SUN5I) ||		   \
+	defined(CONFIG_MACH_SUN6I) ||		   \
+	defined(CONFIG_MACH_SUN7I) ||		   \
+	defined(CONFIG_MACH_SUN8I_A23) ||	   \
+	defined(CONFIG_MACH_SUN9I)
 #define SUNXI_USB_CSR			0x404
+#else
+#define SUNXI_USB_CSR			0x410
 #endif
+
+#define SUNXI_USB_PMU_IRQ_ENABLE	0x800
 #define SUNXI_USB_PASSBY_EN		1
 
 #define SUNXI_EHCI_AHB_ICHR8_EN		(1 << 10)
Signature · 1 line
2.13.5
#1 lore raw

PATCH 1/1 sunxi: usb_phy: invert the USB phy_ctl condition

Quoted 10 lines · Maxime Ripard

All the new SoCs from Allwinner since the A33 have had the phy_ctl offset at 0x410 instead of 0x404 that was used on the previous SoCs.

Instead of adding more and more special cases as the number of SoCs grow, let's invert the test to have 0x410 by default, and the (hopefully) fixed number of old SoCs being the exception.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#2 lore raw

PATCH 1/1 sunxi: usb_phy: invert the USB phy_ctl condition

Quoted 9 lines · Jagan Teki
Quoted 7 lines · Maxime Ripard

All the new SoCs from Allwinner since the A33 have had the phy_ctl offset at 0x410 instead of 0x404 that was used on the previous SoCs.

Instead of adding more and more special cases as the number of SoCs grow, let's invert the test to have 0x410 by default, and the (hopefully) fixed number of old SoCs being the exception.

Quoted 5 lines
Quoted 3 lines

Applied to u-boot-sunxi/next

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.