From patchwork Sun Apr 19 15:48:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 238023 List-Id: U-Boot discussion From: marek.behun at nic.cz (=?UTF-8?q?Marek=20Beh=C3=BAn?=) Date: Sun, 19 Apr 2020 17:48:39 +0200 Subject: [PATCH u-boot-marvell 00/11] Armada 37xx: port comphy to generic-phys (PLEASE TEST) Message-ID: <20200419154850.25868-1-marek.behun@nic.cz> Hi, I have ported the COMPHY and UTMI PHY drivers from Linux to U-Boot. With this we are able to abandon the current comphy_a3700 driver, which is incompatible with Linux' device trees. So if we want to have DTS files for A3720 boards identical to Linux', we have to do this. This series adds the set_mode functionality to generic-phy, then adds the ports of UTMI PHY and COMPHY drivers from Linux, then makes some drivers use the generic-phy API on device probe (these drivers are mvneta, ahci_mvebu, pci-aardvark, xhci-mvebu and ehci-marvell), then converts defconfigs and device trees to use the new bindings and drivers, and the last patch removes the comphy_a3700 driver. I have successfully compiled U-Boot without errors for all these boards (their defconigs) and also for Armada 8k boards, but am unable to test on anything else but Turris MOX. Please note that in order for the COMPHY driver to work, you have to use current ARM Trusted Firmware (such that it supports PHY powering on/off via SMC calls). It would be nice if people tested this series. Marek Marek Beh?n (11): phy: add support for setting phy mode phy: port Armada 37xx UTMI PHY from Linux phy: port Armada 37xx COMPHY from Linux usb: host: make PHY handling more generic usb: ehci-marvell: call generic-phy initialization usb: xhci-mvebu: call generic-phy initialization pci: aardvark: add PHY support ata: ahci_mvebu: add PHY support net: mvneta: add PHY support arm64: mvebu: armada-37xx: convert to use new generic-phy drivers phy: marvell: remove comphy_a3700 driver arch/arm/dts/armada-3720-db.dts | 12 - arch/arm/dts/armada-3720-espressobin.dts | 18 - arch/arm/dts/armada-3720-turris-mox.dts | 19 +- arch/arm/dts/armada-3720-uDPU.dts | 18 +- arch/arm/dts/armada-37xx.dtsi | 72 +- board/CZ.NIC/turris_mox/turris_mox.c | 33 - configs/mvebu_db-88f3720_defconfig | 6 +- configs/mvebu_espressobin-88f3720_defconfig | 6 +- configs/turris_mox_defconfig | 6 +- configs/uDPU_defconfig | 6 +- drivers/ata/ahci_mvebu.c | 35 + drivers/net/mvneta.c | 23 + drivers/pci/pci-aardvark.c | 55 +- drivers/phy/Kconfig | 16 + drivers/phy/Makefile | 2 + drivers/phy/marvell/Makefile | 1 - drivers/phy/marvell/comphy_a3700.c | 1021 ------------------- drivers/phy/marvell/comphy_a3700.h | 264 ----- drivers/phy/marvell/comphy_core.c | 3 - drivers/phy/marvell/comphy_core.h | 25 +- drivers/phy/phy-mvebu-a3700-comphy.c | 315 ++++++ drivers/phy/phy-mvebu-a3700-utmi.c | 235 +++++ drivers/phy/phy-uclass.c | 11 + drivers/usb/host/Makefile | 2 + drivers/usb/host/ehci-generic.c | 11 +- drivers/usb/host/ehci-hcd.c | 66 -- drivers/usb/host/ehci-marvell.c | 33 +- drivers/usb/host/ehci-msm.c | 7 +- drivers/usb/host/ehci-pci.c | 6 +- drivers/usb/host/ehci.h | 4 - drivers/usb/host/phy.c | 115 +++ drivers/usb/host/phy.h | 31 + drivers/usb/host/xhci-mvebu.c | 19 +- include/generic-phy.h | 51 + include/mvebu/comphy.h | 22 - 35 files changed, 1046 insertions(+), 1523 deletions(-) delete mode 100644 drivers/phy/marvell/comphy_a3700.c delete mode 100644 drivers/phy/marvell/comphy_a3700.h create mode 100644 drivers/phy/phy-mvebu-a3700-comphy.c create mode 100644 drivers/phy/phy-mvebu-a3700-utmi.c create mode 100644 drivers/usb/host/phy.c create mode 100644 drivers/usb/host/phy.h delete mode 100644 include/mvebu/comphy.h Tested-by: Tomasz Maciej Nowak