[U-Boot] [PATCH v2 5/6] arm64: zynqmp: Use DWC3 generic driver and DM_USB

Michal Simek michal.simek at xilinx.com
Fri May 18 11:15:08 UTC 2018


Remove harcoded XHCI lists and detect mode, speed based on DT.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
Serial-changes: 2
- Remove also XHCI macros from hardware.h
- Remove additional new line in zcu106
---

Changes in v2: None

 arch/arm/include/asm/arch-zynqmp/hardware.h   |  3 --
 board/xilinx/zynqmp/zynqmp.c                  | 46 -------------------
 .../xilinx_zynqmp_zc1751_xm015_dc1_defconfig  |  1 +
 .../xilinx_zynqmp_zc1751_xm016_dc2_defconfig  |  1 +
 .../xilinx_zynqmp_zc1751_xm017_dc3_defconfig  |  1 +
 configs/xilinx_zynqmp_zcu100_revC_defconfig   |  1 +
 configs/xilinx_zynqmp_zcu102_rev1_0_defconfig |  1 +
 configs/xilinx_zynqmp_zcu102_revA_defconfig   |  1 +
 configs/xilinx_zynqmp_zcu102_revB_defconfig   |  1 +
 configs/xilinx_zynqmp_zcu104_revA_defconfig   |  1 +
 configs/xilinx_zynqmp_zcu104_revC_defconfig   |  1 +
 configs/xilinx_zynqmp_zcu106_revA_defconfig   |  1 +
 configs/xilinx_zynqmp_zcu111_revA_defconfig   |  1 +
 .../configs/xilinx_zynqmp_zc1751_xm015_dc1.h  |  1 -
 .../configs/xilinx_zynqmp_zc1751_xm016_dc2.h  |  2 -
 .../configs/xilinx_zynqmp_zc1751_xm017_dc3.h  |  3 --
 include/configs/xilinx_zynqmp_zcu100.h        |  3 --
 include/configs/xilinx_zynqmp_zcu102.h        |  2 -
 include/configs/xilinx_zynqmp_zcu104.h        |  2 -
 include/configs/xilinx_zynqmp_zcu106.h        |  2 -
 include/configs/xilinx_zynqmp_zcu111.h        |  2 -
 21 files changed, 11 insertions(+), 66 deletions(-)

diff --git a/arch/arm/include/asm/arch-zynqmp/hardware.h b/arch/arm/include/asm/arch-zynqmp/hardware.h
index dfd6097b4beb..acc68251be94 100644
--- a/arch/arm/include/asm/arch-zynqmp/hardware.h
+++ b/arch/arm/include/asm/arch-zynqmp/hardware.h
@@ -17,9 +17,6 @@
 
 #define ARASAN_NAND_BASEADDR	0xFF100000
 
-#define ZYNQMP_USB0_XHCI_BASEADDR	0xFE200000
-#define ZYNQMP_USB1_XHCI_BASEADDR	0xFE300000
-
 #define ZYNQMP_TCM_BASE_ADDR	0xFFE00000
 #define ZYNQMP_TCM_SIZE		0x40000
 
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 57c0d93aa1bc..e41fec32df31 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -548,49 +548,3 @@ int checkboard(void)
 	puts("Board: Xilinx ZynqMP\n");
 	return 0;
 }
