From b7fad79a1d38cebe771120341d5730f2df14be4b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 28 Jun 2014 09:39:50 -0600 Subject: [PATCH] SAMA5D4-EK: Updates to get the at25boot configuration building correctly --- arch/arm/src/sama5/chip/sama5d3x_memorymap.h | 21 ++++++++++++++++++-- arch/arm/src/sama5/chip/sama5d4x_memorymap.h | 21 +++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/sama5/chip/sama5d3x_memorymap.h b/arch/arm/src/sama5/chip/sama5d3x_memorymap.h index 310111fd79..288a60dcb5 100644 --- a/arch/arm/src/sama5/chip/sama5d3x_memorymap.h +++ b/arch/arm/src/sama5/chip/sama5d3x_memorymap.h @@ -616,8 +616,19 @@ # endif # define PGTABLE_IN_HIGHSRAM 1 + /* If we execute from SRAM but keep data in SDRAM, then we will also have + * to position the initial, IDLE stack in SRAM. SDRAM will not be ready + * soon enough to serve as the stack. + * + * In this case, the initial IDLE stack can just follow the vector table, + * lying between the vector table and the page table. We don't really + * know how much memory to set aside for the vector table, but 4KiB should + * be much more than enough + */ + # ifdef CONFIG_BOOT_SDRAM_DATA -# error CONFIG_BOOT_SDRAM_DATA not suupported in this configuration +# define IDLE_STACK_PBASE (SAM_ISRAM0_PADDR + 0x0001000) +# define IDLE_STACK_VBASE (SAM_ISRAM0_VADDR + 0x0001000) # endif # else /* CONFIG_SAMA5_BOOT_ISRAM && CONFIG_ARCH_LOWVECTORS */ @@ -657,7 +668,13 @@ # error "One of PGTABLE_BASE_PADDR or PGTABLE_BASE_VADDR is undefined" # endif - /* If data is in SDRAM, then the IDLE stack at the beginning of ISRAM */ + /* If we execute from SRAM but keep data in SDRAM, then we will also have + * to position the initial, IDLE stack in SRAM. SDRAM will not be ready + * soon enough to serve as the stack. + * + * In this case, the initial IDLE stack can just follow the page table + * in ISRAM. + */ # ifdef CONFIG_BOOT_SDRAM_DATA # define IDLE_STACK_PBASE (SAM_ISRAM0_PADDR + PGTABLE_SIZE) diff --git a/arch/arm/src/sama5/chip/sama5d4x_memorymap.h b/arch/arm/src/sama5/chip/sama5d4x_memorymap.h index 2643567f83..b40d953bce 100644 --- a/arch/arm/src/sama5/chip/sama5d4x_memorymap.h +++ b/arch/arm/src/sama5/chip/sama5d4x_memorymap.h @@ -608,8 +608,19 @@ # endif # define PGTABLE_IN_HIGHSRAM 1 + /* If we execute from SRAM, but keep data in SDRAM, then we will also have + * to position the initial, IDLE stack in SRAM. SDRAM will not be ready + * soon enough to serve as the stack. + * + * In this case, the initial IDLE stack can just follow the vector table, + * lying between the vector table and the page table. We don't really + * know how much memory to set aside for the vector table, but 4KiB should + * be much more than enough + */ + # ifdef CONFIG_BOOT_SDRAM_DATA -# error CONFIG_BOOT_SDRAM_DATA not suupported in this configuration +# define IDLE_STACK_PBASE (SAM_ISRAM0_PADDR + 0x0001000) +# define IDLE_STACK_VBASE (SAM_ISRAM0_VADDR + 0x0001000) # endif # else /* CONFIG_SAMA5_BOOT_ISRAM && CONFIG_ARCH_LOWVECTORS */ @@ -625,6 +636,14 @@ # endif # define PGTABLE_IN_LOWSRAM 1 + /* If we execute from SRAM, but keep data in SDRAM, then we will also have + * to position the initial, IDLE stack in SRAM. SDRAM will not be ready + * soon enough to serve as the stack. + * + * In this case, the initial IDLE stack can just follow the page table + * in ISRAM. + */ + # ifdef CONFIG_BOOT_SDRAM_DATA # define IDLE_STACK_PBASE (PGTABLE_BASE_PADDR + PGTABLE_SIZE) # define IDLE_STACK_VBASE (PGTABLE_BASE_VADDR + PGTABLE_SIZE)