ramrun_8850.ld 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. // This will link an arm elf for uimage. The definitions needed:
  13. // * RAMRUN_IMAGE_START: The sram start address, including uimage header.
  14. // * RAMRUN_IMAGE_SIZE: The sram size.
  15. // * RAMRUN_FLASH_SIZE: The maximum romable size. When defined, it is only
  16. // used to check romable size.
  17. // * CONFIG_SIMAGE_HEADER_SIZE: uimage header size.
  18. //
  19. // Address between [__flash_start, __flash_end] is romable.
  20. #include "link_defs.ld"
  21. #include "hal_config.h"
  22. #include "boot_config.h"
  23. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  24. OUTPUT_ARCH(arm)
  25. ENTRY(bootEntry)
  26. EXTERN(bootEntry)
  27. #define text_contents *(BOOT_ENTRY) \
  28. SORT(*)(.sramboottext .sramboottext.*) \
  29. SORT(*)(.sramtext .sramtext.*) \
  30. SORT(*)(.ramtext .ramtext.*) \
  31. SORT(*)(DEF_RO)
  32. #define data_contents SORT(*)(.sramdata .sramdata.*) \
  33. SORT(*)(DEF_RW)
  34. #define bss_contents *(.srambss .srambss.*) \
  35. *(DEF_ZI)
  36. MEMORY {
  37. syssram(rwx): ORIGIN = CONFIG_SRAM_PHY_ADDRESS, LENGTH = CONFIG_SRAM_SIZE
  38. aonsram(rwx): ORIGIN = CONFIG_AON_SRAM_PHY_ADDRESS, LENGTH = CONFIG_AON_SRAM_SIZE
  39. ram(rw): ORIGIN = CONFIG_RAM_PHY_ADDRESS, LENGTH = CONFIG_RAM_SIZE
  40. }
  41. SECTIONS {
  42. NOLOAD_SIZE_SECT(rom_data, CONFIG_ROM_SRAM_DATA_SIZE) > syssram
  43. NOLOAD_SIZE_SECT(simage, CONFIG_SIMAGE_HEADER_SIZE) > aonsram
  44. ANCHOR_SECT(flash_start) > aonsram
  45. NOAT_SECT(text) > aonsram
  46. NOAT_SECT(data) > aonsram
  47. ANCHOR_SECT(flash_end) > aonsram
  48. NOLOAD_SECT(bss) > aonsram
  49. #ifdef RAMRUN_MMU_ON_SRAM
  50. NOLOAD_END_SECT(aonsram_skip, ORIGIN(aonsram) + LENGTH(aonsram) - 0x4000) > aonsram
  51. NOLOAD_SIZE_SECT(mmu_ttbl1, 0x4000) > aonsram
  52. #endif
  53. NOLOAD_SIZE_SECT(sys_stack, CONFIG_BOOT_SYS_STACK_SIZE) > syssram
  54. NOLOAD_SIZE_SECT(irq_stack, CONFIG_BOOT_IRQ_STACK_SIZE) > syssram
  55. NOLOAD_SIZE_SECT(blue_screen, CONFIG_BLUE_SCREEN_SIZE) > syssram
  56. NOLOAD_END_SECT(sram_heap, ORIGIN(syssram) + LENGTH(syssram)) > syssram
  57. #ifndef RAMRUN_MMU_ON_SRAM
  58. NOLOAD_SIZE_SECT(mmu_ttbl1, 0x4000) > ram
  59. #endif
  60. NOLOAD_END_SECT(ram_heap, ORIGIN(ram) + LENGTH(ram)) > ram
  61. IGNORE_DISCARD_SECTS
  62. }