[PATCH v2 1/2] generic-phy: s/CONFIG_PHY/CONFIG_IS_ENABLED(PHY)/

Allow to disable PHY driver in SPL because it checks the CONFIG_SPL_PHY variable for SPL builds.
The same change was done for usb by commit fd09c205fc57 ("usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/").
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
Changes in v2: - based on bug reported by Marek https://lore.kernel.org/all/d7adc9a4-f505-eaab-8cd9-45f778bc3b4a@denx.de/
include/generic-phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/generic-phy.h b/include/generic-phy.h index ff48b3708195..d40ce589b645 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -155,7 +155,7 @@ struct phy_bulk { unsigned int count; };
-#ifdef CONFIG_PHY +#if CONFIG_IS_ENABLED(PHY)
/** * generic_phy_init() - initialize the PHY port

When usb3-phy label is found, PHY driver is called and serdes line is initialized. This is preparation for serdes/psgtr driver to configure GT lines based on description in DT.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
Changes in v2: - Add missing header
drivers/usb/dwc3/dwc3-generic.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 01bd0ca190e3..2c5205df62cd 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -14,6 +14,7 @@ #include <dm/device-internal.h> #include <dm/lists.h> #include <dwc3-uboot.h> +#include <generic-phy.h> #include <linux/bitops.h> #include <linux/delay.h> #include <linux/usb/ch9.h> @@ -409,6 +410,17 @@ static int dwc3_glue_probe(struct udevice *dev) struct udevice *child = NULL; int index = 0; int ret; + struct phy phy; + + ret = generic_phy_get_by_name(dev, "usb3-phy", &phy); + if (!ret) { + ret = generic_phy_init(&phy); + if (ret) + return ret; + } else if (ret != -ENOENT) { + debug("could not get phy (err %d)\n", ret); + return ret; + }
glue->regs = dev_read_addr(dev);
@@ -420,6 +432,12 @@ static int dwc3_glue_probe(struct udevice *dev) if (ret) return ret;
+ if (phy.dev) { + ret = generic_phy_power_on(&phy); + if (ret) + return ret; + } + ret = device_find_first_child(dev, &child); if (ret) return ret;

On 3/8/22 14:19, Michal Simek wrote:
When usb3-phy label is found, PHY driver is called and serdes line is initialized. This is preparation for serdes/psgtr driver to configure GT lines based on description in DT.
Signed-off-by: Michal Simek michal.simek@xilinx.com
Changes in v2:
- Add missing header
I think 1/2 patch was not submitted ?

On 3/8/22 14:39, Marek Vasut wrote:
On 3/8/22 14:19, Michal Simek wrote:
When usb3-phy label is found, PHY driver is called and serdes line is initialized. This is preparation for serdes/psgtr driver to configure GT lines based on description in DT.
Signed-off-by: Michal Simek michal.simek@xilinx.com
Changes in v2:
- Add missing header
I think 1/2 patch was not submitted ?
It was but you are not in CC.
M
participants (2)
-
Marek Vasut
-
Michal Simek