2018-10-09 |
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 9 Oct 2018
|
2018-10-08 |
bbu: Add "handler" parameter to barebox_update()
...
Add "handler" parameter to barebox_update() and remove the code that
was respondible for header lookup before. With this change finding
appropriate handler is caller's responsibility, which makes it
possible to implement custom handler lookup/existence check, chache
it, and then re-use it without calling handler_find_by_* functions for
the second time.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 8 Oct 2018
Sascha Hauer
committed
on 8 Oct 2018
|
bbu: Expose bbu_find_handler_by_*() functions
...
Expose bbu_find_handler_by_device() and bbu_find_handler_by_name() as
public functions and convert the only user of
barebox_update_handler_exists() to use the former function instead.
With this done, barebox_update_handler_exists() is no longer used
anywhere in the code and can be removed.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 8 Oct 2018
Sascha Hauer
committed
on 8 Oct 2018
|
2018-10-02 |
usb: gadget: fastboot: fix downloading files of wMaxPacketSize bytes
...
File transfers with sizes of exact multiples of wMaxPacketSize up to
EP_BUFFER_SIZE do not work. For a typical scenario that would be files
of 512, 1024 ... 3584 bytes.
This happens because we unconditionally put EP_BUFFER_SIZE into the
initial request length. For non wMaxPacketSize aligned lengths this
works well because the transfer is completed with a short packet.
For wMaxPacketSize aligned lengths there is no short packet though,
so the transfer never completes. Instead we have to put the file
size into the initial request length.
Some controllers like the DWC3 do not work when the request length is
not aligned to wMaxPacketSize, so we align up to wMaxPacketSize like
done in U-Boot.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Gavin Schenk <g.schenk@eckelmann.de>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sascha Hauer
committed
on 2 Oct 2018
|
2018-09-18 |
usb: gadget: fastboot: detect device if not present
...
When a device file is not present when the fastboot gadget is created
then try to detect it before we fail. It may be that we want to write
to a device that we haven't used before.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Sep 2018
|
2018-08-08 |
usb: gadget: allow to actually enable sparse fastboot support
...
When sparse support was (intended to be) made optional it was
effectively unconditionally disabled because
IS_ENABLED(USB_GADGET_FASTBOOT_SPARSE)
always evaluates to 0. To actually make use of the introduced kconfig
symbol the CONFIG_ prefix must not be skipped.
Fixes: f4b5d3eeb607 ("usb: gadget: fastboot: Make sparse support optional")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Gavin Schenk <g.schenk@eckelmann.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 7 Aug 2018
Sascha Hauer
committed
on 8 Aug 2018
|
2018-05-17 |
usb: gadget: fastboot: fix barebox update without using buffer
...
Commit e5098495 "usb: gadget: fastboot: Add option to download to a buffer"
breaks the use of temporary files for fastboot barebox_update.
In the patch the ".imagefile = FASTBOOT_TMPFILE" allocation gets
removed, but data.imagefile is still used. This leads to an NULL
pointer dereference. We fix it by using sourcefile instead.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Michael Grzeschik
authored
on 16 May 2018
Sascha Hauer
committed
on 17 May 2018
|
2018-02-09 |
usb: gadget: fastboot: Add external command execution support
...
Custom projects may need vendor specific expansions to the fastboot
command execution. Allow these to be implemented without messing in
the fastboot code directly.
We have a hook for all commands and also one for the "flash" command.
Each hook can decide if the generic command parser is executed
afterwards (return value FASTBOOT_CMD_FALLTHROUGH) or if the generic
parser shall be skipped (return value 0 or negative error code).
This allows board code to implement vendor specific "oem" commands
or to handle the downloaded image in a special way (i.e. do signature
checks on them)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: Add option to download to a buffer
...
This adds an option to download the image data to a temporary
buffer rather than to a file. While a file is generally the
better option, in some special cases a buffer is better for
memory usage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: beautify fb_run_command()
...
Only some refactoring, no functional change intended.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: fix typo
...
s/correspoinding/corresponding/
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: Always remove temporary file
...
We should consistently remove the temporary image file, regardless
of the error code. To do so, always jump to the end of the function
where the temporary file is removed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: use read_file_2
...
read_file_2 gives us a proper error code and allows us
to specify a maximum size which in this case we happen to know.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: pass struct f_fastboot * around
...
The different fastboot commands mostly do not need the USB endpoint
or the USB request, they need the context data structure struct
f_fastboot * instead, so rather pass this one around between the
different functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
usb: gadget: fastboot: Make sparse support optional
...
Sparse support is not always desired, make it optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Feb 2018
|
2018-01-30 |
usb: gadget: fastboot: allow data.image to be const
...
Do not directly store the dynamically allocated memory in data.image
as we want to make that pointer const and then no longer can call
free() on it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Jan 2018
|
2018-01-18 |
usb: gadget: fastboot: Add sparse image support
...
Sparse images are needed for fastboot to flash images that do not
fit into memory.
Android fastboot is kind of a dumb protocol. It first sends you a
big image and afterwards it tells you where to put this image. This
of course limits fastboot to files smaller than the available memory.
To bypass this issue fastboot has so called Sparse image support. This
is a new image format that can contain holes in the data so a big image
can be written in multiple steps with holes in other areas each step.
Implementing this for UBI images is kind of tricky since ubiformat
normally expects to get a single image. Preparations to ubiformat
a device in multiple parts have been done in previous patches.
It is however, only for the first part possible to detect if it is
a UBI image. The other parts are just binary data and we cannot
know if we have to pass this data raw to the flash or use ubiformat.
For this reason this patch makes the 'u' flag in the partition
description mandatory for proper UBI image flashing on MTD devices.
fastboot passes a max_download_size variable to the host. This
variable contains the image size fastboot can take in one go.
We have to choose a good compromise here. On one hand we do not
want to risk that we actually do not have enough memory to hold the
transferred image, on the other hand we want images like bootloaders
not as sparse images, but in one go instead to make atomic exchange
of the bootloader possible. Right now we have chosen 8MiB which
should be big enough for all bootloaders. The value is configurable
via global.usbgadget.fastboot_max_download_size.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 18 Jan 2018
|
2017-09-27 |
usbgadget: fastboot: Allow to automatically export the bbu handlers
...
We have a list of registered handlers which take a barebox update. Do
the next step and allow to automatically export them via fastboot so
that barebox can be updated via fastboot without manually exporting
the partition. Since this may not be desirable in all cases this
behaviour is configurable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 27 Sep 2017
|
usbgadget: fastboot: Use function to find file_list entry by name
...
We have file_list_entry_by_name() now, so use it rather than open
coding it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 27 Sep 2017
|
2017-04-12 |
usb: gadget: fastboot: delete temporary file
...
After we have copied the data to its final destination there is
no need to keep the temporary file around. Remove it when done
with it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Apr 2017
|
2017-03-10 |
fastboot: abort autoboot timeout when fastboot gadget is activated
...
This patch adds a call to "console_countdown_abort()" to abort a currently or
upcoming running console timeout.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Marc Kleine-Budde
authored
on 10 Mar 2017
Sascha Hauer
committed
on 10 Mar 2017
|
2017-02-23 |
usb: gadget: fastboot: close fd after download
...
The fd for the downloaded file is never closed. Fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Feb 2017
|
2016-07-26 |
include: Move bulk of boot.h to bootm.h
...
The majority of the stuff currently in include/boot.h is about bootm
code implemented common/bootm.c. To be more consistent move it to a
new file include/bootm.h.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Jul 2016
|
2016-05-10 |
usb: fastboot: Fix oem exec support
...
Fixes: b1374a6 usb: fastboot: drop CONFIG_COMMAND_SUPPORT dependency
The correct config option to depend on is CONFIG_COMMAND_SUPPORT,
not CONFIG_COMMAND.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 10 May 2016
|
2016-05-09 |
Merge branch 'for-next/ubiformat'
Sascha Hauer
committed
on 9 May 2016
|
Merge branch 'for-next/include-cleanup'
Sascha Hauer
committed
on 9 May 2016
|
2016-04-26 |
usb: fastboot: drop CONFIG_COMMAND_SUPPORT dependency
...
fastboot can run without command support. In this case we cannot
execute oem commands.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Apr 2016
|
usb: fastboot: Use C API for ubiformat
...
This makes it possible to compile the fastboot gadget without
command support. While at it bail out when ubiformat is not
compiled in.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Apr 2016
|
2016-04-19 |
fix erasing/protecting flashes with unspecified size
...
fixes: 81737c1 mtd: Fix erasing of devices >4GiB
Several places erased a complete flash partition passing ~0 as count to
erase(). With the above commit count to erase was changed from an unsigned
type to a signed type, so the (count > f->size - offset) check in
erase() no longer triggers and the ~0 count is no longer adjusted to the whole
device size. Among other things this results in saveenv failures on NOR
flashes.
This patch fixes this by introducing an explicit macro for erasing the
whole device which is tested for in erase(). All other negative values
are rejected.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Giorgio <giorgio.nicole@arcor.de>
Sascha Hauer
committed
on 19 Apr 2016
|
2016-04-15 |
string: Fix (v)asprintf prototypes
...
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|