diff mbox series

[U-Boot,v1,08/19] phy: marvell: a3700: Set USB3 RX wait depending on ref clock

Message ID 20180307215216.10418-9-marek.behun@nic.cz
State Superseded
Delegated to: Stefan Roese
Headers show
Series More support for Armada 37xx boards | expand

Commit Message

Marek BehĂșn March 7, 2018, 9:52 p.m. UTC
According to specification, CFG_PM_RXDLOZ_WAIT should be set to 0x7
when reference clock is at 25 MHz. The specification (at least the
version I have) does not mentoin the setting for 40 MHz reference
clock, but Marvell's U-Boot sets 0xC in that case.

Signed-off-by: Marek Behun <marek.behun@nic.cz>
---
 drivers/phy/marvell/comphy_a3700.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Stefan Roese March 21, 2018, 9:02 a.m. UTC | #1
On 07.03.2018 22:52, Marek BehĂșn wrote:
> According to specification, CFG_PM_RXDLOZ_WAIT should be set to 0x7
> when reference clock is at 25 MHz. The specification (at least the
> version I have) does not mentoin the setting for 40 MHz reference
> clock, but Marvell's U-Boot sets 0xC in that case.
> 
> Signed-off-by: Marek Behun <marek.behun@nic.cz>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
diff mbox series

Patch

diff --git a/drivers/phy/marvell/comphy_a3700.c b/drivers/phy/marvell/comphy_a3700.c
index b5f2013bbb..78caa96014 100644
--- a/drivers/phy/marvell/comphy_a3700.c
+++ b/drivers/phy/marvell/comphy_a3700.c
@@ -394,20 +394,18 @@  static int comphy_usb3_power_up(u32 lane, u32 type, u32 speed, u32 invert)
 	/*
 	 * 3. Check crystal jumper setting and program the Power and PLL
 	 * Control accordingly
+	 * 4. Change RX wait
 	 */
 	if (get_ref_clk() == 40) {
 		/* 40 MHz */
 		usb3_reg_set16(PWR_PLL_CTRL, 0xFCA3, 0xFFFF);
+		usb3_reg_set16(PWR_MGM_TIM1, 0x10C, 0xFFFF);
 	} else {
 		/* 25 MHz */
 		usb3_reg_set16(PWR_PLL_CTRL, 0xFCA2, 0xFFFF);
+		usb3_reg_set16(PWR_MGM_TIM1, 0x107, 0xFFFF);
 	}
 
-	/*
-	 * 4. Change RX wait
-	 */
-	usb3_reg_set16(PWR_MGM_TIM1, 0x10C, 0xFFFF);
-
 	/*
 	 * 5. Enable idle sync
 	 */