Skip to contentSkip to conversation

drivers: usb: fsl: Workaround for Erratum A004477

PATCH New Nikhil Badola 3 participants 6 messages Nov 21, 2014 – May 5, 2015

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

PATCH 1/1 drivers: usb: fsl: Workaround for Erratum A004477

Add a delay of 1 microsecond before issuing soft reset to the controller to let ongoing ULPI transaction complete. This prevents corruption of ULPI Function Control Register which eventually prevents phy clock from entering to low power mode

---
Depends on patch https://patchwork.ozlabs.org/patch/404879/

 arch/powerpc/cpu/mpc85xx/cmd_errata.c     |  4 ++++
 arch/powerpc/include/asm/config_mpc85xx.h |  6 ++++++
 drivers/usb/host/ehci-fsl.c               | 10 ++++++++++
 include/fsl_usb.h                         | 29 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +4 -0
index fe3eb06..bc59352 100644
@@ -298,6 +298,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	if (has_erratum_a007798())
 		puts("Work-around for Erratum A007798 enabled\n");
 #endif
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004477
+	if (has_erratum_a004477())
+		puts("Work-around for Erratum A004477 enabled\n");
+#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 	if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
 	    (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV))
arch/powerpc/include/asm/config_mpc85xx.h +6 -0
index 7860b40..fe9e9c1 100644
@@ -161,6 +161,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A007075
 #define CONFIG_SYS_FSL_ERRATUM_A006261
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x10
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
@@ -292,6 +293,7 @@
 #define CONFIG_FSL_SATA_ERRATUM_A001
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 
 #elif defined(CONFIG_P1023)
 #define CONFIG_MAX_CPUS			2
@@ -372,6 +374,7 @@
 #define CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM	2
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #elif defined(CONFIG_PPC_P2041) /* also supports P2040 */
@@ -589,6 +592,7 @@
 #define CONFIG_NAND_FSL_IFC
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 #define CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
 #elif defined(CONFIG_BSC9132)
@@ -613,6 +617,7 @@
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_FSL_ERRATUM_A005125
 #define CONFIG_SYS_FSL_ERRATUM_A005434
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x11
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -712,6 +717,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A006475
 #define CONFIG_SYS_FSL_ERRATUM_A006384
 #define CONFIG_SYS_FSL_ERRATUM_A007212
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_CCSRBAR_DEFAULT	0xfe000000
 #define CONFIG_SYS_FSL_SFP_VER_3_0
 
drivers/usb/host/ehci-fsl.c +10 -0
index 5d4288d..41ff1a7 100644
@@ -138,6 +138,16 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 	if (has_erratum_a007798())
 		set_txfifothresh(ehci, TXFIFOTHRESH);
 
+	if (has_erratum_a004477()) {
+		/*
+		 * When reset is issued while any ULPI transaction is ongoing
+		 * then it may result to corruption of ULPI Function Control
+		 * Register which eventually causes phy clock to enter low
+		 * power mode which stops the clock. Thus delay is required
+		 * before reset to let ongoing ULPI transaction complete.
+		 */
+		udelay(1);
+	}
 	return 0;
 }
 
include/fsl_usb.h +29 -0
index d251f5d..88d8a8b 100644
@@ -164,6 +164,30 @@ static inline bool has_erratum_a007792(void)
 	return false;
 }
 
+static inline bool has_erratum_a004477(void)
+{
+	u32 svr = get_svr();
+	u32 soc = SVR_SOC_VER(svr);
+
+	switch (soc) {
+	case SVR_P1010:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+	case SVR_P1022:
+	case SVR_9131:
+	case SVR_9132:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
+	case SVR_P2020:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) ||
+			IS_SVR_REV(svr, 2, 1);
+	case SVR_B4860:
+	case SVR_B4420:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+	case SVR_P4080:
+		return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
+	}
+
+	return false;
+}
 #else
 static inline bool has_erratum_a006261(void)
 {
@@ -184,5 +208,10 @@ static inline bool has_erratum_a007792(void)
 {
 	return false;
 }
+
+static inline bool has_erratum_a004477(void)
+{
+	return false;
+}
 #endif
 #endif /*_ASM_FSL_USB_H_ */
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/1 drivers: usb: fsl: Workaround for Erratum A004477

Hello Nikhil,

Quoted 87 lines · Nikhil Badola

Add a delay of 1 microsecond before issuing soft reset to the controller to let ongoing ULPI transaction complete. This prevents corruption of ULPI Function Control Register which eventually prevents phy clock from entering to low power mode

---
Depends on patch https://patchwork.ozlabs.org/patch/404879/

 arch/powerpc/cpu/mpc85xx/cmd_errata.c     |  4 ++++
 arch/powerpc/include/asm/config_mpc85xx.h |  6 ++++++
 drivers/usb/host/ehci-fsl.c               | 10 ++++++++++
 include/fsl_usb.h                         | 29 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +4 -0
index fe3eb06..bc59352 100644
@@ -298,6 +298,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	if (has_erratum_a007798())
 		puts("Work-around for Erratum A007798 enabled\n");
 #endif
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004477
+	if (has_erratum_a004477())
+		puts("Work-around for Erratum A004477 enabled\n");
+#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 	if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
 	    (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV))
