mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:04:17 +08:00
Add option to copy to RAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1689 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -83,7 +83,7 @@ nuttx: $(HEAD_AOBJ) board/libboard$(LIBEXT)
|
|||||||
@echo "LD: nuttx"
|
@echo "LD: nuttx"
|
||||||
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
|
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
|
||||||
--start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
|
--start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
|
||||||
ifeq ($(CONFIG_BOOT_FROM_FLASH),y)
|
ifeq ($(CONFIG_BOOT_RUNFROMFLASH),y)
|
||||||
@export flashloc=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _eronly | cut -d' ' -f1`; \
|
@export flashloc=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _eronly | cut -d' ' -f1`; \
|
||||||
$(OBJCOPY) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage
|
$(OBJCOPY) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage
|
||||||
@mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@
|
@mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ __start:
|
|||||||
|
|
||||||
/* Copy system .data sections to new home in RAM. */
|
/* Copy system .data sections to new home in RAM. */
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
|
|
||||||
adr r3, LC2
|
adr r3, LC2
|
||||||
ldmia r3, {r0, r1, r2}
|
ldmia r3, {r0, r1, r2}
|
||||||
@@ -141,7 +141,7 @@ LC0: .long _sbss
|
|||||||
.long _ebss
|
.long _ebss
|
||||||
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
|
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
|
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
|
||||||
.long _sdata /* Where .data needs to reside in SDRAM */
|
.long _sdata /* Where .data needs to reside in SDRAM */
|
||||||
.long _edata
|
.long _edata
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ __start:
|
|||||||
|
|
||||||
/* Copy system .data sections to new home in RAM. */
|
/* Copy system .data sections to new home in RAM. */
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
|
|
||||||
adr r3, LC2
|
adr r3, LC2
|
||||||
ldmia r3, {r0, r1, r2}
|
ldmia r3, {r0, r1, r2}
|
||||||
@@ -601,7 +601,7 @@ LC0: .long _sbss
|
|||||||
.long _ebss
|
.long _ebss
|
||||||
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
|
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
|
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
|
||||||
.long _sdata /* Where .data needs to reside in SDRAM */
|
.long _sdata /* Where .data needs to reside in SDRAM */
|
||||||
.long _edata
|
.long _edata
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* arch/arm/src/str71x/str71x_head.S
|
* arch/arm/src/str71x/str71x_head.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -510,7 +510,7 @@ __flashstart:
|
|||||||
|
|
||||||
/* Copy system .data sections to new home in RAM. */
|
/* Copy system .data sections to new home in RAM. */
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
|
|
||||||
adr r3, LC2
|
adr r3, LC2
|
||||||
ldmia r3, {r0, r1, r2}
|
ldmia r3, {r0, r1, r2}
|
||||||
@@ -601,7 +601,7 @@ LC0: .long _sbss
|
|||||||
.long _ebss
|
.long _ebss
|
||||||
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
|
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
|
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
|
||||||
.long _sdata /* Where .data needs to reside in SDRAM */
|
.long _sdata /* Where .data needs to reside in SDRAM */
|
||||||
.long _edata
|
.long _edata
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ nuttx: $(HEAD_AOBJ) board/libboard$(LIBEXT)
|
|||||||
@echo "LD: nuttx"
|
@echo "LD: nuttx"
|
||||||
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
|
@$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) -o $(TOPDIR)/$@ $(HEAD_AOBJ) \
|
||||||
--start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
|
--start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC)
|
||||||
ifeq ($(CONFIG_BOOT_FROM_FLASH),y)
|
ifeq ($(CONFIG_BOOT_RUNFROMFLASH),y)
|
||||||
@export flashloc=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _eronly | cut -d' ' -f1`; \
|
@export flashloc=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _eronly | cut -d' ' -f1`; \
|
||||||
$(OBJCOPY) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage
|
$(OBJCOPY) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage
|
||||||
@mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@
|
@mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* arch/sh/src/sh1/sh1_head.S
|
* arch/sh/src/sh1/sh1_head.S
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
.globl _ebss /* End of BSS */
|
.globl _ebss /* End of BSS */
|
||||||
.globl _svect /* Start of the new vector location */
|
.globl _svect /* Start of the new vector location */
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
.globl _eronly /* Where .data defaults are stored in FLASH */
|
.globl _eronly /* Where .data defaults are stored in FLASH */
|
||||||
.global _sdata /* Start of .data in RAM */
|
.global _sdata /* Start of .data in RAM */
|
||||||
.globl _edata /* End of .data in RAM */
|
.globl _edata /* End of .data in RAM */
|
||||||
@@ -388,7 +388,7 @@ __start0:
|
|||||||
|
|
||||||
/* Initialize data segement */
|
/* Initialize data segement */
|
||||||
|
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
mov.l .Lsdata, r0 /* R0: Start of .data segment */
|
mov.l .Lsdata, r0 /* R0: Start of .data segment */
|
||||||
mov.l .Ledata, r1 /* R1: End+1 of .data segment */
|
mov.l .Ledata, r1 /* R1: End+1 of .data segment */
|
||||||
mov.l .Leronly, r2 /* R2: Start of FLASH .data segment copy */
|
mov.l .Leronly, r2 /* R2: Start of FLASH .data segment copy */
|
||||||
@@ -469,7 +469,7 @@ __start0:
|
|||||||
nop
|
nop
|
||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
#ifdef CONFIG_BOOT_FROM_FLASH
|
#ifdef CONFIG_BOOT_RUNFROMFLASH
|
||||||
.Leronly:
|
.Leronly:
|
||||||
.long _eronly
|
.long _eronly
|
||||||
.Lsdata:
|
.Lsdata:
|
||||||
|
|||||||
Reference in New Issue
Block a user