bootloader_init.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include "esp_err.h"
  8. #include "esp_image_format.h"
  9. /**@{*/
  10. /**
  11. * @brief labels from bootloader linker script: bootloader.ld
  12. *
  13. */
  14. extern int _bss_start;
  15. extern int _bss_end;
  16. extern int _data_start;
  17. extern int _data_end;
  18. /**@}*/
  19. /**
  20. * @brief bootloader image header
  21. *
  22. */
  23. extern esp_image_header_t bootloader_image_hdr;
  24. /**@{*/
  25. /**
  26. * @brief Common initialization steps that are applied to all targets.
  27. *
  28. */
  29. esp_err_t bootloader_read_bootloader_header(void);
  30. esp_err_t bootloader_check_bootloader_validity(void);
  31. void bootloader_clear_bss_section(void);
  32. void bootloader_config_wdt(void);
  33. void bootloader_enable_random(void);
  34. void bootloader_print_banner(void);
  35. /**@}*/
  36. /* @brief Prepares hardware for work.
  37. *
  38. * Setting up:
  39. * - Disable Cache access for both CPUs;
  40. * - Initialise cache mmu;
  41. * - Setting up pins and mode for SD, SPI, UART, Clocking.
  42. * @return ESP_OK - If the setting is successful.
  43. * ESP_FAIL - If the setting is not successful.
  44. */
  45. esp_err_t bootloader_init(void);