morello_plat.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2020-2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <drivers/arm/css/sds.h>
  8. #include <drivers/arm/sbsa.h>
  9. #include <lib/utils_def.h>
  10. #include <plat/arm/common/plat_arm.h>
  11. #include "morello_def.h"
  12. /*
  13. * Table of regions to map using the MMU.
  14. * Replace or extend the below regions as required
  15. */
  16. #if IMAGE_BL1
  17. const mmap_region_t plat_arm_mmap[] = {
  18. ARM_MAP_SHARED_RAM,
  19. MORELLO_MAP_DEVICE,
  20. MORELLO_MAP_NS_SRAM,
  21. ARM_MAP_DRAM1,
  22. ARM_MAP_DRAM2,
  23. {0}
  24. };
  25. #endif
  26. #if IMAGE_BL31
  27. const mmap_region_t plat_arm_mmap[] = {
  28. ARM_MAP_SHARED_RAM,
  29. MORELLO_MAP_DEVICE,
  30. MORELLO_MAP_NS_SRAM,
  31. {0}
  32. };
  33. #endif
  34. #if IMAGE_BL2
  35. const mmap_region_t plat_arm_mmap[] = {
  36. ARM_MAP_SHARED_RAM,
  37. MORELLO_MAP_DEVICE,
  38. MORELLO_MAP_NS_SRAM,
  39. ARM_MAP_DRAM1,
  40. ARM_MAP_DRAM2,
  41. #if TRUSTED_BOARD_BOOT && !RESET_TO_BL2
  42. ARM_MAP_BL1_RW,
  43. #endif
  44. {0}
  45. };
  46. #endif
  47. #if TRUSTED_BOARD_BOOT
  48. int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
  49. {
  50. assert(heap_addr != NULL);
  51. assert(heap_size != NULL);
  52. return arm_get_mbedtls_heap(heap_addr, heap_size);
  53. }
  54. #endif
  55. void plat_arm_secure_wdt_start(void)
  56. {
  57. sbsa_wdog_start(SBSA_SECURE_WDOG_BASE, SBSA_SECURE_WDOG_TIMEOUT);
  58. }
  59. void plat_arm_secure_wdt_stop(void)
  60. {
  61. sbsa_wdog_stop(SBSA_SECURE_WDOG_BASE);
  62. }
  63. #if CSS_USE_SCMI_SDS_DRIVER
  64. static sds_region_desc_t morello_sds_regions[] = {
  65. { .base = PLAT_ARM_SDS_MEM_BASE },
  66. };
  67. sds_region_desc_t *plat_sds_get_regions(unsigned int *region_count)
  68. {
  69. *region_count = ARRAY_SIZE(morello_sds_regions);
  70. return morello_sds_regions;
  71. }
  72. #endif /* CSS_USE_SCMI_SDS_DRIVER */