changeset 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 7cf154cd3891
children da72b51c0572
files gsm-fw/finlink/flash.m4 gsm-fw/finlink/ld-script.src gsm-fw/finlink/xram.m4 gsm-fw/sysglue/sysinit.S
diffstat 4 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/finlink/flash.m4	Mon Sep 01 17:04:19 2014 +0000
+++ b/gsm-fw/finlink/flash.m4	Mon Sep 01 18:02:06 2014 +0000
@@ -1,1 +1,2 @@
 define(`Buildmem',`FLASH')dnl
+define(`Put_in_flash',`AT> FLASH')dnl
--- a/gsm-fw/finlink/ld-script.src	Mon Sep 01 17:04:19 2014 +0000
+++ b/gsm-fw/finlink/ld-script.src	Mon Sep 01 18:02:06 2014 +0000
@@ -15,9 +15,11 @@
 
 include(`../include/config.m4')dnl
 MEMORY {
+ifelse(Buildmem-FLASH_BOOT_VIA_BOOTROM,FLASH-1,
+`	FLASH_OVERLAY : ORIGIN = 0, LENGTH = 0x2000')
 ifelse(Buildmem,FLASH,
-`	FLASH_OVERLAY : ORIGIN = 0, LENGTH = 0x2000
-	FLASH : ORIGIN = 0x2000,    LENGTH = CONFIG_FWFLASH_SIZE - 0x2000')
+`	FLASH : ORIGIN = FLASHIMAGE_BASE_ADDR,
+		LENGTH = CONFIG_FWFLASH_SIZE - FLASHIMAGE_BASE_ADDR')
 	IRAM : ORIGIN = 0x00800000, LENGTH = CONFIG_IRAM_SIZE
 	XRAM : ORIGIN = 0x01000000, LENGTH = CONFIG_XRAM_SIZE
 }
@@ -27,6 +29,13 @@
 ')dnl
 
 SECTIONS {
+ifelse(Buildmem,FLASH,`
+	/* Flash boot entry point */
+	flashboot.text FLASHIMAGE_BASE_ADDR : {
+		*(flashboot.text)
+	} > FLASH
+')dnl
+
 	/* XIP code, going into flash or XRAM emulating flash */
 	xip.text : {
 		*(xip.text*)
@@ -49,10 +58,12 @@
 		*libgpf.iram.a:(.text*)
 		*libc.a:(.text*)
 		*libgcc.a:(.text*)
-	} > IRAM AT> Buildmem
-	__iramtext_ram_addr = ADDR(iram.text);
+	} > IRAM Put_in_flash
+ifelse(Buildmem,FLASH,
+`	__iramtext_ram_addr = ADDR(iram.text);
 	__iramtext_flash_addr = LOADADDR(iram.text);
 	__iramtext_size = SIZEOF(iram.text);
+')dnl
 
 	/* all .rodata will stay in flash */
 	.rodata : {
@@ -67,7 +78,7 @@
 	 */
 	.data : {
 		*(.data*)
-	} > XRAM AT> Buildmem
+	} > XRAM Put_in_flash
 ifelse(Buildmem,FLASH,
 `	__initdata_ram_addr = ADDR(.data);
 	__initdata_flash_addr = LOADADDR(.data);
--- a/gsm-fw/finlink/xram.m4	Mon Sep 01 17:04:19 2014 +0000
+++ b/gsm-fw/finlink/xram.m4	Mon Sep 01 18:02:06 2014 +0000
@@ -1,1 +1,2 @@
 define(`Buildmem',`XRAM')dnl
+define(`Put_in_flash',`/* no AT> for RAM-only build */')dnl
--- a/gsm-fw/sysglue/sysinit.S	Mon Sep 01 17:04:19 2014 +0000
+++ b/gsm-fw/sysglue/sysinit.S	Mon Sep 01 18:02:06 2014 +0000
@@ -12,14 +12,6 @@
 	.code	32
 	.globl	_FlashorXram_entry
 _FlashorXram_entry:
-/* first order of business: copy iram.text to where it's supposed to be */
-	ldr	r8, =__iramtext_flash_addr
-	ldr	r9, =__iramtext_ram_addr
-	ldr	r10, =__iramtext_size
-1:	ldmia	r8!, {r0-r7}
-	stmia	r9!, {r0-r7}
-	subs	r10, r10, #0x20
-	bhi	1b
 /* enable Calypso boot ROM for the ARM exception and IRQ/FIQ vectors */
 	ldr	r1, =0xFFFFFB10
 	mov	r2, #0x0100