linux-stable/drivers/phy/marvell
Pali Rohár 934337080c phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation
Remove old RPC implementation and add a new native kernel implementation.

The old implementation uses ARM SMC API to issue RPC calls to ARM Trusted
Firmware which provides real implementation of PHY configuration.

But older versions of ARM Trusted Firmware do not provide this PHY
configuration functionality, simply returning: operation not supported; or
worse, some versions provide the configuration functionality incorrectly.

For example the firmware shipped in ESPRESSObin board has this older
version of ARM Trusted Firmware and therefore SATA, USB 3.0 and PCIe
functionality do not work with newer versions of Linux kernel.

Due to the above reasons, the following commits were introduced into Linux,
to workaround these issues by ignoring -EOPNOTSUPP error code from
phy-mvebu-a3700-comphy driver function phy_power_on():

commit 45aefe3d22 ("ata: ahci: mvebu: Make SATA PHY optional for Armada
3720")
commit 3241929b67 ("usb: host: xhci: mvebu: make USB 3.0 PHY optional for
Armada 3720")
commit b0c6ae0f89 ("PCI: aardvark: Fix initialization with old Marvell's
Arm Trusted Firmware")

Replace this RPC implementation with proper native kernel implementation,
which is independent on the firmware. Never return -EOPNOTSUPP for proper
arguments.

This should solve multiple issues with real-world boards, where it is not
possible or really inconvenient to change the firmware. Let's eliminate
these issues.

This implementation is ported directly from Armada 3720 comphy driver found
in newest version of ARM Trusted Firmware source code, but with various
fixes of register names, some added comments, some refactoring due to the
original code not conforming to kernel standards. Also PCIe mode poweroff
support was added here, and PHY reset support. These changes are also going
to be sent to ARM Trusted Firmware.

[ Pali did the porting from ATF.
  I (Marek) then fixed some register names, some various other things,
  added some comments and refactored the code to kernel standards. Also
  fixed PHY poweroff and added PHY reset. ]

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20220203214444.1508-3-kabel@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2022-02-25 19:12:21 +05:30
..
Kconfig phy: marvell: phy-mvebu-cp11i-utmi needs USB_COMMON 2021-04-06 10:34:20 +05:30
Makefile drivers: phy: add support for Armada CP110 UTMI PHY 2021-03-30 23:32:53 +05:30
phy-armada38x-comphy.c phy: armada-38x: fix NETA lockup when repeatedly switching speeds 2020-07-21 22:57:46 +05:30
phy-armada375-usb2.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30
phy-berlin-sata.c
phy-berlin-usb.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30
phy-mmp3-hsic.c phy: phy-mmp3-hsic: Remove redundant dev_err call in mmp3_hsic_phy_probe() 2021-06-14 11:00:52 +05:30
phy-mmp3-usb.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30
phy-mvebu-a3700-comphy.c phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation 2022-02-25 19:12:21 +05:30
phy-mvebu-a3700-utmi.c phy-mvebu-a3700-utmi: correct typo in struct mvebu_a3700_utmi comments 2020-07-13 12:14:37 +05:30
phy-mvebu-cp110-comphy.c phy: marvell: phy-mvebu-cp110-comphy: add support for 5gbase-r 2021-11-23 12:14:48 +00:00
phy-mvebu-cp110-utmi.c phy: mvebu-cp110-utmi: Fix kernel-doc warns 2021-11-20 11:33:22 +05:30
phy-mvebu-sata.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30
phy-pxa-28nm-hsic.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30
phy-pxa-28nm-usb2.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30
phy-pxa-usb.c phy: marvell: convert to devm_platform_ioremap_resource 2020-11-16 12:47:47 +05:30