rom_export.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*!
  2. \file rom_export.h
  3. \brief Rom export file for GD32VW55x SDK
  4. \version 2023-07-20, V1.0.0, firmware for GD32VW55x
  5. */
  6. /*
  7. Copyright (c) 2023, GigaDevice Semiconductor Inc.
  8. Redistribution and use in source and binary forms, with or without modification,
  9. are permitted provided that the following conditions are met:
  10. 1. Redistributions of source code must retain the above copyright notice, this
  11. list of conditions and the following disclaimer.
  12. 2. Redistributions in binary form must reproduce the above copyright notice,
  13. this list of conditions and the following disclaimer in the documentation
  14. and/or other materials provided with the distribution.
  15. 3. Neither the name of the copyright holder nor the names of its contributors
  16. may be used to endorse or promote products derived from this software without
  17. specific prior written permission.
  18. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  19. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  22. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  24. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  25. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  26. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  27. OF SUCH DAMAGE.
  28. */
  29. #ifndef __ROM_EXPORT_H
  30. #define __ROM_EXPORT_H
  31. #define V_1_0 0x100
  32. #define V_1_1 0x101
  33. #define V_1_2 0x102
  34. #define V_2_1 0x201
  35. #include "stdint.h"
  36. #include "stddef.h"
  37. #include "rom_trace.h"
  38. #include "rom_region.h"
  39. #include "rom_image.h"
  40. #include "rom_sys.h"
  41. #include "rom_ibl_state.h"
  42. #include "rom_api.h"
  43. extern struct rom_api_t *p_rom_api;
  44. #define rom_printf p_rom_api->printf
  45. #define rom_trace_ex p_rom_api->trace_ex
  46. #define rom_rand p_rom_api->rand
  47. #define rom_hardware_poll p_rom_api->hardware_poll
  48. #define rom_cal_checksum p_rom_api->cal_checksum
  49. #define rom_img_verify_sign p_rom_api->img_verify_sign
  50. #define rom_img_verify_hash p_rom_api->img_verify_digest
  51. #define rom_img_verify_hdr p_rom_api->img_verify_hdr
  52. #define rom_img_verify_pkhash p_rom_api->img_verify_pkhash
  53. #define rom_img_validate p_rom_api->img_validate
  54. #define rom_cert_img_validate p_rom_api->cert_img_validate
  55. #define rom_sys_setting_get p_rom_api->sys_setting_get
  56. #define rom_sys_status_set p_rom_api->sys_status_set
  57. #define rom_sys_status_get p_rom_api->sys_status_get
  58. #define rom_sys_set_trace_level p_rom_api->sys_set_trace_level
  59. #define rom_sys_set_err_process p_rom_api->sys_set_err_process
  60. #define rom_sys_set_img_flag p_rom_api->sys_set_img_flag
  61. #define rom_sys_reset_img_flag p_rom_api->sys_reset_img_flag
  62. #define rom_sys_set_running_img p_rom_api->sys_set_running_img
  63. #define rom_sys_set_fw_ver p_rom_api->sys_set_fw_version
  64. #define rom_sys_set_pk_ver p_rom_api->sys_set_pk_version
  65. #define rom_flash_read p_rom_api->flash_read
  66. #define rom_flash_write p_rom_api->flash_write
  67. #define rom_flash_erase p_rom_api->flash_erase
  68. #define rom_efuse_get_rotpkh p_rom_api->efuse_get_rotpkh
  69. #define rom_do_symm_key_derive p_rom_api->do_symm_key_derive
  70. #define rom_sys_status_check p_rom_api->sys_status_check
  71. #define rom_log_uart_set p_rom_api->log_uart_set
  72. #define rom_digest_haudma_en p_rom_api->digest_haudma_en
  73. #endif // __ROM_EXPORT_H