diff mbox series

[v2] arm: mvebu: a38x: Configurable USB2 high-speed impedance threshold

Message ID 20201108211408.8954-1-joshua.scott@alliedtelesis.co.nz
State Accepted
Commit 28f0cbcdd28c03c44d867a6641d642e97d4704a8
Delegated to: Stefan Roese
Headers show
Series [v2] arm: mvebu: a38x: Configurable USB2 high-speed impedance threshold | expand

Commit Message

Joshua Scott Nov. 8, 2020, 9:14 p.m. UTC
Hardware testing of a board using the Armada 385 has shown that an
impedance threshold setting of 0x7 performs better in an eye-diagram
test than with Marvell's recommended value 0x6.

As other boards may still perform better with Marvell's reccomended value,
a configuration option is added with a default value of 0x6.

Signed-off-by: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
Reviewed-by: Stefan Roese <sr@denx.de>
---
Changes for v2:
    - Added "range" to Kconfig to prevent invalid values from being
      selected.

 arch/arm/mach-mvebu/Kconfig                           | 6 ++++++
 arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

Comments

Stefan Roese Dec. 7, 2020, 11:09 a.m. UTC | #1
On 08.11.20 22:14, Joshua Scott wrote:
> Hardware testing of a board using the Armada 385 has shown that an
> impedance threshold setting of 0x7 performs better in an eye-diagram
> test than with Marvell's recommended value 0x6.
> 
> As other boards may still perform better with Marvell's reccomended value,
> a configuration option is added with a default value of 0x6.
> 
> Signed-off-by: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
> Reviewed-by: Stefan Roese <sr@denx.de>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
> Changes for v2:
>      - Added "range" to Kconfig to prevent invalid values from being
>        selected.
> 
>   arch/arm/mach-mvebu/Kconfig                           | 6 ++++++
>   arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c | 6 +++---
>   2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> index 0d8e0922a2..72aee8b3e5 100644
> --- a/arch/arm/mach-mvebu/Kconfig
> +++ b/arch/arm/mach-mvebu/Kconfig
> @@ -30,6 +30,12 @@ config ARMADA_38X
>   	select ARMADA_32BIT
>   	select HAVE_MVEBU_EFUSE
>   
> +config ARMADA_38X_HS_IMPEDANCE_THRESH
> +	hex  "Armada 38x USB 2.0 High-Speed Impedance Threshold (0x0 - 0x7)"
> +	depends on ARMADA_38X
> +	default 0x6
> +	range 0x0 0x7
> +
>   config ARMADA_XP
>   	bool
>   	select ARMADA_32BIT
> diff --git a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
> index 2454730e6d..ae2a361104 100644
> --- a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
> +++ b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
> @@ -677,9 +677,9 @@ struct op_params usb2_power_up_params[] = {
>   	{0xc200c, 0x0 /*NA*/, 0xf000, {0x1000}, 0, 0},
>   	{0xc400c, 0x0 /*NA*/, 0xf000, {0x1000}, 0, 0},
>   	/* Change the High speed impedance threshold */
> -	{0xc0008, 0x0 /*NA*/, 0x700, {0x600}, 0, 0},
> -	{0xc2008, 0x0 /*NA*/, 0x700, {0x600}, 0, 0},
> -	{0xc4008, 0x0 /*NA*/, 0x700, {0x600}, 0, 0},
> +	{0xc0008, 0x0 /*NA*/, 0x700, {CONFIG_ARMADA_38X_HS_IMPEDANCE_THRESH << 8}, 0, 0},
> +	{0xc2008, 0x0 /*NA*/, 0x700, {CONFIG_ARMADA_38X_HS_IMPEDANCE_THRESH << 8}, 0, 0},
> +	{0xc4008, 0x0 /*NA*/, 0x700, {CONFIG_ARMADA_38X_HS_IMPEDANCE_THRESH << 8}, 0, 0},
>   	/* Change the squelch level of the receiver to meet the receiver electrical measurements (squelch and receiver sensitivity tests) */
>   	{0xc0014, 0x0 /*NA*/, 0xf, {0x8}, 0, 0},
>   	{0xc2014, 0x0 /*NA*/, 0xf, {0x8}, 0, 0},
> 


Viele Grüße,
Stefan
diff mbox series

Patch

diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 0d8e0922a2..72aee8b3e5 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -30,6 +30,12 @@  config ARMADA_38X
 	select ARMADA_32BIT
 	select HAVE_MVEBU_EFUSE
 
+config ARMADA_38X_HS_IMPEDANCE_THRESH
+	hex  "Armada 38x USB 2.0 High-Speed Impedance Threshold (0x0 - 0x7)"
+	depends on ARMADA_38X
+	default 0x6
+	range 0x0 0x7
+
 config ARMADA_XP
 	bool
 	select ARMADA_32BIT
diff --git a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
index 2454730e6d..ae2a361104 100644
--- a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
+++ b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
@@ -677,9 +677,9 @@  struct op_params usb2_power_up_params[] = {
 	{0xc200c, 0x0 /*NA*/, 0xf000, {0x1000}, 0, 0},
 	{0xc400c, 0x0 /*NA*/, 0xf000, {0x1000}, 0, 0},
 	/* Change the High speed impedance threshold */
-	{0xc0008, 0x0 /*NA*/, 0x700, {0x600}, 0, 0},
-	{0xc2008, 0x0 /*NA*/, 0x700, {0x600}, 0, 0},
-	{0xc4008, 0x0 /*NA*/, 0x700, {0x600}, 0, 0},
+	{0xc0008, 0x0 /*NA*/, 0x700, {CONFIG_ARMADA_38X_HS_IMPEDANCE_THRESH << 8}, 0, 0},
+	{0xc2008, 0x0 /*NA*/, 0x700, {CONFIG_ARMADA_38X_HS_IMPEDANCE_THRESH << 8}, 0, 0},
+	{0xc4008, 0x0 /*NA*/, 0x700, {CONFIG_ARMADA_38X_HS_IMPEDANCE_THRESH << 8}, 0, 0},
 	/* Change the squelch level of the receiver to meet the receiver electrical measurements (squelch and receiver sensitivity tests) */
 	{0xc0014, 0x0 /*NA*/, 0xf, {0x8}, 0, 0},
 	{0xc2014, 0x0 /*NA*/, 0xf, {0x8}, 0, 0},