summaryrefslogtreecommitdiffstats
path: root/common/fastboot.c
Commit message (Collapse)AuthorAgeFilesLines
* magicvar: Replace BAREBOX_MAGICVAR_NAMED with BAREBOX_MAGICVARSascha Hauer2020-10-021-7/+4
| | | | | | | | BAREBOX_MAGICVAR now generates a unique identifier automatically, so we can convert users of BAREBOX_MAGICVAR_NAMED to the simpler BAREBOX_MAGICVAR macro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net' into masterSascha Hauer2020-09-251-3/+54
|\
| * fastboot net: implement fastboot over UDPEdmund Henniges2020-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the UDP variant of the fastboot protocol. The only way to start the service for now is to compile with CONFIG_FASTBOOT_NET_ON_BOOT. The service will bind to the network interface that provides the IPv4 gateway. Sending an OKAY packet before performing a restart is necessary since contrary to USB the host will not notice when a UDP server disappears. Signed-off-by: Edmund Henniges <eh@emlix.com> Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fastboot: init list head in commonSascha Hauer2020-08-191-0/+2
| | | | | | | | | | | | | | The list of variables can be initialized in common code, no need to do the in the different implementations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fastboot: Add fastboot_abort()Sascha Hauer2020-08-191-0/+12
| | | | | | | | | | | | Add fastboot_abort() to allow aborting the current session. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fastboot: Warn when cb_download is called with file still openSascha Hauer2020-08-191-0/+6
| | | | | | | | | | | | | | Warn when we are about to open a new download file without having closed the old one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fastboot: rename usbgadget.fastboot_* variables to fastboot.*Daniel Glöckner2020-08-191-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | There is nothing USB-specific in the defined usbgadget.fastboot_* variables. Rename them to be usable also for the UDP fastboot transport. The usbgadget.fastboot_function variable is used to define the files and devices accessible with the erase and flash commands. Since "function" is a term from the USB specification and the Fastboot specification uses the term "partition", we rename that variable to "fastboot.partitions". Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fastboot: only unset image, not loadaddrRouven Czerwinski2020-09-151-1/+1
|/ | | | | | | | In case the board needs to setup the load address of the kernel, don't overwrite the variable, instead only override the image. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot: Drop support for downloading to bufferSascha Hauer2020-06-181-70/+27
| | | | | | | | | | The option to download to a buffer instead of a file was introduced because in some workloads it is required to have a contiguous image in memory. With recent changes now ramfs can provide such a buffer via memmap API even when it downloaded the data to a file. This makes the explicit download to buffer option unnecessary, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot: Use make_temp() to create temporary fileSascha Hauer2020-06-121-2/+3
| | | | | | make_temp() was created for this purpose, so use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot: Use unique tempfile nameSascha Hauer2020-05-201-9/+12
| | | | | | | | With fastboot over ethernet we now can have two instances of fastboot running in parallel. Make sure that both instances use a different temporary file to store data so that they do not influence each other. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot: don't close fd 0 when downloading to ramDaniel Glöckner2020-05-201-1/+2
| | | | | | | | | When downloading to a buffer, download_fd is never assigned a valid file descriptor. We should therefore avoid calling close on the value found in that variable. Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot: split generic code from USB gadgetEdmund Henniges2020-05-201-0/+957
The fastboot specification describes other protocols beyond USB. Allow these to reuse the generic parts of the existing fastboot code when they are implemented. Most of the changes in common/fastboot.c are due to the renaming of struct f_fastboot *f_fb to struct fastboot *fb. Signed-off-by: Edmund Henniges <eh@emlix.com> Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>