Prepair flash_image for specifing device and hw revisions

This commit is contained in:
Pali Rohár committed 2012-06-23 13:05:46 +02:00
1 parent 1ddf269c69
commit b1cfc3181b
4 files changed
+7 -5

No files matched your search

+1 -1
View File
@@ -74,7 +74,7 @@ void check_nolo_order()
check_nolo_order_failed(); check_nolo_order_failed();
} }
void flash_image(const char *filename, const char *piece, const char *version) void flash_image(const char *filename, const char *piece, const char *device, const char *hwrevs, const char *version)
{ {
FILE *fd; FILE *fd;
int vlen = 0; int vlen = 0;
+4 -2
View File
@@ -146,9 +146,11 @@ int flash_callback(struct header_t *header)
return 1; return 1;
} }
type = header->type;
if (!type[0])
type = (char *)fpid_file(header->name); type = (char *)fpid_file(header->name);
printf("\nFlashing %s (%s)\n", header->name, type); printf("\nFlashing %s (%s)\n", header->name, type);
flash_image(header->name, type, NULL); flash_image(header->name, type, header->device, header->hwrevs, header->version);
return 0; return 0;
} }
@@ -447,7 +449,7 @@ int main(int argc, char **argv)
for(c=0;c<pcs_n;c++) { for(c=0;c<pcs_n;c++) {
printf("Flashing %s (%s)\n", pcs[c].type, pcs[c].name); printf("Flashing %s (%s)\n", pcs[c].type, pcs[c].name);
flash_image(pcs[c].name, pcs[c].type, pcs[c].vers); flash_image(pcs[c].name, pcs[c].type, pcs[c].device, pcs[c].hwrevs, pcs[c].version);
} }
} }
+1 -1
View File
@@ -15,7 +15,7 @@ struct devices;
int queue_mode(); int queue_mode();
int reverse_extract_pieces(char *dir); int reverse_extract_pieces(char *dir);
void flash_image(const char *filename, const char *piece, const char *version); void flash_image(const char *filename, const char *piece, const char *device, const char *hwrevs, const char *version);
int fiasco_read_image(char *file); int fiasco_read_image(char *file);
void check_nolo_order(); void check_nolo_order();
extern struct usb_dev_handle *dev; extern struct usb_dev_handle *dev;
+1 -1
View File
@@ -56,7 +56,7 @@ void process_message(char *msg)
const char *type = fpid_file(arg); const char *type = fpid_file(arg);
if (type == NULL) { if (type == NULL) {
squeue_push2(p, "error", "Unknown piece format", 1); squeue_push2(p, "error", "Unknown piece format", 1);
} else flash_image(arg, type, NULL); } else flash_image(arg, type, NULL, NULL, NULL);
} else } else
if (!strcmp(str, "reset")) { if (!strcmp(str, "reset")) {
if (reboot_board() == 0) { if (reboot_board() == 0) {