-
-#ifdef CONFIG_USB_DWC3
-static struct dwc3_device dwc3_device_data0 = {
-	.maximum_speed = USB_SPEED_HIGH,
-	.base = ZYNQMP_USB0_XHCI_BASEADDR,
-	.dr_mode = USB_DR_MODE_PERIPHERAL,
-	.index = 0,
-};
-
-static struct dwc3_device dwc3_device_data1 = {
-	.maximum_speed = USB_SPEED_HIGH,
-	.base = ZYNQMP_USB1_XHCI_BASEADDR,
-	.dr_mode = USB_DR_MODE_PERIPHERAL,
-	.index = 1,
-};
-
-int usb_gadget_handle_interrupts(int index)
-{
-	dwc3_uboot_handle_interrupt(index);
-	return 0;
-}
-
-int board_usb_init(int index, enum usb_init_type init)
-{
-	debug("%s: index %x\n", __func__, index);
-
-#if defined(CONFIG_USB_GADGET_DOWNLOAD)
-	g_dnl_set_serialnumber(CONFIG_SYS_CONFIG_NAME);
-#endif
-
-	switch (index) {
-	case 0:
-		return dwc3_uboot_init(&dwc3_device_data0);
-	case 1:
-		return dwc3_uboot_init(&dwc3_device_data1);
-	};
-
-	return -1;
-}
-
-int board_usb_cleanup(int index, enum usb_init_type init)
-{
-	dwc3_uboot_exit(index);
-	return 0;
-}
-#endif
diff --git a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
index 3aa39306520f..f5a33342fa64 100644
--- a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
+++ b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
@@ -83,6 +83,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig b/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig
index 1bd52ab79124..7f7ee558ee7e 100644
--- a/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig
+++ b/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig
@@ -79,6 +79,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zc1751_xm017_dc3_defconfig b/configs/xilinx_zynqmp_zc1751_xm017_dc3_defconfig
index e1e7d22a3a62..2add3bafe278 100644
--- a/configs/xilinx_zynqmp_zc1751_xm017_dc3_defconfig
+++ b/configs/xilinx_zynqmp_zc1751_xm017_dc3_defconfig
@@ -75,6 +75,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu100_revC_defconfig b/configs/xilinx_zynqmp_zcu100_revC_defconfig
index 3dd6ae9a0b3b..2a6a5a69cdfe 100644
--- a/configs/xilinx_zynqmp_zcu100_revC_defconfig
+++ b/configs/xilinx_zynqmp_zcu100_revC_defconfig
@@ -73,6 +73,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig
index 0ddec9986697..4cb3959f3626 100644
--- a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig
+++ b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig
@@ -93,6 +93,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu102_revA_defconfig b/configs/xilinx_zynqmp_zcu102_revA_defconfig
index 94dc62a61643..e989d1635c30 100644
--- a/configs/xilinx_zynqmp_zcu102_revA_defconfig
+++ b/configs/xilinx_zynqmp_zcu102_revA_defconfig
@@ -91,6 +91,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig
index 8889f1909ac0..bd67df904a2d 100644
--- a/configs/xilinx_zynqmp_zcu102_revB_defconfig
+++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig
@@ -91,6 +91,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu104_revA_defconfig b/configs/xilinx_zynqmp_zcu104_revA_defconfig
index 3d3d941d375c..a76b9cf54622 100644
--- a/configs/xilinx_zynqmp_zcu104_revA_defconfig
+++ b/configs/xilinx_zynqmp_zcu104_revA_defconfig
@@ -84,6 +84,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu104_revC_defconfig b/configs/xilinx_zynqmp_zcu104_revC_defconfig
index 7c22d7f020ed..dcd4897f2fbd 100644
--- a/configs/xilinx_zynqmp_zcu104_revC_defconfig
+++ b/configs/xilinx_zynqmp_zcu104_revC_defconfig
@@ -84,6 +84,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu106_revA_defconfig b/configs/xilinx_zynqmp_zcu106_revA_defconfig
index 017940e98361..a5fa33e366ae 100644
--- a/configs/xilinx_zynqmp_zcu106_revA_defconfig
+++ b/configs/xilinx_zynqmp_zcu106_revA_defconfig
@@ -90,6 +90,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/xilinx_zynqmp_zcu111_revA_defconfig b/configs/xilinx_zynqmp_zcu111_revA_defconfig
index 028a7b532844..4d9b91563523 100644
--- a/configs/xilinx_zynqmp_zcu111_revA_defconfig
+++ b/configs/xilinx_zynqmp_zcu111_revA_defconfig
@@ -84,6 +84,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
diff --git a/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h b/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h
index 852c2238de4a..f0ab3f159222 100644
--- a/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h
+++ b/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h
@@ -11,7 +11,6 @@
 
 #define CONFIG_ZYNQ_SDHCI0
 #define CONFIG_ZYNQ_SDHCI1
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
 
 #include <configs/xilinx_zynqmp.h>
 