arch/powerpc/include/asm/config_mpc85xx.h +6 -0
index 7860b40..fe9e9c1 100644
@@ -161,6 +161,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A007075
 #define CONFIG_SYS_FSL_ERRATUM_A006261
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x10
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
@@ -292,6 +293,7 @@
 #define CONFIG_FSL_SATA_ERRATUM_A001
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 
 #elif defined(CONFIG_P1023)
 #define CONFIG_MAX_CPUS			2
@@ -372,6 +374,7 @@
 #define CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM	2
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #elif defined(CONFIG_PPC_P2041) /* also supports P2040 */
@@ -589,6 +592,7 @@
 #define CONFIG_NAND_FSL_IFC
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 #define CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
 #elif defined(CONFIG_BSC9132)
@@ -613,6 +617,7 @@
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_FSL_ERRATUM_A005125
 #define CONFIG_SYS_FSL_ERRATUM_A005434
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x11
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -712,6 +717,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A006475
 #define CONFIG_SYS_FSL_ERRATUM_A006384
 #define CONFIG_SYS_FSL_ERRATUM_A007212
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_CCSRBAR_DEFAULT	0xfe000000
 #define CONFIG_SYS_FSL_SFP_VER_3_0
 
drivers/usb/host/ehci-fsl.c +0 -0
index 5d4288d..41ff1a7 100644

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type init, · line 147

Quoted 10 lines
drivers/usb/host/ehci-fsl.c +7 -0
@@ -138,6 +138,16 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 	if (has_erratum_a007798())
 		set_txfifothresh(ehci, TXFIFOTHRESH);
 
+	if (has_erratum_a004477()) {
+		/*
+		 * When reset is issued while any ULPI transaction is ongoing
+		 * then it may result to corruption of ULPI Function Control
+		 * Register which eventually causes phy clock to enter low
+		 * power mode which stops the clock. Thus delay is required
+		 * before reset to let ongoing ULPI transaction complete.

Actually the erratum suggests checking transaction status before issuing a soft reset. Here, could the code do this check and wait for the transation to finish, rather than wait for an arbitrary duration?

Quoted 60 lines
drivers/usb/host/ehci-fsl.c +3 -0
+		 */
+		udelay(1);
+	}
 	return 0;
 }
 
include/fsl_usb.h +29 -0
index d251f5d..88d8a8b 100644
@@ -164,6 +164,30 @@ static inline bool has_erratum_a007792(void)
 	return false;
 }
 
+static inline bool has_erratum_a004477(void)
+{
+	u32 svr = get_svr();
+	u32 soc = SVR_SOC_VER(svr);
+
+	switch (soc) {
+	case SVR_P1010:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+	case SVR_P1022:
+	case SVR_9131:
+	case SVR_9132:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
+	case SVR_P2020:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) ||
+			IS_SVR_REV(svr, 2, 1);
+	case SVR_B4860:
+	case SVR_B4420:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+	case SVR_P4080:
+		return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
+	}
+
+	return false;
+}
 #else
 static inline bool has_erratum_a006261(void)
 {
@@ -184,5 +208,10 @@ static inline bool has_erratum_a007792(void)
 {
 	return false;
 }
+
+static inline bool has_erratum_a004477(void)
+{
+	return false;
+}
 #endif
 #endif /*_ASM_FSL_USB_H_ */
Signature · 7 lines
1.7.11.7


_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH 1/1 drivers: usb: fsl: Workaround for Erratum A004477

Quoted 104 lines

-----Original Message-----
From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
Sent: Friday, November 21, 2014 6:00 PM
To: Badola Nikhil-B46172
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] drivers: usb: fsl: Workaround for Erratum A004477

