stm32mp2.ld.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) 2023, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef STM32MP2_LD_S
  7. #define STM32MP2_LD_S
  8. #include <lib/xlat_tables/xlat_tables_defs.h>
  9. #include <platform_def.h>
  10. OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
  11. OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
  12. ENTRY(__BL2_IMAGE_START__)
  13. MEMORY {
  14. HEADER (rw) : ORIGIN = 0x00000000, LENGTH = STM32MP_HEADER_RESERVED_SIZE
  15. RAM (rwx) : ORIGIN = STM32MP_BINARY_BASE, LENGTH = STM32MP_BINARY_SIZE
  16. }
  17. SECTIONS
  18. {
  19. /*
  20. * TF mapping must conform to ROM code specification.
  21. */
  22. .header : {
  23. __HEADER_START__ = .;
  24. KEEP(*(.header))
  25. . = ALIGN(4);
  26. __HEADER_END__ = .;
  27. } >HEADER
  28. . = STM32MP_BINARY_BASE;
  29. .data . : {
  30. . = ALIGN(PAGE_SIZE);
  31. __DATA_START__ = .;
  32. *(.data*)
  33. /*
  34. * dtb.
  35. * The strongest and only alignment contraint is MMU 4K page.
  36. * Indeed as images below will be removed, 4K pages will be re-used.
  37. */
  38. . = ( STM32MP_BL2_DTB_BASE - STM32MP_BINARY_BASE );
  39. __DTB_IMAGE_START__ = .;
  40. *(.dtb_image*)
  41. __DTB_IMAGE_END__ = .;
  42. /*
  43. * bl2.
  44. * The strongest and only alignment contraint is MMU 4K page.
  45. * Indeed as images below will be removed, 4K pages will be re-used.
  46. */
  47. #if SEPARATE_CODE_AND_RODATA
  48. . = ( STM32MP_BL2_RO_BASE - STM32MP_BINARY_BASE );
  49. #else
  50. . = ( STM32MP_BL2_BASE - STM32MP_BINARY_BASE );
  51. #endif
  52. __BL2_IMAGE_START__ = .;
  53. *(.bl2_image*)
  54. __BL2_IMAGE_END__ = .;
  55. __DATA_END__ = .;
  56. } >RAM
  57. __TF_END__ = .;
  58. }
  59. #endif /* STM32MP2_LD_S */