plat_marvell.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright (C) 2016 Marvell International Ltd.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. * https://spdx.org/licenses
  6. */
  7. #ifndef PLAT_MARVELL_H
  8. #define PLAT_MARVELL_H
  9. #include <stdint.h>
  10. #include <common/bl_common.h>
  11. #include <lib/cassert.h>
  12. #include <lib/el3_runtime/cpu_data.h>
  13. #include <lib/xlat_tables/xlat_tables_v2.h>
  14. /*
  15. * Extern declarations common to Marvell standard platforms
  16. */
  17. extern const mmap_region_t plat_marvell_mmap[];
  18. #define MARVELL_CASSERT_MMAP \
  19. CASSERT((ARRAY_SIZE(plat_marvell_mmap) + MARVELL_BL_REGIONS) \
  20. <= MAX_MMAP_REGIONS, \
  21. assert_max_mmap_regions)
  22. /*
  23. * Utility functions common to Marvell standard platforms
  24. */
  25. void marvell_setup_page_tables(uintptr_t total_base,
  26. size_t total_size,
  27. uintptr_t code_start,
  28. uintptr_t code_limit,
  29. uintptr_t rodata_start,
  30. uintptr_t rodata_limit
  31. #if USE_COHERENT_MEM
  32. , uintptr_t coh_start,
  33. uintptr_t coh_limit
  34. #endif
  35. );
  36. /* Console utility functions */
  37. void marvell_console_boot_init(void);
  38. void marvell_console_boot_end(void);
  39. void marvell_console_runtime_init(void);
  40. void marvell_console_runtime_end(void);
  41. /* IO storage utility functions */
  42. void marvell_io_setup(void);
  43. /* Systimer utility function */
  44. void marvell_configure_sys_timer(void);
  45. /* Topology utility function */
  46. int marvell_check_mpidr(u_register_t mpidr);
  47. /* BL1 utility functions */
  48. void marvell_bl1_early_platform_setup(void);
  49. void marvell_bl1_platform_setup(void);
  50. void marvell_bl1_plat_arch_setup(void);
  51. /* BL2 utility functions */
  52. void marvell_bl2_early_platform_setup(meminfo_t *mem_layout);
  53. void marvell_bl2_platform_setup(void);
  54. void marvell_bl2_plat_arch_setup(void);
  55. uint32_t marvell_get_spsr_for_bl32_entry(void);
  56. uint32_t marvell_get_spsr_for_bl33_entry(void);
  57. /* BL31 utility functions */
  58. void marvell_bl31_early_platform_setup(void *from_bl2,
  59. uintptr_t soc_fw_config,
  60. uintptr_t hw_config,
  61. void *plat_params_from_bl2);
  62. void marvell_bl31_platform_setup(void);
  63. void marvell_bl31_plat_runtime_setup(void);
  64. void marvell_bl31_plat_arch_setup(void);
  65. /* FIP TOC validity check */
  66. int marvell_io_is_toc_valid(void);
  67. /*
  68. * PSCI functionality
  69. */
  70. void marvell_psci_arch_init(int idx);
  71. void plat_marvell_system_reset(void);
  72. /*
  73. * Optional functions required in Marvell standard platforms
  74. */
  75. void plat_marvell_io_setup(void);
  76. int plat_marvell_get_alt_image_source(
  77. unsigned int image_id,
  78. uintptr_t *dev_handle,
  79. uintptr_t *image_spec);
  80. unsigned int plat_marvell_calc_core_pos(u_register_t mpidr);
  81. void plat_marvell_interconnect_init(void);
  82. void plat_marvell_interconnect_enter_coherency(void);
  83. const mmap_region_t *plat_marvell_get_mmap(void);
  84. uint32_t get_ref_clk(void);
  85. #endif /* PLAT_MARVELL_H */