Hello Nikhil,

arch/powerpc/cpu/mpc85xx/cmd_errata.c static int do_errata(cmd_tbl_t *cmdtp, int flag, int

Quoted 21 lines · Nikhil Badola

Add a delay of 1 microsecond before issuing soft reset to the controller to let ongoing ULPI transaction complete. This prevents corruption of ULPI Function Control Register which eventually prevents phy clock from entering to low power mode

---
Depends on patch https://patchwork.ozlabs.org/patch/404879/

 arch/powerpc/cpu/mpc85xx/cmd_errata.c     |  4 ++++
 arch/powerpc/include/asm/config_mpc85xx.h |  6 ++++++
 drivers/usb/host/ehci-fsl.c               | 10 ++++++++++
 include/fsl_usb.h                         | 29 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
index fe3eb06..bc59352 100644
@@ -298,6 +298,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int

argc, char * const argv[])

arch/powerpc/cpu/mpc85xx/cmd_errata.c static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 299

Quoted 2 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
 	if (has_erratum_a007798())
 		puts("Work-around for Erratum A007798 enabled\n");

#endif

Quoted 13 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +3 -0
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004477
+	if (has_erratum_a004477())
+		puts("Work-around for Erratum A004477 enabled\n"); #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 	if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
 	    (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV)) diff --git

a/arch/powerpc/include/asm/config_mpc85xx.h
b/arch/powerpc/include/asm/config_mpc85xx.h
index 7860b40..fe9e9c1 100644

arch/powerpc/include/asm/config_mpc85xx.h +0 -0
@@ -161,6 +161,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define
Quoted 1 line

CONFIG_SYS_FSL_ERRATUM_A007075 #define

CONFIG_SYS_FSL_ERRATUM_A006261

Quoted 37 lines
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x10
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -292,6 +293,7 @@
 #define CONFIG_FSL_SATA_ERRATUM_A001
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define

CONFIG_SYS_FSL_ERRATUM_A005125

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 
 #elif defined(CONFIG_P1023)
 #define CONFIG_MAX_CPUS			2
@@ -372,6 +374,7 @@
 #define CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM	2
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define

CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1

#elif defined(CONFIG_PPC_P2041) /* also supports P2040 */ @@ -589,6
+592,7 @@ #define CONFIG_NAND_FSL_IFC #define CONFIG_SYS_FSL_ERRATUM_ESDHC111 #define CONFIG_SYS_FSL_ERRATUM_A005125

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
 #elif defined(CONFIG_BSC9132)
@@ -613,6 +617,7 @@
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_FSL_ERRATUM_A005125  #define

CONFIG_SYS_FSL_ERRATUM_A005434

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x11
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -712,6 +717,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A006475  #define
Quoted 1 line

CONFIG_SYS_FSL_ERRATUM_A006384 #define

CONFIG_SYS_FSL_ERRATUM_A007212

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type

Quoted 9 lines
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_CCSRBAR_DEFAULT	0xfe000000
 #define CONFIG_SYS_FSL_SFP_VER_3_0
drivers/usb/host/ehci-fsl.c +0 -0
index 5d4288d..41ff1a7 100644
@@ -138,6 +138,16 @@ int ehci_hcd_init(int index, enum usb_init_type

init,

Quoted 3 lines
drivers/usb/host/ehci-fsl.c +0 -0
 	if (has_erratum_a007798())
 		set_txfifothresh(ehci, TXFIFOTHRESH);
 
Quoted 11 lines

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type init, · line 147

Quoted 7 lines
drivers/usb/host/ehci-fsl.c +7 -0
+	if (has_erratum_a004477()) {
+		/*
+		 * When reset is issued while any ULPI transaction is ongoing
+		 * then it may result to corruption of ULPI Function Control
+		 * Register which eventually causes phy clock to enter low
+		 * power mode which stops the clock. Thus delay is required
+		 * before reset to let ongoing ULPI transaction complete.

Actually the erratum suggests checking transaction status before issuing a soft reset. Here, could the code do this check and wait for the transation to finish, rather than wait for an arbitrary duration?

There have been discussions with IP team for changing the suggested workaround. The erratum talks about the ULPI transactions i.e from controller to ULPI phy and not the USB schedule transactions .Hence halting the controller before soft reset isn't the correct workaround.
In addition, as per the current flow of usb start/reset, the controller is always in halt set before issuing soft reset. This is taken care by usb_stop().

Regarding the delay of 1 microsecond( minimum delay), it seems to be sufficient for ULPI Transactions to complete as ULPI interface runs on 60Mhz clock.

Quoted 63 lines
Quoted 53 lines
drivers/usb/host/ehci-fsl.c +3 -0
+		 */
+		udelay(1);
+	}
 	return 0;
 }
 
