mvebu: switch to kernel 6.1
[openwrt/staging/jow.git] / target / linux / mvebu / patches-5.15 / 710-v6.2-phy-marvell-phy-mvebu-a3700-comphy-Reset-COMPHY-regi.patch
1 From b01d622d76134e9401970ffd3fbbb9a7051f976a Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Tue, 20 Sep 2022 14:11:54 +0200
4 Subject: [PATCH] phy: marvell: phy-mvebu-a3700-comphy: Reset COMPHY registers
5 before USB 3.0 power on
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Turris MOX board with older ARM Trusted Firmware version v1.5 is not able
11 to detect any USB 3.0 device connected to USB-A port on Mox-A module after
12 commit 0a6fc70d76bd ("phy: marvell: phy-mvebu-a3700-comphy: Remove broken
13 reset support"). On the other hand USB 2.0 devices connected to the same
14 USB-A port are working fine.
15
16 It looks as if the older firmware configures COMPHY registers for USB 3.0
17 somehow incompatibly for kernel driver. Experiments show that resetting
18 COMPHY registers via setting SFT_RST auto-clearing bit in COMPHY_SFT_RESET
19 register fixes this issue.
20
21 Reset the COMPHY in mvebu_a3700_comphy_usb3_power_on() function as a first
22 step after selecting COMPHY lane and USB 3.0 function. With this change
23 Turris MOX board can successfully detect USB 3.0 devices again.
24
25 Before the above mentioned commit this reset was implemented in PHY reset
26 method, so this is the reason why there was no issue with older firmware
27 version then.
28
29 Fixes: 0a6fc70d76bd ("phy: marvell: phy-mvebu-a3700-comphy: Remove broken reset support")
30 Reported-by: Marek Behún <kabel@kernel.org>
31 Signed-off-by: Pali Rohár <pali@kernel.org>
32 Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
33 Link: https://lore.kernel.org/r/20220920121154.30115-1-pali@kernel.org
34 Signed-off-by: Vinod Koul <vkoul@kernel.org>
35 ---
36 drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 3 +++
37 1 file changed, 3 insertions(+)
38
39 --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
40 +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
41 @@ -826,6 +826,9 @@ mvebu_a3700_comphy_usb3_power_on(struct
42 if (ret)
43 return ret;
44
45 + /* COMPHY register reset (cleared automatically) */
46 + comphy_lane_reg_set(lane, COMPHY_SFT_RESET, SFT_RST, SFT_RST);
47 +
48 /*
49 * 0. Set PHY OTG Control(0x5d034), bit 4, Power up OTG module The
50 * register belong to UTMI module, so it is set in UTMI phy driver.