soc_image_head.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2021 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief Actions LEOPARD family boot related infomation public interfaces.
  9. */
  10. #include <kernel.h>
  11. #include <device.h>
  12. #include <string.h>
  13. #include "soc_boot.h"
  14. #include <linker/linker-defs.h>
  15. #define IMAGE_MAGIC0 0x48544341
  16. #define IMAGE_MAGIC1 0x41435448
  17. typedef struct image_head {
  18. uint32_t ih_magic0;
  19. uint32_t ih_magic1; //
  20. uint32_t ih_load_addr; /*load addr, include header*/
  21. uint8_t ih_name[8]; //
  22. uint32_t ih_entry;
  23. uint32_t ih_img_size;
  24. uint32_t ih_img_chksum; /*if not sign, use check sum��ih_img_size not include header */
  25. uint32_t ih_hdr_chksum; /* include header. */
  26. uint16_t ih_hdr_size; /* Size of image header (bytes). */
  27. uint16_t ih_ptlv_size; /* Size of protected TLV area (bytes). */
  28. uint16_t ih_tlv_size; /*tlv size*/
  29. uint16_t ih_version;
  30. uint32_t ih_flags;
  31. uint8_t ih_ext_ictype[7];
  32. uint8_t ih_storage_type; // mbrec
  33. }image_head_t;
  34. #if (CONFIG_ROM_START_OFFSET == 0)
  35. const image_head_t app_head __in_section_unique(img_head) =
  36. {
  37. .ih_magic0 = IMAGE_MAGIC0,
  38. .ih_magic1 = IMAGE_MAGIC1,
  39. .ih_load_addr = 0,
  40. .ih_name = "app",
  41. .ih_entry = 0,
  42. .ih_img_size = 0,
  43. .ih_img_chksum = 0,
  44. .ih_hdr_chksum = 0,
  45. .ih_hdr_size = sizeof(app_head),
  46. .ih_ptlv_size = 0,
  47. .ih_tlv_size = 0,
  48. .ih_version = 0x1001,
  49. .ih_flags = 0,
  50. .ih_ext_ictype = {0,0,0,0,0,0,0},
  51. .ih_storage_type = 0,
  52. };
  53. #endif