include/fsl_usb.h index renamed from include/fsl_usb.h +0 -0

d251f5d..88d8a8b 100644

include/fsl_usb.h +27 -1
@@ -164,6 +164,30 @@ static inline bool has_erratum_a007792(void)
 	return false;
 }
 
+static inline bool has_erratum_a004477(void) {
+	u32 svr = get_svr();
+	u32 soc = SVR_SOC_VER(svr);
+
+	switch (soc) {
+	case SVR_P1010:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+	case SVR_P1022:
+	case SVR_9131:
+	case SVR_9132:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
+	case SVR_P2020:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) ||
+			IS_SVR_REV(svr, 2, 1);
+	case SVR_B4860:
+	case SVR_B4420:
+		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
+	case SVR_P4080:
+		return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
+	}
+
+	return false;
+}
 #else
 static inline bool has_erratum_a006261(void)  { @@ -184,5 +208,10 @@
 static inline bool has_erratum_a007792(void)  {
 	return false;
 }
+
+static inline bool has_erratum_a004477(void) {
+	return false;
+}
 #endif
 #endif /*_ASM_FSL_USB_H_ */
--

1.7.11.7

Quoted 4 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Amicalement,
--
Albert.

#3 lore raw

PATCH 1/1 drivers: usb: fsl: Workaround for Erratum A004477

Quoted 123 lines · nikhil.badola at freescale.com
Quoted 104 lines

-----Original Message-----
From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
Sent: Friday, November 21, 2014 6:00 PM
To: Badola Nikhil-B46172
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] drivers: usb: fsl: Workaround for Erratum A004477

Hello Nikhil,

arch/powerpc/cpu/mpc85xx/cmd_errata.c static int do_errata(cmd_tbl_t *cmdtp, int flag, int

Quoted 21 lines · Nikhil Badola

Add a delay of 1 microsecond before issuing soft reset to the controller to let ongoing ULPI transaction complete. This prevents corruption of ULPI Function Control Register which eventually prevents phy clock from entering to low power mode

---
Depends on patch https://patchwork.ozlabs.org/patch/404879/

 arch/powerpc/cpu/mpc85xx/cmd_errata.c     |  4 ++++
 arch/powerpc/include/asm/config_mpc85xx.h |  6 ++++++
 drivers/usb/host/ehci-fsl.c               | 10 ++++++++++
 include/fsl_usb.h                         | 29 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
index fe3eb06..bc59352 100644
@@ -298,6 +298,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int

argc, char * const argv[])

arch/powerpc/cpu/mpc85xx/cmd_errata.c static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 299

Quoted 2 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
 	if (has_erratum_a007798())
 		puts("Work-around for Erratum A007798 enabled\n");

#endif

Quoted 13 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +3 -0
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004477
+	if (has_erratum_a004477())
+		puts("Work-around for Erratum A004477 enabled\n"); #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 	if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
 	    (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV)) diff --git

a/arch/powerpc/include/asm/config_mpc85xx.h
b/arch/powerpc/include/asm/config_mpc85xx.h
index 7860b40..fe9e9c1 100644

arch/powerpc/include/asm/config_mpc85xx.h +0 -0
@@ -161,6 +161,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define
Quoted 1 line

CONFIG_SYS_FSL_ERRATUM_A007075 #define

CONFIG_SYS_FSL_ERRATUM_A006261

Quoted 37 lines
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x10
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -292,6 +293,7 @@
 #define CONFIG_FSL_SATA_ERRATUM_A001
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define

CONFIG_SYS_FSL_ERRATUM_A005125

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 
 #elif defined(CONFIG_P1023)
 #define CONFIG_MAX_CPUS			2
@@ -372,6 +374,7 @@
 #define CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM	2
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define

CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1

#elif defined(CONFIG_PPC_P2041) /* also supports P2040 */ @@ -589,6
+592,7 @@ #define CONFIG_NAND_FSL_IFC #define CONFIG_SYS_FSL_ERRATUM_ESDHC111 #define CONFIG_SYS_FSL_ERRATUM_A005125

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
 #elif defined(CONFIG_BSC9132)
