MPC5646C_FLASH.lcf 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* Internal FLASH linker command file for MPC5646C */
  2. /* */
  3. /* 3MB Flash, 256KB SRAM */
  4. /* */
  5. /* Intended to be used for the stationary example project. */
  6. /* This LCF should be used in single core projects. */
  7. /* */
  8. /* VERSION: 1.1 */
  9. MEMORY
  10. {
  11. /* FLASH: 0x00000000 - 0x0002FFFFF */
  12. /* Fixed location required for RCHW, program entry point and CSE array length */
  13. resetvector: org = 0x00000000, len = 0x00000010
  14. /* Contains initializations from __ppc_eabi_init.c,
  15. MPC56xx_HWInit.c, MPC56xx_init_*.c and the entry point (__startup).
  16. Should be 4K of since the system automatically creates a default TLB entry
  17. from the start of the entry point specified in RCHW.
  18. */
  19. init: org = 0x00000010, len = 0x00000FF0 /* 4K */
  20. /* 64K gap required to align the exception handlers.*/
  21. /* Contains interrupt branch tables for both z4 core and INTC module
  22. and the ISR handlers code. Note, the gap is required since the vector
  23. base address field of Z4 IVPR is defined within the range [0:15], the
  24. INTC branch tables must be loaded at an address aligned to 64K boundary.
  25. */
  26. exception_handlers_p0: org = 0x00010000, len = 0x0030000 /* 192K */
  27. /* Space allocated for user code and device initialization.
  28. ROM Image address should be set with the start address of this
  29. segment in order to instruct the runtime to initialize the
  30. static variables. All the section above are ignored for this action.
  31. Please see -romaddr linker option.*/
  32. internal_flash: org = 0x00040000, len = 0x002C0000 /* ~2800K */
  33. /* SRAM: 0x40000000 - 0x40003FFFF */
  34. internal_ram: org = 0x40000000, len = 0x00030000
  35. heap : org = 0x40030000, len = 0x00008000
  36. stack : org = 0x40038000, len = 0x00008000
  37. }
  38. /* This will ensure the rchw and reset vector are not stripped by the linker */
  39. FORCEACTIVE { "bam_rchw" "bam_resetvector"}
  40. SECTIONS
  41. {
  42. .__bam_bootarea LOAD (ADDR(resetvector)): {} > resetvector
  43. /* Section used for initialization code: __ppc_eabi_init.c,
  44. MPC56xx_HWInit.c, MPC56xx_init_*.c and the entry point (__startup).
  45. */
  46. GROUP : {
  47. .init LOAD (ADDR(init)) : {}
  48. .init_vle (VLECODE) LOAD (_e_init) : {
  49. *(.init)
  50. *(.init_vle)
  51. }
  52. } > init
  53. /* Note: _e_ prefix enables load after END of that specified section */
  54. GROUP : {
  55. /* Special section for INTC branch table required in hardware mode.
  56. Place the .intc_hw_branch_table_p0 section first in order to used both core and INTC
  57. tables. The intc_hw_branch_table should contain entries aligned to 16 bytes.
  58. */
  59. .intc_hw_branch_table_p0 LOAD (ADDR(exception_handlers_p0)) ALIGN (0x10) : {}
  60. /* Because the Z4 IVORx are settable the IVOR branch table can be placed
  61. after the INTC HW table.*/
  62. .ivor_branch_table_p0 (VLECODE) LOAD (_e_intc_hw_branch_table_p0) ALIGN (0x10) : {}
  63. /* ISR handlers code. */
  64. .__exception_handlers_p0 (VLECODE) LOAD (_e_ivor_branch_table_p0) : {}
  65. } > exception_handlers_p0
  66. GROUP : {
  67. .text : {}
  68. .text_vle (VLECODE) : {
  69. *(.text)
  70. *(.text_vle)
  71. }
  72. .rodata (CONST) : {
  73. *(.rdata)
  74. *(.rodata)
  75. }
  76. .ctors : {}
  77. .dtors : {}
  78. extab : {}
  79. extabindex : {}
  80. } > internal_flash
  81. GROUP : {
  82. /* Used in INTC SW mode to store the interrupt handlers array. Should be aligned to 4K. */
  83. .__uninitialized_intc_handlertable ALIGN(0x1000) : {}
  84. .data : {}
  85. .sdata : {}
  86. .sbss : {}
  87. .sdata2 : {}
  88. .sbss2 : {}
  89. .bss : {}
  90. } > internal_ram
  91. }
  92. /* Freescale CodeWarrior compiler address designations */
  93. _stack_addr = ADDR(stack)+SIZEOF(stack);
  94. _stack_end = ADDR(stack);
  95. _heap_addr = ADDR(heap);
  96. _heap_end = ADDR(heap)+SIZEOF(heap);
  97. /* If INTC HW mode is used it represents the vector base address to set
  98. IVPR and the location of intc_hw_branch_table_p0 section. The EXCEPTION_HANDLERS
  99. will point to the IVOR branch table.
  100. */
  101. __IVPR_VALUE = ADDR(exception_handlers_p0);
  102. /* IVOR branch table location. Used in Exceptions.c */
  103. EXCEPTION_HANDLERS = ADDR(.ivor_branch_table_p0);
  104. /* L2 SRAM Location (used for L2 SRAM initialization) */
  105. L2SRAM_LOCATION = ADDR(internal_ram);
  106. /* How many writes with stmw, 128 bytes each, are needed to cover
  107. the whole L2SRAM (used for L2 SRAM initialization) */
  108. L2SRAM_CNT = 0x40000 / 128;