[U-Boot] [PATCH 0/2] Fix remaining errors and warning on u-boot-usb tree

From: Patrice Chotard patrice.chotard@st.com
This series fixes remaining compilation errors for poplar platform and warning for dra7xx_evm / dra7xx_hs_evm platforms
Patrice Chotard (2): usb: host: xhci-dxc3: fix compilation warnings clk: fix compilation errors for poplar platform
drivers/clk/clk-uclass.c | 47 ++++++++++++++++++++++---------------------- drivers/usb/host/xhci-dwc3.c | 4 ++-- include/clk.h | 35 ++++++++++++++++++++------------- 3 files changed, 47 insertions(+), 39 deletions(-)

From: Patrice Chotard patrice.chotard@st.com
Fix following warnings encountered with platforms dra7xx_evm and dra7xx_hs_evm :
arm: + dra7xx_evm + hccr = (struct xhci_hccr *)devfdt_get_addr(dev); + ^ + hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + ^ w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] arm: + dra7xx_hs_evm + hccr = (struct xhci_hccr *)devfdt_get_addr(dev); + ^ + hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + ^ w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Introduced by 7e65e84 usb: host: xhci-dwc3: Convert driver to DM
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- drivers/usb/host/xhci-dwc3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index 541a785..4191a89 100644 --- a/drivers/usb/host/xhci-dwc3.c +++ b/drivers/usb/host/xhci-dwc3.c @@ -121,8 +121,8 @@ static int xhci_dwc3_probe(struct udevice *dev) enum usb_dr_mode dr_mode; int ret;
- hccr = (struct xhci_hccr *)devfdt_get_addr(dev); - hcor = (struct xhci_hcor *)((phys_addr_t)hccr + + hccr = (struct xhci_hccr *)((uintptr_t)dev_read_addr(dev)); + hcor = (struct xhci_hcor *)((uintptr_t)hccr + HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
ret = generic_phy_get_by_index(dev, 0, &plat->usb_phy);

On 25 July 2017 at 05:24, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Fix following warnings encountered with platforms dra7xx_evm and dra7xx_hs_evm :
arm: + dra7xx_evm
- hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
^
- hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
^
w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] arm: + dra7xx_hs_evm
- hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
^
- hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
^
w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe': w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Introduced by 7e65e84 usb: host: xhci-dwc3: Convert driver to DM
Signed-off-by: Patrice Chotard patrice.chotard@st.com
drivers/usb/host/xhci-dwc3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks for the very clear commit messages.
Reviewed-by: Simon Glass sjg@chromium.org

From: Patrice Chotard patrice.chotard@st.com
Move clk_release_all() prototype and definition inside OF_CONTROL flag to avoid following compilation error for poplar platform:
aarch64: + poplar +drivers/usb/host/built-in.o: In function `ehci_usb_remove': +drivers/usb/host/ehci-generic.c:159: undefined reference to `clk_release_all' +drivers/usb/host/built-in.o: In function `ehci_usb_probe': +drivers/usb/host/ehci-generic.c:133: undefined reference to `clk_release_all' +make[1]: *** [u-boot] Error 139 +make: *** [sub-make] Error 2
Introduced by 4e542c4 clk: add clk_release_all()
Signed-off-by: Patrice Chotard patrice.chotard@st.com --- drivers/clk/clk-uclass.c | 47 ++++++++++++++++++++++++----------------------- include/clk.h | 35 +++++++++++++++++++++-------------- 2 files changed, 45 insertions(+), 37 deletions(-)
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index ffbe872..e68d927 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -114,6 +114,30 @@ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk)
return clk_get_by_index(dev, index, clk); } + +int clk_release_all(struct clk *clk, int count) +{ + int i, ret; + + for (i = 0; i < count; i++) { + debug("%s(clk[%d]=%p)\n", __func__, i, &clk[i]); + + /* check if clock has been previously requested */ + if (!clk[i].dev) + continue; + + ret = clk_disable(&clk[i]); + if (ret && ret != -ENOSYS) + return ret; + + ret = clk_free(&clk[i]); + if (ret && ret != -ENOSYS) + return ret; + } + + return 0; +} + #endif /* OF_CONTROL */
int clk_request(struct udevice *dev, struct clk *clk) @@ -190,29 +214,6 @@ int clk_disable(struct clk *clk) return ops->disable(clk); }
-int clk_release_all(struct clk *clk, int count) -{ - int i, ret; - - for (i = 0; i < count; i++) { - debug("%s(clk[%d]=%p)\n", __func__, i, &clk[i]); - - /* check if clock has been previously requested */ - if (!clk[i].dev) - continue; - - ret = clk_disable(&clk[i]); - if (ret && ret != -ENOSYS) - return ret; - - ret = clk_free(&clk[i]); - if (ret && ret != -ENOSYS) - return ret; - } - - return 0; -} - UCLASS_DRIVER(clk) = { .id = UCLASS_CLK, .name = "clk", diff --git a/include/clk.h b/include/clk.h index a905a41..c5988f7 100644 --- a/include/clk.h +++ b/include/clk.h @@ -98,6 +98,21 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk); * @return 0 if OK, or a negative error code. */ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk); + +/** + * clk_release_all() - Disable (turn off)/Free an array of previously + * requested clocks. + * + * For each clock contained in the clock array, this function will check if + * clock has been previously requested and then will disable and free it. + * + * @clk: A clock struct array that was previously successfully + * requested by clk_request/get_by_*(). + * @count Number of clock contained in the array + * @return zero on success, or -ve error code. + */ +int clk_release_all(struct clk *clk, int count); + #else static inline int clk_get_by_index(struct udevice *dev, int index, struct clk *clk) @@ -110,6 +125,12 @@ static inline int clk_get_by_name(struct udevice *dev, const char *name, { return -ENOSYS; } + +static inline int clk_release_all(struct clk *clk, int count) +{ + return -ENOSYS; +} + #endif
/** @@ -174,20 +195,6 @@ int clk_enable(struct clk *clk); */ int clk_disable(struct clk *clk);
-/** - * clk_release_all() - Disable (turn off)/Free an array of previously - * requested clocks. - * - * For each clock contained in the clock array, this function will check if - * clock has been previously requested and then will disable and free it. - * - * @clk: A clock struct array that was previously successfully - * requested by clk_request/get_by_*(). - * @count Number of clock contained in the array - * @return zero on success, or -ve error code. - */ -int clk_release_all(struct clk *clk, int count); - int soc_clk_dump(void);
#endif

On 25 July 2017 at 05:24, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
Move clk_release_all() prototype and definition inside OF_CONTROL flag to avoid following compilation error for poplar platform:
aarch64: + poplar +drivers/usb/host/built-in.o: In function `ehci_usb_remove': +drivers/usb/host/ehci-generic.c:159: undefined reference to `clk_release_all' +drivers/usb/host/built-in.o: In function `ehci_usb_probe': +drivers/usb/host/ehci-generic.c:133: undefined reference to `clk_release_all' +make[1]: *** [u-boot] Error 139 +make: *** [sub-make] Error 2
Introduced by 4e542c4 clk: add clk_release_all()
Signed-off-by: Patrice Chotard patrice.chotard@st.com
drivers/clk/clk-uclass.c | 47 ++++++++++++++++++++++++----------------------- include/clk.h | 35 +++++++++++++++++++++-------------- 2 files changed, 45 insertions(+), 37 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On 07/25/2017 01:24 PM, patrice.chotard@st.com wrote:
From: Patrice Chotard patrice.chotard@st.com
This series fixes remaining compilation errors for poplar platform and warning for dra7xx_evm / dra7xx_hs_evm platforms
Patrice Chotard (2): usb: host: xhci-dxc3: fix compilation warnings clk: fix compilation errors for poplar platform
drivers/clk/clk-uclass.c | 47 ++++++++++++++++++++++---------------------- drivers/usb/host/xhci-dwc3.c | 4 ++-- include/clk.h | 35 ++++++++++++++++++++------------- 3 files changed, 47 insertions(+), 39 deletions(-)
Applied both, thanks.
participants (3)
-
Marek Vasut
-
patrice.chotard@st.com
-
Simon Glass