@@ -613,6 +617,7 @@
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_FSL_ERRATUM_A005125  #define

CONFIG_SYS_FSL_ERRATUM_A005434

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x11
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -712,6 +717,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A006475  #define
Quoted 1 line

CONFIG_SYS_FSL_ERRATUM_A006384 #define

CONFIG_SYS_FSL_ERRATUM_A007212

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type

Quoted 9 lines
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_CCSRBAR_DEFAULT	0xfe000000
 #define CONFIG_SYS_FSL_SFP_VER_3_0
drivers/usb/host/ehci-fsl.c +0 -0
index 5d4288d..41ff1a7 100644
@@ -138,6 +138,16 @@ int ehci_hcd_init(int index, enum usb_init_type

init,

Quoted 3 lines
drivers/usb/host/ehci-fsl.c +0 -0
 	if (has_erratum_a007798())
 		set_txfifothresh(ehci, TXFIFOTHRESH);
 
Quoted 11 lines

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type init, · line 147

Quoted 7 lines
drivers/usb/host/ehci-fsl.c +7 -0
+	if (has_erratum_a004477()) {
+		/*
+		 * When reset is issued while any ULPI transaction is ongoing
+		 * then it may result to corruption of ULPI Function Control
+		 * Register which eventually causes phy clock to enter low
+		 * power mode which stops the clock. Thus delay is required
+		 * before reset to let ongoing ULPI transaction complete.

Actually the erratum suggests checking transaction status before issuing a soft reset. Here, could the code do this check and wait for the transation to finish, rather than wait for an arbitrary duration?

There have been discussions with IP team for changing the suggested workaround. The erratum talks about the ULPI transactions i.e from controller to ULPI phy and not the USB schedule transactions .Hence halting the controller before soft reset isn't the correct workaround.
In addition, as per the current flow of usb start/reset, the controller is always in halt set before issuing soft reset. This is taken care by usb_stop().

Quoted 3 lines

Regarding the delay of 1 microsecond( minimum delay), it seems to be sufficient for ULPI Transactions to complete as ULPI interface runs on 60Mhz clock.

Guys,

Is there any open comment on this patch? Do we all agree on this approach? Are we still waiting for IP team for the workaround?

York

#4 lore raw

PATCH 1/1 drivers: usb: fsl: Workaround for Erratum A004477

Quoted 140 lines

-----Original Message-----
From: Sun York-R58495
Sent: Friday, April 24, 2015 9:10 AM
To: Badola Nikhil-B46172; Albert ARIBAUD
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] drivers: usb: fsl: Workaround for Erratum A004477

Quoted 118 lines · nikhil.badola at freescale.com
Quoted 106 lines

-----Original Message-----
From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
Sent: Friday, November 21, 2014 6:00 PM
To: Badola Nikhil-B46172
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] drivers: usb: fsl: Workaround for Erratum
A004477

Hello Nikhil,

Quoted 21 lines · Nikhil Badola

Add a delay of 1 microsecond before issuing soft reset to the controller to let ongoing ULPI transaction complete. This prevents corruption of ULPI Function Control Register which eventually prevents phy clock from entering to low power mode

---
Depends on patch https://patchwork.ozlabs.org/patch/404879/

 arch/powerpc/cpu/mpc85xx/cmd_errata.c     |  4 ++++
 arch/powerpc/include/asm/config_mpc85xx.h |  6 ++++++
 drivers/usb/host/ehci-fsl.c               | 10 ++++++++++
 include/fsl_usb.h                         | 29 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
index fe3eb06..bc59352 100644
@@ -298,6 +298,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int
Quoted 1 line

flag, int

argc, char * const argv[])

arch/powerpc/cpu/mpc85xx/cmd_errata.c static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 299

Quoted 2 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
 	if (has_erratum_a007798())
 		puts("Work-around for Erratum A007798 enabled\n");

#endif

Quoted 13 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +3 -0
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004477
+	if (has_erratum_a004477())
+		puts("Work-around for Erratum A004477 enabled\n"); #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 	if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
 	    (SVR_REV(svr) <= CONFIG_SYS_FSL_A004447_SVR_REV)) diff --git

a/arch/powerpc/include/asm/config_mpc85xx.h
b/arch/powerpc/include/asm/config_mpc85xx.h
index 7860b40..fe9e9c1 100644

arch/powerpc/include/asm/config_mpc85xx.h +0 -0
@@ -161,6 +161,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define
Quoted 1 line

CONFIG_SYS_FSL_ERRATUM_A007075 #define

CONFIG_SYS_FSL_ERRATUM_A006261

Quoted 37 lines
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x10
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -292,6 +293,7 @@
 #define CONFIG_FSL_SATA_ERRATUM_A001  #define

CONFIG_SYS_FSL_ERRATUM_A004508 #define
CONFIG_SYS_FSL_ERRATUM_A005125

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 
 #elif defined(CONFIG_P1023)
 #define CONFIG_MAX_CPUS			2
@@ -372,6 +374,7 @@
 #define CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM	2
 #define CONFIG_SYS_FSL_ERRATUM_A004508  #define

CONFIG_SYS_FSL_ERRATUM_A005125
+#define CONFIG_SYS_FSL_ERRATUM_A004477
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1

#elif defined(CONFIG_PPC_P2041) /* also supports P2040 */ @@ -589,6
+592,7 @@ #define CONFIG_NAND_FSL_IFC #define CONFIG_SYS_FSL_ERRATUM_ESDHC111 #define CONFIG_SYS_FSL_ERRATUM_A005125

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_ESDHC_HC_BLK_ADDR
 
 #elif defined(CONFIG_BSC9132)
@@ -613,6 +617,7 @@
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_FSL_ERRATUM_A005125  #define

CONFIG_SYS_FSL_ERRATUM_A005434

arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 #define CONFIG_SYS_FSL_A004447_SVR_REV	0x11
 #define CONFIG_ESDHC_HC_BLK_ADDR
@@ -712,6 +717,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A006475  #define
Quoted 1 line

CONFIG_SYS_FSL_ERRATUM_A006384 #define

CONFIG_SYS_FSL_ERRATUM_A007212

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type

Quoted 9 lines
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
+#define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_CCSRBAR_DEFAULT	0xfe000000
 #define CONFIG_SYS_FSL_SFP_VER_3_0
(quoted diff) +0 -0

b/drivers/usb/host/ehci-fsl.c index 5d4288d..41ff1a7 100644

drivers/usb/host/ehci-fsl.c +0 -0
@@ -138,6 +138,16 @@ int ehci_hcd_init(int index, enum usb_init_type

init,

Quoted 3 lines
drivers/usb/host/ehci-fsl.c +0 -0
 	if (has_erratum_a007798())
 		set_txfifothresh(ehci, TXFIFOTHRESH);
 
Quoted 11 lines

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type init, · line 147

Quoted 7 lines
drivers/usb/host/ehci-fsl.c +7 -0
+	if (has_erratum_a004477()) {
+		/*
+		 * When reset is issued while any ULPI transaction is ongoing
+		 * then it may result to corruption of ULPI Function Control
+		 * Register which eventually causes phy clock to enter low
+		 * power mode which stops the clock. Thus delay is required
+		 * before reset to let ongoing ULPI transaction complete.

Actually the erratum suggests checking transaction status before issuing a soft reset. Here, could the code do this check and wait for the transation to finish, rather than wait for an arbitrary duration?

Quoted 1 line

There have been discussions with IP team for changing the suggested

workaround.

Quoted 5 lines

The erratum talks about the ULPI transactions i.e from controller to ULPI phy and not the USB schedule transactions .Hence halting the controller before soft reset isn't the correct workaround.
In addition, as per the current flow of usb start/reset, the controller is always in halt set before issuing soft reset. This is taken care by

usb_stop().

Quoted 3 lines

Regarding the delay of 1 microsecond( minimum delay), it seems to be sufficient for ULPI Transactions to complete as ULPI interface runs on

Quoted 8 lines

60Mhz clock.

Quoted 1 line

Guys,

Is there any open comment on this patch? Do we all agree on this approach? Are we still waiting for IP team for the workaround?

IP team has agreed to change previous workaround to the 1us delay workaround

#5 lore raw

PATCH 1/1 drivers: usb: fsl: Workaround for Erratum A004477

Quoted 4 lines · On 04/23/2015 08:54 PM, Badola Nikhil-B46172 wrote:

IP team has agreed to change previous workaround to the 1us delay workaround

Applied to u-boot-mpc85xx master. Awaiting upstream.

York