summaryrefslogtreecommitdiffstats
path: root/common/fastboot.c
diff options
context:
space:
mode:
authorDaniel Glöckner <dg@emlix.com>2020-05-14 20:21:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-08-19 07:36:15 +0200
commit38d7ba55da264ddfbb310b28d633a44aa41982ea (patch)
tree9ecc0350464ba27b9b7dcaedde25e1f4f718c7b2 /common/fastboot.c
parentfa82936f249fb5762b639c15321b5a766d380343 (diff)
downloadbarebox-38d7ba55da264ddfbb310b28d633a44aa41982ea.tar.gz
barebox-38d7ba55da264ddfbb310b28d633a44aa41982ea.tar.xz
fastboot: rename usbgadget.fastboot_* variables to fastboot.*
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>
Diffstat (limited to 'common/fastboot.c')
-rw-r--r--common/fastboot.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/common/fastboot.c b/common/fastboot.c
index 302720c43d..d06581a314 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -46,6 +46,8 @@
#define FASTBOOT_VERSION "0.4"
static unsigned int fastboot_max_download_size = SZ_8M;
+static int fastboot_bbu;
+static char *fastboot_partitions;
struct fb_variable {
char *name;
@@ -903,17 +905,43 @@ void fastboot_exec_cmd(struct fastboot *fb, const char *cmdbuf)
ARRAY_SIZE(cmd_dispatch_info));
}
+bool get_fastboot_bbu(void)
+{
+ return fastboot_bbu;
+}
+
+const char *get_fastboot_partitions(void)
+{
+ return fastboot_partitions;
+}
+
static int fastboot_globalvars_init(void)
{
if (IS_ENABLED(CONFIG_FASTBOOT_SPARSE))
- globalvar_add_simple_int("usbgadget.fastboot_max_download_size",
+ globalvar_add_simple_int("fastboot.max_download_size",
&fastboot_max_download_size, "%u");
+ globalvar_add_simple_bool("fastboot.bbu", &fastboot_bbu);
+ globalvar_add_simple_string("fastboot.partitions",
+ &fastboot_partitions);
+
+ globalvar_alias_deprecated("usbgadget.fastboot_function",
+ "fastboot.partitions");
+ globalvar_alias_deprecated("usbgadget.fastboot_bbu",
+ "fastboot.bbu");
+ globalvar_alias_deprecated("usbgadget.fastboot_max_download_size",
+ "fastboot.max_download_size");
return 0;
}
device_initcall(fastboot_globalvars_init);
-BAREBOX_MAGICVAR_NAMED(global_usbgadget_fastboot_max_download_size,
- global.usbgadget.fastboot_max_download_size,
+BAREBOX_MAGICVAR_NAMED(global_fastboot_max_download_size,
+ global.fastboot.max_download_size,
"Fastboot maximum download size");
+BAREBOX_MAGICVAR_NAMED(global_fastboot_partitions,
+ global.fastboot.partitions,
+ "Partitions exported for update via fastboot");
+BAREBOX_MAGICVAR_NAMED(global_fastboot_bbu,
+ global.fastboot.bbu,
+ "Export barebox update handlers via fastboot");