ram.ld 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. #include "config.h"
  2. ENTRY(_start)
  3. /* Define the flash max size */
  4. __max_flash_size = FLASH_CODE_SIZE;
  5. __base = 0x10000000;
  6. /* Define the area */
  7. __aram_vma = 0x20000;
  8. __bram_vma = 0x18000;
  9. __dram_vma = 0x58000;
  10. __eram_vma = 0x24000;
  11. __comm_vma = 0x14000;
  12. MEMORY
  13. {
  14. init : org = __base, len = 512
  15. flash(rx) : org = __base + 512, len = __max_flash_size
  16. comm(rx) : org = __comm_vma, len = 16k
  17. stack : org = 0x10800, len = 1k
  18. data : org = 0x10C00, len = 13k
  19. heap : org = 0x1d400, len = 11k
  20. aram : org = __aram_vma, len = 16k
  21. bram : org = __bram_vma, len = 21k
  22. dram : org = __dram_vma, len = 12k
  23. eram : org = __eram_vma, len = 4k
  24. }
  25. SECTIONS
  26. {
  27. .init : {
  28. *(.reset)
  29. *(.bcom_text.sniff.bb.entry)
  30. . = ALIGN(512);
  31. } > init
  32. .btcom_flash : {
  33. __code_start_bt_comm = .;
  34. *(.bcom_text*)
  35. *(.bcom_rodata*)
  36. . = ALIGN(512);
  37. __code_end_bt_comm = .;
  38. } > flash
  39. .comm : {
  40. __comm_start = .;
  41. *(.vector)
  42. *(.plt)
  43. *(.com_text*)
  44. #if SYS_KARAOK_EN
  45. *(.com_rm_voice*)
  46. #endif
  47. *(.com_text.bb.leisr)
  48. *(.com_text.stack.handler)
  49. *(.com_rodata*)
  50. *(.srodata*)
  51. *debug.o(.rodata*)
  52. *(.data*)
  53. *(.sdata*)
  54. *(.fot_data.buf)
  55. *\ext_scan.o(.rodata*)
  56. *\ble_evt.o(.rodata*)
  57. *\hci_transport_h3.o(.rodata*)
  58. *(.load_text)
  59. *(.load_rodata)
  60. __comm_end = .;
  61. . = ALIGN(512);
  62. } > comm AT > flash
  63. .flash : {
  64. __code_start_stream = .;
  65. *(.com_stream.text*)
  66. . = ALIGN(512);
  67. __code_end_stream = .;
  68. __code_start_record = .;
  69. *(.com_rec*)
  70. . = ALIGN(512);
  71. __code_end_record = .;
  72. __code_start_wsola = .;
  73. *(.mav_com) //SYS_MAGIC_VOICE_EN
  74. *(.rodata.mav) //SYS_MAGIC_VOICE_EN
  75. . = ALIGN(512);
  76. __code_end_wsola = .;
  77. __code_start_pitch = .;
  78. *(.pitch_shift_pro) //SYS_MAGIC_VOICE_EN
  79. *(.pitch_shift_hnn) //SYS_MAGIC_VOICE_EN
  80. . = ALIGN(512);
  81. __code_end_pitch = .;
  82. __code_start_karaok_dednr = .;
  83. *(.com_mic_dnr*)
  84. . = ALIGN(512);
  85. __code_end_karaok_dednr = .;
  86. __code_start_mp3dec = .;
  87. *(.mp3dec*)
  88. . = ALIGN(512);
  89. __code_end_mp3dec = .;
  90. __code_start_sbcdec = .;
  91. *(.sbcdec*)
  92. *(.sbc_com*)
  93. . = ALIGN(512);
  94. __code_end_sbcdec = .;
  95. __code_start_sbcenc = .;
  96. *(.rodata.sbcenc*)
  97. *(.text.sbcenc*)
  98. . = ALIGN(512);
  99. __code_end_sbcenc = .;
  100. __code_start_mp3enc = .;
  101. *(.mpaenc*)
  102. . = ALIGN(512);
  103. __code_end_mp3enc = .;
  104. __code_start_wavdec = .;
  105. *(.wavdec*)
  106. . = ALIGN(512);
  107. __code_end_wavdec = .;
  108. __code_start_wmadec = .;
  109. *(.wmadec.bitstream)
  110. *(.wmadec.windows)
  111. *(.wmadec*)
  112. . = ALIGN(512);
  113. __code_end_wmadec = .;
  114. __code_start_apedec = .;
  115. *(.apedec*)
  116. . = ALIGN(512);
  117. __code_end_apedec = .;
  118. __code_start_flacdec = .;
  119. *(.flacdec*)
  120. . = ALIGN(512);
  121. __code_end_flacdec = .;
  122. __code_start_usbdev = .;
  123. *(.usbdev*)
  124. . = ALIGN(512);
  125. __code_end_usbdev = .;
  126. __code_start_wma_rlc44q = .;
  127. *(.wma_huff_rlc44q_table)
  128. . = ALIGN(512);
  129. __code_end_wma_rlc44q = .;
  130. __code_start_wma_rlc44o = .;
  131. *(.wma_huff_rlc44o_table)
  132. . = ALIGN(512);
  133. __code_end_wma_rlc44o = .;
  134. __code_start_wma_rlc16 = .;
  135. *(.wma_huff_rlc16_table)
  136. . = ALIGN(512);
  137. __code_end_wma_rlc16 = .;
  138. __code_start_sleep = .;
  139. *(.saradc_text*)
  140. *(.sleep_text*)
  141. *(.text.charge_com*)
  142. . = ALIGN(512);
  143. __code_end_sleep = .;
  144. __code_start_bb_test = .;
  145. *(.bb_test*)
  146. *(.bb_test_rodata*)
  147. . = ALIGN(512);
  148. __code_end_bb_test = .;
  149. __code_start_bt_voice = .;
  150. *(.bt_voice*)
  151. . = ALIGN(512);
  152. __code_end_bt_voice = .;
  153. __code_start_sco_nr = .;
  154. *(.bt_sco.alc)
  155. *(.text.alc.table)
  156. *(.text.aec.asm)
  157. *(.text.aec.util)
  158. *(.text.fft)
  159. *(.text.aec.ns)
  160. *(.text.aec.trum)
  161. *(.text.aec.core)
  162. *(.rodata.fft)
  163. *(.rodata.aec*)
  164. . = ALIGN(512);
  165. __code_end_sco_nr = .;
  166. __code_start_piano = .;
  167. *(.piano_com*)
  168. . = ALIGN(512);
  169. __code_end_piano = .;
  170. __code_start_update = .;
  171. *(.text.update*)
  172. . = ALIGN(512);
  173. __code_end_update = .;
  174. __code_start_eq = .;
  175. *(.com_eq.text*)
  176. . = ALIGN(512);
  177. __code_end_eq = .;
  178. __code_start_spdif = .;
  179. *(.spdif_text*)
  180. . = ALIGN(512);
  181. __code_end_spdif = .;
  182. __code_start_rf = .;
  183. *(.text.rf_init*)
  184. . = ALIGN(512);
  185. __code_end_rf = .;
  186. __code_start_auxdnr = .;
  187. *(.text.aux_dnr*)
  188. *(.text.aux_sdadc*)
  189. . = ALIGN(512);
  190. __code_end_auxdnr = .;
  191. *(.irq_init.aligned)
  192. *(.text*)
  193. *(.rodata*)
  194. *(.rela*)
  195. LONG(0)
  196. . = ALIGN(512);
  197. } > flash
  198. .stack (NOLOAD) : {
  199. __irq_stack_start = .;
  200. . = 0x400;
  201. __irq_stack = .;
  202. } > stack
  203. __irq_stack_size = __irq_stack - __irq_stack_start;
  204. .bss (NOLOAD) : {
  205. __bss_start = .;
  206. *(COMMON)
  207. *(.bss*)
  208. *(.sbss*)
  209. *(.buf*)
  210. #if SYS_KARAOK_EN
  211. *(.sdadc_buf)
  212. #endif
  213. *(.dac_obuf)
  214. *(.btmem.stack.sdp)
  215. *(.gpdma_buf)
  216. #if BT_PBAP_EN||BT_MAP_EN
  217. *(.btmem_pbap.ram)
  218. #endif
  219. #if KARAOK_REC_EN
  220. *(.kara_rec_cache)
  221. #endif
  222. #if SYS_KARAOK_EN
  223. *(.magic_buf)
  224. #endif
  225. #if LE_EN
  226. *(.ble_rx_buf)
  227. *(.ble_cache*)
  228. #endif
  229. #if EXLIB_BT_MONO_XDRC_EN
  230. *(.xdrc_ram*)
  231. #endif
  232. *(.fot_data.com*)
  233. __bss_end = .;
  234. } > data
  235. __bss_size = __bss_end - __bss_start;
  236. .heap (NOLOAD) : {
  237. *(.mem_heap)
  238. } > heap
  239. .eram __eram_vma (NOLOAD) : {
  240. *(.btmem.bb.le*)
  241. *(.btmem.ble.adv)
  242. *(.btstack_hci.buf)
  243. *(.btmem.stack.memory)
  244. *(.btmem.hid.usage)
  245. /**(.btmem.stack.st)
  246. *(.btmem.tws)
  247. *(.btmem.stack.hid)*/
  248. } > eram
  249. .pitch_eram __eram_vma (NOLOAD) : {
  250. #if !LE_EN
  251. // . = 0x700;
  252. // *(.pitch_shift.cb)
  253. #endif
  254. } > eram
  255. .upd_eram __eram_vma (NOLOAD) : {
  256. *(.upd_buf*)
  257. } > eram
  258. .pitch_bram __bram_vma (NOLOAD) : { //EXSPI_REC_PITCH_SHIFT_PLAY 使用
  259. *(.pitch_shift.buf) //1.5K
  260. *(.pitch_shift.cb) //3.1K
  261. } > bram
  262. .bram __bram_vma (NOLOAD) : {
  263. *(.btmem.bthw)
  264. *(.btmem*)
  265. } > bram
  266. .wma_btmem __bram_vma (NOLOAD) : {
  267. *(.wma_coefs_buf)
  268. } > bram
  269. .mp3enc_btmem __bram_vma (NOLOAD) : {
  270. *(.l2enc_sb_buf)
  271. } > bram
  272. .echo_btmem __bram_vma (NOLOAD) : {
  273. *(.echo_buf)
  274. } > bram
  275. .mpeg_btmem __bram_vma (NOLOAD) : {
  276. *(.mpeg_buf)
  277. *(.dual_buf)
  278. *(.speed_buf1)
  279. } > bram
  280. .i2s_btmem __bram_vma (NOLOAD) : {
  281. *(.i2s_cache*)
  282. } > bram
  283. .aec_ram __aram_vma (NOLOAD) : {
  284. *(.aec_ram.buf)
  285. *(.aec_buf*)
  286. *(.nr_cache*)
  287. *(.sco_eq_buf)
  288. *(.far_data.buf)
  289. #if AEC_DUMP_FILE
  290. *(.dum_file.buf)
  291. #endif
  292. . = 0x4000;
  293. } > aram
  294. .alc_ram __aram_vma (NOLOAD) : {
  295. #if SCO_MAV_EN
  296. *(.sco_mav_buf*)
  297. #endif // SCO_MAV_EN
  298. . = 0x1000;
  299. *(.alc_ram.buf)
  300. *(.nr_buf*)
  301. *(.wavenc.aec)
  302. #if SCO_MAV_EN
  303. *(.sco_mav_cache)
  304. #endif // SCO_MAV_EN
  305. #if (BT_HFP_CALL_KARAOK_EN && SYS_MAGIC_VOICE_EN)
  306. *(.mav_cache_flash)
  307. #endif
  308. . = 0x3800;
  309. *(.echo_cache)
  310. . = 0x4000;
  311. } > aram
  312. .fcc_buf __aram_vma (NOLOAD) : {
  313. . = 0x1000;
  314. *(.fcc_buf.huart)
  315. *(.fcc_buf*)
  316. *(.wavres.buf)
  317. } > aram
  318. .sbc_cache __aram_vma (NOLOAD) : {
  319. . = 0x670;
  320. *(.a2dp_buf*)
  321. *(.mav_buf)
  322. . = 0x1000;
  323. *(.sbc_cache_buf)
  324. . = 0x3a2c; //不能与avio_buf空间重叠,avio_buf播放提示音会使用
  325. *(.ble_buf*)
  326. . = 0x4000;
  327. } > aram
  328. .aram_music __aram_vma (NOLOAD) : {
  329. *(.mp3buf.dec)
  330. . = 0x1000;
  331. *(.pff_buf*)
  332. . = 0x1200;
  333. *(.udev_buf*)
  334. *(.usb_buf*)
  335. *(.mp3_id3_buf)
  336. *(.lrc_buf*)
  337. *(.pff.scan.tempbuf)
  338. . = 0x3800;
  339. *(.avio_buf)
  340. *(.diskio_buf)
  341. *(.pff.buf)
  342. *(.fname.buf)
  343. . = 0x4000;
  344. } > aram
  345. .aram_wma __aram_vma (NOLOAD) : {
  346. . = 0x1200;
  347. *(.wma_coefs_buf0)
  348. *(.wma_ctx_buf)
  349. *(.wma_wincb_buf)
  350. *(.wma_id3_buf)
  351. . = 0x3800;
  352. } > aram
  353. .aram_flac __aram_vma (NOLOAD) : {
  354. . = 0x1200;
  355. *(.flac_decoded_buf)
  356. . = 0x3800;
  357. } > aram
  358. .aram_fnav __aram_vma (NOLOAD) : {
  359. . = 0x1000;
  360. *(.fnav_buf)
  361. . = 0x2800;
  362. } > aram
  363. .aram_fmrx __aram_vma (NOLOAD) : {
  364. . = 0x1000;
  365. *(.fmrx_cb_buf)
  366. } > aram
  367. .aram_sbc __aram_vma (NOLOAD) : {
  368. *(.sbcbuf.dec)
  369. #if FUNC_REC_EN
  370. *(.l2enc.buf*)
  371. #endif
  372. . = 0x1000;
  373. . = 0x3000;
  374. } > aram
  375. .sbcenc __aram_vma (NOLOAD) : {
  376. . = 0x670;
  377. *(.sbcenc.buf*)
  378. . = 0x1000;
  379. } > aram
  380. .aram_msc_stm __aram_vma (NOLOAD) : {
  381. *(.stm_buf)
  382. . = 0x1000;
  383. } > aram
  384. .dram_upd __dram_vma (NOLOAD) : {
  385. *(.ota_buf*)
  386. *(.uart_upd_buf*)
  387. } > dram
  388. .dram_mp3 __dram_vma (NOLOAD) : {
  389. *(.mp3_decram_buf)
  390. . = 0x3000;
  391. } > dram
  392. .dram_ape __dram_vma (NOLOAD) : {
  393. *(.apebuf.cb)
  394. *(.apebuf.filter)
  395. *(.apebuf.decode)
  396. *(.apebuf.seektbl)
  397. . = 0x3000;
  398. } > dram
  399. .dram_wma __dram_vma (NOLOAD) : {
  400. *(.wmabuf*)
  401. . = 0x3000;
  402. } > dram
  403. .dram_flac __dram_vma (NOLOAD) : {
  404. *(.flacbuf*)
  405. *(.flac_decoded_buf1)
  406. *(.wavbuf.dec)
  407. . = 0x3000;
  408. } > dram
  409. .dram_sbc __dram_vma (NOLOAD) : {
  410. *(.sbc_decram_buf)
  411. . = 0xD38;
  412. *(.a2dp_play)
  413. *(.mav_cache)
  414. . = 0x3000;
  415. } > dram
  416. .dram_pitch __dram_vma (NOLOAD) : {
  417. . = 0x2200;
  418. //*(.pitch_shift.cb)
  419. . = 0x3000;
  420. } > dram
  421. // .dram_ble __dram_vma (NOLOAD) : {
  422. // . = 0x2380; //注意:放这里与通话冲突了, 暂没地方放
  423. // *(.ble_cache*)
  424. // . = 0x2AFC;
  425. // } > dram
  426. .dram_sco __dram_vma (NOLOAD) : {
  427. *(.wavenc.sco)
  428. . = 0xD38; //0xd38之前为msbc解码空间
  429. *(.sco_cache)
  430. *(.sco_data)
  431. *(.sco_hci)
  432. *(.plc_buf)
  433. *(.plc_data)
  434. . = 0x3000;
  435. } > dram
  436. .dram_rec __dram_vma (NOLOAD) : {
  437. . = 0xD38;
  438. *(.rec.wave.header)
  439. *(.recenc.obuf)
  440. *(.rec.obuf)
  441. *(.l2enc_bit_buf)
  442. . = 0x3000;
  443. } > dram
  444. .dram_usb __dram_vma (NOLOAD) : {
  445. *(.usb.device.desc.buf)
  446. *(.ude.aubuf)
  447. *(.spi_flash_ram)
  448. . = 0x3000;
  449. } > dram
  450. .dram_spf __dram_vma (NOLOAD) : {
  451. *(.spf_buf)
  452. . = 0x3000;
  453. } > dram
  454. }
  455. /* Calc the lma */
  456. __bank_size = SIZEOF(.flash);
  457. __comm_lma = LOADADDR(.comm);
  458. __comm_size = SIZEOF(.comm);