vli-usbhub: Make erasing less verbose and writing more obvious
Richard Hughes
4 years ago
555 | 555 | GError **error) |
556 | 556 | { |
557 | 557 | g_autoptr(GPtrArray) chunks = fu_chunk_array_new (NULL, sz, addr, 0x0, 0x1000); |
558 | g_debug ("erasing 0x%x bytes @0x%x", (guint) sz, addr); | |
558 | 559 | for (guint i = 0; i < chunks->len; i++) { |
559 | 560 | FuChunk *chunk = g_ptr_array_index (chunks, i); |
560 | g_debug ("erasing @0x%x", chunk->address); | |
561 | if (g_getenv ("FWUPD_VLI_USBHUB_VERBOSE") != NULL) | |
562 | g_debug ("erasing @0x%x", chunk->address); | |
561 | 563 | if (!fu_vli_usbhub_device_erase_sector (self, chunk->address, error)) { |
562 | 564 | g_prefix_error (error, |
563 | 565 | "failed to erase FW sector @0x%x: ", |
1085 | 1087 | } |
1086 | 1088 | |
1087 | 1089 | /* write */ |
1090 | if (g_getenv ("FWUPD_VLI_USBHUB_VERBOSE") != NULL) | |
1091 | g_debug ("writing 0x%x block @0x%x", (guint) bufsz, address); | |
1088 | 1092 | if (!fu_vli_usbhub_device_spi_write_enable (self, error)) { |
1089 | 1093 | g_prefix_error (error, "enabling SPI write failed: "); |
1090 | 1094 | return FALSE; |
1114 | 1118 | g_autoptr(GPtrArray) chunks = NULL; |
1115 | 1119 | |
1116 | 1120 | /* write SPI data, then CRC bytes last */ |
1121 | g_debug ("writing 0x%x bytes @0x%x", (guint) bufsz, address); | |
1117 | 1122 | chunks = fu_chunk_array_new (buf, bufsz, 0x0, 0x0, FU_VLI_USBHUB_TXSIZE); |
1118 | 1123 | if (chunks->len > 1) { |
1119 | 1124 | for (guint i = 1; i < chunks->len; i++) { |