stm32mp15-fw-config.dtsi 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
  2. /*
  3. * Copyright (c) 2021-2024, 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 secure memory: located at DDR top */
  14. #define DDR_SEC_SIZE STM32MP_DDR_S_SIZE
  15. #define DDR_SEC_BASE (STM32MP_DDR_BASE + (DDR_SIZE - DDR_SEC_SIZE))
  16. #define DDR_NS_SIZE (DDR_SEC_BASE - DDR_NS_BASE)
  17. #else /* !AARCH32_SP_OPTEE */
  18. #define DDR_NS_SIZE DDR_SIZE
  19. #endif /* AARCH32_SP_OPTEE */
  20. /dts-v1/;
  21. / {
  22. dtb-registry {
  23. compatible = "fconf,dyn_cfg-dtb_registry";
  24. hw-config {
  25. load-address = <0x0 STM32MP_HW_CONFIG_BASE>;
  26. max-size = <STM32MP_HW_CONFIG_MAX_SIZE>;
  27. id = <HW_CONFIG_ID>;
  28. };
  29. nt_fw {
  30. load-address = <0x0 STM32MP_BL33_BASE>;
  31. max-size = <STM32MP_BL33_MAX_SIZE>;
  32. id = <BL33_IMAGE_ID>;
  33. };
  34. #ifdef AARCH32_SP_OPTEE
  35. tos_fw {
  36. load-address = <0x0 STM32MP_OPTEE_BASE>;
  37. max-size = <STM32MP_OPTEE_SIZE>;
  38. id = <BL32_IMAGE_ID>;
  39. };
  40. #else
  41. tos_fw {
  42. load-address = <0x0 STM32MP_BL32_BASE>;
  43. max-size = <STM32MP_BL32_SIZE>;
  44. id = <BL32_IMAGE_ID>;
  45. };
  46. tos_fw-config {
  47. load-address = <0x0 STM32MP_BL32_DTB_BASE>;
  48. max-size = <STM32MP_BL32_DTB_SIZE>;
  49. id = <TOS_FW_CONFIG_ID>;
  50. };
  51. #endif
  52. };
  53. st-mem-firewall {
  54. compatible = "st,mem-firewall";
  55. #ifdef AARCH32_SP_OPTEE
  56. memory-ranges = <
  57. DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR
  58. DDR_SEC_BASE DDR_SEC_SIZE TZC_REGION_S_RDWR 0
  59. >;
  60. #else
  61. memory-ranges = <
  62. DDR_NS_BASE DDR_NS_SIZE TZC_REGION_S_NONE TZC_REGION_NSEC_ALL_ACCESS_RDWR>;
  63. #endif
  64. };
  65. };