xtload-api.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Customer ID=11656; Build=0x5f626; Copyright (c) 2003-2012 Tensilica Inc. ALL RIGHTS RESERVED.
  2. These coded instructions, statements, and computer programs are the
  3. copyrighted works and confidential proprietary information of Tensilica Inc.
  4. They may not be modified, copied, reproduced, distributed, or disclosed to
  5. third parties in any manner, medium, or form, in whole or in part, without
  6. the prior written consent of Tensilica Inc. */
  7. #ifndef _XTLOAD_API_H
  8. #define _XTLOAD_API_H
  9. #include <stdint.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #define XTENSA_BYTES_PER_WORD 4
  14. #define XLOAD_ALL_CORES -1
  15. typedef int core_number_t;
  16. typedef uint32_t xtload_address_t;
  17. typedef uint32_t xtload_word_count_t;
  18. typedef uint32_t * xtload_word_ptr_t;
  19. /* These functions correspond one-to-one with xt-load script
  20. commands. See the documentation for xt-load for their usage.
  21. There are however, several higher-level script commands--such as
  22. load-elf-file--which don't have direct analogues here. These
  23. "missing" commands are essentially just macros that result in
  24. several of these commands below. Note that you can execute several
  25. of these commands, then the results of a script, or vice-versa.
  26. */
  27. void xtload_bootloader_wake (void);
  28. void xtload_bootloader_sleep (void);
  29. void xtload_bootloader_done (void);
  30. void xtload_bootloader_not_done (void);
  31. void xtload_reset_and_cont (core_number_t core);
  32. void xtload_stall_and_reset (core_number_t core);
  33. #define xtload_reset_and_stall xtload_stall_and_reset
  34. void xtload_stall_and_target (core_number_t core);
  35. void xtload_ignore_and_stall (core_number_t core);
  36. void xtload_ignore_and_cont (core_number_t core);
  37. #define xtload_ignore_and_continue xtload_ignore_and_cont
  38. void xtload_read_words (xtload_address_t addr, xtload_word_count_t count);
  39. void xtload_zero_words (xtload_address_t addr, xtload_word_count_t count);
  40. void xtload_write_words (int swap, xtload_address_t addr,
  41. xtload_word_ptr_t ptr, xtload_word_count_t count);
  42. void xtload_setup_write_words (xtload_address_t addr, xtload_word_count_t count);
  43. void xtload_read_register (core_number_t core);
  44. /* *I M P O R T A N T*
  45. The bootloader API calls this function whenever it outputs a word
  46. to the bootloader hardware chain.
  47. Because the API has no information about how the bootloader
  48. hardware is connected to the host hardware, the user must
  49. implement this function to write a word to the bootloader's register.
  50. A user's implementation might write the bytes to an Xtensa queue or
  51. to a memory-mapped register.
  52. For example, xt-load uses this API just like any other client. Its
  53. implementation of this function simply writes this word to an
  54. output file.
  55. */
  56. void xtload_user_output_word (uint32_t word);
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* _XTLOAD_API_H */