[U-Boot] [PATCH 0/4] Fix compile failure encountered on u-boot-usb tree (2017-07-20)

From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)

From: Patrice Chotard patrice.chotard@st.com
To avoid compilation breakage on platform that doesn't support DM PHY but uses xhci-dwc3 driver, add the missing CONFIG_PHY flag.
Introduced by patch : 84e53877 "usb: host: xhci-dwc3: Add generic PHY support"
Cc: Ran Wang ran.wang_1@nxp.com Cc: Bin Meng bmeng.cn@gmail.com
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Ran Wang ran.wang_1@nxp.com --- include/generic-phy.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/include/generic-phy.h b/include/generic-phy.h index 58cd2b2..eac5adc 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -122,6 +122,7 @@ struct phy_ops { int (*power_off)(struct phy *phy); };
+#ifdef CONFIG_PHY
/** * generic_phy_init() - initialize the PHY port @@ -220,6 +221,47 @@ int generic_phy_get_by_index(struct udevice *user, int index, int generic_phy_get_by_name(struct udevice *user, const char *phy_name, struct phy *phy);
+#else /* CONFIG_PHY */ + +static inline int generic_phy_init(struct phy *phy) +{ + return 0; +} + +static inline int generic_phy_exit(struct phy *phy) +{ + return 0; +} + +static inline int generic_phy_reset(struct phy *phy) +{ + return 0; +} + +static inline int generic_phy_power_on(struct phy *phy) +{ + return 0; +} + +static inline int generic_phy_power_off(struct phy *phy) +{ + return 0; +} + +static inline int generic_phy_get_by_index(struct udevice *user, int index, + struct phy *phy) +{ + return 0; +} + +static inline int generic_phy_get_by_name(struct udevice *user, const char *phy_name, + struct phy *phy) +{ + return 0; +} + +#endif /* CONFIG_PHY */ + /** * generic_phy_valid() - check if PHY port is valid *

From: Patrice Chotard patrice.chotard@st.com
Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman : +drivers/usb/host/built-in.o: In function `xhci_dwc3_remove': +drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister' +drivers/usb/host/built-in.o: In function `xhci_dwc3_probe': +drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode' +drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'
introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Ran Wang ran.wang_1@nxp.com --- drivers/usb/host/xhci-dwc3.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index 374fe74..541a785 100644 --- a/drivers/usb/host/xhci-dwc3.c +++ b/drivers/usb/host/xhci-dwc3.c @@ -111,6 +111,7 @@ void dwc3_set_fladj(struct dwc3 *dwc3_reg, u32 val) GFLADJ_30MHZ(val)); }
+#ifdef CONFIG_DM_USB static int xhci_dwc3_probe(struct udevice *dev) { struct xhci_dwc3_platdata *plat = dev_get_platdata(dev); @@ -184,3 +185,4 @@ U_BOOT_DRIVER(xhci_dwc3) = { .platdata_auto_alloc_size = sizeof(struct xhci_dwc3_platdata), .flags = DM_FLAG_ALLOC_PRIV_DMA, }; +#endif

On 24 July 2017 at 09:07, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman : +drivers/usb/host/built-in.o: In function `xhci_dwc3_remove': +drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister' +drivers/usb/host/built-in.o: In function `xhci_dwc3_probe': +drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode' +drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'
introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Ran Wang ran.wang_1@nxp.com
drivers/usb/host/xhci-dwc3.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

On 08/06/2017 07:15 AM, Simon Glass wrote:
On 24 July 2017 at 09:07, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman : +drivers/usb/host/built-in.o: In function `xhci_dwc3_remove': +drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister' +drivers/usb/host/built-in.o: In function `xhci_dwc3_probe': +drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode' +drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'
introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Ran Wang ran.wang_1@nxp.com
drivers/usb/host/xhci-dwc3.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
Um, this patch was applied like two weeks ago. Is this some automated botmail ... reviewman ? :)

Hi Marek,
On 6 August 2017 at 13:17, Marek Vasut marex@denx.de wrote:
On 08/06/2017 07:15 AM, Simon Glass wrote:
On 24 July 2017 at 09:07, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman : +drivers/usb/host/built-in.o: In function `xhci_dwc3_remove': +drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister' +drivers/usb/host/built-in.o: In function `xhci_dwc3_probe': +drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode' +drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'
introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Ran Wang ran.wang_1@nxp.com
drivers/usb/host/xhci-dwc3.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
Um, this patch was applied like two weeks ago. Is this some automated botmail ... reviewman ? :)
There is no mention of it being applied on this thread, so it looked like an open patch to me.
Regards, Simon

