zynq_bootimg.h 871 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2018 Xilinx, Inc.
  4. */
  5. #ifndef _ZYNQ_BOOTIMG_H_
  6. #define _ZYNQ_BOOTIMG_H_
  7. #define ZYNQ_MAX_PARTITION_NUMBER 0xE
  8. struct partition_hdr {
  9. u32 imagewordlen; /* 0x0 */
  10. u32 datawordlen; /* 0x4 */
  11. u32 partitionwordlen; /* 0x8 */
  12. u32 loadaddr; /* 0xC */
  13. u32 execaddr; /* 0x10 */
  14. u32 partitionstart; /* 0x14 */
  15. u32 partitionattr; /* 0x18 */
  16. u32 sectioncount; /* 0x1C */
  17. u32 checksumoffset; /* 0x20 */
  18. u32 pads1[1];
  19. u32 acoffset; /* 0x28 */
  20. u32 pads2[4];
  21. u32 checksum; /* 0x3C */
  22. };
  23. int zynq_get_part_count(struct partition_hdr *part_hdr_info);
  24. int zynq_get_partition_info(u32 image_base_addr, u32 *fsbl_len,
  25. struct partition_hdr *part_hdr);
  26. int zynq_validate_hdr(struct partition_hdr *header);
  27. int zynq_validate_partition(u32 start_addr, u32 len, u32 chksum_off);
  28. #endif /* _ZYNQ_BOOTIMG_H_ */