usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
PATCH 1/1 usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
For some reason from day one we used to have both CONFIG_DWC2_UTMI_WIDTH mentioned in dwc2.h and in scripts/config_whitelist.txt but never really used and CONFIG_DWC2_UTMI_PHY_WIDTH used in real code in dwc2.c (but never defined).
Moreover even though CONFIG_DWC2_UTMI_WIDTH might be either 8 or 16 depending on hardware (and the same is said in a comment for it in dwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration.
--- drivers/usb/host/dwc2.c | 2 +- drivers/usb/host/dwc2.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/dwc2.c +1 -1
@@ -375,7 +375,7 @@ static void dwc_otg_core_init(struct dwc2_priv *priv) usbcfg &= ~DWC2_GUSBCFG_DDRSEL ;#endif }else {/* UTMI+ interface */ -#if (CONFIG_DWC2_UTMI_PHY_WIDTH ==16 ) +#if (CONFIG_DWC2_UTMI_WIDTH ==16 ) usbcfg |=DWC2_GUSBCFG_PHYIF ;#endif }
drivers/usb/host/dwc2.h +2 -0
@@ -775,7 +775,9 @@ struct dwc2_core_regs {#define DWC2_PHY_TYPE_UTMI 1#define DWC2_PHY_TYPE_ULPI 2#define CONFIG_DWC2_PHY_TYPE DWC2_PHY_TYPE_UTMI/* PHY type */ +#ifndef CONFIG_DWC2_UTMI_WIDTH #define CONFIG_DWC2_UTMI_WIDTH 8/* UTMI bus width (8/16) */ +#endif #undef CONFIG_DWC2_PHY_ULPI_DDR/* ULPI PHY uses DDR mode */ #define CONFIG_DWC2_PHY_ULPI_EXT_VBUS /* ULPI PHY controls VBUS */
Signature · 1 line
2.14.3
Marek Vasut
AppliedPATCH 1/1 usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
Quoted 5 lines · Alexey Brodkin
For some reason from day one we used to have both
CONFIG_DWC2_UTMI_WIDTHmentioned indwc2.hand inscripts/config_whitelist.txtbut never really used andCONFIG_DWC2_UTMI_PHY_WIDTHused in real code indwc2.c(but never defined).
Quoted 7 lines
Moreover even though
CONFIG_DWC2_UTMI_WIDTHmight be either 8 or 16 depending on hardware (and the same is said in a comment for it indwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration.Signed-off-by Alexey Brodkin <[email protected]>Cc Marek Vasut <[email protected]>
Applied, thanks.
btw How the heck did that code ever even compile ?
Quoted 33 lines
--- drivers/usb/host/dwc2.c | 2 +- drivers/usb/host/dwc2.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)drivers/usb/host/dwc2.c +1
-1@@ -375,7 +375,7 @@ static void dwc_otg_core_init(struct dwc2_priv *priv) usbcfg &= ~DWC2_GUSBCFG_DDRSEL ;#endif }else {/* UTMI+ interface */ -#if (CONFIG_DWC2_UTMI_PHY_WIDTH ==16 ) +#if (CONFIG_DWC2_UTMI_WIDTH ==16 ) usbcfg |=DWC2_GUSBCFG_PHYIF ;#endif }drivers/usb/host/dwc2.h +2
-0@@ -775,7 +775,9 @@ struct dwc2_core_regs {#define DWC2_PHY_TYPE_UTMI 1#define DWC2_PHY_TYPE_ULPI 2#define CONFIG_DWC2_PHY_TYPE DWC2_PHY_TYPE_UTMI/* PHY type */ +#ifndef CONFIG_DWC2_UTMI_WIDTH #define CONFIG_DWC2_UTMI_WIDTH 8/* UTMI bus width (8/16) */ +#endif #undef CONFIG_DWC2_PHY_ULPI_DDR/* ULPI PHY uses DDR mode */ #define CONFIG_DWC2_PHY_ULPI_EXT_VBUS /* ULPI PHY controls VBUS */
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
Hi Marek,
Quoted 11 lines · Marek Vasut
Quoted 10 lines · Alexey Brodkin
For some reason from day one we used to have both
CONFIG_DWC2_UTMI_WIDTHmentioned indwc2.hand inscripts/config_whitelist.txtbut never really used andCONFIG_DWC2_UTMI_PHY_WIDTHused in real code indwc2.c(but never defined).Moreover even though
CONFIG_DWC2_UTMI_WIDTHmight be either 8 or 16 depending on hardware (and the same is said in a comment for it indwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Alexey Brodkin <[email protected]>Cc Marek Vasut <[email protected]>Applied, thanks.
btw How the heck did that code ever even compile ?
Well my change doesn't really fix anything in existing code except makes once check meaningful compared to dummy always negative as it was before :)
I'd say it means the driver was not very widely used on different hardwares. Still it does work [at least] to some extent which is really nice.
-Alexey
PATCH 1/1 usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
Quoted 17 lines · Alexey Brodkin
Hi Marek,
Quoted 14 lines · Marek Vasut
Quoted 12 lines · Alexey Brodkin
For some reason from day one we used to have both
CONFIG_DWC2_UTMI_WIDTHmentioned indwc2.hand inscripts/config_whitelist.txtbut never really used andCONFIG_DWC2_UTMI_PHY_WIDTHused in real code indwc2.c(but never defined).Moreover even though
CONFIG_DWC2_UTMI_WIDTHmight be either 8 or 16 depending on hardware (and the same is said in a comment for it indwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration.Signed-off-by Alexey Brodkin <[email protected]>Cc Marek Vasut <[email protected]>
Quoted 7 lines
Quoted 3 lines
Applied, thanks.
btw How the heck did that code ever even compile ?
Well my change doesn't really fix anything in existing code except makes once check meaningful compared to dummy always negative as it was before :)
Ha, now I see it.
Quoted 2 lines
I'd say it means the driver was not very widely used on different hardwares. Still it does work [at least] to some extent which is really nice.
Probably. All this info should be pulled from DT anyway.
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
Hi Marek,
Quoted 33 lines
-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Monday, February 5, 2018 4:18 PM
To: Alexey Brodkin <[email protected]>
Cc: u-boot at lists.denx.de
Subject: Re: [PATCH] usb: dwc2: RenameCONFIG_DWC2_UTMI_PHY_WIDTHtoCONFIG_DWC2_UTMI_WIDTHQuoted 17 lines · Alexey Brodkin
Hi Marek,
Quoted 14 lines · Marek Vasut
Quoted 12 lines · Alexey Brodkin
For some reason from day one we used to have both
CONFIG_DWC2_UTMI_WIDTHmentioned indwc2.hand inscripts/config_whitelist.txtbut never really used andCONFIG_DWC2_UTMI_PHY_WIDTHused in real code indwc2.c(but never defined).Moreover even though
CONFIG_DWC2_UTMI_WIDTHmight be either 8 or 16 depending on hardware (and the same is said in a comment for it indwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration.Signed-off-by Alexey Brodkin <[email protected]>Cc Marek Vasut <[email protected]>Quoted 7 lines
Quoted 3 lines
Applied, thanks.
btw How the heck did that code ever even compile ?
Well my change doesn't really fix anything in existing code except makes once check meaningful compared to dummy always negative as it was before :)
Quoted 6 lines
Ha, now I see it.
Quoted 2 lines
I'd say it means the driver was not very widely used on different hardwares. Still it does work [at least] to some extent which is really nice.
Probably. All this info should be pulled from DT anyway.
That's so true... but now when there're real users of this driver moving stuff to Device tree is not that trivial:
1) We need to move there those options that are now "configured" via defines
2) We need to keep compatibility with Linux DT options for the same controller otherwise we'll lose ability to use the same .dtb-s in both Linux and U-Boot.
I'm not saying it's not doable but it is not a one-liner unfortunately.
-Alexey
PATCH 1/1 usb: dwc2: Rename CONFIG_DWC2_UTMI_PHY_WIDTH to CONFIG_DWC2_UTMI_WIDTH
Quoted 42 lines · Alexey Brodkin
Hi Marek,
Quoted 33 lines
-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Monday, February 5, 2018 4:18 PM
To: Alexey Brodkin <[email protected]>
Cc: u-boot at lists.denx.de
Subject: Re: [PATCH] usb: dwc2: RenameCONFIG_DWC2_UTMI_PHY_WIDTHtoCONFIG_DWC2_UTMI_WIDTHQuoted 17 lines · Alexey Brodkin
Hi Marek,
Quoted 14 lines · Marek Vasut
Quoted 12 lines · Alexey Brodkin
For some reason from day one we used to have both
CONFIG_DWC2_UTMI_WIDTHmentioned indwc2.hand inscripts/config_whitelist.txtbut never really used andCONFIG_DWC2_UTMI_PHY_WIDTHused in real code indwc2.c(but never defined).Moreover even though
CONFIG_DWC2_UTMI_WIDTHmight be either 8 or 16 depending on hardware (and the same is said in a comment for it indwc2.h) but then 8 is hardcoded in the header leaving no ability to override this value in board's configuration.Signed-off-by Alexey Brodkin <[email protected]>Cc Marek Vasut <[email protected]>Quoted 7 lines
Quoted 3 lines
Applied, thanks.
btw How the heck did that code ever even compile ?
Well my change doesn't really fix anything in existing code except makes once check meaningful compared to dummy always negative as it was before :)
Quoted 6 lines
Ha, now I see it.
Quoted 2 lines
I'd say it means the driver was not very widely used on different hardwares. Still it does work [at least] to some extent which is really nice.
Probably. All this info should be pulled from DT anyway.
Quoted 7 lines
That's so true... but now when there're real users of this driver moving stuff to Device tree is not that trivial:
1) We need to move there those options that are now "configured" via defines
2) We need to keep compatibility with Linux DT options for the same controller otherwise we'll lose ability to use the same .dtb-s in both Linux and U-Boot.I'm not saying it's not doable but it is not a one-liner unfortunately.
It should be done, soon. I'm not saying it's gonna be easy, but I don't see it being hard either.
btw same should be done for the Linux driver.
Signature · 2 lines
Best regards, Marek Vasut