plat.ld.S 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ROCKCHIP_PLAT_LD_S
  7. #define ROCKCHIP_PLAT_LD_S
  8. #include <lib/xlat_tables/xlat_tables_defs.h>
  9. MEMORY {
  10. SRAM (rwx): ORIGIN = SRAM_BASE, LENGTH = SRAM_SIZE
  11. PMUSRAM (rwx): ORIGIN = PMUSRAM_BASE, LENGTH = PMUSRAM_RSIZE
  12. }
  13. SECTIONS
  14. {
  15. . = SRAM_BASE;
  16. ASSERT(. == ALIGN(PAGE_SIZE),
  17. "SRAM_BASE address is not aligned on a page boundary.")
  18. /*
  19. * The SRAM space allocation for RK3399
  20. * ----------------
  21. * | m0 code bin
  22. * ----------------
  23. * | sram text
  24. * ----------------
  25. * | sram data
  26. * ----------------
  27. */
  28. .incbin_sram : ALIGN(PAGE_SIZE) {
  29. __sram_incbin_start = .;
  30. *(.sram.incbin)
  31. __sram_incbin_real_end = .;
  32. . = ALIGN(PAGE_SIZE);
  33. __sram_incbin_end = .;
  34. } >SRAM
  35. ASSERT((__sram_incbin_real_end - __sram_incbin_start) <=
  36. SRAM_BIN_LIMIT, ".incbin_sram has exceeded its limit")
  37. .text_sram : ALIGN(PAGE_SIZE) {
  38. __bl31_sram_text_start = .;
  39. *(.sram.text)
  40. *(.sram.rodata)
  41. __bl31_sram_text_real_end = .;
  42. . = ALIGN(PAGE_SIZE);
  43. __bl31_sram_text_end = .;
  44. } >SRAM
  45. ASSERT((__bl31_sram_text_real_end - __bl31_sram_text_start) <=
  46. SRAM_TEXT_LIMIT, ".text_sram has exceeded its limit")
  47. .data_sram : ALIGN(PAGE_SIZE) {
  48. __bl31_sram_data_start = .;
  49. *(.sram.data)
  50. __bl31_sram_data_real_end = .;
  51. . = ALIGN(PAGE_SIZE);
  52. __bl31_sram_data_end = .;
  53. } >SRAM
  54. ASSERT((__bl31_sram_data_real_end - __bl31_sram_data_start) <=
  55. SRAM_DATA_LIMIT, ".data_sram has exceeded its limit")
  56. .stack_sram : ALIGN(PAGE_SIZE) {
  57. __bl31_sram_stack_start = .;
  58. . += PAGE_SIZE;
  59. __bl31_sram_stack_end = .;
  60. } >SRAM
  61. . = PMUSRAM_BASE;
  62. /*
  63. * pmu_cpuson_entrypoint request address
  64. * align 64K when resume, so put it in the
  65. * start of pmusram
  66. */
  67. .pmusram : {
  68. ASSERT(. == ALIGN(64 * 1024),
  69. ".pmusram.entry request 64K aligned.");
  70. *(.pmusram.entry)
  71. __bl31_pmusram_text_start = .;
  72. *(.pmusram.text)
  73. *(.pmusram.rodata)
  74. __bl31_pmusram_text_end = .;
  75. /* M0 start address request 4K align */
  76. . = ALIGN(4096);
  77. __pmusram_incbin_start = .;
  78. *(.pmusram.incbin)
  79. __pmusram_incbin_end = .;
  80. __bl31_pmusram_data_start = .;
  81. *(.pmusram.data)
  82. __bl31_pmusram_data_end = .;
  83. } >PMUSRAM
  84. }
  85. #endif /* ROCKCHIP_PLAT_LD_S */