public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Eichenberger <eichest@gmail.com>
To: sr@denx.de, pali@kernel.org, marek.behun@nic.cz
Cc: u-boot@lists.denx.de, "René Straub" <rene.straub@netmodule.com>
Subject: [PATCH 1/2] arm: mvebu: a38x: serdes: fix serdes config for USB3
Date: Thu,  9 Dec 2021 11:19:33 +0100	[thread overview]
Message-ID: <20211209101934.37823-2-eichest@gmail.com> (raw)
In-Reply-To: <20211209101934.37823-1-eichest@gmail.com>

The electrical serdes configuration for USB3 expects an array as data
argument. For USB3 the second value is used (see data_arr_idx = USB3 =
1). However, because only one value is inside the array mv_seq_exec is
accessing an invalid element and the serdes is configured wrongly.

This wrong initialization is leading to an unreliable detection
mechanism for some USB3 devices. We were able to reproduce the issue
regularly with an LTE modem from Sierra Wireless (SM7455) where it was
not detected as USB3 device in 1/3 of all tests.

This commit fixes the issue by setting data_arr_idx to 0. This is the
same value as the original U-Boot from Marvell is using. There it is
called FIRST_CELL which is a define for 0.
See: https://github.com/MarvellEmbeddedProcessors/u-boot-marvell
commit 56f963ce4c ("fix: serdes: a38x, a39x: Fix USB3 serdes DB
initialization")

Signed-off-by: Stefan Eichenberger <eichest@gmail.com>
Signed-off-by: René Straub <rene.straub@netmodule.com>
---
 arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 d2bc3ab25c..11b5824232 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
@@ -1204,7 +1204,7 @@ int hws_serdes_seq_db_init(void)
 		    sizeof(usb3_electrical_config_serdes_rev2_params) /
 		    sizeof(struct op_params);
 	}
-	serdes_seq_db[USB3_ELECTRICAL_CONFIG_SEQ].data_arr_idx = USB3;
+	serdes_seq_db[USB3_ELECTRICAL_CONFIG_SEQ].data_arr_idx = 0;
 
 	/* USB3_TX_CONFIG_SEQ sequence init */
 	serdes_seq_db[USB3_TX_CONFIG_SEQ1].op_params_ptr =
-- 
2.30.2


  reply	other threads:[~2021-12-09 12:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 10:19 [PATCH 0/2] arm: mvebu: a38x: improve USB3 serdes configuration Stefan Eichenberger
2021-12-09 10:19 ` Stefan Eichenberger [this message]
2021-12-18  8:41   ` [PATCH 1/2] arm: mvebu: a38x: serdes: fix serdes config for USB3 Stefan Roese
2021-12-09 10:19 ` [PATCH 2/2] arm: mvebu: a38x: serdes: improve USB3 electrical configuration Stefan Eichenberger
2021-12-18  8:42   ` Stefan Roese
2021-12-18 13:48 ` [PATCH 0/2] arm: mvebu: a38x: improve USB3 serdes configuration Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211209101934.37823-2-eichest@gmail.com \
    --to=eichest@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=rene.straub@netmodule.com \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox