2
0

fwimg.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Common firmware image format
  3. */
  4. #ifndef FWIMG_H
  5. #define FWIMG_H
  6. #include <inttypes.h>
  7. /*
  8. * Firmware chunk header.
  9. */
  10. #define FW_MAGIC 0x7a07fbd6
  11. struct fw_header {
  12. uint32_t magic; /* Magic number */
  13. uint16_t type; /* Content type */
  14. uint16_t flags; /* Content flags */
  15. uint32_t len; /* Content length (excluding header) */
  16. uint32_t addr; /* Address or similar */
  17. };
  18. enum fw_data_type {
  19. FDT_END, /* End of stream */
  20. FDT_DATA, /* FPGA firmware ata to be flashed */
  21. FDT_TARGET, /* Subsystem string (must match) */
  22. FDT_NOTE, /* Version: XXXXX or similar */
  23. FDT_ESP_OTA, /* ESP32 OTA image */
  24. FDT_FPGA_INIT, /* FPGA bitstream for update */
  25. FDT_ESP_PART, /* ESP32 partition table */
  26. FDT_ESP_SYS, /* ESP32 boot loader, OTA control, etc */
  27. FDT_ESP_TOOL, /* esptool.py options for serial flashing */
  28. FDT_BOARDINFO /* Board information flash address */
  29. };
  30. enum fw_data_flags {
  31. FDF_OPTIONAL = 0x0001 /* Ignore if chunk data type unknown */
  32. };
  33. #endif /* FW_H */