ethosn_big_fw.h 828 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2023, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <stdbool.h>
  7. #include <stdint.h>
  8. /*
  9. * Big FW binary structure.
  10. * Must be kept in sync with the Arm(R) Ethos(TM)-N NPU firmware binary layout.
  11. */
  12. struct ethosn_big_fw {
  13. uint32_t fw_magic;
  14. uint32_t fw_ver_major;
  15. uint32_t fw_ver_minor;
  16. uint32_t fw_ver_patch;
  17. uint32_t arch_min;
  18. uint32_t arch_max;
  19. uint32_t offset;
  20. uint32_t size;
  21. uint32_t code_offset;
  22. uint32_t code_size;
  23. uint32_t ple_offset;
  24. uint32_t ple_size;
  25. uint32_t vector_table_offset;
  26. uint32_t vector_table_size;
  27. uint32_t unpriv_stack_offset;
  28. uint32_t unpriv_stack_size;
  29. uint32_t priv_stack_offset;
  30. uint32_t priv_stack_size;
  31. } __packed;
  32. bool ethosn_big_fw_verify_header(const struct ethosn_big_fw *big_fw,
  33. uint32_t npu_arch_ver);