8850_psram.ld 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #include "link_defs.ld"
  13. #include "quec_cust_patch.h"
  14. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  15. OUTPUT_ARCH(arm)
  16. ENTRY(Reset_Handler)
  17. EXTERN(Reset_Handler)
  18. #define ttbl1_contents *(.TTBL1)
  19. #define ttbl2_contents *(.TTBL2)
  20. #define entry_contents *(RESET)
  21. #define sramboottext_contents KEEP(*(VECTORS)) SORT(*)(.sramboottext .sramboottext.*)
  22. #ifndef QUEC_PATCH_LINK_SRAM
  23. #define sramtext_contents SORT(*)(.sramtext .sramtext.*)
  24. #else
  25. #define sramtext_contents *libkernel.a:portASM.*(DEF_RO) \
  26. *libkernel.a:port.*(DEF_RO) \
  27. SORT(*)(.sramtext .sramtext.*)
  28. #endif
  29. #define ramtext_contents SORT(*)(.ramtext .ramtext.*)
  30. #define text_contents SORT(*)(DEF_RO) KEEP(*(.rokeep))
  31. #define sramdata_contents SORT(*)(.sramdata .sramdata.* .bootsramdata .sramucdata)
  32. #define data_contents SORT(*)(DEF_RW) KEEP(*(.rwkeep))
  33. #define srambss_contents *(.srambss .srambss.* .sramuninit .sramucbss)
  34. #define bss_contents *(DEF_ZI .ucdata .ucbackup)
  35. #define init_array_contents KEEP(*(.init_array*))
  36. #ifdef CONFIG_APP_FLASH2_ENABLED
  37. /* libraries on external flash, should be tuned by requirement. *//*SORT(*libatr.a:*)(DEF_RO) \ SORT(*libats.a:*)(DEF_RO) \ SORT(*libaudio.a:*)(DEF_RO) \ SORT(*libaudio_core.a:*)(DEF_RO)*/
  38. #define flash2text_contents SORT(*libonextflash.a:*)(DEF_RO) \
  39. SORT(*libaudio_core.a:*)(DEF_RO)
  40. #endif
  41. #define SRAM_HEAP_END (ORIGIN(sram) + LENGTH(sram) - CONFIG_IRQ_STACK_SIZE - CONFIG_SVC_STACK_SIZE - CONFIG_BLUE_SCREEN_SIZE)
  42. MEMORY {
  43. flash(rx): ORIGIN = CONFIG_APP_FLASH_ADDRESS, LENGTH = CONFIG_APP_FLASH_SIZE
  44. ram(rwx): ORIGIN = CONFIG_APP_RAM_ADDRESS, LENGTH = CONFIG_APP_RAM_SIZE
  45. sram(rwx): ORIGIN = CONFIG_SRAM_PHY_ADDRESS, LENGTH = CONFIG_SRAM_SIZE
  46. #ifdef CONFIG_APP_FLASH2_ENABLED
  47. flash2(rx): ORIGIN = CONFIG_APP_FLASH2_ADDRESS, LENGTH = CONFIG_APP_FLASH2_SIZE
  48. #endif
  49. }
  50. SECTIONS {
  51. NOLOAD_SIZE_SECT(simage, CONFIG_SIMAGE_HEADER_SIZE) > flash
  52. ANCHOR_SECT(flash_start) > flash
  53. NOAT_SECT_ALIGNED(ttbl1, 16384) >ram
  54. #ifdef CONFIG_BSCORE_ENABLE
  55. NOLOAD_SIZE_SECT(bscore, CONFIG_BSCORE_SIZE) >ram
  56. #endif
  57. NOAT_SECT_ALIGNED(ttbl2, 16384) >ram
  58. NOAT_SECT(entry) >flash
  59. LOAD_SECT(sramboottext) >sram AT>flash
  60. LOAD_SECT(sramtext) >sram AT>flash
  61. LOAD_SECT(ramtext) >ram AT>flash
  62. NOAT_SECT(init_array) >flash
  63. #ifdef CONFIG_APP_FLASH2_ENABLED
  64. ANCHOR_SECT(flash2_start) > flash2
  65. NOAT_SECT(flash2text) > flash2
  66. ANCHOR_SECT(flash2_end) > flash2
  67. #endif
  68. NOAT_SECT(text) >flash
  69. LOAD_SECT(sramdata) >sram AT>flash
  70. LOAD_SECT(data) >ram AT>flash
  71. NOLOAD_SECT(srambss) >sram
  72. NOLOAD_END_SECT(sram_heap, SRAM_HEAP_END) >sram
  73. NOLOAD_SIZE_SECT(blue_screen, CONFIG_BLUE_SCREEN_SIZE) >sram
  74. NOLOAD_SIZE_SECT(svc_stack, CONFIG_SVC_STACK_SIZE) >sram
  75. NOLOAD_SIZE_SECT(irq_stack, CONFIG_IRQ_STACK_SIZE) >sram
  76. NOLOAD_SECT(bss) >ram
  77. NOLOAD_END_SECT(heap, ORIGIN(ram) + LENGTH(ram)) > ram
  78. ANCHOR_SECT(flash_end) > flash
  79. IGNORE_DISCARD_SECTS
  80. }