diff --git a/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h b/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h
index 2533ab860906..bfebbb3cd197 100644
--- a/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h
+++ b/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h
@@ -9,8 +9,6 @@
 #ifndef __CONFIG_ZYNQMP_ZC1751_XM016_DC2_H
 #define __CONFIG_ZYNQMP_ZC1751_XM016_DC2_H
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB1_XHCI_BASEADDR}
-
 #include <configs/xilinx_zynqmp.h>
 
 #endif /* __CONFIG_ZYNQMP_ZC1751_XM016_DC2_H */
diff --git a/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h b/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h
index f7d4ab2800c9..bd4a0c3178b8 100644
--- a/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h
+++ b/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h
@@ -11,9 +11,6 @@
 
 #define CONFIG_ZYNQ_SDHCI1
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
-				 ZYNQMP_USB1_XHCI_BASEADDR}
-
 #include <configs/xilinx_zynqmp.h>
 
 #endif /* __CONFIG_ZYNQMP_ZC1751_XM017_DC3_H */
diff --git a/include/configs/xilinx_zynqmp_zcu100.h b/include/configs/xilinx_zynqmp_zcu100.h
index 029347da479c..b65d0c1cddd2 100644
--- a/include/configs/xilinx_zynqmp_zcu100.h
+++ b/include/configs/xilinx_zynqmp_zcu100.h
@@ -24,9 +24,6 @@
 				{0, {{I2C_MUX_PCA9548, 0x75, 7} } }, \
 				}
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
-				 ZYNQMP_USB1_XHCI_BASEADDR}
-
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
 
diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h
index c61e1b5e27c2..ca11b97c7c4c 100644
--- a/include/configs/xilinx_zynqmp_zcu102.h
+++ b/include/configs/xilinx_zynqmp_zcu102.h
@@ -35,8 +35,6 @@
 
 #define CONFIG_PCA953X
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
 #define CONFIG_ZYNQ_EEPROM_BUS		5
 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR	0x54
diff --git a/include/configs/xilinx_zynqmp_zcu104.h b/include/configs/xilinx_zynqmp_zcu104.h
index 8d417f45e014..7e3b9ad7058b 100644
--- a/include/configs/xilinx_zynqmp_zcu104.h
+++ b/include/configs/xilinx_zynqmp_zcu104.h
@@ -26,8 +26,6 @@
 
 #define CONFIG_PCA953X
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
 
 #include <configs/xilinx_zynqmp.h>
diff --git a/include/configs/xilinx_zynqmp_zcu106.h b/include/configs/xilinx_zynqmp_zcu106.h
index 01ac12a53c17..cc2d145ddd94 100644
--- a/include/configs/xilinx_zynqmp_zcu106.h
+++ b/include/configs/xilinx_zynqmp_zcu106.h
@@ -35,8 +35,6 @@
 
 #define CONFIG_PCA953X
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
 #define CONFIG_ZYNQ_EEPROM_BUS		5
 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR	0x54
diff --git a/include/configs/xilinx_zynqmp_zcu111.h b/include/configs/xilinx_zynqmp_zcu111.h
index 3233b379798d..8f8cb4f08707 100644
--- a/include/configs/xilinx_zynqmp_zcu111.h
+++ b/include/configs/xilinx_zynqmp_zcu111.h
@@ -38,8 +38,6 @@
 
 #define CONFIG_PCA953X
 
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
 #define CONFIG_ZYNQ_EEPROM_BUS		5
 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR	0x54
-- 
2.17.0



More information about the U-Boot mailing list