Message ID | 1471341825-5000-3-git-send-email-kever.yang@rock-chips.com |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
Headers | show |
+ Simon, On 08/16/2016 06:03 PM, Kever Yang wrote: > This patch add board_usb_init() and interrupt callback > for dwc3 gadget. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > board/rockchip/evb_rk3399/evb-rk3399.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c > index d394276..cd61f59 100644 > --- a/board/rockchip/evb_rk3399/evb-rk3399.c > +++ b/board/rockchip/evb_rk3399/evb-rk3399.c > @@ -7,6 +7,8 @@ > #include <dm.h> > #include <dm/pinctrl.h> > #include <asm/arch/periph.h> > +#include <usb.h> > +#include <dwc3-uboot.h> > > DECLARE_GLOBAL_DATA_PTR; > > @@ -54,3 +56,23 @@ void dram_init_banksize(void) > gd->bd->bi_dram[0].start = 0x200000; > gd->bd->bi_dram[0].size = 0x80000000; > } > + > +#ifdef CONFIG_USB_DWC3 > +static struct dwc3_device dwc3_device_data = { > + .maximum_speed = USB_SPEED_HIGH, > + .base = 0xfe800000, > + .dr_mode = USB_DR_MODE_PERIPHERAL, > + .index = 0, > +}; > + > +int usb_gadget_handle_interrupts(void) > +{ > + dwc3_uboot_handle_interrupt(0); > + return 0; > +} > + > +int board_usb_init(int index, enum usb_init_type init) > +{ > + return dwc3_uboot_init(&dwc3_device_data); > +} > +#endif
Hi, On 16 August 2016 at 04:03, Kever Yang <kever.yang@rock-chips.com> wrote: > This patch add board_usb_init() and interrupt callback > for dwc3 gadget. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > board/rockchip/evb_rk3399/evb-rk3399.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) Reviewed-by: Simon Glass <sjg@chromium.org> > > diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c > index d394276..cd61f59 100644 > --- a/board/rockchip/evb_rk3399/evb-rk3399.c > +++ b/board/rockchip/evb_rk3399/evb-rk3399.c > @@ -7,6 +7,8 @@ > #include <dm.h> > #include <dm/pinctrl.h> > #include <asm/arch/periph.h> > +#include <usb.h> > +#include <dwc3-uboot.h> > > DECLARE_GLOBAL_DATA_PTR; > > @@ -54,3 +56,23 @@ void dram_init_banksize(void) > gd->bd->bi_dram[0].start = 0x200000; > gd->bd->bi_dram[0].size = 0x80000000; > } > + > +#ifdef CONFIG_USB_DWC3 > +static struct dwc3_device dwc3_device_data = { > + .maximum_speed = USB_SPEED_HIGH, > + .base = 0xfe800000, > + .dr_mode = USB_DR_MODE_PERIPHERAL, > + .index = 0, I think you are already talking about how this might move to device tree / driver model. Is that right? > +}; > + > +int usb_gadget_handle_interrupts(void) > +{ > + dwc3_uboot_handle_interrupt(0); > + return 0; > +} > + > +int board_usb_init(int index, enum usb_init_type init) > +{ > + return dwc3_uboot_init(&dwc3_device_data); > +} > +#endif > -- > 1.9.1 > > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot Regards, Simon
diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c index d394276..cd61f59 100644 --- a/board/rockchip/evb_rk3399/evb-rk3399.c +++ b/board/rockchip/evb_rk3399/evb-rk3399.c @@ -7,6 +7,8 @@ #include <dm.h> #include <dm/pinctrl.h> #include <asm/arch/periph.h> +#include <usb.h> +#include <dwc3-uboot.h> DECLARE_GLOBAL_DATA_PTR; @@ -54,3 +56,23 @@ void dram_init_banksize(void) gd->bd->bi_dram[0].start = 0x200000; gd->bd->bi_dram[0].size = 0x80000000; } + +#ifdef CONFIG_USB_DWC3 +static struct dwc3_device dwc3_device_data = { + .maximum_speed = USB_SPEED_HIGH, + .base = 0xfe800000, + .dr_mode = USB_DR_MODE_PERIPHERAL, + .index = 0, +}; + +int usb_gadget_handle_interrupts(void) +{ + dwc3_uboot_handle_interrupt(0); + return 0; +} + +int board_usb_init(int index, enum usb_init_type init) +{ + return dwc3_uboot_init(&dwc3_device_data); +} +#endif
This patch add board_usb_init() and interrupt callback for dwc3 gadget. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- board/rockchip/evb_rk3399/evb-rk3399.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)