[U-Boot] [RFC PATCH v1 0/5] Add fastboot UDP support

Lukasz Majewski
2018-04-25T15:19:10Z

On Wed, 25 Apr 2018 13:50:50 +0100
Alex Kiernan <alex.kiernan@gmail.com> wrote:

> On Wed, Apr 25, 2018 at 8:53 AM, Alex Kiernan
> <alex.kiernan@gmail.com> wrote:
> > On Tue, Apr 24, 2018 at 6:10 PM, Jocelyn Bohr <bohr@verily.com>
> > wrote:
> >> Thanks so much for porting this, Alex!
> >>
>
> ...
>
> >>
> >> You can select both network and USB fastboot to be enabled with
> >> the Kconfig, but at runtime you have to select to wait on either
> >> USB or network by running
> >> "fastboot udp" or "fastboot usb <USB_controller>". When the Android
> >> bootloader
> >> gets the command to reboot back to fastboot, it will read the
> >> "fastbootcmd" env
> >> variable and run that as a command
> >> (common/android_bootloader.c:151).
> >
> > Thanks for that (especially the detail on android_bootloader which
> > I'd not read through). The bit that concerns me is in
> > timed_send_info:
> >
> > +/**
> > + * Send an INFO packet during long commands based on timer. If
> > + * CONFIG_UDP_FUNCTION_FASTBOOT is defined, an INFO packet is
> > sent
> > + * if the time is 30 seconds after start. Else, noop.
> > + *
> > + * TODO: Handle the situation where both UDP and USB fastboot are
> > + * enabled.
> > + *
> > + * @param start: Time since last INFO packet was sent.
> > + * @param msg: String describing the reason for waiting
> > + */
> > +void timed_send_info(ulong *start, const char *msg);
> >
> > The code in timed_send_info is guarded with an ifdef, rather than
> > based on the transport that's been selected at runtime. Do we need
> > to make timed_send_info work based on the runtime state, rather
> > than the compile time, or can we drop the ifdef guard and remove
> > the TODO? I guess I'm assuming the former, but with no way to test
> > USB I don't want head off down the wrong road!
> >
>
> Having started digging through how we'd merge the two code paths, it's
> clear if you had UDP and USB both enabled at compile time and then try
> and run the USB path it'll try and do UDP things in timed_send_info,
> which can't be good!
>

I think that we can assume operation of only one medium in a time - i.e.

when you issue fastboot usb then no UDP support (and opposite).

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180425/d9c5972a/attachment.sig>