comparison gsm-fw/finlink/ld-script.src @ 632:02d14592bb73

ramImage build change: load iram.text directly into IRAM w/o wasting XRAM
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 01 Sep 2014 18:02:06 +0000
parents aa93994e9f63
children da72b51c0572
comparison
equal deleted inserted replaced
631:7cf154cd3891 632:02d14592bb73
13 13
14 ENTRY(ifelse(Buildmem,XRAM,_FlashorXram_entry,0)) 14 ENTRY(ifelse(Buildmem,XRAM,_FlashorXram_entry,0))
15 15
16 include(`../include/config.m4')dnl 16 include(`../include/config.m4')dnl
17 MEMORY { 17 MEMORY {
18 ifelse(Buildmem-FLASH_BOOT_VIA_BOOTROM,FLASH-1,
19 ` FLASH_OVERLAY : ORIGIN = 0, LENGTH = 0x2000')
18 ifelse(Buildmem,FLASH, 20 ifelse(Buildmem,FLASH,
19 ` FLASH_OVERLAY : ORIGIN = 0, LENGTH = 0x2000 21 ` FLASH : ORIGIN = FLASHIMAGE_BASE_ADDR,
20 FLASH : ORIGIN = 0x2000, LENGTH = CONFIG_FWFLASH_SIZE - 0x2000') 22 LENGTH = CONFIG_FWFLASH_SIZE - FLASHIMAGE_BASE_ADDR')
21 IRAM : ORIGIN = 0x00800000, LENGTH = CONFIG_IRAM_SIZE 23 IRAM : ORIGIN = 0x00800000, LENGTH = CONFIG_IRAM_SIZE
22 XRAM : ORIGIN = 0x01000000, LENGTH = CONFIG_XRAM_SIZE 24 XRAM : ORIGIN = 0x01000000, LENGTH = CONFIG_XRAM_SIZE
23 } 25 }
24 ifelse(FFS_IN_RAM,1,` 26 ifelse(FFS_IN_RAM,1,`
25 RAMFFS_BLKSIZE_BYTES = 1 << RAMFFS_BLKSIZE_LOG2; 27 RAMFFS_BLKSIZE_BYTES = 1 << RAMFFS_BLKSIZE_LOG2;
26 RAMFFS_TOTAL_SIZE = RAMFFS_BLKSIZE_BYTES * RAMFFS_NBLOCKS; 28 RAMFFS_TOTAL_SIZE = RAMFFS_BLKSIZE_BYTES * RAMFFS_NBLOCKS;
27 ')dnl 29 ')dnl
28 30
29 SECTIONS { 31 SECTIONS {
32 ifelse(Buildmem,FLASH,`
33 /* Flash boot entry point */
34 flashboot.text FLASHIMAGE_BASE_ADDR : {
35 *(flashboot.text)
36 } > FLASH
37 ')dnl
38
30 /* XIP code, going into flash or XRAM emulating flash */ 39 /* XIP code, going into flash or XRAM emulating flash */
31 xip.text : { 40 xip.text : {
32 *(xip.text*) 41 *(xip.text*)
33 xipcode.o(.text*) 42 xipcode.o(.text*)
34 *libplus.xip.a:(.text*) 43 *libplus.xip.a:(.text*)
47 iramcode.o(.text*) 56 iramcode.o(.text*)
48 *libplus.iram.a:(.text*) 57 *libplus.iram.a:(.text*)
49 *libgpf.iram.a:(.text*) 58 *libgpf.iram.a:(.text*)
50 *libc.a:(.text*) 59 *libc.a:(.text*)
51 *libgcc.a:(.text*) 60 *libgcc.a:(.text*)
52 } > IRAM AT> Buildmem 61 } > IRAM Put_in_flash
53 __iramtext_ram_addr = ADDR(iram.text); 62 ifelse(Buildmem,FLASH,
63 ` __iramtext_ram_addr = ADDR(iram.text);
54 __iramtext_flash_addr = LOADADDR(iram.text); 64 __iramtext_flash_addr = LOADADDR(iram.text);
55 __iramtext_size = SIZEOF(iram.text); 65 __iramtext_size = SIZEOF(iram.text);
66 ')dnl
56 67
57 /* all .rodata will stay in flash */ 68 /* all .rodata will stay in flash */
58 .rodata : { 69 .rodata : {
59 *(.rodata*) 70 *(.rodata*)
60 } > Buildmem 71 } > Buildmem
65 * the .data section from flash to XRAM; for the RAM-only 76 * the .data section from flash to XRAM; for the RAM-only
66 * build it goes directly into XRAM and stays there. 77 * build it goes directly into XRAM and stays there.
67 */ 78 */
68 .data : { 79 .data : {
69 *(.data*) 80 *(.data*)
70 } > XRAM AT> Buildmem 81 } > XRAM Put_in_flash
71 ifelse(Buildmem,FLASH, 82 ifelse(Buildmem,FLASH,
72 ` __initdata_ram_addr = ADDR(.data); 83 ` __initdata_ram_addr = ADDR(.data);
73 __initdata_flash_addr = LOADADDR(.data); 84 __initdata_flash_addr = LOADADDR(.data);
74 __initdata_size = SIZEOF(.data); 85 __initdata_size = SIZEOF(.data);
75 ')dnl 86 ')dnl