stm32mp15-fw-config.dtsi 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
  2. /*
  3. * Copyright (c) 2021-2022, STMicroelectronics - All Rights Reserved
  4. */
  5. #include <common/tbbr/tbbr_img_def.h>
  6. #include <dt-bindings/soc/stm32mp15-tzc400.h>
  7. #include <platform_def.h>
  8. #ifndef DDR_SIZE
  9. #error "DDR_SIZE is not defined"
  10. #endif
  11. #define DDR_NS_BASE STM32MP_DDR_BASE
  12. #ifdef AARCH32_SP_OPTEE
  13. /* OP-TEE reserved shared memory: located at DDR top or null size */
  14. #define DDR_SHARE_SIZE STM32MP_DDR_SHMEM_SIZE
  15. #define DDR_SHARE_BASE (STM32MP_DDR_BASE + (DDR_SIZE - DDR_SHARE_SIZE))
  16. /* OP-TEE secure memory: located right below OP-TEE reserved shared memory */
  17. #define DDR_SEC_SIZE STM32MP_DDR_S_SIZE
  18. #define DDR_SEC_BASE (DDR_SHARE_BASE - DDR_SEC_SIZE)
  19. #define DDR_NS_SIZE (DDR_SEC_BASE - DDR_NS_BASE)
  20. #else /* !AARCH32_SP_OPTEE */
  21. #define DDR_NS_SIZE DDR_SIZE
  22. #endif /* AARCH32_SP_OPTEE */
  23. /dts-v1/;
  24. / {
  25. dtb-registry {
  26. compatible = "fconf,dyn_cfg-dtb_registry";
  27. hw-config {
  28. load-address = <0x0 STM32MP_HW_CONFIG_BASE>;
  29. max-size = <STM32MP_HW_CONFIG_MAX_SIZE>;
  30. id = <HW_CONFIG_ID>;
  31. };
  32. nt_fw {
  33. load-address = <0x0 STM32MP_BL33_BASE>;
  34. max-size = <STM32MP_BL33_MAX_SIZE>;
  35. id = <BL33_IMAGE_ID>;
  36. };
  37. #ifdef AARCH32_SP_OPTEE
  38. tos_fw {
  39. load-address = <0x0 STM32MP_OPTEE_BASE>;
  40. max-size = <STM32MP_OPTEE_SIZE>;
  41. id = <BL32_IMAGE_ID>;
  42. };
  43. #else
  44. tos_fw {
  45. load-address = <0x0 STM32MP_BL32_BASE>;
  46. max-size = <STM32MP_BL32_SIZE>;
  47. id = <BL32_IMAGE_ID>;
  48. };
  49. tos_fw-config {
  50. load-address = <0x0 STM32MP_BL32_DTB_BASE>;
  51. max-size = <STM32MP_BL32_DTB_SIZE>;
  52. id = <TOS_FW_CONFIG_ID>;
  53. };
  54. #endif
  55. };
  56. st-mem-firewall {
  57. compatible = "st,mem-firewall";
  58. #ifdef AARCH32_SP_OPTEE
  59. memory-ranges = <
  60. DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR
  61. DDR_SEC_BASE DDR_SEC_SIZE TZC_REGION_S_RDWR 0
  62. #if STM32MP15_OPTEE_RSV_SHM
  63. DDR_SHARE_BASE DDR_SHARE_SIZE TZC_REGION_S_NONE
  64. TZC_REGION_ACCESS_RDWR(STM32MP1_TZC_A7_ID)
  65. #endif
  66. >;
  67. #else
  68. memory-ranges = <
  69. DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR>;
  70. #endif
  71. };
  72. };