Make mv_udc work for i.mx6
Subsystems (5)
v3 cover Make mv_udc work for i.mx6
Hi Marek, Stefano
This series is based on u-boot-usb/master branch. After this series, nitrogen6x works with tftpboot to transfer files over usb.
V2 was dropped to my bad posting of it and should be ignored.
This V3 is a rebase and most patches had to be changed slightly. I also ran a ./MAKEALL -a arm and fixed the errors that the V1 series had.
The most noticeable change is the addition of
usb: gadget: mv_udc: fix hardware udc address for i.MX6
Let me know if you want to go back to a udc variable to store the address instead of using hcor.
Stefano, would you like to take patches 1-5 ?
I'll likely need a V3, but maybe the early ones
will be approved.
Thanks
Troy Kisky (20):
Add functions for use with i.mx6 otg udc
mx6: iomux: add GPR1 defines
nitrogen6x: add otg usb ethernet gadget support
nitrogen6x: add CONFIG_MV_UDC
arch-mxs/sys_proto.h: include regs-common.h
usb: gadget: mv_udc: fix hardware udc address for i.MX6
usb: gadget: config: fix unaligned access issues
usb: gadget: mv_udc: add MX6Q specific reset
usb: gadget: ether set wMaxPacketSize
usb: gadget: ether: return error from rx_submit if no request
usb: gadget: mv_udc: split mv_udc.h file
usb: udc: add udc.h include file
usb: gadget: mv_udc: fix typo in error message
usb: gadget: mv_udc: set is_dualspeed = 1
usb: gadget: mv_udc: fix full speed connections
usb: gadget: mv_udc: optimize bounce
usb: gadget: mv_udc: flush item before head
usb: gadget: mv_udc: optimize ep_enable
usb: gadget: mv_udc: zero transfer descriptor memory on probe
usb: gadget: mv_udc: clear desc upon ep_disable
arch/arm/cpu/armv7/mx6/soc.c | 47 ++++++++++ arch/arm/include/asm/arch-mx6/crm_regs.h | 3 + arch/arm/include/asm/arch-mx6/imx-regs.h | 17 ++++ arch/arm/include/asm/arch-mx6/iomux.h | 6 ++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 + arch/arm/include/asm/arch-mxs/sys_proto.h | 2 + board/boundary/nitrogen6x/nitrogen6x.c | 16 ++++ drivers/serial/usbtty.h | 3 +- drivers/usb/gadget/config.c | 6 +- drivers/usb/gadget/designware_udc.c | 1 + drivers/usb/gadget/ether.c | 4 + drivers/usb/gadget/mpc8xx_udc.c | 1 + drivers/usb/gadget/mv_udc.c | 141 +++++++++++++++++++----------- drivers/usb/gadget/mv_udc.h | 115 ++++++++++++++++++++++++ drivers/usb/gadget/omap1510_udc.c | 1 + drivers/usb/gadget/pxa27x_udc.c | 1 + drivers/usb/musb/musb_udc.c | 3 +- include/configs/nitrogen6x.h | 6 ++ include/usb/designware_udc.h | 31 ------- include/usb/mpc8xx_udc.h | 19 +--- include/usb/musb_udc.h | 40 --------- include/usb/mv_udc.h | 118 ------------------------- include/usb/omap1510_udc.h | 27 +----- include/usb/pxa27x_udc.h | 26 +----- include/usb/udc.h | 63 +++++++++++++ 25 files changed, 389 insertions(+), 312 deletions(-) create mode 100644 drivers/usb/gadget/mv_udc.h delete mode 100644 include/usb/musb_udc.h create mode 100644 include/usb/udc.h
Signature · 1 line
1.8.1.2
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Add functions for use with mx6 soc
void otg_enable(void);
void reset_usb_phy1(void);
--- arch/arm/cpu/armv7/mx6/soc.c | 47 +++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx6/crm_regs.h | 3 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)
arch/arm/cpu/armv7/mx6/soc.c +47 -0
@@ -12,11 +12,58 @@#include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> +#include <asm/arch/crm_regs.h> #include <asm/arch/sys_proto.h> #include <asm/imx-common/boot_mode.h> #include <asm/imx-common/dma.h> #include <stdbool.h> +#ifdef CONFIG_MV_UDC +static void enable_usb_phy1_clk (unsigned char enable) +{ +struct usbphy *phy = (struct usbphy *)USB_PHY0_BASE_ADDR ; + +writel (BM_USBPHY_CTRL_CLKGATE , + enable ? &phy->ctrl.clr : &phy->ctrl.set); +} + +void reset_usb_phy1 (void ) +{ +struct usbphy *phy = (struct usbphy *)USB_PHY0_BASE_ADDR ; + +/* Reset USBPHY module */ +writel (BM_USBPHY_CTRL_SFTRST , &phy->ctrl.set); +udelay (10 ); + +/* Remove CLKGATE and SFTRST */ +writel (BM_USBPHY_CTRL_CLKGATE |BM_USBPHY_CTRL_SFTRST , &phy->ctrl.clr); +udelay (10 ); + +/* Power up the PHY */ +writel (0 , &phy->pwd.val); +} + +static void set_usb_phy1_clk (void ) +{ +struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR ; + +writel (BM_ANADIG_USB1_CHRG_DETECT_EN_B + |BM_ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B , + &anatop->usb1_chrg_detect_set); + +/* make sure pll is enable here */ +writel (BM_ANADIG_USB1_PLL_480_CTRL_EN_USB_CLKS , + &anatop->usb1_pll_480_ctrl_set); +} + +void otg_enable (void ) +{ +set_usb_phy1_clk (); +enable_usboh3_clk (1 ); +enable_usb_phy1_clk (1 ); +} +#endif +struct scu_regs {u32 ctrl;u32 config;
arch/arm/include/asm/arch-mx6/crm_regs.h +3 -0
@@ -647,6 +647,9 @@ struct mxc_ccm_reg {#define BF_ANADIG_USB1_PLL_480_CTRL_DIV_SELECT (v) \ (((v) << 0) & BM_ANADIG_USB1_PLL_480_CTRL_DIV_SELECT) +#define BM_ANADIG_USB1_CHRG_DETECT_EN_B 0x00100000 +#define BM_ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B 0x00080000 +#define BM_ANADIG_PLL_528_LOCK 0x80000000#define BP_ANADIG_PLL_528_RSVD1 19#define BM_ANADIG_PLL_528_RSVD1 0x7FF80000
arch/arm/include/asm/arch-mx6/imx-regs.h +17 -0
@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set; +u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +}; + +#define BM_USBPHY_CTRL_CLKGATE 0x40000000 +#define BM_USBPHY_CTRL_SFTRST 0x80000000 +struct ocotp_regs {u32 ctrl;u32 ctrl_set;
arch/arm/include/asm/arch-mx6/sys_proto.h +4 -0
@@ -40,4 +40,8 @@ int mxs_wait_mask_set(struct mxs_register_32 *reg,int mxs_wait_mask_clr (struct mxs_register_32 *reg,uint32_t mask,unsigned int timeout); + +void otg_enable (void ); +void reset_usb_phy1 (void ); +#endif
Signature · 1 line
1.8.1.2
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Dear Troy Kisky,
Quoted 12 lines
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>--- arch/arm/cpu/armv7/mx6/soc.c | 47 +++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx6/crm_regs.h | 3 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)
[...]
Quoted 11 lines
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx6/imx-regs.hindex 5d6bccb..3eed4d8 100644arch/arm/include/asm/arch-mx6/imx-regs.h +3
-0@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set;
arch/arm/include/asm/arch-mx6/imx-regs.h struct cspi_regs { · line 434
Quoted 10 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +10
-0+u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +};
Maybe you want to keep the naming here consistent with MX28 and MX6?
See arch/arm/include/asm/imx-common/regs-common.h
[...]
Best regards,
Marek Vasut
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Quoted 40 lines · Marek Vasut
Dear Troy Kisky,
Quoted 12 lines
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>--- arch/arm/cpu/armv7/mx6/soc.c | 47 +++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx6/crm_regs.h | 3 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)[...]
Quoted 11 lines
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx6/imx-regs.hindex 5d6bccb..3eed4d8 100644arch/arm/include/asm/arch-mx6/imx-regs.h +3
-0@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set;arch/arm/include/asm/arch-mx6/imx-regs.h struct cspi_regs { · line 434
Quoted 10 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +10
-0+u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +};Maybe you want to keep the naming here consistent with MX28 and MX6?
Quoted 7 lines
See
arch/arm/include/asm/imx-common/regs-common.h[...]
Best regards,
Marek Vasut
Wow, arch/arm/include/asm/imx-common/regs-common.h
is damn ugly. I personally hate unions even when there is a very good reason.
Would you like to see me attempt to clean it up or do you like it the way it is
since your commit started the unions ?
Troy
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Dear Troy Kisky,
Quoted 55 lines · Marek Vasut
Quoted 47 lines
Dear Troy Kisky,
Quoted 16 lines
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>---
arch/arm/cpu/armv7/mx6/soc.c | 47+++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx6/crm_regs.h| 3 ++
arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)[...]
Quoted 13 lines
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx6/imx-regs.hindex 5d6bccb..3eed4d8 100644arch/arm/include/asm/arch-mx6/imx-regs.h +3
-0@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set;arch/arm/include/asm/arch-mx6/imx-regs.h struct cspi_regs { · line 436
Quoted 10 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +10
-0+u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +};Maybe you want to keep the naming here consistent with MX28 and MX6?
Quoted 6 lines
See
arch/arm/include/asm/imx-common/regs-common.h[...]
Best regards,
Marek Vasut
Quoted 7 lines
Wow,
arch/arm/include/asm/imx-common/regs-common.h
is damn ugly. I personally hate unions even when there is a very good reason.Would you like to see me attempt to clean it up or do you like it the way it is
since your commit started the unions ?
I think it works perfectly well and does exactly what it's supposed to do. What's your problem with the file?
Best regards,
Marek Vasut
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Quoted 58 lines · Marek Vasut
Dear Troy Kisky,
Quoted 56 lines · Marek Vasut
Quoted 45 lines
Dear Troy Kisky,
Quoted 16 lines
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>---
arch/arm/cpu/armv7/mx6/soc.c | 47+++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx6/crm_regs.h| 3 ++
arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)[...]
Quoted 13 lines
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx6/imx-regs.hindex 5d6bccb..3eed4d8 100644arch/arm/include/asm/arch-mx6/imx-regs.h +3
-0@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set;arch/arm/include/asm/arch-mx6/imx-regs.h struct cspi_regs { · line 436
Quoted 10 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +10
-0+u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +};Maybe you want to keep the naming here consistent with MX28 and MX6?
Quoted 6 lines
See
arch/arm/include/asm/imx-common/regs-common.h[...]
Best regards,
Marek VasutWow,
arch/arm/include/asm/imx-common/regs-common.h
is damn ugly. I personally hate unions even when there is a very good reason.
Quoted 9 lines
Quoted 3 lines
Would you like to see me attempt to clean it up or do you like it the way it is
since your commit started the unions ?I think it works perfectly well and does exactly what it's supposed to do. What's your problem with the file?
Best regards,
Marek Vasut
Why is there a union ? It looks to me like you just want to access the same variable
with 2 naming strategies.
Troy
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Dear Troy Kisky,
Quoted 70 lines · Marek Vasut
Quoted 69 lines
Dear Troy Kisky,
Quoted 56 lines · Marek Vasut
Quoted 48 lines
Dear Troy Kisky,
Quoted 17 lines
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>---
arch/arm/cpu/armv7/mx6/soc.c | 47+++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx6/crm_regs.h| 3 ++
|arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)[...]
Quoted 13 lines
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx6/imx-regs.hindex 5d6bccb..3eed4d8 100644 ---a/arch/arm/include/asm/arch-mx6/imx-regs.h+++b/arch/arm/include/asm/arch-mx6/imx-regs.harch/arm/include/asm/arch-mx6/imx-regs.h +3
-0@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set;arch/arm/include/asm/arch-mx6/imx-regs.h struct cspi_regs { · line 436
Quoted 10 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +10
-0+u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +};Maybe you want to keep the naming here consistent with MX28 and MX6?
Quoted 6 lines
See
arch/arm/include/asm/imx-common/regs-common.h[...]
Best regards,
Marek VasutQuoted 7 lines
Wow,
arch/arm/include/asm/imx-common/regs-common.h
is damn ugly. I personally hate unions even when there is a very good reason.Would you like to see me attempt to clean it up or do you like it the way it is
since your commit started the unions ?I think it works perfectly well and does exactly what it's supposed to do. What's your problem with the file?
Quoted 6 lines
Quoted 2 lines
Best regards,
Marek VasutWhy is there a union ? It looks to me like you just want to access the same variable
with 2 naming strategies.
That is correct. I can either pass it further into functions as the struct mxs_register_32 name_reg or I can directly access it as name_set/_clr/_tog . Works just fine.
Best regards,
Marek Vasut
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Quoted 68 lines · Marek Vasut
Dear Troy Kisky,
Quoted 66 lines · Marek Vasut
Quoted 65 lines
Dear Troy Kisky,
Quoted 53 lines · Marek Vasut
Quoted 46 lines
Dear Troy Kisky,
Quoted 17 lines
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>---
arch/arm/cpu/armv7/mx6/soc.c | 47+++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx6/crm_regs.h| 3 ++
|arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)[...]
Quoted 13 lines
(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx6/imx-regs.hindex 5d6bccb..3eed4d8 100644 ---a/arch/arm/include/asm/arch-mx6/imx-regs.h+++b/arch/arm/include/asm/arch-mx6/imx-regs.harch/arm/include/asm/arch-mx6/imx-regs.h +3
-0@@ -419,6 +419,23 @@ struct cspi_regs { ECSPI5_BASE_ADDR#endif +struct set_clr_tog { +u32 val; +u32 set;arch/arm/include/asm/arch-mx6/imx-regs.h struct cspi_regs { · line 436
Quoted 10 lines
arch/arm/include/asm/arch-mx6/imx-regs.h +10
-0+u32 clr; +u32 tog; +}; + +struct usbphy { +struct set_clr_tog pwd; +struct set_clr_tog tx; +struct set_clr_tog rx; +struct set_clr_tog ctrl; +};Maybe you want to keep the naming here consistent with MX28 and MX6?
Quoted 6 lines
See
arch/arm/include/asm/imx-common/regs-common.h[...]
Best regards,
Marek VasutQuoted 7 lines
Wow,
arch/arm/include/asm/imx-common/regs-common.h
is damn ugly. I personally hate unions even when there is a very good reason.Would you like to see me attempt to clean it up or do you like it the way it is
since your commit started the unions ?I think it works perfectly well and does exactly what it's supposed to do. What's your problem with the file?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Best regards,
Marek VasutWhy is there a union ? It looks to me like you just want to access the same variable
with 2 naming strategies.That is correct. I can either pass it further into functions as the struct
mxs_register_32name_regor I can directly access it as name_set/_clr/_tog . Works just fine.
I never said it didn't work, obviously it does.
Quoted 4 lines
Best regards,
Marek Vasut
There may be code that you can point at that would make this useful, but I have
a hard time envisioning it. The code I added, I know doesn't need a union, and I bet most
of the other variable accesses don't need a union. That's why I asked if you'd like
me to attempt to clean it up (always access thru struct, ie replace name_set with name.set).
I don't want to change the code I added to use this. I can see a small advantage in consistency with the mx28.
Troy
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Dear Troy Kisky,
[...]
Quoted 13 lines
Quoted 7 lines
Quoted 3 lines
Why is there a union ? It looks to me like you just want to access the same variable
with 2 naming strategies.That is correct. I can either pass it further into functions as the struct
mxs_register_32name_regor I can directly access it as name_set/_clr/_tog . Works just fine.I never said it didn't work, obviously it does.
Quoted 2 lines
Best regards,
Marek Vasut
Quoted 8 lines
There may be code that you can point at that would make this useful, but I have
a hard time envisioning it. The code I added, I know doesn't need a union, and I bet most
of the other variable accesses don't need a union. That's why I asked if you'd like
me to attempt to clean it up (always access thru struct, ie replacename_setwith name.set).
No, I want to keep this as-is. Especially because the MX28 has the registers named exactly by this scheme.
Quoted 1 line
I don't want to change the code I added to use this.
Please do, I do not want a duplicit implementation of these register structures in the tree.
Quoted 1 line
I can see a small advantage in consistency with the mx28.
THe MX6 uses many IP blocks from MX28 -- APBH DMA, NAND, USB -- to name a few. Keeping mx28 and mx6 aligned is more than helpful.
Best regards,
Marek Vasut
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Quoted 22 lines · Marek Vasut
Dear Troy Kisky,
[...]
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Why is there a union ? It looks to me like you just want to access the same variable
with 2 naming strategies.That is correct. I can either pass it further into functions as the struct
mxs_register_32name_regor I can directly access it as name_set/_clr/_tog . Works just fine.I never said it didn't work, obviously it does.
Quoted 2 lines
Best regards,
Marek VasutQuoted 8 lines
There may be code that you can point at that would make this useful, but I have
a hard time envisioning it. The code I added, I know doesn't need a union, and I bet most
of the other variable accesses don't need a union. That's why I asked if you'd like
me to attempt to clean it up (always access thru struct, ie replacename_setwith name.set).
Quoted 2 lines
No, I want to keep this as-is. Especially because the MX28 has the registers named exactly by this scheme.
Exactly matching documentation is a good advantage.
Quoted 5 lines
Quoted 2 lines
I don't want to change the code I added to use this.
Please do, I do not want a duplicit implementation of these register structures in the tree.
Quoted 7 lines
Quoted 1 line
I can see a small advantage in consistency with the mx28.
THe MX6 uses many IP blocks from MX28 -- APBH DMA, NAND, USB -- to name a few. Keeping mx28 and mx6 aligned is more than helpful.
Best regards,
Marek Vasut
Marek, I really appreciate your willingness to explain your reasoning. Though I wouldn't do this
without prompting, perhaps my dislike of unions is a bit irrational. But since there are also many
other places where this change could be made (grep _tog in arch-mx6/crm_regs.h, imx-regs.h,)
I'd like Stefano to say he is OK with using mxs_reg_32 and doesn't share my opinion and doesn't
want to rename it to something else. After all, you're talking about removing a structure with only
4 members, not a great amount of duplication.
Troy
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Dear Troy Kisky,
Quoted 45 lines · Marek Vasut
Quoted 26 lines
Dear Troy Kisky,
[...]
Quoted 13 lines
Quoted 7 lines
Quoted 3 lines
Why is there a union ? It looks to me like you just want to access the same variable
with 2 naming strategies.That is correct. I can either pass it further into functions as the struct
mxs_register_32name_regor I can directly access it as name_set/_clr/_tog . Works just fine.I never said it didn't work, obviously it does.
Quoted 2 lines
Best regards,
Marek VasutQuoted 8 lines
There may be code that you can point at that would make this useful, but I have
a hard time envisioning it. The code I added, I know doesn't need a union, and I bet most
of the other variable accesses don't need a union. That's why I asked if you'd like
me to attempt to clean it up (always access thru struct, ie replacename_setwith name.set).Quoted 2 lines
No, I want to keep this as-is. Especially because the MX28 has the registers named exactly by this scheme.
Exactly matching documentation is a good advantage.
Quoted 5 lines
Quoted 1 line
I don't want to change the code I added to use this.
Please do, I do not want a duplicit implementation of these register structures in the tree.
Quoted 7 lines
Quoted 1 line
I can see a small advantage in consistency with the mx28.
THe MX6 uses many IP blocks from MX28 -- APBH DMA, NAND, USB -- to name a few. Keeping mx28 and mx6 aligned is more than helpful.
Best regards,
Marek Vasut
Quoted 6 lines
Marek, I really appreciate your willingness to explain your reasoning. Though I wouldn't do this
without prompting, perhaps my dislike of unions is a bit irrational. But since there are also many
other places where this change could be made (grep_toginarch-mx6/crm_regs.h,imx-regs.h,)
This clearly means that someone didn't look around before coding this stuff. Brief look indicates the OCOTP is taken from MX28 too and so is ANATOP.
Quoted 5 lines
I'd like Stefano to say he is OK with using
mxs_reg_32and doesn't share my opinion and doesn't
want to rename it to something else. After all, you're talking about removing a structure with only
4 members, not a great amount of duplication.
I think I lost you here, sorry. To put down what I am talking about:
- Use what already is in imx-common/regs-common.h
- imx-common/regs-common.h does not need change
I did not yet hear any reasonable argument to change the imx-common/regs- common.h file. Unions being ugly in your opinion is not a valid argument.
Note that MX28 was in the tree much earlier than MX6 and if MX6 did reinvent the wheel, it should be fixed before this duplication spreads. Especially so the MX6 and MX28 do not diverge and can share much of the code.
Best regards,
Marek Vasut
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
In reply to Troy KiskyAre there any news on this front? If not, please fix as requested so I can apply this stuff for .10 , thanks.
Best regards,
Marek Vasut
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Quoted 6 lines · Marek Vasut
Are there any news on this front? If not, please fix as requested so I can apply this stuff for .10 , thanks.
Best regards,
Marek Vasut
I will update, I'm just sidetracked with Windows work for a little while.
Thanks
Troy
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
In reply to Troy KiskyDear Troy Kisky,
Quoted 11 lines · In message <[email protected]>…
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>--- arch/arm/cpu/armv7/mx6/soc.c | 47 +++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx6/crm_regs.h | 3 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)
This appears to be V3 of this patch series, but I cannot see any kind
of change log? Please note that this is a mandatory requirement, see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
Note this applies to the whole patch series.
Thanks!
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There's no honorable way to kill, no gentle way to destroy. There is nothing good in war. Except its ending. -- Abraham Lincoln, "The Savage Curtain", stardate 5906.5
PATCH v3 1/20 Add functions for use with i.mx6 otg udc
Quoted 14 lines · Wolfgang Denk
Dear Troy Kisky,
Quoted 11 lines · In message <[email protected]>…
Add functions for use with mx6 soc
voidotg_enable(void);
voidreset_usb_phy1(void);Signed-off-by Troy Kisky <[email protected]>--- arch/arm/cpu/armv7/mx6/soc.c | 47 +++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx6/crm_regs.h | 3 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 17 +++++++++++ arch/arm/include/asm/arch-mx6/sys_proto.h | 4 +++ 4 files changed, 71 insertions(+)
Quoted 6 lines
This appears to be V3 of this patch series, but I cannot see any kind
of change log? Please note that this is a mandatory requirement, see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versionsNote this applies to the whole patch series.
Yes, that does look wrong. V1 was not reviewed, I was asked to rebase because of many conflicting
changes to the same file. I screwed up the posting of V2 and it also was not reviewed. I finally got a
reviewable set of changes with V3. Sorry about the mess-up.
Troy
PATCH v3 2/20 mx6: iomux: add GPR1 defines
In reply to Troy Kisky--- arch/arm/include/asm/arch-mx6/iomux.h | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/include/asm/arch-mx6/iomux.h +6 -0
@@ -10,6 +10,12 @@#define MX6_IOMUXC_GPR7 0x020e001c/* +* IOMUXC_GPR1 bit fields +*/ +#define IOMUXC_GPR1_OTG_ID_ENET_RX_ERR (0<<13) +#define IOMUXC_GPR1_OTG_ID_GPIO1 (1<<13) +#define IOMUXC_GPR1_OTG_ID_MASK (1<<13) +/* * IOMUXC_GPR13 bit fields */ #define IOMUXC_GPR13_SDMA_STOP_REQ (1<<30)
Signature · 1 line
1.8.1.2
PATCH v3 3/20 nitrogen6x: add otg usb ethernet gadget support
In reply to Troy Kisky--- board/boundary/nitrogen6x/nitrogen6x.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
board/boundary/nitrogen6x/nitrogen6x.c +16 -0
@@ -30,6 +30,7 @@#include <i2c.h> DECLARE_GLOBAL_DATA_PTR ; +#define GP_USB_OTG_PWR IMX_GPIO_NR(3, 22)#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
@@ -369,6 +370,13 @@ int board_eth_init(bd_t *bis) free(bus); }#endif + +#ifdef CONFIG_MV_UDC +otg_enable (); + +/* For otg ethernet*/ +usb_eth_initialize (bis); +#endif return 0 ; }
@@ -717,6 +725,7 @@ int board_early_init_f(void)gpio_direction_input (WL12XX_WL_IRQ_GP );gpio_direction_output (WL12XX_WL_ENABLE_GP ,0 );gpio_direction_output (WL12XX_BT_ENABLE_GP ,0 ); +gpio_direction_output (GP_USB_OTG_PWR ,0 );/* OTG power off */ imx_iomux_v3_setup_multiple_pads (wl12xx_pads,ARRAY_SIZE (wl12xx_pads));setup_buttons ();
@@ -738,6 +747,13 @@ int overwrite_console(void)int board_init (void ) { +struct iomuxc_base_regs *const iomuxc_regs + = (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR ; + +clrsetbits_le32 (&iomuxc_regs->gpr[1 ], +IOMUXC_GPR1_OTG_ID_MASK , +IOMUXC_GPR1_OTG_ID_GPIO1 ); +/* address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ;
Signature · 1 line
1.8.1.2
PATCH v3 4/20 nitrogen6x: add CONFIG_MV_UDC
In reply to Troy Kisky--- include/configs/nitrogen6x.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/configs/nitrogen6x.h +6 -0
@@ -30,6 +30,12 @@#define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_MISC_INIT_R #define CONFIG_MXC_GPIO +#define CONFIG_MV_UDC +#define CONFIG_USBD_HS +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_ETHER +#define CONFIG_USB_ETH_CDC +#define CONFIG_NETCONSOLE #define CONFIG_CMD_FUSE #ifdef CONFIG_CMD_FUSE
Signature · 1 line
1.8.1.2
PATCH v3 5/20 arch-mxs/sys_proto.h: include regs-common.h
In reply to Troy Kiskysys_proto uses mxs_register_32 so
include <asm/imx-common/regs-common.h>
like arch-mx6/sys_proto.h does.
This prevents warnings when building m28evk after
the next patch in the series.
--- arch/arm/include/asm/arch-mxs/sys_proto.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/include/asm/arch-mxs/sys_proto.h +2 -0
@@ -10,6 +10,8 @@#ifndef __SYS_PROTO_H__#define __SYS_PROTO_H__ +#include <asm/imx-common/regs-common.h> +int mxs_reset_block (struct mxs_register_32 *reg); int mxs_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask,
Signature · 1 line
1.8.1.2
PATCH v3 6/20 usb: gadget: mv_udc: fix hardware udc address for i.MX6
In reply to Troy KiskyThe hcor for i.MX6 is 02184340
and the udc should be 02184140
---
I don't know if this is a correct fix, please check carefully.
--- drivers/usb/gadget/mv_udc.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/usb/gadget/mv_udc.c +19 -9
@@ -110,6 +110,16 @@ static struct mv_drv controller = { }, }; +struct mv_udc *get_mv_udc (void ) +{ +#ifdef CONFIG_MXC_USB_PORT +return (struct mv_udc *)((unsigned )controller.ctrl->hcor + - (0x200 *CONFIG_MXC_USB_PORT )); +#else +return (struct mv_udc *)controller.ctrl->hcor; +#endif +} +/** * mv_get_qh() - return queue head for endpoint * @ep_num: Endpoint number
@@ -213,7 +223,7 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req)static void ep_enable (int num,int in) {struct ept_queue_head *head; -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();unsigned n; head =mv_get_qh (num, in);
@@ -316,7 +326,7 @@ static int mv_ep_queue(struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) { struct mv_ep *mv_ep = container_of(ep, struct mv_ep, ep); -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();struct ept_queue_item *item;struct ept_queue_head *head;int bit, num, len, in, ret;
@@ -389,7 +399,7 @@ static void handle_ep_complete(struct mv_ep *ep)static void handle_setup (void ) {struct usb_request *req = &controller.ep[0 ].req; -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();struct ept_queue_head *head;struct usb_ctrlrequest r;int status =0 ;
@@ -462,7 +472,7 @@ static void stop_activity(void) {int i, num, in;struct ept_queue_head *head; -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();writel (readl (&udc->epcomp), &udc->epcomp);writel (readl (&udc->epstat), &udc->epstat);writel (0xffffffff , &udc->epflush);
@@ -485,7 +495,7 @@ static void stop_activity(void)void udc_irq (void ) { -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();unsigned n =readl (&udc->usbsts);writel (n, &udc->usbsts);int bit, i, num, in;
@@ -543,7 +553,7 @@ void udc_irq(void)int usb_gadget_handle_interrupts (void ) {u32 value; -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc (); value =readl (&udc->usbsts);if (value)
@@ -554,7 +564,7 @@ int usb_gadget_handle_interrupts(void)static int mv_pullup (struct usb_gadget *gadget,int is_on) { -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();if (is_on) {/* RESET */ writel (USBCMD_ITC (MICRO_8FRAME ) |USBCMD_RST , &udc->usbcmd);
@@ -582,7 +592,7 @@ static int mv_pullup(struct usb_gadget *gadget, int is_on)void udc_disconnect (void ) { -struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; +struct mv_udc *udc =get_mv_udc ();/* disable pullup */ stop_activity ();writel (USBCMD_FS2 , &udc->usbcmd);
@@ -694,7 +704,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) ret =mvudc_probe ();if (!ret) { - udc = (struct mv_udc *)controller.ctrl->hcor; + udc =get_mv_udc ();/* select ULPI phy */ writel (PTS (PTS_ENABLE ) |PFSC , &udc->portsc);
Signature · 1 line
1.8.1.2
PATCH v3 6/20 usb: gadget: mv_udc: fix hardware udc address for i.MX6
Dear Troy Kisky,
Quoted 19 lines
The hcor for i.MX6 is 02184340
and the udc should be 02184140Signed-off-by Troy Kisky <[email protected]>---
I don't know if this is a correct fix, please check carefully.--- drivers/usb/gadget/mv_udc.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)drivers/usb/gadget/mv_udc.c +0
-0@@ -110,6 +110,16 @@ static struct mv_drv controller = { }, };
drivers/usb/gadget/mv_udc.c static struct mv_drv controller = { · line 122
Quoted 10 lines
drivers/usb/gadget/mv_udc.c +10
-0+struct mv_udc *get_mv_udc (void ) +{ +#ifdef CONFIG_MXC_USB_PORT +return (struct mv_udc *)((unsigned )controller.ctrl->hcor + - (0x200 *CONFIG_MXC_USB_PORT )); +#else +return (struct mv_udc *)controller.ctrl->hcor; +#endif +} +
This in particular is something I wanted to avoid happening.
Can you instead call
usb_lowlevel_init(0, (void **)&controller.ctrl);
for different number than 0 in usb_gadget_register_driver() instead ? THe effect will be the same, yet the patch will be smaller.
Best regards,
Marek Vasut
PATCH v3 7/20 usb: gadget: config: fix unaligned access issues
In reply to Troy Kisky--- drivers/usb/gadget/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/gadget/config.c +4 -2
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <asm/unaligned.h> #include <asm/errno.h> #include <linux/list.h> #include <linux/string.h>
@@ -86,7 +87,8 @@ int usb_gadget_config_buf(/* config descriptor first */ if (length <USB_DT_CONFIG_SIZE || !desc)return -EINVAL ; - *cp = *config; +/* config need not be aligned */ +memcpy (cp, config,sizeof (*cp));/* then interface/endpoint/class/vendor/... */ len = usb_descriptor_fillbuf(USB_DT_CONFIG_SIZE + (u8 *)buf,
@@ -100,7 +102,7 @@ int usb_gadget_config_buf(/* patch up the config descriptor */ cp->bLength =USB_DT_CONFIG_SIZE ; cp->bDescriptorType =USB_DT_CONFIG ; - cp->wTotalLength =cpu_to_le16 (len); +put_unaligned_le16 (len, &cp->wTotalLength); cp->bmAttributes |=USB_CONFIG_ATT_ONE ;return len; }
Signature · 1 line
1.8.1.2
PATCH v3 7/20 usb: gadget: config: fix unaligned access issues
Dear Troy Kisky,
I don't understand what this patch does and why. It's not very clear from the (missing) commit message either.
Quoted 28 lines
Signed-off-by Troy Kisky <[email protected]>--- drivers/usb/gadget/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/usb/gadget/config.c +3
-1@@ -10,6 +10,7 @@*/ #include <common.h> +#include <asm/unaligned.h> #include <asm/errno.h> #include <linux/list.h> #include <linux/string.h> @@ -86,7 +87,8 @@ int usb_gadget_config_buf(/* config descriptor first */ if (length <USB_DT_CONFIG_SIZE || !desc)return -EINVAL ; - *cp = *config; +/* config need not be aligned */ +memcpy (cp, config,sizeof (*cp));/* then interface/endpoint/class/vendor/... */ len = usb_descriptor_fillbuf(USB_DT_CONFIG_SIZE + (u8 *)buf,
drivers/usb/gadget/config.c int usb_gadget_config_buf( · line 108
Quoted 8 lines
drivers/usb/gadget/config.c +1
-1@@ -100,7 +102,7 @@ int usb_gadget_config_buf(/* patch up the config descriptor */ cp->bLength =USB_DT_CONFIG_SIZE ; cp->bDescriptorType =USB_DT_CONFIG ; - cp->wTotalLength =cpu_to_le16 (len); +put_unaligned_le16 (len, &cp->wTotalLength); cp->bmAttributes |=USB_CONFIG_ATT_ONE ;return len; }
Best regards,
Marek Vasut
PATCH v3 8/20 usb: gadget: mv_udc: add MX6Q specific reset
In reply to Troy Kisky---
I don't know if this is needed, but it doesn't hurt.
--- drivers/usb/gadget/mv_udc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/gadget/mv_udc.c +4 -0
@@ -13,6 +13,7 @@#include <config.h> #include <net.h> #include <malloc.h> +#include <asm/arch/sys_proto.h> #include <asm/io.h> #include <linux/types.h> #include <usb/mv_udc.h>
@@ -569,6 +570,9 @@ static int mv_pullup(struct usb_gadget *gadget, int is_on)/* RESET */ writel (USBCMD_ITC (MICRO_8FRAME ) |USBCMD_RST , &udc->usbcmd);udelay (200 ); +#if defined(CONFIG_MX6Q ) || defined(CONFIG_MX6DL ) +reset_usb_phy1 (); +#endif writel ((unsigned )controller.epts, &udc->epinitaddr);
Signature · 1 line
1.8.1.2
PATCH v3 8/20 usb: gadget: mv_udc: add MX6Q specific reset
Dear Troy Kisky,
Why are you adding this? Any kind of explanation is missing.
Quoted 22 lines
Signed-off-by Troy Kisky <[email protected]>---
I don't know if this is needed, but it doesn't hurt.--- drivers/usb/gadget/mv_udc.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/gadget/mv_udc.c +1
-0@@ -13,6 +13,7 @@#include <config.h> #include <net.h> #include <malloc.h> +#include <asm/arch/sys_proto.h> #include <asm/io.h> #include <linux/types.h> #include <usb/mv_udc.h> @@ -569,6 +570,9 @@ static int mv_pullup(struct usb_gadget *gadget, int
is_on) /* RESET */
drivers/usb/gadget/mv_udc.c static int mv_pullup(struct usb_gadget *gadget, int is_on) · line 577
Quoted 7 lines
drivers/usb/gadget/mv_udc.c +3
-0writel (USBCMD_ITC (MICRO_8FRAME ) |USBCMD_RST , &udc->usbcmd);udelay (200 ); +#if defined(CONFIG_MX6Q ) || defined(CONFIG_MX6DL ) +reset_usb_phy1 (); +#endif writel ((unsigned )controller.epts, &udc->epinitaddr);
Best regards,
Marek Vasut
PATCH v3 9/20 usb: gadget: ether set wMaxPacketSize
In reply to Troy Kiskyset wMaxPacketSize for full speed descriptors
--- drivers/usb/gadget/ether.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/ether.c +2 -0
@@ -635,6 +635,7 @@ fs_source_desc = { .bEndpointAddress = USB_DIR_IN, .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = __constant_cpu_to_le16(64), }; static struct usb_endpoint_descriptor
@@ -644,6 +645,7 @@ fs_sink_desc = { .bEndpointAddress = USB_DIR_OUT, .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = __constant_cpu_to_le16(64), };static const struct usb_descriptor_header *fs_eth_function[11 ] = {
Signature · 1 line
1.8.1.2
PATCH v3 9/20 usb: gadget: ether set wMaxPacketSize
Dear Troy Kisky,
Quoted 1 line
set wMaxPacketSize for full speed descriptors
Why? Please elaborate more.
Quoted 18 lines
Signed-off-by Troy Kisky <[email protected]>--- drivers/usb/gadget/ether.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/gadget/ether.c +1
-0@@ -635,6 +635,7 @@ fs_source_desc = { .bEndpointAddress = USB_DIR_IN, .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = __constant_cpu_to_le16(64), }; static struct usb_endpoint_descriptor
drivers/usb/gadget/ether.c fs_sink_desc = { · line 651
Quoted 7 lines
drivers/usb/gadget/ether.c +1
-0@@ -644,6 +645,7 @@ fs_sink_desc = { .bEndpointAddress = USB_DIR_OUT, .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = __constant_cpu_to_le16(64), };static const struct usb_descriptor_header *fs_eth_function[11 ] = {
Best regards,
Marek Vasut
PATCH v3 10/20 usb: gadget: ether: return error from rx_submit if no request
In reply to Troy KiskyThis prevents a crash if tftpboot is given a bad filename.
--- drivers/usb/gadget/ether.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/ether.c +2 -0
@@ -1535,6 +1535,8 @@ static int rx_submit(struct eth_dev *dev, struct usb_request *req,*/ debug ("%s\n" , __func__); +if (!req) +return -EINVAL ; size = (ETHER_HDR_SIZE + dev->mtu +RX_EXTRA ); size += dev->out_ep->maxpacket -1 ;
Signature · 1 line
1.8.1.2
PATCH v3 10/20 usb: gadget: ether: return error from rx_submit if no request
Dear Troy Kisky,
Quoted 1 line
This prevents a crash if tftpboot is given a bad filename.
How is bad filename related to struct usb_request?
Quoted 12 lines
Signed-off-by Troy Kisky <[email protected]>--- drivers/usb/gadget/ether.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/gadget/ether.c +0
-0@@ -1535,6 +1535,8 @@ static int rx_submit(struct eth_dev *dev, struct
usb_request*req, */
drivers/usb/gadget/ether.c static int rx_submit(struct eth_dev *dev, struct usb_request *req, · line 1542
Quoted 6 lines
drivers/usb/gadget/ether.c +2
-0debug ("%s\n" , __func__); +if (!req) +return -EINVAL ; size = (ETHER_HDR_SIZE + dev->mtu +RX_EXTRA ); size += dev->out_ep->maxpacket -1 ;
Best regards,
Marek Vasut
PATCH v3 11/20 usb: gadget: mv_udc: split mv_udc.h file
In reply to Troy KiskyMove defines only needed by mv_udc.c to a file
in the same directory.
This allows usbtty to compile for mv_udc,
but it still doesn't link.
--- drivers/usb/gadget/mv_udc.c | 6 +++ drivers/usb/gadget/mv_udc.h | 115 ++++++++++++++++++++++++++++++++++++++++++ include/usb/mv_udc.h | 118 -------------------------------------------- 3 files changed, 121 insertions(+), 118 deletions(-) create mode 100644 drivers/usb/gadget/mv_udc.h
drivers/usb/gadget/mv_udc.c +6 -0
@@ -14,9 +14,15 @@#include <net.h> #include <malloc.h> #include <asm/arch/sys_proto.h> +#include <asm/byteorder.h> #include <asm/io.h> +#include <asm/errno.h> #include <linux/types.h> +#include <linux/usb/ch9.h> +#include <linux/usb/gadget.h> #include <usb/mv_udc.h> +#include "../host/ehci.h" +#include "mv_udc.h" #if CONFIG_USB_MAX_CONTROLLER_COUNT >1 #error This driver only supports one single controller.
drivers/usb/gadget/mv_udc.h new file +115 -0
115 lines not on this page · raw message
include/usb/mv_udc.h +0 -118
124 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v3 12/20 usb: udc: add udc.h include file
In reply to Troy KiskyMove common defintions to udc.h
--- drivers/serial/usbtty.h | 3 +- drivers/usb/gadget/designware_udc.c | 1 + drivers/usb/gadget/mpc8xx_udc.c | 1 + drivers/usb/gadget/omap1510_udc.c | 1 + drivers/usb/gadget/pxa27x_udc.c | 1 + drivers/usb/musb/musb_udc.c | 3 +- include/usb/designware_udc.h | 31 ------------------ include/usb/mpc8xx_udc.h | 19 +---------- include/usb/musb_udc.h | 40 ----------------------- include/usb/omap1510_udc.h | 27 ++-------------- include/usb/pxa27x_udc.h | 26 +-------------- include/usb/udc.h | 63 +++++++++++++++++++++++++++++++++++++ 12 files changed, 75 insertions(+), 141 deletions(-) delete mode 100644 include/usb/musb_udc.h create mode 100644 include/usb/udc.h
drivers/serial/usbtty.h +1 -2
@@ -16,8 +16,6 @@#include <usb/mpc8xx_udc.h> #elif defined(CONFIG_OMAP1510 )#include <usb/omap1510_udc.h> -#elif defined(CONFIG_MUSB_UDC ) -#include <usb/musb_udc.h> #elif defined(CONFIG_CPU_PXA27X )#include <usb/pxa27x_udc.h> #elif defined(CONFIG_DW_UDC )
@@ -26,6 +24,7 @@#include <usb/mv_udc.h> #endif +#include <usb/udc.h> #include <version.h> /* If no VendorID/ProductID is defined in config.h, pretend to be Linux
drivers/usb/gadget/designware_udc.c +1 -0
@@ -14,6 +14,7 @@#include <usbdevice.h> #include "ep0.h" #include <usb/designware_udc.h> +#include <usb/udc.h> #include <asm/arch/hardware.h> #define UDC_INIT_MDELAY 80/* Device settle delay */
drivers/usb/gadget/mpc8xx_udc.c +1 -0
@@ -47,6 +47,7 @@#include <commproc.h> #include <usbdevice.h> #include <usb/mpc8xx_udc.h> +#include <usb/udc.h> #include "ep0.h"
drivers/usb/gadget/omap1510_udc.c +1 -0
@@ -20,6 +20,7 @@#endif #include <usbdevice.h> #include <usb/omap1510_udc.h> +#include <usb/udc.h> #include "ep0.h"
drivers/usb/gadget/pxa27x_udc.c +1 -0
@@ -16,6 +16,7 @@#include <asm/arch/hardware.h> #include <asm/io.h> #include <usb/pxa27x_udc.h> +#include <usb/udc.h> #include "ep0.h"
drivers/usb/musb/musb_udc.c +2 -1
@@ -39,7 +39,8 @@*/ #include <common.h> -#include <usb/musb_udc.h> +#include <usbdevice.h> +#include <usb/udc.h> #include "../gadget/ep0.h" #include "musb_core.h" #if defined(CONFIG_USB_OMAP3 )
include/usb/designware_udc.h +0 -31
@@ -174,19 +174,6 @@ struct udcfifo_regs { };/* -* USBTTY definitions -*/ -#define EP0_MAX_PACKET_SIZE 64 -#define UDC_INT_ENDPOINT 1 -#define UDC_INT_PACKET_SIZE 64 -#define UDC_OUT_ENDPOINT 2 -#define UDC_BULK_PACKET_SIZE 64 -#define UDC_BULK_HS_PACKET_SIZE 512 -#define UDC_IN_ENDPOINT 3 -#define UDC_OUT_PACKET_SIZE 64 -#define UDC_IN_PACKET_SIZE 64 - -/* * UDC endpoint definitions */ #define UDC_EP0 0
@@ -194,22 +181,4 @@ struct udcfifo_regs {#define UDC_EP2 2#define UDC_EP3 3 -/* -* Function declarations -*/ - -void udc_irq (void ); - -void udc_set_nak (int epid); -void udc_unset_nak (int epid); -int udc_endpoint_write (struct usb_endpoint_instance *endpoint); -int udc_init (void ); -void udc_enable (struct usb_device_instance *device); -void udc_disable (void ); -void udc_connect (void ); -void udc_disconnect (void ); -void udc_startup_events (struct usb_device_instance *device); -void udc_setup_ep (struct usb_device_instance *device,unsigned int ep, -struct usb_endpoint_instance *endpoint); -#endif /* __DW_UDC_H */
include/usb/mpc8xx_udc.h +1 -18
@@ -111,11 +111,9 @@/* UDC device defines */ #define EP0_MAX_PACKET_SIZE EP_MAX_PKT -#define UDC_OUT_ENDPOINT 0x02 +#define UDC_OUT_PACKET_SIZE EP_MIN_PACKET_SIZE -#define UDC_IN_ENDPOINT 0x03#define UDC_IN_PACKET_SIZE EP_MIN_PACKET_SIZE -#define UDC_INT_ENDPOINT 0x01#define UDC_INT_PACKET_SIZE UDC_IN_PACKET_SIZE#define UDC_BULK_PACKET_SIZE EP_MIN_PACKET_SIZE
@@ -178,18 +176,3 @@ typedef enum mpc8xx_udc_state{ STATE_READY, }mpc8xx_udc_state_t; -/* Declarations */ -int udc_init (void ); -void udc_irq (void ); -int udc_endpoint_write (struct usb_endpoint_instance *endpoint); -void udc_setup_ep (struct usb_device_instance *device,unsigned int ep, -struct usb_endpoint_instance *endpoint); -void udc_connect (void ); -void udc_disconnect (void ); -void udc_enable (struct usb_device_instance *device); -void udc_disable (void ); -void udc_startup_events (struct usb_device_instance *device); - -/* Flow control */ -void udc_set_nak (int epid); -void udc_unset_nak (int epid);
include/usb/musb_udc.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* Copyright (c) 2009 Wind River Systems, Inc. -* Tom Rix <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ -#ifndef __MUSB_UDC_H__ -#define __MUSB_UDC_H__ - -#include <usbdevice.h> - -/* UDC level routines */ -void udc_irq (void ); -void udc_set_nak (int ep_num); -void udc_unset_nak (int ep_num); -int udc_endpoint_write (struct usb_endpoint_instance *endpoint); -void udc_setup_ep (struct usb_device_instance *device,unsigned int id, -struct usb_endpoint_instance *endpoint); -void udc_connect (void ); -void udc_disconnect (void ); -void udc_enable (struct usb_device_instance *device); -void udc_disable (void ); -void udc_startup_events (struct usb_device_instance *device); -int udc_init (void ); - -/* usbtty */ -#ifdef CONFIG_USB_TTY - -#define EP0_MAX_PACKET_SIZE 64/* MUSB_EP0_FIFOSIZE */ -#define UDC_INT_ENDPOINT 1 -#define UDC_INT_PACKET_SIZE 64 -#define UDC_OUT_ENDPOINT 2 -#define UDC_OUT_PACKET_SIZE 64 -#define UDC_IN_ENDPOINT 3 -#define UDC_IN_PACKET_SIZE 64 -#define UDC_BULK_PACKET_SIZE 64 - -#endif /* CONFIG_USB_TTY */ - -#endif /* __MUSB_UDC_H__ */
include/usb/omap1510_udc.h +3 -24
@@ -162,32 +162,11 @@#define UDC_VBUS_MODE (1 << 18)/* OMAP Endpoint parameters */ -#define EP0_MAX_PACKET_SIZE 64 -#define UDC_OUT_ENDPOINT 2 -#define UDC_OUT_PACKET_SIZE 64 -#define UDC_IN_ENDPOINT 1 -#define UDC_IN_PACKET_SIZE 64 -#define UDC_INT_ENDPOINT 5#define UDC_INT_PACKET_SIZE 16#define UDC_BULK_PACKET_SIZE 16 -void udc_irq (void ); -/* Flow control */ -void udc_set_nak (int epid); -void udc_unset_nak (int epid); - -/* Higher level functions for abstracting away from specific device */ -int udc_endpoint_write (struct usb_endpoint_instance *endpoint); - -int udc_init (void ); - -void udc_enable (struct usb_device_instance *device); -void udc_disable (void ); - -void udc_connect (void ); -void udc_disconnect (void ); - -void udc_startup_events (struct usb_device_instance *device); -void udc_setup_ep (struct usb_device_instance *device,unsigned int ep,struct usb_endpoint_instance *endpoint); +#define UDC_INT_ENDPOINT 5 +#define UDC_OUT_ENDPOINT 2 +#define UDC_IN_ENDPOINT 1#endif
include/usb/pxa27x_udc.h +1 -25
@@ -22,35 +22,11 @@/* Endpoint parameters */ #define MAX_ENDPOINTS 4 -#define EP_MAX_PACKET_SIZE 64#define EP0_MAX_PACKET_SIZE 16 +#define UDC_OUT_ENDPOINT 0x02 -#define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE#define UDC_IN_ENDPOINT 0x01 -#define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE#define UDC_INT_ENDPOINT 0x05 -#define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE -#define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE - -void udc_irq (void ); -/* Flow control */ -void udc_set_nak (int epid); -void udc_unset_nak (int epid); - -/* Higher level functions for abstracting away from specific device */ -int udc_endpoint_write (struct usb_endpoint_instance *endpoint); - -int udc_init (void ); - -void udc_enable (struct usb_device_instance *device); -void udc_disable (void ); - -void udc_connect (void ); -void udc_disconnect (void ); - -void udc_startup_events (struct usb_device_instance *device); -void udc_setup_ep (struct usb_device_instance *device, -unsigned int ep,struct usb_endpoint_instance *endpoint);#endif
include/usb/udc.h new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v3 13/20 usb: gadget: mv_udc: fix typo in error message
In reply to Troy KiskyChange 'nfo=' to 'info='
--- drivers/usb/gadget/mv_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/mv_udc.c +2 -2
@@ -383,8 +383,8 @@ static void handle_ep_complete(struct mv_ep *ep)mv_invalidate_qtd (num);if (item->info &0xff ) -printf ("EP%d/%s FAIL nfo=%x pg0=%x\n" , - num, in ?"in" :"out" , item->info, item->page0); +printf ("EP%d/%s FAIL info=%x pg0=%x\n" , + num, in ?"in" :"out" , item->info, item->page0); len = (item->info >>16 ) &0x7fff ;
Signature · 1 line
1.8.1.2
PATCH v3 14/20 usb: gadget: mv_udc: set is_dualspeed = 1
In reply to Troy KiskyThis controller support full and high speed.
--- drivers/usb/gadget/mv_udc.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/mv_udc.c +1 -0
@@ -114,6 +114,7 @@ static struct mv_drv controller = { .gadget = { .name = "mv_udc", .ops = &mv_udc_ops, + .is_dualspeed = 1, }, };
Signature · 1 line
1.8.1.2
PATCH v3 15/20 usb: gadget: mv_udc: fix full speed connections
In reply to Troy KiskySet maximum packet length in queue header to wMaxPacketSize of endpoint.
--- drivers/usb/gadget/mv_udc.c | 48 ++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 14 deletions(-)
drivers/usb/gadget/mv_udc.c +34 -14
@@ -17,6 +17,7 @@#include <asm/byteorder.h> #include <asm/io.h> #include <asm/errno.h> +#include <asm/unaligned.h> #include <linux/types.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h>
@@ -228,7 +229,7 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req)return ; } -static void ep_enable (int num,int in) +static void ep_enable (int num,int in,int maxpacket) {struct ept_queue_head *head;struct mv_udc *udc =get_mv_udc ();
@@ -242,7 +243,7 @@ static void ep_enable(int num, int in) n |= (CTRL_RXE |CTRL_RXR |CTRL_RXT_BULK );if (num !=0 ) { - head->config =CONFIG_MAX_PKT (EP_MAX_PACKET_SIZE ) |CONFIG_ZLT ; + head->config =CONFIG_MAX_PKT (maxpacket) |CONFIG_ZLT ;mv_flush_qh (num); }writel (n, &udc->epctrl[num]);
@@ -255,8 +256,21 @@ static int mv_ep_enable(struct usb_ep *ep,int num, in; num = desc->bEndpointAddress &USB_ENDPOINT_NUMBER_MASK ; in = (desc->bEndpointAddress &USB_DIR_IN ) !=0 ; -ep_enable (num, in); mv_ep->desc = desc; + +if (num) { +int max =get_unaligned_le16 (&desc->wMaxPacketSize); + +if ((max >64 ) && (controller.gadget.speed ==USB_SPEED_FULL )) + max =64 ; +if (ep->maxpacket != max) { +DBG ("%s: from %d to %d\n" , __func__, + ep->maxpacket, max); + ep->maxpacket = max; + } + } +ep_enable (num, in, ep->maxpacket); +DBG ("%s: num=%d maxpacket=%d\n" , __func__, num, ep->maxpacket);return 0 ; }
@@ -429,14 +443,16 @@ static void handle_setup(void)if ((r.wValue ==0 ) && (r.wLength ==0 )) { req->length =0 ;for (i =0 ; i <NUM_ENDPOINTS ; i++) { -if (!controller.ep[i].desc) +struct mv_ep *ep = &controller.ep[i]; + +if (!ep->desc)continue ; - num = controller.ep[i].desc->bEndpointAddress + num = ep->desc->bEndpointAddress &USB_ENDPOINT_NUMBER_MASK ; - in = (controller.ep[i].desc->bEndpointAddress + in = (ep->desc->bEndpointAddress &USB_DIR_IN ) !=0 ;if ((num == _num) && (in == _in)) { -ep_enable (num, in); +ep_enable (num, in, ep->ep.maxpacket);usb_ep_queue (controller.gadget.ep0, req,0 );break ;
@@ -520,15 +536,19 @@ void udc_irq(void)DBG ("-- suspend --\n" );if (n &STS_PCI ) { -DBG ("-- portchange --\n" ); +int max =64 ; +int speed =USB_SPEED_FULL ; + bit = (readl (&udc->portsc) >>26 ) &3 ; +DBG ("-- portchange %x %s\n" , bit, (bit ==2 ) ?"High" :"Full" );if (bit ==2 ) { - controller.gadget.speed =USB_SPEED_HIGH ; -for (i =1 ; i <NUM_ENDPOINTS && n; i++) -if (controller.ep[i].desc) - controller.ep[i].ep.maxpacket =512 ; - }else { - controller.gadget.speed =USB_SPEED_FULL ; + speed =USB_SPEED_HIGH ; + max =512 ; + } + controller.gadget.speed = speed; +for (i =1 ; i <NUM_ENDPOINTS ; i++) { +if (controller.ep[i].ep.maxpacket > max) + controller.ep[i].ep.maxpacket = max; } }
Signature · 1 line
1.8.1.2
PATCH v3 16/20 usb: gadget: mv_udc: optimize bounce
In reply to Troy KiskyOnly perform one copy, either in the bounce routine for IN transfers, or the debounce rtn for OUT transfer.
On out transfers, only copy the number of bytes received from the bounce buffer
--- drivers/usb/gadget/mv_udc.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-)
drivers/usb/gadget/mv_udc.c +16 -21
@@ -279,7 +279,7 @@ static int mv_ep_disable(struct usb_ep *ep)return 0 ; } -static int mv_bounce (struct mv_ep *ep) +static int mv_bounce (struct mv_ep *ep,int in) {uint32_t addr = (uint32_t )ep->req.buf;uint32_t ba;
@@ -308,8 +308,8 @@ align:if (!ep->b_buf)return -ENOMEM ; } - -memcpy (ep->b_buf, ep->req.buf, ep->req.length); +if (in) +memcpy (ep->b_buf, ep->req.buf, ep->req.length); flush: ba = (uint32_t )ep->b_buf;
@@ -318,29 +318,25 @@ flush:return 0 ; } -static void mv_debounce (struct mv_ep *ep) +static void mv_debounce (struct mv_ep *ep,int in) {uint32_t addr = (uint32_t )ep->req.buf;uint32_t ba = (uint32_t )ep->b_buf; +if (in) { +if (addr == ba) +return ;/* not a bounce */ + goto free; + }invalidate_dcache_range (ba, ba + ep->b_len); -/* Input buffer address is not aligned. */ -if (addr & (ARCH_DMA_MINALIGN -1 )) - goto copy; - -/* Input buffer length is not aligned. */ -if (ep->req.length & (ARCH_DMA_MINALIGN -1 )) - goto copy; - -/* The buffer is well aligned, only invalidate cache. */ -return ; +if (addr == ba) +return ;/* not a bounce */ -copy:memcpy (ep->req.buf, ep->b_buf, ep->req.length); - +free:/* Large payloads use allocated buffer, free it. */ -if (ep->req.length >64 ) +if (ep->b_buf != ep->b_fast)free (ep->b_buf); }
@@ -358,7 +354,7 @@ static int mv_ep_queue(struct usb_ep *ep, head =mv_get_qh (num, in); len = req->length; - ret =mv_bounce (mv_ep); + ret =mv_bounce (mv_ep, in);if (ret)return ret;
@@ -402,10 +398,9 @@ static void handle_ep_complete(struct mv_ep *ep) num, in ? "in" : "out", item->info, item->page0); len = (item->info >>16 ) &0x7fff ; - -mv_debounce (ep); - ep->req.length -= len; +mv_debounce (ep, in); +DBG ("ept%d %s complete %x\n" , num, in ?"in" :"out" , len); ep->req.complete (&ep->ep, &ep->req);
Signature · 1 line
1.8.1.2
PATCH v3 17/20 usb: gadget: mv_udc: flush item before head
In reply to Troy KiskyMake sure the transfer descriptor is flushed before the queue is updated so that the controller will not see old information.
--- drivers/usb/gadget/mv_udc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/gadget/mv_udc.c +2 -3
@@ -362,21 +362,20 @@ static int mv_ep_queue(struct usb_ep *ep, item->info =INFO_BYTES (len) |INFO_IOC |INFO_ACTIVE ; item->page0 = (uint32_t )mv_ep->b_buf; item->page1 = ((uint32_t )mv_ep->b_buf &0xfffff000 ) +0x1000 ; +mv_flush_qtd (num); head->next = (unsigned ) item; head->info =0 ;DBG ("ept%d %s queue len %x, buffer %p\n" , num, in ?"in" :"out" , len, mv_ep->b_buf); +mv_flush_qh (num);if (in) bit =EPT_TX (num);else bit =EPT_RX (num); -mv_flush_qh (num); -mv_flush_qtd (num); -writel (bit, &udc->epprime);return 0 ;
Signature · 1 line
1.8.1.2
PATCH v3 18/20 usb: gadget: mv_udc: optimize ep_enable
In reply to Troy KiskyOnly get head if not ep0.
--- drivers/usb/gadget/mv_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/mv_udc.c +2 -2
@@ -231,10 +231,8 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req)static void ep_enable (int num,int in,int maxpacket) { -struct ept_queue_head *head;struct mv_udc *udc =get_mv_udc ();unsigned n; - head =mv_get_qh (num, in); n =readl (&udc->epctrl[num]);if (in)
@@ -243,6 +241,8 @@ static void ep_enable(int num, int in, int maxpacket) n |= (CTRL_RXE |CTRL_RXR |CTRL_RXT_BULK );if (num !=0 ) { +struct ept_queue_head *head =mv_get_qh (num, in); + head->config =CONFIG_MAX_PKT (maxpacket) |CONFIG_ZLT ;mv_flush_qh (num); }
Signature · 1 line
1.8.1.2
PATCH v3 19/20 usb: gadget: mv_udc: zero transfer descriptor memory on probe
In reply to Troy KiskySince we flush the TD, we may as well set it to a known value.
--- drivers/usb/gadget/mv_udc.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/mv_udc.c +1 -0
@@ -661,6 +661,7 @@ static int mvudc_probe(void)free (controller.epts);return -ENOMEM ; } +memset (controller.items_mem,0 , ilist_sz);for (i =0 ; i <2 *NUM_ENDPOINTS ; i++) {/*
Signature · 1 line
1.8.1.2
PATCH v3 20/20 usb: gadget: mv_udc: clear desc upon ep_disable
In reply to Troy Kiskydesc is set at ep_enable, so for symmetry,
clear it at ep_disable.
--- drivers/usb/gadget/mv_udc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/gadget/mv_udc.c +3 -0
@@ -276,6 +276,9 @@ static int mv_ep_enable(struct usb_ep *ep,static int mv_ep_disable (struct usb_ep *ep) { + struct mv_ep *mv_ep = container_of(ep, struct mv_ep, ep); + + mv_ep->desc =NULL ;return 0 ; }
Signature · 1 line
1.8.1.2
v3 cover Make mv_udc work for i.mx6
In reply to Troy KiskyDear Troy Kisky,
Quoted 21 lines
Hi Marek, Stefano
This series is based on u-boot-usb/master branch. After this series, nitrogen6x works with tftpboot to transfer files over usb.
V2 was dropped to my bad posting of it and should be ignored.
This V3 is a rebase and most patches had to be changed slightly. I also ran a ./MAKEALL -a arm and fixed the errors that the V1 series had.
The most noticeable change is the addition of
usb: gadget:
mv_udc: fix hardware udc address for i.MX6Let me know if you want to go back to a udc variable to store the address instead of using hcor.
Quoted 5 lines
Stefano, would you like to take patches 1-5 ?
I'll likely need a V3, but maybe the early ones
will be approved.Thanks
In general, cool stuff. I want this in, you just need to learn to write proper commit messages. I don't understand the middle part of your patchset very well, that's where I was rambling the most. Otherwise, it's almost OK, one or two more loop and you're in.
Best regards,
Marek Vasut
v3 cover Make mv_udc work for i.mx6
In reply to Troy KiskyHi Troy,
Quoted 17 lines · Troy Kisky
Hi Marek, Stefano
This series is based on u-boot-usb/master branch. After this series, nitrogen6x works with tftpboot to transfer files over usb.
V2 was dropped to my bad posting of it and should be ignored.
This V3 is a rebase and most patches had to be changed slightly. I also ran a ./MAKEALL -a arm and fixed the errors that the V1 series had.
The most noticeable change is the addition of
usb: gadget:
mv_udc: fix hardware udc address for i.MX6
Quoted 7 lines
Let me know if you want to go back to a udc variable to store the address instead of using hcor.
Stefano, would you like to take patches 1-5 ?
I'll likely need a V3, but maybe the early ones
will be approved.
Fine with me - I merge the first 5 patches.
Regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================