[U-Boot] [PATCH] phy: add a NO-OP phy driver

Patrick DELAUNAY patrick.delaunay at st.com
Fri Jul 21 12:12:04 UTC 2017


Hi Marek and Jean-Jacques,

-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Marek Vasut
Sent: vendredi 21 juillet 2017 11:03
To: Jean-Jacques Hiblot <jjhiblot at ti.com>; Patrice CHOTARD <patrice.chotard at st.com>; u-boot at lists.denx.de; sjg at chromium.org
Cc: ran.wang_1 at nxp.com; Christophe KERELLO <christophe.kerello at st.com>
Subject: Re: [U-Boot] [PATCH] phy: add a NO-OP phy driver

On 07/21/2017 10:49 AM, Jean-Jacques Hiblot wrote:
> The no-op phy driver is useful when a driver uses the phy framework 
> but no PHY driver is available for the hardware (or the hardware has 
> no PHY).
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>


So with this patch we have noop PHY driver
But that don't solve all the issues:

1/ compilation issue

=> dependency need to be added to avoid to modify all defconfig

In drivers/usb/host/Kconfig
	Add select  PHY

For  USB_EHCI_GENERIC and USB_OHCI_GENERIC

PS: I don't sure that solve issue for all the case (is USB is activated in SPL for boards)

2/ execution need to be protected

In all driver, we have de sequence 

	err = generic_phy_get_by_index(dev, 0, &priv->phy);
	if (err) {
		if (err != -ENOENT) {
			error("failed to get usb phy\n");
			goto reset_err;
		}
	}

	err = generic_phy_init(&priv->phy);
	if (err) {
		error("failed to init usb phy\n");
		goto reset_err;
	}

=> the priv->phy can be invalid (if ENOENT error)

	int generic_phy_init(struct phy *phy)
	int generic_phy_reset(struct phy *phy)
	int generic_phy_exit(struct phy *phy)
	int generic_phy_power_on(struct phy *phy)
	int generic_phy_power_off(struct phy *phy)

	need to be protected for invalid phy 

Regards

Patrick


More information about the U-Boot mailing list