[U-Boot] [PATCH V3 1/4] usb: rockchip: add the rockusb gadget

Simon Glass sjg at chromium.org
Mon May 8 16:38:10 UTC 2017


Hi Eddie,

On 2 May 2017 at 02:47, Eddie Cai <eddie.cai.linux at gmail.com> wrote:
>
> Hi Simon
>
> 2017-04-30 11:49 GMT+08:00 Simon Glass <sjg at chromium.org>:
> > Hi Eddie,
> >
> > On 28 April 2017 at 18:41, Eddie Cai <eddie.cai.linux at gmail.com> wrote:
> >> this patch implement rockusb protocol on the device side. this is based on USB
> >> download gadget infrastructure. the rockusb function implements the rd, wl, rid
> >> commands. it can work with rkdeveloptool.
> >>
> >> Signed-off-by: Eddie Cai <eddie.cai.linux at gmail.com>
> >>
> >> Changes in v3:
> >> -split the macro to f_rockusb.h
> >> -use ALLOC_CACHE_ALIGN_BUFFER to define cache safe struct inside the function.
> >> -fix checkpatch error
> >>
> >> ---
> >>  arch/arm/include/asm/arch-rockchip/f_rockusb.h | 104 ++++
> >>  drivers/usb/gadget/Makefile                    |   1 +
> >>  drivers/usb/gadget/f_rockusb.c                 | 724 +++++++++++++++++++++++++
> >>  3 files changed, 829 insertions(+)
> >>  create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
> >>  create mode 100644 drivers/usb/gadget/f_rockusb.c

[..]


> >> +char *rockusb_dev_type = 0;
> >> +int rockusb_dev_index = 0;
> >
> > Move to top
> OK
> >
> > I wonder if you should group all your data in a struct?
> this data is useless if we just want to talk to cpu, get cpu info etc.
> So no need to group
> it in a struct. i will make it static to avoid other module use it

The thing is that we should convert USB gadgets to driver model at
some point. When we do, we cannot have static local data - it all
needs to go into a driver-model struct.

So I think it is better to do this now, and have a single static
struct locally, then pass it around between the functions in this
file. That way we have less work to do with DM conversion.

Regards,
Simon


More information about the U-Boot mailing list