qtiseclib_interface.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef QTISECLIB_INTERFACE_H
  7. #define QTISECLIB_INTERFACE_H
  8. #include <stdbool.h>
  9. #include <stdint.h>
  10. #include <qtiseclib_defs.h>
  11. typedef struct memprot_ipa_info_s {
  12. uint64_t mem_addr;
  13. uint64_t mem_size;
  14. } memprot_info_t;
  15. typedef struct memprot_dst_vm_perm_info_s {
  16. uint32_t dst_vm;
  17. uint32_t dst_vm_perm;
  18. uint64_t ctx;
  19. uint32_t ctx_size;
  20. } memprot_dst_vm_perm_info_t;
  21. /*
  22. * QTISECLIB Published API's.
  23. */
  24. /*
  25. * Assembly API's
  26. */
  27. /*
  28. * CPUSS common reset handler for all CPU wake up (both cold & warm boot).
  29. * Executes on all core. This API assume serialization across CPU
  30. * already taken care before invoking.
  31. *
  32. * Clobbers: x0 - x17, x30
  33. */
  34. void qtiseclib_cpuss_reset_asm(uint32_t bl31_cold_boot_state);
  35. /*
  36. * Execute CPU (Kryo4 gold) specific reset handler / system initialization.
  37. * This takes care of executing required CPU errata's.
  38. *
  39. * Clobbers: x0 - x16
  40. */
  41. void qtiseclib_kryo4_gold_reset_asm(void);
  42. /*
  43. * Execute CPU (Kryo46 gold) specific reset handler / system initialization.
  44. * This takes care of executing required CPU errata's.
  45. *
  46. * Clobbers: x0 - x16
  47. */
  48. void qtiseclib_kryo6_gold_reset_asm(void);
  49. /*
  50. * Execute CPU (Kryo4 silver) specific reset handler / system initialization.
  51. * This takes care of executing required CPU errata's.
  52. *
  53. * Clobbers: x0 - x16
  54. */
  55. void qtiseclib_kryo4_silver_reset_asm(void);
  56. /*
  57. * Execute CPU (Kryo6 silver) specific reset handler / system initialization.
  58. * This takes care of executing required CPU errata's.
  59. *
  60. * Clobbers: x0 - x16
  61. */
  62. void qtiseclib_kryo6_silver_reset_asm(void);
  63. /*
  64. * C Api's
  65. */
  66. void qtiseclib_bl31_platform_setup(void);
  67. void qtiseclib_invoke_isr(uint32_t irq, void *handle);
  68. void qtiseclib_panic(void);
  69. int qtiseclib_mem_assign(const memprot_info_t *mem_info,
  70. uint32_t mem_info_list_cnt,
  71. const uint32_t *source_vm_list,
  72. uint32_t src_vm_list_cnt,
  73. const memprot_dst_vm_perm_info_t *dest_vm_list,
  74. uint32_t dst_vm_list_cnt);
  75. int qtiseclib_psci_init(uintptr_t warmboot_entry);
  76. int qtiseclib_psci_node_power_on(u_register_t mpidr);
  77. void qtiseclib_psci_node_on_finish(const uint8_t *states);
  78. void qtiseclib_psci_cpu_standby(uint8_t pwr_state);
  79. void qtiseclib_psci_node_power_off(const uint8_t *states);
  80. void qtiseclib_psci_node_suspend(const uint8_t *states);
  81. void qtiseclib_psci_node_suspend_finish(const uint8_t *states);
  82. void qtiseclib_disable_cluster_coherency(uint8_t state);
  83. #endif /* QTISECLIB_INTERFACE_H */