From: Patrice Chotard patrice.chotard@st.com
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Patrick Delaunay patrick.delaunay@st.com --- drivers/usb/host/ehci-generic.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c index 3f751f1..03f8d32 100644 --- a/drivers/usb/host/ehci-generic.c +++ b/drivers/usb/host/ehci-generic.c @@ -99,12 +99,13 @@ static int ehci_usb_probe(struct udevice *dev) error("failed to get usb phy\n"); goto reset_err; } - } + } else {
- err = generic_phy_init(&priv->phy); - if (err) { - error("failed to init usb phy\n"); - goto reset_err; + err = generic_phy_init(&priv->phy); + if (err) { + error("failed to init usb phy\n"); + goto reset_err; + } }
hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);

On 24 July 2017 at 09:07, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Patrick Delaunay patrick.delaunay@st.com
drivers/usb/host/ehci-generic.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

From: Patrice Chotard patrice.chotard@st.com
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Patrick Delaunay patrick.delaunay@st.com --- drivers/usb/host/ohci-generic.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c index 9249039..e22ee97 100644 --- a/drivers/usb/host/ohci-generic.c +++ b/drivers/usb/host/ohci-generic.c @@ -91,12 +91,13 @@ static int ohci_usb_probe(struct udevice *dev) error("failed to get usb phy\n"); goto reset_err; } - } + } else {
- err = generic_phy_init(&priv->phy); - if (err) { - error("failed to init usb phy\n"); - goto reset_err; + err = generic_phy_init(&priv->phy); + if (err) { + error("failed to init usb phy\n"); + goto reset_err; + } }
err = ohci_register(dev, regs);

On 24 July 2017 at 09:07, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard patrice.chotard@st.com Reported-by: Patrick Delaunay patrick.delaunay@st.com
drivers/usb/host/ohci-generic.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
Applied all, thanks.

Hi Marek,
On Tue, Jul 25, 2017 at 1:32 AM, Marek Vasut marex@denx.de wrote:
On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
Applied all, thanks.
I see these 4 patches are applied on top of u-boot-usb/master directly. I think they should be squashed into Patrice's previous patches, so that we can still maintain bisectablity.
Regards, Bin

On 07/25/2017 12:50 AM, Bin Meng wrote:
Hi Marek,
Hi Bin,
On Tue, Jul 25, 2017 at 1:32 AM, Marek Vasut marex@denx.de wrote:
On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
Applied all, thanks.
I see these 4 patches are applied on top of u-boot-usb/master directly. I think they should be squashed into Patrice's previous patches, so that we can still maintain bisectablity.
They can, but then I have to rewrite history and rebase your patches on top of his, which I'm not too happy to do. Plus if I squash them, you cannot locate either of the squashed patches in the ML, which sucks.
Regards, Bin

On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.

Hi Marek
On 07/24/2017 11:11 PM, Marek Vasut wrote:
On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.
Ok i will submit fixes to fix error poplar and warnings for dra7xx_evm platforms.
Regarding evb-rk3328, warnings are not link with my series
Patrice

On 07/25/2017 11:01 AM, Patrice CHOTARD wrote:
Hi Marek
On 07/24/2017 11:11 PM, Marek Vasut wrote:
On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.
Ok i will submit fixes to fix error poplar and warnings for dra7xx_evm platforms.
Can you please run buildman to see if there are any failures remaining ?
Regarding evb-rk3328, warnings are not link with my series
OK
Patrice

Hi Marek
On 07/25/2017 11:12 AM, Marek Vasut wrote:
On 07/25/2017 11:01 AM, Patrice CHOTARD wrote:
Hi Marek
On 07/24/2017 11:11 PM, Marek Vasut wrote:
On 07/24/2017 05:07 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes : _ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers which avoid to init a generic PHY if not found, reported by Patrick Delaunay
This series need an additionnal patch from Jean-Jacques Hiblot : [PATCH v2] phy: add a NO-OP phy driver
Patrice Chotard (4): dm: phy: add missing #ifdef CONFIG_PHY dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB usb: host: ehci-generic: initialize PHY only when found usb: host: ohci-generic: initialize PHY only when found
drivers/usb/host/ehci-generic.c | 11 ++++++----- drivers/usb/host/ohci-generic.c | 11 ++++++----- drivers/usb/host/xhci-dwc3.c | 2 ++ include/generic-phy.h | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-)
FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.
Ok i will submit fixes to fix error poplar and warnings for dra7xx_evm platforms.
Can you please run buildman to see if there are any failures remaining ?
Of course, buildman becomes my friends ;-)
Regarding evb-rk3328, warnings are not link with my series
OK
Patrice
participants (5)
-
Bin Meng
-
Marek Vasut
-
Patrice CHOTARD
-
patrice.chotard@st.com
-
Simon Glass