Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/37072 )
Change subject: WIP: Add preliminary network update functionality ......................................................................
WIP: Add preliminary network update functionality
DO NOT MERGE. Incomplete. Only for your amusement.
Update chip database and firmware images over the network.
Change-Id: I5c378754da4ce06b63f317eb22fa237d7a616fd8 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M Makefile M em100.c M em100.h M tar.c 4 files changed, 13 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/72/37072/1
diff --git a/Makefile b/Makefile index ef1bd01..c4c33b4 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@
XZ = xz/xz_crc32.c xz/xz_crc64.c xz/xz_dec_bcj.c xz/xz_dec_lzma2.c xz/xz_dec_stream.c SOURCES = em100.c firmware.c fpga.c hexdump.c sdram.c spi.c system.c trace.c usb.c -SOURCES += tar.c $(XZ) +SOURCES += curl.c tar.c $(XZ)
OBJECTS = $(SOURCES:.c=.o)
diff --git a/em100.c b/em100.c index d075711..30a518c 100644 --- a/em100.c +++ b/em100.c @@ -690,6 +690,7 @@ {"firmware-write", 1, 0, 'g'}, {"device", 1, 0, 'x'}, {"list-devices", 0, 0, 'l'}, + {"update-files", 0, 0, 'U'}, {"terminal",0 ,0, 'T'}, {NULL, 0, 0, 0} }; @@ -718,6 +719,7 @@ " -x|--device BUS:DEV use EM100pro on USB bus/device\n" " -x|--device DPxxxxxx use EM100pro with serial no DPxxxxxx\n" " -l|--list-devices list all connected EM100pro devices\n" + " -U|--update-files update device (chip) and firmware database\n" " -D|--debug: print debug information.\n" " -h|--help: this help text\n\n", name); @@ -742,9 +744,7 @@ unsigned long spi_start_address = 0; const char *voltage = NULL;
- test_tar(); - - while ((opt = getopt_long(argc, argv, "c:d:a:u:rsvtO:F:f:g:S:V:p:Dx:lhT", + while ((opt = getopt_long(argc, argv, "c:d:a:u:rsvtO:F:f:g:S:V:p:Dx:lUhT", longopts, &idx)) != -1) { switch (opt) { case 'c': @@ -812,6 +812,9 @@ case 'l': em100_list(); return 0; + case 'U': + update_all_files(); + return 0; default: case 'h': usage(argv[0]); diff --git a/em100.h b/em100.h index 0f5d51d..dd01204 100644 --- a/em100.h +++ b/em100.h @@ -171,6 +171,10 @@ unsigned char *tar_load_compressed(char *filename, long *length); int test_tar(void);
+/* Network */ +void download(char *name, char *id); +int update_all_files(void); + /* Misc. */
#define MB * 1024 * 1024 diff --git a/tar.c b/tar.c index 23e4486..aceaf29 100644 --- a/tar.c +++ b/tar.c @@ -235,6 +235,7 @@ return fw; }
+#if 0 int test_tar(void) { int ret; @@ -270,4 +271,4 @@ free(fw); return 0; } - +#endif