From ba377ddfd3168092de8cc00f18eae604479b4e6b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 24 Jul 2013 10:08:32 -0600 Subject: Revamp the way external memory regions are configured; Add logic to add SAMA5 external memory regions to the heap --- nuttx/ChangeLog | 12 +- nuttx/arch/Kconfig | 141 -------- nuttx/arch/arm/src/lpc17xx/Kconfig | 114 +++++++ nuttx/arch/arm/src/lpc31xx/Kconfig | 135 +++++++- nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c | 32 +- nuttx/arch/arm/src/lpc31xx/lpc31_boot.c | 6 +- nuttx/arch/arm/src/lpc31xx/lpc31_memorymap.h | 8 +- nuttx/arch/arm/src/sam34/Kconfig | 157 ++++++++- nuttx/arch/arm/src/sam34/sam_allocateheap.c | 46 +-- nuttx/arch/arm/src/sama5/Kconfig | 349 ++++++++++++++++++- nuttx/arch/arm/src/sama5/Make.defs | 5 +- nuttx/arch/arm/src/sama5/chip/sama5d3x_memorymap.h | 8 +- nuttx/arch/arm/src/sama5/sam_allocateheap.c | 368 +++++++++++++++++++++ nuttx/arch/arm/src/sama5/sam_boot.c | 8 +- nuttx/arch/arm/src/sama5/sam_clockconfig.c | 4 +- nuttx/configs/arduino-due/nsh/defconfig | 8 +- nuttx/configs/arduino-due/ostest/defconfig | 8 +- nuttx/configs/arduino-due/src/arduino-due.h | 2 +- nuttx/configs/ea3131/README.txt | 22 +- nuttx/configs/ea3131/nsh/defconfig | 22 +- nuttx/configs/ea3131/ostest/defconfig | 22 +- nuttx/configs/ea3131/pgnsh/defconfig | 22 +- nuttx/configs/ea3131/src/Makefile | 2 +- nuttx/configs/ea3131/src/ea3131_internal.h | 2 +- nuttx/configs/ea3131/src/up_boot.c | 2 +- nuttx/configs/ea3131/src/up_mem.c | 4 +- nuttx/configs/ea3131/usbserial/defconfig | 22 +- nuttx/configs/ea3131/usbstorage/defconfig | 22 +- nuttx/configs/ea3152/README.txt | 22 +- nuttx/configs/ea3152/ostest/defconfig | 22 +- nuttx/configs/ea3152/src/Makefile | 2 +- nuttx/configs/ea3152/src/ea3152_internal.h | 2 +- nuttx/configs/ea3152/src/up_boot.c | 2 +- nuttx/configs/ea3152/src/up_mem.c | 4 +- nuttx/configs/open1788/README.txt | 4 +- nuttx/configs/open1788/include/board.h | 2 +- nuttx/configs/open1788/knsh/defconfig | 20 +- nuttx/configs/open1788/nxlines/defconfig | 12 +- nuttx/configs/open1788/src/Makefile | 6 +- nuttx/configs/open1788/src/lpc17_boardinitialize.c | 6 +- nuttx/configs/open1788/src/lpc17_nandinitialize.c | 4 +- nuttx/configs/open1788/src/lpc17_norinitialize.c | 4 +- nuttx/configs/open1788/src/lpc17_sdraminitialize.c | 24 +- nuttx/configs/open1788/src/open1788.h | 6 +- nuttx/configs/sam3u-ek/nsh/defconfig | 8 +- nuttx/configs/sam3u-ek/nxwm/defconfig | 8 +- nuttx/configs/sam4s-xplained/README.txt | 8 +- nuttx/configs/sam4s-xplained/nsh/defconfig | 8 +- nuttx/configs/sam4s-xplained/src/Makefile | 2 +- nuttx/configs/sam4s-xplained/src/sam4s-xplained.h | 2 +- nuttx/configs/sam4s-xplained/src/sam_boot.c | 2 +- nuttx/configs/sam4s-xplained/src/sam_sram.c | 4 +- nuttx/configs/sama5d3x-ek/ostest/Make.defs | 2 +- nuttx/configs/sama5d3x-ek/ostest/defconfig | 18 +- 54 files changed, 1350 insertions(+), 407 deletions(-) create mode 100644 nuttx/arch/arm/src/sama5/sam_allocateheap.c diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1a1c0fbd1..d03fd845d 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -5176,4 +5176,14 @@ arm_fullcontextrestore.S, arm_saveusercontext.S: Add hardware floating point register save/restore logic for the Cortex-A5\ (2013-7-23). - + * arch/Kconfig: Attempt at generic external memory configuration is not + flexible enough, especially for the SAMA5. Move external memory + configuration options from arch/Kconfig to + arch/arm/src/lpc17xx/Kconfig, lpc31xx/Kconfig, sam34/Kconfig, and + sama5/Kconfig and renamed each from CONFIG_ARCH_ to, for example, + CONFIG_LPC31_. This renaming also affect many defconfig files + (2013-7-24). + * arch/arm/src/sama5/Kconfig and sam_allocateheap.c: Set up + configuration options for SAMA5 external memory regions; add a custom + sam_allocateheap.c to add the various configured memory regions to the + heap (2013-7-24). diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index 8b76605f6..c24da579d 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -103,147 +103,6 @@ source arch/x86/Kconfig source arch/z16/Kconfig source arch/z80/Kconfig -menu "External Memory Configuration" - -config ARCH_HAVE_EXTNAND - bool - -config ARCH_HAVE_EXTNOR - bool - -config ARCH_HAVE_EXTDRAM - bool - -config ARCH_HAVE_EXTSRAM0 - bool - -config ARCH_HAVE_EXTSRAM1 - bool - -config ARCH_EXTNAND - bool "Configure external NAND" - default n - depends on ARCH_HAVE_EXTNAND - ---help--- - Configure external NAND memory and, if applicable, map then external - NAND into the memory map. - -if ARCH_EXTNAND - -config ARCH_EXTNANDSIZE - int "External NAND size" - default 0 - ---help--- - Size of the external NAND in bytes. - -endif - -config ARCH_EXTNOR - bool "Configure external NOR memory" - default n - depends on ARCH_HAVE_EXTNOR - ---help--- - Configure external NOR memory and, if applicable, map then external - NOR into the memory map. - -if ARCH_EXTNOR - -config ARCH_EXTNORSIZE - int "External NOR size" - default 0 - ---help--- - Size of the external NOR in bytes. - -endif - -config ARCH_EXTDRAM - bool "Configure external DRAM" - default n - depends on ARCH_HAVE_EXTDRAM - ---help--- - Configure external DRAM memory and, if applicable, map then external - DRAM into the memory map. - -if ARCH_EXTDRAM - -config ARCH_EXTDRAMSIZE - int "External SDRAM size" - default 0 - ---help--- - Size of the external SDRAM in bytes. - -choice - prompt "SDRAM Width Selection" - default ARCH_SDRAM_16BIT - -config ARCH_SDRAM_8BIT - bool "8-bit" - -config ARCH_SDRAM_16BIT - bool "16-bit" - -config ARCH_SDRAM_32BIT - bool "32-bit" - -endchoice - -config ARCH_EXTDRAMHEAP - bool "Add external SDRAM to the heap" - default y - ---help--- - Add the external SDRAM into the heap. - -endif - -config ARCH_EXTSRAM0 - bool "Configure external SRAM (Bank 0)" - default n - depends on ARCH_HAVE_EXTSRAM0 - ---help--- - Configure external SRAM Bank 0 memory and, if applicable, map then - external SRAM Bank 0 into the memory map. - -if ARCH_EXTSRAM0 - -config ARCH_EXTSRAM0SIZE - int "External SRAM size" - default 0 - ---help--- - Size of the external SRAM Bank 0 in bytes. - -config ARCH_EXTSRAM0HEAP - bool "Add external SRAM (Bank 0) to the heap" - default y - ---help--- - Add external SRAM Bank 0 into the heap. - -endif - -config ARCH_EXTSRAM1 - bool "Configure external SRAM (Bank 1)" - default n - depends on ARCH_HAVE_EXTSRAM1 - ---help--- - Configure external SRAM Bank 1 memory and, if applicable, map then - external SRAM Bank 1 into the memory map. - -if ARCH_EXTSRAM1 - -config ARCH_EXTSRAM1SIZE - int "External SRAM1 size" - default 0 - ---help--- - Size of the external SRAM Bank 1 in bytes. - -config ARCH_EXTSRAM1HEAP - bool "Add external SRAM (Bank 1) to the heap" - default y - ---help--- - Add external SRAM Bank 1 into the heap. - -endif -endmenu - comment "Architecture Options" config ARCH_NOINTC diff --git a/nuttx/arch/arm/src/lpc17xx/Kconfig b/nuttx/arch/arm/src/lpc17xx/Kconfig index ff383bae4..1194e3fa3 100644 --- a/nuttx/arch/arm/src/lpc17xx/Kconfig +++ b/nuttx/arch/arm/src/lpc17xx/Kconfig @@ -323,6 +323,120 @@ config LPC17_EEPROM endmenu +menu "External Memory Configuration" + +config ARCH_HAVE_EXTNAND + bool + +config ARCH_HAVE_EXTNOR + bool + +config ARCH_HAVE_EXTDRAM + bool + +config ARCH_HAVE_EXTSRAM0 + bool + +config LPC17_EXTNAND + bool "Configure external NAND" + default n + depends on ARCH_HAVE_EXTNAND + ---help--- + Configure external NAND memory and, if applicable, map then external + NAND into the memory map. + +if LPC17_EXTNAND + +config LPC17_EXTNANDSIZE + int "External NAND size" + default 0 + ---help--- + Size of the external NAND in bytes. + +endif + +config LPC17_EXTNOR + bool "Configure external NOR memory" + default n + depends on ARCH_HAVE_EXTNOR + ---help--- + Configure external NOR memory and, if applicable, map then external + NOR into the memory map. + +if LPC17_EXTNOR + +config LPC17_EXTNORSIZE + int "External NOR size" + default 0 + ---help--- + Size of the external NOR in bytes. + +endif + +config LPC17_EXTDRAM + bool "Configure external DRAM" + default n + depends on ARCH_HAVE_EXTDRAM + ---help--- + Configure external DRAM memory and, if applicable, map then external + DRAM into the memory map. + +if LPC17_EXTDRAM + +config LPC17_EXTDRAMSIZE + int "External SDRAM size" + default 0 + ---help--- + Size of the external SDRAM in bytes. + +choice + prompt "SDRAM Width Selection" + default LPC17_SDRAM_16BIT + +config LPC17_SDRAM_8BIT + bool "8-bit" + +config LPC17_SDRAM_16BIT + bool "16-bit" + +config LPC17_SDRAM_32BIT + bool "32-bit" + +endchoice + +config LPC17_EXTDRAMHEAP + bool "Add external SDRAM to the heap" + default y + ---help--- + Add the external SDRAM into the heap. + +endif + +config LPC17_EXTSRAM0 + bool "Configure external SRAM (Bank 0)" + default n + depends on ARCH_HAVE_EXTSRAM0 + ---help--- + Configure external SRAM Bank 0 memory and, if applicable, map then + external SRAM Bank 0 into the memory map. + +if LPC17_EXTSRAM0 + +config LPC17_EXTSRAM0SIZE + int "External SRAM size" + default 0 + ---help--- + Size of the external SRAM Bank 0 in bytes. + +config LPC17_EXTSRAM0HEAP + bool "Add external SRAM (Bank 0) to the heap" + default y + ---help--- + Add external SRAM Bank 0 into the heap. + +endif +endmenu + menu "Serial driver options" depends on LPC17_UART0 || LPC17_UART1 || LPC17_UART2 || LPC17_UART3 || LPC17_UART4 diff --git a/nuttx/arch/arm/src/lpc31xx/Kconfig b/nuttx/arch/arm/src/lpc31xx/Kconfig index 1022cfe60..c2447cb7f 100644 --- a/nuttx/arch/arm/src/lpc31xx/Kconfig +++ b/nuttx/arch/arm/src/lpc31xx/Kconfig @@ -38,7 +38,7 @@ config ARCH_CHIP_LPC3154 select ARCH_HAVE_EXTSRAM1 select ARCH_HAVE_EXTDRAM -endchoice +endchoice # LPC31xx Configuration Options choice prompt "Toolchain Selection" @@ -62,11 +62,11 @@ config LPC31_BUILDROOT bool "Buildroot" depends on !WINDOWS_NATIVE -endchoice +endchoice # Toolchain Selection config LPC31_SDRAMHCLK int "External SDRAM HCLK" - depends on ARCH_EXTSDRAM + depends on LPC31_EXTSDRAM ---help--- The SDRAM HCLK may be specified here (if not, it will be calculated). @@ -89,7 +89,127 @@ config LPC31_MCI bool "MCI" default n -endmenu +endmenu # LPC31xx Peripheral Support + +menu "External Memory Configuration" + +config ARCH_HAVE_EXTNAND + bool + +config ARCH_HAVE_EXTDRAM + bool + +config ARCH_HAVE_EXTSRAM0 + bool + +config ARCH_HAVE_EXTSRAM1 + bool + +config LPC31_EXTNAND + bool "Configure external NAND" + default n + depends on ARCH_HAVE_EXTNAND + ---help--- + Configure external NAND memory and, if applicable, map then external + NAND into the memory map. + +if LPC31_EXTNAND + +config LPC31_EXTNANDSIZE + int "External NAND size" + default 0 + ---help--- + Size of the external NAND in bytes. + +endif # LPC31_EXTNAND + +config LPC31_EXTDRAM + bool "Configure external DRAM" + default n + depends on ARCH_HAVE_EXTDRAM + ---help--- + Configure external DRAM memory and, if applicable, map then external + DRAM into the memory map. + +if LPC31_EXTDRAM + +config LPC31_EXTDRAMSIZE + int "External SDRAM size" + default 0 + ---help--- + Size of the external SDRAM in bytes. + +choice + prompt "SDRAM Width Selection" + default LPC31_SDRAM_16BIT + +config LPC31_SDRAM_8BIT + bool "8-bit" + +config LPC31_SDRAM_16BIT + bool "16-bit" + +config LPC31_SDRAM_32BIT + bool "32-bit" + +endchoice # SDRAM Width Selection + +config LPC31_EXTDRAMHEAP + bool "Add external SDRAM to the heap" + default y + ---help--- + Add the external SDRAM into the heap. + +endif # LPC31_EXTDRAM + +config LPC31_EXTSRAM0 + bool "Configure external SRAM (Bank 0)" + default n + depends on ARCH_HAVE_EXTSRAM0 + ---help--- + Configure external SRAM Bank 0 memory and, if applicable, map then + external SRAM Bank 0 into the memory map. + +if LPC31_EXTSRAM0 + +config LPC31_EXTSRAM0SIZE + int "External SRAM size" + default 0 + ---help--- + Size of the external SRAM Bank 0 in bytes. + +config LPC31_EXTSRAM0HEAP + bool "Add external SRAM (Bank 0) to the heap" + default y + ---help--- + Add external SRAM Bank 0 into the heap. + +endif # LPC31_EXTSRAM0 + +config LPC31_EXTSRAM1 + bool "Configure external SRAM (Bank 1)" + default n + depends on ARCH_HAVE_EXTSRAM1 + ---help--- + Configure external SRAM Bank 1 memory and, if applicable, map then + external SRAM Bank 1 into the memory map. + +if LPC31_EXTSRAM1 + +config LPC31_EXTSRAM1SIZE + int "External SRAM1 size" + default 0 + ---help--- + Size of the external SRAM Bank 1 in bytes. + +config LPC31_EXTSRAM1HEAP + bool "Add external SRAM (Bank 1) to the heap" + default y + ---help--- + Add external SRAM Bank 1 into the heap. + +endif # LPC31_EXTSRAM1 +endmenu # External Memory Configuration menu "LPC31xx UART Configuration" depends on LPC31_UART @@ -109,7 +229,7 @@ config LPC31_UART_MULVAL ---help--- BAUD multiplier -endmenu +endmenu # LPC31xx UART Configuration menu "USB device driver options" @@ -143,7 +263,7 @@ config LPC31_USBDEV_REGDEBUG ---help--- Output detailed register-level USB device debug information. Requires also DEBUG. -endmenu +endmenu # USB device driver options menu "SPI device driver options" @@ -154,5 +274,4 @@ config LPC31_SPI_REGDEBUG ---help--- Output detailed register-level SPI device debug information. Requires also DEBUG. -endmenu - +endmenu # SPI device driver options diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c b/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c index 7c2c8696a..5a935a548 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c @@ -68,31 +68,31 @@ * memory regions that we have been asked to add to the heap. */ -#if defined(CONFIG_ARCH_EXTSRAM0) && defined(CONFIG_ARCH_EXTSRAM0HEAP) -# if defined(CONFIG_ARCH_EXTSRAM1) && defined(CONFIG_ARCH_EXTSRAM1HEAP) -# if defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP) +#if defined(CONFIG_LPC31_EXTSRAM0) && defined(CONFIG_LPC31_EXTSRAM0HEAP) +# if defined(CONFIG_LPC31_EXTSRAM1) && defined(CONFIG_LPC31_EXTSRAM1HEAP) +# if defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) # /* SRAM+EXTSRAM0+EXTSRAM1+EXTSDRAM */ # define LPC31_NEXT_REGIONS 4 # else # /* SRAM+EXTSRAM0+EXTSRAM1 */ # define LPC31_NEXT_REGIONS 3 # endif -# elif defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP) +# elif defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) # /* SRAM+EXTSRAM0+EXTSDRAM */ # define LPC31_NEXT_REGIONS 3 # else # /* SRAM+EXTSRAM0 */ # define LPC31_NEXT_REGIONS 2 # endif -#elif defined(CONFIG_ARCH_EXTSRAM1) && defined(CONFIG_ARCH_EXTSRAM1HEAP) -# if defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP) +#elif defined(CONFIG_LPC31_EXTSRAM1) && defined(CONFIG_LPC31_EXTSRAM1HEAP) +# if defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) # /* SRAM+EXTSRAM1+EXTSDRAM */ # define LPC31_NEXT_REGIONS 3 # else # /* SRAM+EXTSRAM1 */ # define LPC31_NEXT_REGIONS 2 # endif -#elif defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP) +#elif defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) # /* SRAM+EXTSDRAM */ # define LPC31_NEXT_REGIONS 2 #else @@ -106,13 +106,13 @@ # else # error "CONFIG_MM_REGIONS is too large for the selected memory regions" # endif -# if defined(CONFIG_ARCH_EXTSRAM0) && defined(CONFIG_ARCH_EXTSRAM0HEAP) +# if defined(CONFIG_LPC31_EXTSRAM0) && defined(CONFIG_LPC31_EXTSRAM0HEAP) # error "External SRAM0 is selected for heap" # endif -# if defined(CONFIG_ARCH_EXTSRAM1) && defined(CONFIG_ARCH_EXTSRAM1HEAP) +# if defined(CONFIG_LPC31_EXTSRAM1) && defined(CONFIG_LPC31_EXTSRAM1HEAP) # error "External SRAM1 is selected for heap" # endif -# if defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP) +# if defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) # error "External SRAM1 is selected for heap" # endif #endif @@ -196,16 +196,16 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) #if CONFIG_MM_REGIONS > 1 void up_addregion(void) { -#if defined(CONFIG_ARCH_EXTSRAM0) && defined(CONFIG_ARCH_EXTSRAM0HEAP) - kmm_addregion((FAR void*)LPC31_EXTSRAM0_VSECTION, CONFIG_ARCH_EXTSRAM0SIZE); +#if defined(CONFIG_LPC31_EXTSRAM0) && defined(CONFIG_LPC31_EXTSRAM0HEAP) + kmm_addregion((FAR void*)LPC31_EXTSRAM0_VSECTION, CONFIG_LPC31_EXTSRAM0SIZE); #endif -#if defined(CONFIG_ARCH_EXTSRAM1) && defined(CONFIG_ARCH_EXTSRAM1HEAP) - kmm_addregion((FAR void*)LPC31_EXTSRAM1_VSECTION, CONFIG_ARCH_EXTSRAM1SIZE); +#if defined(CONFIG_LPC31_EXTSRAM1) && defined(CONFIG_LPC31_EXTSRAM1HEAP) + kmm_addregion((FAR void*)LPC31_EXTSRAM1_VSECTION, CONFIG_LPC31_EXTSRAM1SIZE); #endif -#if defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP) - kmm_addregion((FAR void*)LPC31_EXTSDRAM_VSECTION, CONFIG_ARCH_EXTDRAMSIZE); +#if defined(CONFIG_LPC31_EXTDRAM) && defined(CONFIG_LPC31_EXTDRAMHEAP) + kmm_addregion((FAR void*)LPC31_EXTSDRAM_VSECTION, CONFIG_LPC31_EXTDRAMSIZE); #endif } #endif diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c b/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c index a7c1acdc8..24beb87fa 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_boot.c @@ -112,17 +112,17 @@ static const struct section_mapping_s section_mapping[] = LPC31_MCI_MMUFLAGS, LPC31_MCI_NSECTIONS}, { LPC31_USBOTG_PSECTION, LPC31_USBOTG_VSECTION, LPC31_USBOTG_MMUFLAGS, LPC31_USBOTG_NSECTIONS}, -#if defined(CONFIG_ARCH_EXTSRAM0) && CONFIG_ARCH_EXTSRAM0SIZE > 0 +#if defined(CONFIG_LPC31_EXTSRAM0) && CONFIG_LPC31_EXTSRAM0SIZE > 0 { LPC31_EXTSRAM_PSECTION, LPC31_EXTSRAM_VSECTION, LPC31_EXTSDRAM_MMUFLAGS, LPC31_EXTSRAM_NSECTIONS}, #endif -#if defined(CONFIG_ARCH_EXTDRAM) && CONFIG_ARCH_EXTDRAMSIZE > 0 +#if defined(CONFIG_LPC31_EXTDRAM) && CONFIG_LPC31_EXTDRAMSIZE > 0 { LPC31_EXTSDRAM0_PSECTION, LPC31_EXTSDRAM0_VSECTION, LPC31_EXTSDRAM_MMUFLAGS, LPC31_EXTSDRAM0_NSECTIONS}, #endif { LPC31_INTC_PSECTION, LPC31_INTC_VSECTION, LPC31_INTC_MMUFLAGS, LPC31_INTC_NSECTIONS}, -#ifdef CONFIG_ARCH_EXTNAND +#ifdef CONFIG_LPC31_EXTNAND { LPC31_NAND_PSECTION, LPC31_NAND_VSECTION LPC31_NAND_MMUFLAGS, LPC31_NAND_NSECTIONS}, #endif diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_memorymap.h b/nuttx/arch/arm/src/lpc31xx/lpc31_memorymap.h index 6337f9e83..dfe2bc16d 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_memorymap.h +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_memorymap.h @@ -81,7 +81,7 @@ /* 0x60001000-0x6fffffff: Reserved */ #define LPC31_NAND_PSECTION 0x70000000 /* 0x70000000-0x700007ff: NANDFLASH Ctrl 2Kb */ /* 0x70000800-0xffffffff: Reserved */ -#ifdef CONFIG_ARCH_EXTNAND /* End of the physical address space */ +#ifdef CONFIG_LPC31_EXTNAND /* End of the physical address space */ # define LPC31_LAST_PSECTION (LPC31_NAND_PSECTION + (1 << 20)) #else # define LPC31_LAST_PSECTION (LPC31_INTC_PSECTION + (1 << 20)) @@ -176,8 +176,8 @@ * the size of the SDRAM installed. */ -#if defined(CONFIG_ARCH_EXTDRAM) && CONFIG_ARCH_EXTDRAMSIZE > 0 -# define LPC31_EXTSDRAM0_NSECTIONS _NSECTIONS(CONFIG_ARCH_EXTDRAMSIZE) +#if defined(CONFIG_LPC31_EXTDRAM) && CONFIG_LPC31_EXTDRAMSIZE > 0 +# define LPC31_EXTSDRAM0_NSECTIONS _NSECTIONS(CONFIG_LPC31_EXTDRAMSIZE) #endif /* Section MMU Flags */ @@ -233,7 +233,7 @@ # define LPC31_INTC_VSECTION 0x60000000 /* 0x60000000-0x60000fff: Interrupt controller 4Kb */ # define LPC31_NAND_VSECTION 0x70000000 /* 0x70000000-0x700007ff: NANDFLASH Ctrl 2Kb */ # -# ifdef CONFIG_ARCH_EXTNAND /* End of the virtual address space */ +# ifdef CONFIG_LPC31_EXTNAND /* End of the virtual address space */ # define LPC31_LAST_VSECTION (LPC31_NAND_VSECTION + (1 << 20)) # else # define LPC31_LAST_VSECTION (LPC31_INTC_VSECTION + (1 << 20)) diff --git a/nuttx/arch/arm/src/sam34/Kconfig b/nuttx/arch/arm/src/sam34/Kconfig index 8ce877628..ffa5269e3 100644 --- a/nuttx/arch/arm/src/sam34/Kconfig +++ b/nuttx/arch/arm/src/sam34/Kconfig @@ -163,7 +163,7 @@ config ARCH_CHIP_ATSAM4S8B select ARCH_CORTEXM4 select ARCH_CHIP_SAM4S -endchoice +endchoice # AT91SAM3/4 Chip Selection config ARCH_CHIP_SAM3U bool @@ -520,7 +520,7 @@ config SAM34_HSMCI default n depends on ARCH_CHIP_SAM3U || ARCH_CHIP_SAM3X || ARCH_CHIP_SAM3A || ARCH_CHIP_SAM4S -endmenu +endmenu # AT91SAM3/4 Peripheral Support if ARCH_CHIP_SAM4L menu "AT91SAM3/4 Clock Configuration" @@ -587,8 +587,8 @@ config SAM34_RCFAST8M config SAM34_RCFAST4M bool "4MHz" -endchoice -endif +endchoice # Fast RC Oscillator Speed +endif # SAM34_RCFAST config SAM34_RC1M bool "1MHz RC oscillator" @@ -610,8 +610,149 @@ config SAM34_RC32K you can also force the clock to be enabled at boot time for other purposes. -endmenu -endif +endmenu # AT91SAM3/4 Clock Configuration +endif # ARCH_CHIP_SAM4L + +menu "External Memory Configuration" + +config ARCH_HAVE_EXTNAND + bool + +config ARCH_HAVE_EXTNOR + bool + +config ARCH_HAVE_EXTDRAM + bool + +config ARCH_HAVE_EXTSRAM0 + bool + +config ARCH_HAVE_EXTSRAM1 + bool + +config SAM34_EXTNAND + bool "Configure external NAND" + default n + depends on ARCH_HAVE_EXTNAND + ---help--- + Configure external NAND memory and, if applicable, map then external + NAND into the memory map. + +if SAM34_EXTNAND + +config SAM34_EXTNANDSIZE + int "External NAND size" + default 0 + ---help--- + Size of the external NAND in bytes. + +endif # SAM34_EXTNAND + +config SAM34_EXTNOR + bool "Configure external NOR memory" + default n + depends on ARCH_HAVE_EXTNOR + ---help--- + Configure external NOR memory and, if applicable, map then external + NOR into the memory map. + +if SAM34_EXTNOR + +config SAM34_EXTNORSIZE + int "External NOR size" + default 0 + ---help--- + Size of the external NOR in bytes. + +endif # SAM34_EXTNOR + +config SAM34_EXTDRAM + bool "Configure external DRAM" + default n + depends on ARCH_HAVE_EXTDRAM + ---help--- + Configure external DRAM memory and, if applicable, map then external + DRAM into the memory map. + +if SAM34_EXTDRAM + +config SAM34_EXTDRAMSIZE + int "External SDRAM size" + default 0 + ---help--- + Size of the external SDRAM in bytes. + +choice + prompt "SDRAM Width Selection" + default SAM34_SDRAM_16BIT + +config SAM34_SDRAM_8BIT + bool "8-bit" + +config SAM34_SDRAM_16BIT + bool "16-bit" + +config SAM34_SDRAM_32BIT + bool "32-bit" + +endchoice # SDRAM Width Selection + +config SAM34_EXTDRAMHEAP + bool "Add external SDRAM to the heap" + default y + ---help--- + Add the external SDRAM into the heap. + +endif # SAM34_EXTDRAM + +config SAM34_EXTSRAM0 + bool "Configure external SRAM (Bank 0)" + default n + depends on ARCH_HAVE_EXTSRAM0 + ---help--- + Configure external SRAM Bank 0 memory and, if applicable, map then + external SRAM Bank 0 into the memory map. + +if SAM34_EXTSRAM0 + +config SAM34_EXTSRAM0SIZE + int "External SRAM size" + default 0 + ---help--- + Size of the external SRAM Bank 0 in bytes. + +config SAM34_EXTSRAM0HEAP + bool "Add external SRAM (Bank 0) to the heap" + default y + ---help--- + Add external SRAM Bank 0 into the heap. + +endif # SAM34_EXTSRAM0 + +config SAM34_EXTSRAM1 + bool "Configure external SRAM (Bank 1)" + default n + depends on ARCH_HAVE_EXTSRAM1 + ---help--- + Configure external SRAM Bank 1 memory and, if applicable, map then + external SRAM Bank 1 into the memory map. + +if SAM34_EXTSRAM1 + +config SAM34_EXTSRAM1SIZE + int "External SRAM1 size" + default 0 + ---help--- + Size of the external SRAM Bank 1 in bytes. + +config SAM34_EXTSRAM1HEAP + bool "Add external SRAM (Bank 1) to the heap" + default y + ---help--- + Add external SRAM Bank 1 into the heap. + +endif # SAM34_EXTSRAM1 +endmenu # External Memory Configuration comment "AT91SAM3/4 USART Configuration" @@ -675,7 +816,7 @@ config GPIOF_IRQ default n depends on ARCH_CHIP_SAM3X || ARCH_CHIP_SAM3A -endif +endif # GPIO_IRQ if SAM34_WDT comment "AT91SAM3/4 Watchdog Configuration"| @@ -701,4 +842,4 @@ config WDT_DISABLE_ON_RESET configure and disable the watchdog timer very early in the boot sequence. -endif +endif # SAM34_WDT diff --git a/nuttx/arch/arm/src/sam34/sam_allocateheap.c b/nuttx/arch/arm/src/sam34/sam_allocateheap.c index 93fae363d..423c38f2a 100644 --- a/nuttx/arch/arm/src/sam34/sam_allocateheap.c +++ b/nuttx/arch/arm/src/sam34/sam_allocateheap.c @@ -75,24 +75,24 @@ * to be used as heap. */ -#if !defined(CONFIG_ARCH_EXTSRAM0) || !defined(CONFIG_ARCH_EXTSRAM0HEAP) -# undef CONFIG_ARCH_EXTSRAM0SIZE -# define CONFIG_ARCH_EXTSRAM0SIZE 0 +#if !defined(CONFIG_SAM34_EXTSRAM0) || !defined(CONFIG_SAM34_EXTSRAM0HEAP) +# undef CONFIG_SAM34_EXTSRAM0SIZE +# define CONFIG_SAM34_EXTSRAM0SIZE 0 #endif -#if !defined(CONFIG_ARCH_EXTSRAM1) || !defined(CONFIG_ARCH_EXTSRAM1HEAP) -# undef CONFIG_ARCH_EXTSRAM1SIZE -# define CONFIG_ARCH_EXTSRAM1SIZE 0 +#if !defined(CONFIG_SAM34_EXTSRAM1) || !defined(CONFIG_SAM34_EXTSRAM1HEAP) +# undef CONFIG_SAM34_EXTSRAM1SIZE +# define CONFIG_SAM34_EXTSRAM1SIZE 0 #endif -#if !defined(CONFIG_ARCH_EXTSRAM2) || !defined(CONFIG_ARCH_EXTSRAM2HEAP) -# undef CONFIG_ARCH_EXTSRAM2SIZE -# define CONFIG_ARCH_EXTSRAM2SIZE 0 +#if !defined(CONFIG_SAM34_EXTSRAM2) || !defined(CONFIG_SAM34_EXTSRAM2HEAP) +# undef CONFIG_SAM34_EXTSRAM2SIZE +# define CONFIG_SAM34_EXTSRAM2SIZE 0 #endif -#if !defined(CONFIG_ARCH_EXTSRAM3) || !defined(CONFIG_ARCH_EXTSRAM3HEAP) -# undef CONFIG_ARCH_EXTSRAM3SIZE -# define CONFIG_ARCH_EXTSRAM3SIZE 0 +#if !defined(CONFIG_SAM34_EXTSRAM3) || !defined(CONFIG_SAM34_EXTSRAM3HEAP) +# undef CONFIG_SAM34_EXTSRAM3SIZE +# define CONFIG_SAM34_EXTSRAM3SIZE 0 #endif /* SAM3U, SAM3X, and SAM3A Unique memory configurations */ @@ -119,7 +119,7 @@ # warning "CONFIG_MM_REGIONS < 3: NFC SRAM not included in HEAP" # endif -# if CONFIG_ARCH_EXTSRAM0SIZE > 0 +# if CONFIG_SAM34_EXTSRAM0SIZE > 0 # if CONFIG_MM_REGIONS > 3 # define HAVE_EXTSRAM0_REGION 1 # else @@ -127,7 +127,7 @@ # endif # endif -# elif CONFIG_ARCH_EXTSRAM0SIZE > 0 +# elif CONFIG_SAM34_EXTSRAM0SIZE > 0 # if CONFIG_MM_REGIONS > 2 # define HAVE_EXTSRAM0_REGION 1 # else @@ -138,7 +138,7 @@ /* The SAM4S and SAM4L may have only internal SRAM0 and external SRAM0 */ -# if CONFIG_ARCH_EXTSRAM0SIZE > 0 +# if CONFIG_SAM34_EXTSRAM0SIZE > 0 # if CONFIG_MM_REGIONS > 1 # define HAVE_EXTSRAM0_REGION 1 # else @@ -340,44 +340,44 @@ void up_addregion(void) #ifdef HAVE_EXTSRAM0_REGION /* Allow user access to the heap memory */ - sam_mpu_uheap(SAM_EXTCS0_BASE, CONFIG_ARCH_EXTSRAM0SIZE); + sam_mpu_uheap(SAM_EXTCS0_BASE, CONFIG_SAM34_EXTSRAM0SIZE); /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS0_BASE, CONFIG_ARCH_EXTSRAM0SIZE); + kumm_addregion((FAR void*)SAM_EXTCS0_BASE, CONFIG_SAM34_EXTSRAM0SIZE); #endif /* HAVE_EXTSRAM0_REGION */ #ifdef HAVE_EXTSRAM1_REGION /* Allow user access to the heap memory */ - sam_mpu_uheap(SAM_EXTCS1_BASE, CONFIG_ARCH_EXTSRAM1SIZE); + sam_mpu_uheap(SAM_EXTCS1_BASE, CONFIG_SAM34_EXTSRAM1SIZE); /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS1_BASE, CONFIG_ARCH_EXTSRAM1SIZE); + kumm_addregion((FAR void*)SAM_EXTCS1_BASE, CONFIG_SAM34_EXTSRAM1SIZE); #endif /* HAVE_EXTSRAM0_REGION */ #ifdef HAVE_EXTSRAM2_REGION /* Allow user access to the heap memory */ - sam_mpu_uheap(SAM_EXTCS2_BASE, CONFIG_ARCH_EXTSRAM2SIZE); + sam_mpu_uheap(SAM_EXTCS2_BASE, CONFIG_SAM34_EXTSRAM2SIZE); /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS2_BASE, CONFIG_ARCH_EXTSRAM2SIZE); + kumm_addregion((FAR void*)SAM_EXTCS2_BASE, CONFIG_SAM34_EXTSRAM2SIZE); #endif /* HAVE_EXTSRAM0_REGION */ #ifdef HAVE_EXTSRAM3_REGION /* Allow user access to the heap memory */ - sam_mpu_uheap(SAM_EXTCS3_BASE, CONFIG_ARCH_EXTSRAM3SIZE); + sam_mpu_uheap(SAM_EXTCS3_BASE, CONFIG_SAM34_EXTSRAM3SIZE); /* Add the region */ - kumm_addregion((FAR void*)SAM_EXTCS3_BASE, CONFIG_ARCH_EXTSRAM3SIZE); + kumm_addregion((FAR void*)SAM_EXTCS3_BASE, CONFIG_SAM34_EXTSRAM3SIZE); #endif /* HAVE_EXTSRAM0_REGION */ } diff --git a/nuttx/arch/arm/src/sama5/Kconfig b/nuttx/arch/arm/src/sama5/Kconfig index c830af9f4..492903dce 100644 --- a/nuttx/arch/arm/src/sama5/Kconfig +++ b/nuttx/arch/arm/src/sama5/Kconfig @@ -27,7 +27,7 @@ config ARCH_CHIP_ATSAMA5D35 bool "Atmel ATSAMA5D35" select ARCH_CHIP_SAMA5D3 -endchoice +endchoice # Atmel AT91SAMA5 Chip Selection menu "ATSAMA5 Peripheral Support" @@ -205,7 +205,7 @@ config SAMA5_MPDDRC bool "MPDDR controller (MPDDRC)" default n -endmenu +endmenu # ATSAMA5 Peripheral Support config PIO_IRQ bool "PIO pin interrupts" @@ -234,35 +234,364 @@ config PIOE_IRQ bool "PIOE interrupts" default n -endif +endif # PIO_IRQ + +menu "External Memory Configuration" + +config SAMA5_DDRCS + bool "External DDR-SDRAM Memory" + default n + ---help--- + Build in support for DDR-SDRAM memory resources. + +if SAMA5_DDRCS + +config SAMA5_DDRCS_SIZE + int "DDR-SDRAM Memory size" + default 0 + ---help--- + Mapped size of the DDR-SDRAM memory region. + +choice + prompt "DDR-SDRAM Memory Type" + default SAMA5_DDRCS_LPDDR1 + ---help--- + Select the type of DDR-SDRAM memory present + +config SAMA5_DDRCS_LPDDR1 + bool "Low-power DDR1-SDRAM (LPDDR1)" + +config SAMA5_DDRCS_LPDDR2 + bool "Low-power DDR2-SDRAM-S4 (LPDDR2)" + +endchoice # DDR-SDRAM Memory Type +endif # SAMA5_DDRCS + +config SAMA5_EBICS0 + bool "External CS0 Memory" + default n + ---help--- + Build in support for memory resources in the chip select 0 (CS0) + memory region. + +if SAMA5_EBICS0 + +config SAMA5_EBICS0_SIZE + int "CS0 Memory size" + default 0 + ---help--- + Mapped size of the memory region at CS0. + +choice + prompt "CS0 Memory Type" + default SAMA5_EBICS0_NOR + ---help--- + Select the type of memory present on CS0 + +config SAMA5_EBICS0_SRAM + bool "SRAM" + +config SAMA5_EBICS0_PSRAM + bool "PSRAM" + +config SAMA5_EBICS0_PROM + bool "PROM" + +config SAMA5_EBICS0_EEPROM + bool "EEPROM" + +config SAMA5_EBICS0_EPROM + bool "EPROM" + +config SAMA5_EBICS0_LCD + bool "LCD" + +config SAMA5_EBICS0_NOR + bool "NOR Flash" + +config SAMA5_EBICS0_NAND + bool "NAND Flash" + +endchoice # CS0 Memory Type +endif # SAMA5_EBICS0 + +config SAMA5_EBICS1 + bool "External CS1 Memory" + default n + ---help--- + Build in support for memory resources in the chip select 1 (CS1) + memory region. + +if SAMA5_EBICS1 + +config SAMA5_EBICS1_SIZE + int "CS1 Memory size" + default 0 + ---help--- + Mapped size of the memory region at CS1. + +choice + prompt "CS1 Memory Type" + default SAMA5_EBICS1_NOR + ---help--- + Select the type of memory present on CS1 + +config SAMA5_EBICS1_SRAM + bool "SRAM" + +config SAMA5_EBICS1_PSRAM + bool "PSRAM" + +config SAMA5_EBICS1_PROM + bool "PROM" + +config SAMA5_EBICS1_EEPROM + bool "EEPROM" + +config SAMA5_EBICS1_EPROM + bool "EPROM" + +config SAMA5_EBICS1_LCD + bool "LCD" + +config SAMA5_EBICS1_NOR + bool "NOR Flash" + +config SAMA5_EBICS1_NAND + bool "NAND Flash" + +endchoice # CS1 Memory Type +endif # SAMA5_EBICS1 + +config SAMA5_EBICS2 + bool "External CS2 Memory" + default n + ---help--- + Build in support for memory resources in the chip select 2 (CS2) + memory region. + +if SAMA5_EBICS2 + +config SAMA5_EBICS2_SIZE + int "CS2 Memory size" + default 0 + ---help--- + Mapped size of the memory region at CS2. + +choice + prompt "CS2 Memory Type" + default SAMA5_EBICS2_NOR + ---help--- + Select the type of memory present on CS2 + +config SAMA5_EBICS2_SRAM + bool "SRAM" + +config SAMA5_EBICS2_PSRAM + bool "PSRAM" + +config SAMA5_EBICS2_PROM + bool "PROM" + +config SAMA5_EBICS2_EEPROM + bool "EEPROM" + +config SAMA5_EBICS2_EPROM + bool "EPROM" + +config SAMA5_EBICS2_LCD + bool "LCD" + +config SAMA5_EBICS2_NOR + bool "NOR Flash" + +config SAMA5_EBICS2_NAND + bool "NAND Flash" + +endchoice # CS2 Memory Type +endif # SAMA5_EBICS2 + +config SAMA5_EBICS3 + bool "External CS3 Memory" + default n + ---help--- + Build in support for memory resources in the chip select 3 (CS3) + memory region. + +if SAMA5_EBICS3 + +config SAMA5_EBICS3_SIZE + int "CS3 Memory size" + default 0 + ---help--- + Mapped size of the memory region at CS3. + +choice + prompt "CS3 Memory Type" + default SAMA5_EBICS3_NOR + ---help--- + Select the type of memory present on CS3 + +config SAMA5_EBICS3_SRAM + bool "SRAM" + +config SAMA5_EBICS3_PSRAM + bool "PSRAM" + +config SAMA5_EBICS3_PROM + bool "PROM" + +config SAMA5_EBICS3_EEPROM + bool "EEPROM" + +config SAMA5_EBICS3_EPROM + bool "EPROM" + +config SAMA5_EBICS3_LCD + bool "LCD" + +config SAMA5_EBICS3_NOR + bool "NOR Flash" + +config SAMA5_EBICS3_NAND + bool "NAND Flash" + +endchoice # CS3 Memory Type +endif # SAMA5_EBICS3 +endmenu # External Memory Configuration choice prompt "SAMA5 Boot Configuration" - default SAMA5_BOOT_SRAM + default SAMA5_BOOT_ISRAM ---help--- The startup code needs to know if the code is running from internal SRAM, external SRAM, or CS0-3 in order to initialize properly. Note that the - boot device is not specified for cases where the code is copied into SRAM; - those cases are all covered by SAMA5_BOOT_SRAM. + boot device is not specified for cases where the code is copied into + internal SRAM; those cases are all covered by SAMA5_BOOT_ISRAM. -config SAMA5_BOOT_SRAM +config SAMA5_BOOT_ISRAM bool "Running from internal SRAM" config SAMA5_BOOT_SDRAM bool "Running from external SDRAM" + depends on SAMA5_DDRCS config SAMA5_BOOT_CS0FLASH bool "Running in external FLASH CS0" + depends on SAMA5_EBICS0_NOR + +config SAMA5_BOOT_CS0SRAM + bool "Running in external FLASH CS0" + depends on SAMA5_EBICS0_SRAM || SAMA5_EBICS0_PSRAM config SAMA5_BOOT_CS1FLASH bool "Running in external FLASH CS1" + depends on SAMA5_EBICS1_NOR + +config SAMA5_BOOT_CS1SRAM + bool "Running in external FLASH CS1" + depends on SAMA5_EBICS1_SRAM || SAMA5_EBICS1_PSRAM config SAMA5_BOOT_CS2FLASH bool "Running in external FLASH CS2" + depends on SAMA5_EBICS2_NOR + +config SAMA5_BOOT_CS2SRAM + bool "Running in external FLASH CS2" + depends on SAMA5_EBICS2_SRAM || SAMA5_EBICS2_PSRAM + +config SAMA5_BOOT_CS2FLASH + bool "Running in external FLASH CS3" + depends on SAMA5_EBICS3_NOR -config SAMA5_BOOT_CS3FLASH +config SAMA5_BOOT_CS3SRAM bool "Running in external FLASH CS3" + depends on SAMA5_EBICS3_SRAM || SAMA5_EBICS3_PSRAM + +endchoice # SAMA5 Boot Configuration + +menu "Heap Configuration" + +config SAMA5_ISRAM_HEAP + bool "Include ISRAM in heap" + default y + depends on !SAMA5_BOOT_ISRAM + ---help--- + Include the internal SRAM memory in the heap. + + NOTE: MM_REGIONS must also be set to indicate the total number of + memory regions to be added to the heap. + + *** DO NOT SELECT THIS OPTION IF YOU ARE EXECUTING FROM INTERNAL SRAM!!** + In this case, the remaining ISRAM will automatically be added to the + heap (using DRAM_END). + +config SAMA5_DDRCS_HEAP + bool "Include DDR-SDRAM in heap" + default y + depends on SAMA5_DDRCS && !SAMA5_BOOT_SDRAM + ---help--- + Include the DDR-SDRAM memory in the heap. + + NOTE: MM_REGIONS must also be set to indicate the total number of + memory regions to be added to the heap. + + *** DO NOT SELECT THIS OPTION IF YOU ARE EXECUTING FROM SDRAM!!** + In this case, the remaining SDRAM will automatically be added to the + heap (using DRAM_END) + +config SAMA5_EBICS0_HEAP + bool "Include SRAM/PSRAM in heap" + default y + depends on (SAMA5_EBICS0_SRAM || SAMA5_EBICS0_PSRAM) && !SAMA5_BOOT_CS0SRAM + ---help--- + Include the CS0 SRAM/PSREAM memory in the heap. + + NOTE: MM_REGIONS must also be set to indicate the total number of + memory regions to be added to the heap. + + *** DO NOT SELECT THIS OPTION IF YOU ARE EXECUTING FROM CS0 SRAM!!** + In this case, the remaining SRAM will automatically be added to the + heap (using DRAM_END). + +config SAMA5_EBICS1_HEAP + bool "Include SRAM/PSRAM in heap" + default y + depends on (SAMA5_EBICS1_SRAM || SAMA5_EBICS1_PSRAM) && !SAMA5_BOOT_CS1SRAM + ---help--- + Include the CS1 SRAM/PSREAM memory in the heap. + + NOTE: MM_REGIONS must also be set to indicate the total number of + memory regions to be added to the heap. + + *** DO NOT SELECT THIS OPTION IF YOU ARE EXECUTING FROM CS1 SRAM!!** + In this case, the remaining SRAM will automatically be added to the + heap (using DRAM_END). + +config SAMA5_EBICS2_HEAP + bool "Include SRAM/PSRAM in heap" + default y + depends on (SAMA5_EBICS2_SRAM || SAMA5_EBICS2_PSRAM) && !SAMA5_BOOT_CS2SRAM + ---help--- + Include the CS2 SRAM/PSREAM memory in the heap. + + NOTE: MM_REGIONS must also be set to indicate the total number of + memory regions to be added to the heap. + + *** DO NOT SELECT THIS OPTION IF YOU ARE EXECUTING FROM CS2 SRAM!!** + In this case, the remaining SRAM will automatically be added to the + heap (using DRAM_END). + +config SAMA5_EBICS3_HEAP + bool "Include SRAM/PSRAM in heap" + default y + depends on (SAMA5_EBICS3_SRAM || SAMA5_EBICS3_PSRAM) && !SAMA5_BOOT_CS3SRAM + ---help--- + Include the CS3 SRAM/PSREAM memory in the heap. -endchoice + *** DO NOT SELECT THIS OPTION IF YOU ARE EXECUTING FROM CS3 SRAM!!** + In this case, the remaining SRAM will automatically be added to the + heap (using DRAM_END). -endif +endmenu # Heap Configuration +endif # ARCH_CHIP_SAMA5 diff --git a/nuttx/arch/arm/src/sama5/Make.defs b/nuttx/arch/arm/src/sama5/Make.defs index 9f6b347a9..1b2ff6365 100644 --- a/nuttx/arch/arm/src/sama5/Make.defs +++ b/nuttx/arch/arm/src/sama5/Make.defs @@ -43,7 +43,6 @@ CMN_CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_exit.c CMN_CSRCS += up_createstack.c up_releasestack.c up_usestack.c up_vfork.c CMN_CSRCS += up_mdelay.c up_udelay.c CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c -CMN_CSRCS += up_allocateheap.c CMN_CSRCS += arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_dataabort.c CMN_CSRCS += arm_doirq.c arm_initialstate.c arm_prefetchabort.c @@ -67,5 +66,5 @@ endif CHIP_ASRCS = -CHIP_CSRCS = sam_boot.c sam_clockconfig.c sam_gpio.c sam_irq.c -CHIP_CSRCS += sam_lowputc.c sam_serial.c sam_timerisr.c +CHIP_CSRCS = sam_allocateheap.c sam_boot.c sam_clockconfig.c sam_gpio.c +CHIP_CSRCS += sam_irq.c sam_lowputc.c sam_serial.c sam_timerisr.c diff --git a/nuttx/arch/arm/src/sama5/chip/sama5d3x_memorymap.h b/nuttx/arch/arm/src/sama5/chip/sama5d3x_memorymap.h index bd158bab6..285a76b74 100644 --- a/nuttx/arch/arm/src/sama5/chip/sama5d3x_memorymap.h +++ b/nuttx/arch/arm/src/sama5/chip/sama5d3x_memorymap.h @@ -210,11 +210,11 @@ #define SAM_AXIMX_NSECTIONS _NSECTIONS(SAM_AXIMX_SIZE) #define SAM_DAP_NSECTIONS _NSECTIONS(SAM_DAP_SIZE) -#define SAM_EBICS0_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBISC0_SIZE) +#define SAM_EBICS0_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBICS0_SIZE) #define SAM_DDRCS_NSECTIONS _NSECTIONS(CONFIG_SAMA5_DDRCS_SIZE) -#define SAM_EBICS1_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBISC1_SIZE) -#define SAM_EBICS2_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBISC2_SIZE) -#define SAM_EBICS3_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBISC3_SIZE) +#define SAM_EBICS1_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBICS1_SIZE) +#define SAM_EBICS2_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBICS2_SIZE) +#define SAM_EBICS3_NSECTIONS _NSECTIONS(CONFIG_SAMA5_EBICS3_SIZE) #define SAM_NFCCR_NSECTIONS _NSECTIONS(SAM_NFCCR_SIZE) #define SAM_PERIPHA_NSECTIONS _NSECTIONS(SAM_PERIPHA_SIZE) diff --git a/nuttx/arch/arm/src/sama5/sam_allocateheap.c b/nuttx/arch/arm/src/sama5/sam_allocateheap.c new file mode 100644 index 000000000..0828f6d6a --- /dev/null +++ b/nuttx/arch/arm/src/sama5/sam_allocateheap.c @@ -0,0 +1,368 @@ +/**************************************************************************** + * arch/arm/src/sama5/sam_allocateheap.c + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include "up_arch.h" +#include "up_internal.h" + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ +/* We cannot use the memory for heap if it is not enabled. Or, if it is + * enabled, but does not hold SDRAM, SRAM, or PSRAM. + * + * We cannot add the region if it is if we are executing from it! In that + * case, the remainder of the memory will automatically be added to the heap + * based on g_idle_topstack and CONFIG_DRAM_END + */ + +#if defined(CONFIG_SAMA5_BOOT_ISRAM) +# undef CONFIG_SAMA5_ISRAM_HEAP +#endif + +#if !defined(CONFIG_SAMA5_DDRCS) || defined(CONFIG_SAMA5_BOOT_SDRAM) +# undef CONFIG_SAMA5_DDRCS_HEAP +#endif + +#if !defined(CONFIG_SAMA5_EBICS0) || defined(CONFIG_SAMA5_BOOT_CS0SRAM) || \ + (!defined(CONFIG_SAMA5_EBICS0_SRAM) && !defined(CONFIG_SAMA5_EBICS0_PSRAM)) + +# undef SAMA5_EBICS0_HEAP +#endif + +#if !defined(CONFIG_SAMA5_EBICS1) || defined(CONFIG_SAMA5_BOOT_CS1SRAM) || \ + (!defined(CONFIG_SAMA5_EBICS1_SRAM) && !defined(CONFIG_SAMA5_EBICS1_PSRAM)) + +# undef SAMA5_EBICS1_HEAP +#endif + +#if !defined(CONFIG_SAMA5_EBICS2) || defined(CONFIG_SAMA5_BOOT_CS2SRAM) || \ + (!defined(CONFIG_SAMA5_EBICS2_SRAM) && !defined(CONFIG_SAMA5_EBICS2_PSRAM)) + +# undef SAMA5_EBICS2_HEAP +#endif + +#if !defined(SAMA5_CONFIG_EBICS3) || defined(CONFIG_SAMA5_BOOT_CS3SRAM) || \ + (!defined(SAMA5_CONFIG_EBICS3_SRAM) && !defined(CONFIG_SAMA5_EBICS3_PSRAM)) + +# undef SAMA5_EBICS3_HEAP +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_allocate_heap + * + * Description: + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated by an analogous up_allocate_kheap(). A custom version of this + * file is needed if memory protection of the kernel heap is required. + * + * The following memory map is assumed for the flat build: + * + * .data region. Size determined at link time. + * .bss region Size determined at link time. + * IDLE thread stack. Size determined by CONFIG_IDLETHREAD_STACKSIZE. + * Heap. Extends to the end of SRAM. + * + * The following memory map is assumed for the kernel build: + * + * Kernel .data region. Size determined at link time. + * Kernel .bss region Size determined at link time. + * Kernel IDLE thread stack. Size determined by CONFIG_IDLETHREAD_STACKSIZE. + * Padding for alignment + * User .data region. Size determined at link time. + * User .bss region Size determined at link time. + * Kernel heap. Size determined by CONFIG_MM_KERNEL_HEAPSIZE. + * User heap. Extends to the end of SRAM. + * + ****************************************************************************/ + +void up_allocate_heap(FAR void **heap_start, size_t *heap_size) +{ +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Get the unaligned size and position of the user-space heap. + * This heap begins after the user-space .bss section at an offset + * of CONFIG_MM_KERNEL_HEAPSIZE (subject to alignment). + */ + + uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend + CONFIG_MM_KERNEL_HEAPSIZE; + size_t usize = CONFIG_DRAM_END - ubase; + int log2; + + DEBUGASSERT(ubase < (uintptr_t)CONFIG_DRAM_END); + + /* Return the user-space heap settings */ + + up_ledon(LED_HEAPALLOCATE); + *heap_start = (FAR void*)ubase; + *heap_size = usize; +#else + + /* Return the heap settings */ + + up_ledon(LED_HEAPALLOCATE); + *heap_start = (FAR void*)g_idle_topstack; + *heap_size = CONFIG_DRAM_END - g_idle_topstack; +#endif +} + +/**************************************************************************** + * Name: up_allocate_kheap + * + * Description: + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function allocates + * the kernel-space heap. A custom version of this function is need if + * memory protection of the kernel heap is required. + * + ****************************************************************************/ + +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) +void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) +{ + /* Get the unaligned size and position of the user-space heap. + * This heap begins after the user-space .bss section at an offset + * of CONFIG_MM_KERNEL_HEAPSIZE (subject to alignment). + */ + + uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend + CONFIG_MM_KERNEL_HEAPSIZE; + size_t usize = CONFIG_DRAM_END - ubase; + int log2; + + DEBUGASSERT(ubase < (uintptr_t)CONFIG_DRAM_END); + + /* Return the kernel heap settings (i.e., the part of the heap region + * that was not dedicated to the user heap). + */ + + *heap_start = (FAR void*)USERSPACE->us_bssend; + *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; +} +#endif + +/**************************************************************************** + * Name: up_addregion + * + * Description: + * Memory may be added in non-contiguous chunks. Additional chunks are + * added by calling this function. + * + ****************************************************************************/ + +#if CONFIG_MM_REGIONS > 1 +void up_addregion(void) +{ + int nregions = CONFIG_MM_REGIONS; + size_t size; + +#ifdef CONFIG_SAMA5_ISRAM_HEAP +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + + /* Allow user-mode access to the ISRAM heap */ + + size = SAM_ISRAM0_SIZE + SAM_ISRAM1_SIZE; + sam_uheap((uintptr_t)SAM_ISRAM0_VADDR, size); + +#endif + + /* Add the ISRAM user heap region. */ + + kumm_addregion((FAR void*)SAM_ISRAM0_VADDR, size); + + nregions--; +#endif + +#ifdef CONFIG_SAMA5_DDRCS_HEAP + if (nregions > 0) + { +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Allow user-mode access to the ISRAM heap */ + + size = CONFIG_SAMA5_DDRCS_SIZE; + sam_uheap((uintptr_t)SAM_DDRCS_VSECTION, size); +#endif + + /* Add the ISRAM user heap region. */ + + kumm_addregion((FAR void*)SAM_DDRCS_VSECTION, size); + + nregions--; + } + else + { + lldbg("ERROR: SDRAM memory not added to heap. CONFIG_MM_NREGIONS=%d\n", + CONFIG_MM_REGIONS); + lldbg(" Increase the size of CONFIG_MM_NREGIONS\n"); + } +#endif + +#ifdef SAMA5_EBICS0_HEAP + if (nregions > 0) + { +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Allow user-mode access to the ISRAM heap */ + + size = CONFIG_SAMA5_EBICS0_SIZE; + sam_uheap((uintptr_t)SAM_EBICS0_VSECTION, size); +#endif + + /* Add the ISRAM user heap region. */ + + kumm_addregion((FAR void*)SAM_EBICS0_VSECTION, size); + + nregions--; + } + else + { + lldbg("ERROR: CS0 memory not added to heap. CONFIG_MM_NREGIONS=%d\n", + CONFIG_MM_REGIONS); + lldbg(" Increase the size of CONFIG_MM_NREGIONS\n"); + } +#endif + +#ifdef SAMA5_EBICS1_HEAP + if (nregions > 0) + { +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Allow user-mode access to the ISRAM heap */ + + size = CONFIG_SAMA5_EBICS1_SIZE; + sam_uheap((uintptr_t)SAM_EBICS1_VSECTION, size); +#endif + + /* Add the ISRAM user heap region. */ + + kumm_addregion((FAR void*)SAM_EBICS1_VSECTION, size); + + nregions--; + } + else + { + lldbg("ERROR: CS1 memory not added to heap. CONFIG_MM_NREGIONS=%d\n", + CONFIG_MM_REGIONS); + lldbg(" Increase the size of CONFIG_MM_NREGIONS\n"); + } +#endif + +#ifdef SAMA5_EBICS2_HEAP + if (nregions > 0) + { +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Allow user-mode access to the ISRAM heap */ + + size = CONFIG_SAMA5_EBICS2_SIZE; + sam_uheap((uintptr_t)SAM_EBICS2_VSECTION, size); +#endif + + /* Add the ISRAM user heap region. */ + + kumm_addregion((FAR void*)SAM_EBICS2_VSECTION, size); + + nregions--; + } + else + { + lldbg("ERROR: CS2 memory not added to heap. CONFIG_MM_NREGIONS=%d\n", + CONFIG_MM_REGIONS); + lldbg(" Increase the size of CONFIG_MM_NREGIONS\n"); + } +#endif + +#ifdef SAMA5_EBICS3_HEAP + if (nregions > 0) + { +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Allow user-mode access to the ISRAM heap */ + + size = CONFIG_SAMA5_EBICS3_SIZE; + sam_uheap((uintptr_t)SAM_EBICS3_VSECTION, size); +#endif + + /* Add the ISRAM user heap region. */ + + kumm_addregion((FAR void*)SAM_EBICS3_VSECTION, size); + + nregions--; + } + else + { + lldbg("ERROR: CS3 memory not added to heap. CONFIG_MM_NREGIONS=%d\n", + CONFIG_MM_REGIONS); + lldbg(" Increase the size of CONFIG_MM_NREGIONS\n"); + } +#endif + + /* Did we add all of the requestion regions */ + + if (nregions > 0) + { + lldbg("ERROR: Not all regions added to heap: %d added, but CONFIG_MM_NREGIONS=%d\n", + CONFIG_MM_REGIONS - nregions, CONFIG_MM_REGIONS); + lldbg(" Decrease the size of CONFIG_MM_NREGIONS\n"); + } +} +#endif diff --git a/nuttx/arch/arm/src/sama5/sam_boot.c b/nuttx/arch/arm/src/sama5/sam_boot.c index 7e42fa950..79c75dae4 100644 --- a/nuttx/arch/arm/src/sama5/sam_boot.c +++ b/nuttx/arch/arm/src/sama5/sam_boot.c @@ -120,7 +120,7 @@ static const struct section_mapping_s section_mapping[] = /* SAMA5 External Memories */ -#ifdef CONFIG_SAMA5_EBISC0 +#ifdef CONFIG_SAMA5_EBICS0 { SAM_EBICS0_PSECTION, SAM_EBICS0_VSECTION, SAM_EBICS0_MMUFLAGS, SAM_EBICS0_NSECTIONS}, #endif @@ -128,15 +128,15 @@ static const struct section_mapping_s section_mapping[] = { SAM_DDRCS_PSECTION, SAM_DDRCS_VSECTION, SAM_DDRCS_MMUFLAGS, SAM_DDRCS_NSECTIONS}, #endif -#ifdef CONFIG_SAMA5_EBISC1 +#ifdef CONFIG_SAMA5_EBICS1 { SAM_EBICS1_PSECTION, SAM_EBICS1_VSECTION, SAM_EBICS1_MMUFLAGS, SAM_EBICS1_NSECTIONS}, #endif -#ifdef CONFIG_SAMA5_EBISC2 +#ifdef CONFIG_SAMA5_EBICS2 { SAM_EBICS2_PSECTION, SAM_EBICS2_VSECTION, SAM_EBICS2_MMUFLAGS, SAM_EBICS2_NSECTIONS}, #endif -#ifdef CONFIG_SAMA5_EBISC3 +#ifdef CONFIG_SAMA5_EBICS3 { SAM_EBICS3_PSECTION, SAM_EBICS3_VSECTION, SAM_EBICS3_MMUFLAGS, SAM_EBICS3_NSECTIONS}, #endif diff --git a/nuttx/arch/arm/src/sama5/sam_clockconfig.c b/nuttx/arch/arm/src/sama5/sam_clockconfig.c index a0dcd916e..b3de93fdc 100644 --- a/nuttx/arch/arm/src/sama5/sam_clockconfig.c +++ b/nuttx/arch/arm/src/sama5/sam_clockconfig.c @@ -464,7 +464,7 @@ void sam_clockconfig(void) #ifdef CONFIG_SAMA5_BOOT_CS0FLASH if (config) -#if define(CONFIG_SAMA5_BOOT_SRAM) || defined(CONFIG_SAMA5_BOOT_CS0FLASH) +#if define(CONFIG_SAMA5_BOOT_ISRAM) || defined(CONFIG_SAMA5_BOOT_CS0FLASH) { /* Enable main oscillator (if it has not already been selected) */ @@ -501,6 +501,6 @@ void sam_clockconfig(void) sam_upllsetup(); } -#endif /* CONFIG_SAMA5_BOOT_SRAM || CONFIG_SAMA5_BOOT_CS0FLASH */ +#endif /* CONFIG_SAMA5_BOOT_ISRAM || CONFIG_SAMA5_BOOT_CS0FLASH */ #endif /* CONFIG_SAMA5_BOOT_CS0FLASH */ } diff --git a/nuttx/configs/arduino-due/nsh/defconfig b/nuttx/configs/arduino-due/nsh/defconfig index 01e2dfe16..e672fe6b6 100644 --- a/nuttx/configs/arduino-due/nsh/defconfig +++ b/nuttx/configs/arduino-due/nsh/defconfig @@ -187,10 +187,10 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTSRAM0=y CONFIG_ARCH_HAVE_EXTSRAM1=y -# CONFIG_ARCH_EXTNAND is not set -# CONFIG_ARCH_EXTNOR is not set -# CONFIG_ARCH_EXTSRAM0 is not set -# CONFIG_ARCH_EXTSRAM1 is not set +# CONFIG_SAM34_EXTNAND is not set +# CONFIG_SAM34_EXTNOR is not set +# CONFIG_SAM34_EXTSRAM0 is not set +# CONFIG_SAM34_EXTSRAM1 is not set # # Architecture Options diff --git a/nuttx/configs/arduino-due/ostest/defconfig b/nuttx/configs/arduino-due/ostest/defconfig index 2cfc4c240..3ad676207 100644 --- a/nuttx/configs/arduino-due/ostest/defconfig +++ b/nuttx/configs/arduino-due/ostest/defconfig @@ -187,10 +187,10 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTSRAM0=y CONFIG_ARCH_HAVE_EXTSRAM1=y -# CONFIG_ARCH_EXTNAND is not set -# CONFIG_ARCH_EXTNOR is not set -# CONFIG_ARCH_EXTSRAM0 is not set -# CONFIG_ARCH_EXTSRAM1 is not set +# CONFIG_SAM34_EXTNAND is not set +# CONFIG_SAM34_EXTNOR is not set +# CONFIG_SAM34_EXTSRAM0 is not set +# CONFIG_SAM34_EXTSRAM1 is not set # # Architecture Options diff --git a/nuttx/configs/arduino-due/src/arduino-due.h b/nuttx/configs/arduino-due/src/arduino-due.h index 986f824bf..0430b8d2d 100644 --- a/nuttx/configs/arduino-due/src/arduino-due.h +++ b/nuttx/configs/arduino-due/src/arduino-due.h @@ -316,7 +316,7 @@ * ************************************************************************************/ -#ifdef CONFIG_ARCH_EXTSRAM0 +#ifdef CONFIG_SAM34_EXTSRAM0 void sam_sram_initialize(void); #endif diff --git a/nuttx/configs/ea3131/README.txt b/nuttx/configs/ea3131/README.txt index e3e718210..8d8f2c0bf 100644 --- a/nuttx/configs/ea3131/README.txt +++ b/nuttx/configs/ea3131/README.txt @@ -570,23 +570,23 @@ ARM/EA3131-specific Configuration Options External memory available on the board (see also CONFIG_MM_REGIONS) - CONFIG_ARCH_EXTSRAM0 - Select if external SRAM0 is present - CONFIG_ARCH_EXTSRAM0HEAP - Select if external SRAM0 should be + CONFIG_LPC31_EXTSRAM0 - Select if external SRAM0 is present + CONFIG_LPC31_EXTSRAM0HEAP - Select if external SRAM0 should be configured as part of the NuttX heap. - CONFIG_ARCH_EXTSRAM0SIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTSRAM0SIZE - Size (in bytes) of the installed external SRAM0 memory - CONFIG_ARCH_EXTSRAM1 - Select if external SRAM1 is present - CONFIG_ARCH_EXTSRAM1HEAP - Select if external SRAM1 should be + CONFIG_LPC31_EXTSRAM1 - Select if external SRAM1 is present + CONFIG_LPC31_EXTSRAM1HEAP - Select if external SRAM1 should be configured as part of the NuttX heap. - CONFIG_ARCH_EXTSRAM1SIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTSRAM1SIZE - Size (in bytes) of the installed external SRAM1 memory - CONFIG_ARCH_EXTDRAM - Select if external SDRAM is present - CONFIG_ARCH_EXTDRAMHEAP - Select if external SDRAM should be + CONFIG_LPC31_EXTDRAM - Select if external SDRAM is present + CONFIG_LPC31_EXTDRAMHEAP - Select if external SDRAM should be configured as part of the NuttX heap. - CONFIG_ARCH_EXTDRAMSIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTDRAMSIZE - Size (in bytes) of the installed external SDRAM memory - CONFIG_ARCH_EXTNAND - Select if external NAND is present - CONFIG_ARCH_EXTNANDSIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTNAND - Select if external NAND is present + CONFIG_LPC31_EXTNANDSIZE - Size (in bytes) of the installed external NAND memory LPC313X specific device driver settings diff --git a/nuttx/configs/ea3131/nsh/defconfig b/nuttx/configs/ea3131/nsh/defconfig index 328cf96f0..02a9949e3 100644 --- a/nuttx/configs/ea3131/nsh/defconfig +++ b/nuttx/configs/ea3131/nsh/defconfig @@ -79,17 +79,17 @@ CONFIG_LPC31_UART=y # # Exernal memory available on the board (see also CONFIG_MM_REGIONS) # -CONFIG_ARCH_EXTSRAM0=n -CONFIG_ARCH_EXTSRAM0HEAP=n -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM1=n -CONFIG_ARCH_EXTSRAM1HEAP=n -CONFIG_ARCH_EXTSRAM1SIZE=131072 -CONFIG_ARCH_EXTDRAM=n -CONFIG_ARCH_EXTDRAMHEAP=n -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTNAND=n -CONFIG_ARCH_EXTNANDSIZE=67108864 +CONFIG_LPC31_EXTSRAM0=n +CONFIG_LPC31_EXTSRAM0HEAP=n +CONFIG_LPC31_EXTSRAM0SIZE=131072 +CONFIG_LPC31_EXTSRAM1=n +CONFIG_LPC31_EXTSRAM1HEAP=n +CONFIG_LPC31_EXTSRAM1SIZE=131072 +CONFIG_LPC31_EXTDRAM=n +CONFIG_LPC31_EXTDRAMHEAP=n +CONFIG_LPC31_EXTDRAMSIZE=67108864 +CONFIG_LPC31_EXTNAND=n +CONFIG_LPC31_EXTNANDSIZE=67108864 # # LPC31XX specific device driver settings diff --git a/nuttx/configs/ea3131/ostest/defconfig b/nuttx/configs/ea3131/ostest/defconfig index 5f4b80027..19c1d6e30 100644 --- a/nuttx/configs/ea3131/ostest/defconfig +++ b/nuttx/configs/ea3131/ostest/defconfig @@ -79,17 +79,17 @@ CONFIG_LPC31_UART=y # # Exernal memory available on the board (see also CONFIG_MM_REGIONS) # -CONFIG_ARCH_EXTSRAM0=n -CONFIG_ARCH_EXTSRAM0HEAP=n -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM1=n -CONFIG_ARCH_EXTSRAM1HEAP=n -CONFIG_ARCH_EXTSRAM1SIZE=131072 -CONFIG_ARCH_EXTDRAM=n -CONFIG_ARCH_EXTDRAMHEAP=n -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTNAND=n -CONFIG_ARCH_EXTNANDSIZE=67108864 +CONFIG_LPC31_EXTSRAM0=n +CONFIG_LPC31_EXTSRAM0HEAP=n +CONFIG_LPC31_EXTSRAM0SIZE=131072 +CONFIG_LPC31_EXTSRAM1=n +CONFIG_LPC31_EXTSRAM1HEAP=n +CONFIG_LPC31_EXTSRAM1SIZE=131072 +CONFIG_LPC31_EXTDRAM=n +CONFIG_LPC31_EXTDRAMHEAP=n +CONFIG_LPC31_EXTDRAMSIZE=67108864 +CONFIG_LPC31_EXTNAND=n +CONFIG_LPC31_EXTNANDSIZE=67108864 # # LPC31XX specific device driver settings diff --git a/nuttx/configs/ea3131/pgnsh/defconfig b/nuttx/configs/ea3131/pgnsh/defconfig index 9283f3207..a73842bc7 100644 --- a/nuttx/configs/ea3131/pgnsh/defconfig +++ b/nuttx/configs/ea3131/pgnsh/defconfig @@ -79,17 +79,17 @@ CONFIG_LPC31_UART=y # # Exernal memory available on the board (see also CONFIG_MM_REGIONS) # -CONFIG_ARCH_EXTSRAM0=n -CONFIG_ARCH_EXTSRAM0HEAP=n -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM1=n -CONFIG_ARCH_EXTSRAM1HEAP=n -CONFIG_ARCH_EXTSRAM1SIZE=131072 -CONFIG_ARCH_EXTDRAM=n -CONFIG_ARCH_EXTDRAMHEAP=n -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTNAND=n -CONFIG_ARCH_EXTNANDSIZE=67108864 +CONFIG_LPC31_EXTSRAM0=n +CONFIG_LPC31_EXTSRAM0HEAP=n +CONFIG_LPC31_EXTSRAM0SIZE=131072 +CONFIG_LPC31_EXTSRAM1=n +CONFIG_LPC31_EXTSRAM1HEAP=n +CONFIG_LPC31_EXTSRAM1SIZE=131072 +CONFIG_LPC31_EXTDRAM=n +CONFIG_LPC31_EXTDRAMHEAP=n +CONFIG_LPC31_EXTDRAMSIZE=67108864 +CONFIG_LPC31_EXTNAND=n +CONFIG_LPC31_EXTNANDSIZE=67108864 # # LPC31XX specific device driver settings diff --git a/nuttx/configs/ea3131/src/Makefile b/nuttx/configs/ea3131/src/Makefile index 1b91577e9..27c4b6221 100644 --- a/nuttx/configs/ea3131/src/Makefile +++ b/nuttx/configs/ea3131/src/Makefile @@ -44,7 +44,7 @@ CSRCS = up_boot.c up_clkinit.c ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += up_buttons.c endif -ifeq ($(CONFIG_ARCH_EXTDRAM),y) +ifeq ($(CONFIG_LPC31_EXTDRAM),y) CSRCS += up_mem.c endif ifeq ($(CONFIG_ARCH_LEDS),y) diff --git a/nuttx/configs/ea3131/src/ea3131_internal.h b/nuttx/configs/ea3131/src/ea3131_internal.h index 4ba97d83d..1846bf461 100644 --- a/nuttx/configs/ea3131/src/ea3131_internal.h +++ b/nuttx/configs/ea3131/src/ea3131_internal.h @@ -86,7 +86,7 @@ * ************************************************************************************/ -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC31_EXTDRAM extern void lpc31_meminitialize(void); #endif diff --git a/nuttx/configs/ea3131/src/up_boot.c b/nuttx/configs/ea3131/src/up_boot.c index c8ae70461..554e90d10 100644 --- a/nuttx/configs/ea3131/src/up_boot.c +++ b/nuttx/configs/ea3131/src/up_boot.c @@ -75,7 +75,7 @@ void lpc31_boardinitialize(void) { /* Initialize configured, external memory resources */ -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC31_EXTDRAM lpc31_meminitialize(); #endif diff --git a/nuttx/configs/ea3131/src/up_mem.c b/nuttx/configs/ea3131/src/up_mem.c index 668233d3b..15a09c595 100644 --- a/nuttx/configs/ea3131/src/up_mem.c +++ b/nuttx/configs/ea3131/src/up_mem.c @@ -59,7 +59,7 @@ #include "lpc31_mpmc.h" #include "ea3131_internal.h" -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC31_EXTDRAM /**************************************************************************** * Pre-processor Definitions @@ -356,4 +356,4 @@ void lpc31_meminitialize(void) lpc31_sdraminitialize(); } -#endif /* CONFIG_ARCH_EXTDRAM */ +#endif /* CONFIG_LPC31_EXTDRAM */ diff --git a/nuttx/configs/ea3131/usbserial/defconfig b/nuttx/configs/ea3131/usbserial/defconfig index 642a258c5..c4b0c2bbe 100644 --- a/nuttx/configs/ea3131/usbserial/defconfig +++ b/nuttx/configs/ea3131/usbserial/defconfig @@ -79,17 +79,17 @@ CONFIG_LPC31_UART=y # # Exernal memory available on the board (see also CONFIG_MM_REGIONS) # -CONFIG_ARCH_EXTSRAM0=n -CONFIG_ARCH_EXTSRAM0HEAP=n -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM1=n -CONFIG_ARCH_EXTSRAM1HEAP=n -CONFIG_ARCH_EXTSRAM1SIZE=131072 -CONFIG_ARCH_EXTDRAM=n -CONFIG_ARCH_EXTDRAMHEAP=n -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTNAND=n -CONFIG_ARCH_EXTNANDSIZE=67108864 +CONFIG_LPC31_EXTSRAM0=n +CONFIG_LPC31_EXTSRAM0HEAP=n +CONFIG_LPC31_EXTSRAM0SIZE=131072 +CONFIG_LPC31_EXTSRAM1=n +CONFIG_LPC31_EXTSRAM1HEAP=n +CONFIG_LPC31_EXTSRAM1SIZE=131072 +CONFIG_LPC31_EXTDRAM=n +CONFIG_LPC31_EXTDRAMHEAP=n +CONFIG_LPC31_EXTDRAMSIZE=67108864 +CONFIG_LPC31_EXTNAND=n +CONFIG_LPC31_EXTNANDSIZE=67108864 # # LPC31XX specific device driver settings diff --git a/nuttx/configs/ea3131/usbstorage/defconfig b/nuttx/configs/ea3131/usbstorage/defconfig index 73213ef4a..528ef8693 100644 --- a/nuttx/configs/ea3131/usbstorage/defconfig +++ b/nuttx/configs/ea3131/usbstorage/defconfig @@ -79,17 +79,17 @@ CONFIG_LPC31_UART=y # # Exernal memory available on the board (see also CONFIG_MM_REGIONS) # -CONFIG_ARCH_EXTSRAM0=n -CONFIG_ARCH_EXTSRAM0HEAP=n -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM1=n -CONFIG_ARCH_EXTSRAM1HEAP=n -CONFIG_ARCH_EXTSRAM1SIZE=131072 -CONFIG_ARCH_EXTDRAM=n -CONFIG_ARCH_EXTDRAMHEAP=n -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTNAND=n -CONFIG_ARCH_EXTNANDSIZE=67108864 +CONFIG_LPC31_EXTSRAM0=n +CONFIG_LPC31_EXTSRAM0HEAP=n +CONFIG_LPC31_EXTSRAM0SIZE=131072 +CONFIG_LPC31_EXTSRAM1=n +CONFIG_LPC31_EXTSRAM1HEAP=n +CONFIG_LPC31_EXTSRAM1SIZE=131072 +CONFIG_LPC31_EXTDRAM=n +CONFIG_LPC31_EXTDRAMHEAP=n +CONFIG_LPC31_EXTDRAMSIZE=67108864 +CONFIG_LPC31_EXTNAND=n +CONFIG_LPC31_EXTNANDSIZE=67108864 # # LPC31XX specific device driver settings diff --git a/nuttx/configs/ea3152/README.txt b/nuttx/configs/ea3152/README.txt index e405c6a21..ef502eb90 100644 --- a/nuttx/configs/ea3152/README.txt +++ b/nuttx/configs/ea3152/README.txt @@ -376,23 +376,23 @@ ARM/EA3152-specific Configuration Options External memory available on the board (see also CONFIG_MM_REGIONS) - CONFIG_ARCH_EXTSRAM0 - Select if external SRAM0 is present - CONFIG_ARCH_EXTSRAM0HEAP - Select if external SRAM0 should be + CONFIG_LPC31_EXTSRAM0 - Select if external SRAM0 is present + CONFIG_LPC31_EXTSRAM0HEAP - Select if external SRAM0 should be configured as part of the NuttX heap. - CONFIG_ARCH_EXTSRAM0SIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTSRAM0SIZE - Size (in bytes) of the installed external SRAM0 memory - CONFIG_ARCH_EXTSRAM1 - Select if external SRAM1 is present - CONFIG_ARCH_EXTSRAM1HEAP - Select if external SRAM1 should be + CONFIG_LPC31_EXTSRAM1 - Select if external SRAM1 is present + CONFIG_LPC31_EXTSRAM1HEAP - Select if external SRAM1 should be configured as part of the NuttX heap. - CONFIG_ARCH_EXTSRAM1SIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTSRAM1SIZE - Size (in bytes) of the installed external SRAM1 memory - CONFIG_ARCH_EXTDRAM - Select if external SDRAM is present - CONFIG_ARCH_EXTDRAMHEAP - Select if external SDRAM should be + CONFIG_LPC31_EXTDRAM - Select if external SDRAM is present + CONFIG_LPC31_EXTDRAMHEAP - Select if external SDRAM should be configured as part of the NuttX heap. - CONFIG_ARCH_EXTDRAMSIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTDRAMSIZE - Size (in bytes) of the installed external SDRAM memory - CONFIG_ARCH_EXTNAND - Select if external NAND is present - CONFIG_ARCH_EXTNANDSIZE - Size (in bytes) of the installed + CONFIG_LPC31_EXTNAND - Select if external NAND is present + CONFIG_LPC31_EXTNANDSIZE - Size (in bytes) of the installed external NAND memory LPC315X specific device driver settings diff --git a/nuttx/configs/ea3152/ostest/defconfig b/nuttx/configs/ea3152/ostest/defconfig index 377d8fb99..78700547c 100644 --- a/nuttx/configs/ea3152/ostest/defconfig +++ b/nuttx/configs/ea3152/ostest/defconfig @@ -79,17 +79,17 @@ CONFIG_LPC31_UART=y # # Exernal memory available on the board (see also CONFIG_MM_REGIONS) # -CONFIG_ARCH_EXTSRAM0=n -CONFIG_ARCH_EXTSRAM0HEAP=n -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM1=n -CONFIG_ARCH_EXTSRAM1HEAP=n -CONFIG_ARCH_EXTSRAM1SIZE=131072 -CONFIG_ARCH_EXTDRAM=n -CONFIG_ARCH_EXTDRAMHEAP=n -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTNAND=n -CONFIG_ARCH_EXTNANDSIZE=67108864 +CONFIG_LPC31_EXTSRAM0=n +CONFIG_LPC31_EXTSRAM0HEAP=n +CONFIG_LPC31_EXTSRAM0SIZE=131072 +CONFIG_LPC31_EXTSRAM1=n +CONFIG_LPC31_EXTSRAM1HEAP=n +CONFIG_LPC31_EXTSRAM1SIZE=131072 +CONFIG_LPC31_EXTDRAM=n +CONFIG_LPC31_EXTDRAMHEAP=n +CONFIG_LPC31_EXTDRAMSIZE=67108864 +CONFIG_LPC31_EXTNAND=n +CONFIG_LPC31_EXTNANDSIZE=67108864 # # LPC31XX specific device driver settings diff --git a/nuttx/configs/ea3152/src/Makefile b/nuttx/configs/ea3152/src/Makefile index c184838d5..df33bbcea 100644 --- a/nuttx/configs/ea3152/src/Makefile +++ b/nuttx/configs/ea3152/src/Makefile @@ -44,7 +44,7 @@ CSRCS = up_boot.c up_clkinit.c ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += up_buttons.c endif -ifeq ($(CONFIG_ARCH_EXTDRAM),y) +ifeq ($(CONFIG_LPC31_EXTDRAM),y) CSRCS += up_mem.c endif ifeq ($(CONFIG_ARCH_LEDS),y) diff --git a/nuttx/configs/ea3152/src/ea3152_internal.h b/nuttx/configs/ea3152/src/ea3152_internal.h index 84fab1338..f55bbd173 100644 --- a/nuttx/configs/ea3152/src/ea3152_internal.h +++ b/nuttx/configs/ea3152/src/ea3152_internal.h @@ -86,7 +86,7 @@ * ************************************************************************************/ -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC31_EXTDRAM extern void lpc31_meminitialize(void); #endif diff --git a/nuttx/configs/ea3152/src/up_boot.c b/nuttx/configs/ea3152/src/up_boot.c index 066808b2f..df599b305 100644 --- a/nuttx/configs/ea3152/src/up_boot.c +++ b/nuttx/configs/ea3152/src/up_boot.c @@ -75,7 +75,7 @@ void lpc31_boardinitialize(void) { /* Initialize configured, external memory resources */ -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC31_EXTDRAM lpc31_meminitialize(); #endif diff --git a/nuttx/configs/ea3152/src/up_mem.c b/nuttx/configs/ea3152/src/up_mem.c index 4ac716f06..d4c0d8c8b 100644 --- a/nuttx/configs/ea3152/src/up_mem.c +++ b/nuttx/configs/ea3152/src/up_mem.c @@ -59,7 +59,7 @@ #include "lpc31_mpmc.h" #include "ea3152_internal.h" -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC31_EXTDRAM /**************************************************************************** * Pre-processor Definitions @@ -356,4 +356,4 @@ void lpc31_meminitialize(void) lpc31_sdraminitialize(); } -#endif /* CONFIG_ARCH_EXTDRAM */ +#endif /* CONFIG_LPC31_EXTDRAM */ diff --git a/nuttx/configs/open1788/README.txt b/nuttx/configs/open1788/README.txt index f4a269f58..1425db718 100644 --- a/nuttx/configs/open1788/README.txt +++ b/nuttx/configs/open1788/README.txt @@ -508,8 +508,8 @@ CONFIGURATION the configuration in the following ways: CONFIG_LPC17_EMC=y : Enable the EMC - CONFIG_ARCH_EXTDRAM=y : Configure external DRAM - CONFIG_ARCH_EXTDRAMSIZE=67108864 : DRAM size 2x256/8 = 64MB + CONFIG_LPC17_EXTDRAM=y : Configure external DRAM + CONFIG_LPC17_EXTDRAMSIZE=67108864 : DRAM size 2x256/8 = 64MB CONFIG_SYSTEM_RAMTEST=y : Enable the RAM test built-in In this configuration, the SDRAM is not added to heap and so is diff --git a/nuttx/configs/open1788/include/board.h b/nuttx/configs/open1788/include/board.h index e054c5400..ac5feb64c 100644 --- a/nuttx/configs/open1788/include/board.h +++ b/nuttx/configs/open1788/include/board.h @@ -201,7 +201,7 @@ */ #ifdef CONFIG_LPC17_EMC -#if defined(CONFIG_ARCH_EXTNAND) || defined(CONFIG_ARCH_EXTDRAM) +#if defined(CONFIG_LPC17_EXTNAND) || defined(CONFIG_LPC17_EXTDRAM) # define BOARD_CMDDLY 17 # define BOARD_FBCLKDLY 17 # define BOARD_CLKOUT0DLY 1 diff --git a/nuttx/configs/open1788/knsh/defconfig b/nuttx/configs/open1788/knsh/defconfig index 8295097d3..d93870f8f 100755 --- a/nuttx/configs/open1788/knsh/defconfig +++ b/nuttx/configs/open1788/knsh/defconfig @@ -214,16 +214,16 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTDRAM=y CONFIG_ARCH_HAVE_EXTSRAM0=y -CONFIG_ARCH_EXTNAND=y -CONFIG_ARCH_EXTNANDSIZE=134217728 -CONFIG_ARCH_EXTNOR=y -CONFIG_ARCH_EXTNORSIZE=4194304 -CONFIG_ARCH_EXTDRAM=y -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTDRAMHEAP=y -CONFIG_ARCH_EXTSRAM0=y -CONFIG_ARCH_EXTSRAM0SIZE=131072 -CONFIG_ARCH_EXTSRAM0HEAP=y +CONFIG_LPC17_EXTNAND=y +CONFIG_LPC17_EXTNANDSIZE=134217728 +CONFIG_LPC17_EXTNOR=y +CONFIG_LPC17_EXTNORSIZE=4194304 +CONFIG_LPC17_EXTDRAM=y +CONFIG_LPC17_EXTDRAMSIZE=67108864 +CONFIG_LPC17_EXTDRAMHEAP=y +CONFIG_LPC17_EXTSRAM0=y +CONFIG_LPC17_EXTSRAM0SIZE=131072 +CONFIG_LPC17_EXTSRAM0HEAP=y # # Architecture Options diff --git a/nuttx/configs/open1788/nxlines/defconfig b/nuttx/configs/open1788/nxlines/defconfig index dcf6b98f7..68957e1fa 100644 --- a/nuttx/configs/open1788/nxlines/defconfig +++ b/nuttx/configs/open1788/nxlines/defconfig @@ -209,12 +209,12 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTDRAM=y CONFIG_ARCH_HAVE_EXTSRAM0=y -# CONFIG_ARCH_EXTNAND is not set -# CONFIG_ARCH_EXTNOR is not set -CONFIG_ARCH_EXTDRAM=y -CONFIG_ARCH_EXTDRAMSIZE=67108864 -CONFIG_ARCH_EXTDRAMHEAP=y -# CONFIG_ARCH_EXTSRAM0 is not set +# CONFIG_LPC17_EXTNAND is not set +# CONFIG_LPC17_EXTNOR is not set +CONFIG_LPC17_EXTDRAM=y +CONFIG_LPC17_EXTDRAMSIZE=67108864 +CONFIG_LPC17_EXTDRAMHEAP=y +# CONFIG_LPC17_EXTSRAM0 is not set # # Architecture Options diff --git a/nuttx/configs/open1788/src/Makefile b/nuttx/configs/open1788/src/Makefile index fd73a9686..44821e7fb 100644 --- a/nuttx/configs/open1788/src/Makefile +++ b/nuttx/configs/open1788/src/Makefile @@ -41,15 +41,15 @@ ASRCS = CSRCS = lpc17_boardinitialize.c lpc17_ssp.c ifeq ($(CONFIG_LPC17_EMC),y) -ifeq ($(CONFIG_ARCH_EXTNOR),y) +ifeq ($(CONFIG_LPC17_EXTNOR),y) CSRCS += lpc17_norinitialize.c endif -ifeq ($(CONFIG_ARCH_EXTNAND),y) +ifeq ($(CONFIG_LPC17_EXTNAND),y) CSRCS += lpc17_nandinitialize.c endif -ifeq ($(CONFIG_ARCH_EXTDRAM),y) +ifeq ($(CONFIG_LPC17_EXTDRAM),y) CSRCS += lpc17_sdraminitialize.c endif endif diff --git a/nuttx/configs/open1788/src/lpc17_boardinitialize.c b/nuttx/configs/open1788/src/lpc17_boardinitialize.c index 9e106bb3b..0143e58b3 100644 --- a/nuttx/configs/open1788/src/lpc17_boardinitialize.c +++ b/nuttx/configs/open1788/src/lpc17_boardinitialize.c @@ -79,13 +79,13 @@ void lpc17_boardinitialize(void) #ifdef CONFIG_LPC17_EMC lpc17_emcinitialize(); -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC17_EXTDRAM open1788_sdram_initialize(); #endif -#ifdef CONFIG_ARCH_EXTNOR +#ifdef CONFIG_LPC17_EXTNOR open1788_nor_initialize(); #endif -#ifdef CONFIG_ARCH_EXTNAND +#ifdef CONFIG_LPC17_EXTNAND open1788_nand_initialize(); #endif #endif diff --git a/nuttx/configs/open1788/src/lpc17_nandinitialize.c b/nuttx/configs/open1788/src/lpc17_nandinitialize.c index a0d658759..75a6f5a31 100644 --- a/nuttx/configs/open1788/src/lpc17_nandinitialize.c +++ b/nuttx/configs/open1788/src/lpc17_nandinitialize.c @@ -49,7 +49,7 @@ #include "open1788.h" -#if defined(CONFIG_LPC17_EMC) && defined(CONFIG_ARCH_EXTNAND) +#if defined(CONFIG_LPC17_EMC) && defined(CONFIG_LPC17_EXTNAND) /************************************************************************************ * Definitions @@ -98,4 +98,4 @@ void open1788_nand_initialize(void) lpc17_gpioconfig(GPIO_NAND_RB); } -#endif /* CONFIG_LPC17_EMC && CONFIG_ARCH_EXTNAND */ +#endif /* CONFIG_LPC17_EMC && CONFIG_LPC17_EXTNAND */ diff --git a/nuttx/configs/open1788/src/lpc17_norinitialize.c b/nuttx/configs/open1788/src/lpc17_norinitialize.c index 8cf21d540..c39527fa6 100644 --- a/nuttx/configs/open1788/src/lpc17_norinitialize.c +++ b/nuttx/configs/open1788/src/lpc17_norinitialize.c @@ -49,7 +49,7 @@ #include "open1788.h" -#if defined(CONFIG_LPC17_EMC) && defined(CONFIG_ARCH_EXTNOR) +#if defined(CONFIG_LPC17_EMC) && defined(CONFIG_LPC17_EXTNOR) /************************************************************************************ * Definitions @@ -94,4 +94,4 @@ void open1788_nor_initialize(void) up_mdelay(10); } -#endif /* CONFIG_LPC17_EMC && CONFIG_ARCH_EXTNOR */ +#endif /* CONFIG_LPC17_EMC && CONFIG_LPC17_EXTNOR */ diff --git a/nuttx/configs/open1788/src/lpc17_sdraminitialize.c b/nuttx/configs/open1788/src/lpc17_sdraminitialize.c index 818f1ade4..d0081ac18 100644 --- a/nuttx/configs/open1788/src/lpc17_sdraminitialize.c +++ b/nuttx/configs/open1788/src/lpc17_sdraminitialize.c @@ -52,7 +52,7 @@ #include "open1788.h" -#if defined(CONFIG_LPC17_EMC) && defined(CONFIG_ARCH_EXTDRAM) +#if defined(CONFIG_LPC17_EMC) && defined(CONFIG_LPC17_EXTDRAM) /************************************************************************************ * Definitions @@ -78,13 +78,13 @@ /* Set up for 32-bit SDRAM at CS0 */ -#define CONFIG_ARCH_SDRAM_32BIT +#define CONFIG_LPC17_SDRAM_32BIT -#ifdef CONFIG_ARCH_SDRAM_16BIT +#ifdef CONFIG_LPC17_SDRAM_16BIT # define SDRAM_SIZE 0x02000000 /* 256Mbit */ -#else /* if defined(CONFIG_ARCH_SDRAM_32BIT) */ -# undef CONFIG_ARCH_SDRAM_32BIT -# define CONFIG_ARCH_SDRAM_32BIT 1 +#else /* if defined(CONFIG_LPC17_SDRAM_32BIT) */ +# undef CONFIG_LPC17_SDRAM_32BIT +# define CONFIG_LPC17_SDRAM_32BIT 1 # define SDRAM_SIZE 0x04000000 /* 512Mbit */ #endif @@ -109,7 +109,7 @@ void open1788_sdram_initialize(void) { uint32_t regval; -#ifdef CONFIG_ARCH_SDRAM_16BIT +#ifdef CONFIG_LPC17_SDRAM_16BIT volatile uint16_t dummy; #else volatile uint32_t dummy; @@ -159,7 +159,7 @@ void open1788_sdram_initialize(void) putreg32(MDKCFG_RASCAS0VAL, LPC17_EMC_DYNAMICRASCAS0); - #ifdef CONFIG_ARCH_SDRAM_16BIT + #ifdef CONFIG_LPC17_SDRAM_16BIT /* For Manley lpc1778 SDRAM: H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: * * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC @@ -168,7 +168,7 @@ void open1788_sdram_initialize(void) putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13), LPC17_EMC_DYNAMICCONFIG0); -#elif defined CONFIG_ARCH_SDRAM_32BIT +#elif defined CONFIG_LPC17_SDRAM_32BIT /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | EMC_DYNAMICCONFIG_AM1, @@ -210,9 +210,9 @@ void open1788_sdram_initialize(void) putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_MODE, LPC17_EMC_DYNAMICCONTROL); -#ifdef CONFIG_ARCH_SDRAM_16BIT +#ifdef CONFIG_LPC17_SDRAM_16BIT dummy = getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ -#elif defined CONFIG_ARCH_SDRAM_32BIT +#elif defined CONFIG_LPC17_SDRAM_32BIT dummy = getreg32(SDRAM_BASE | (0x32 << 13)); /* 4 burst, 3 CAS latency */ #endif @@ -233,4 +233,4 @@ void open1788_sdram_initialize(void) putreg32(regval, LPC17_SYSCON_EMCDLYCTL); } -#endif /* CONFIG_LPC17_EMC && CONFIG_ARCH_EXTDRAM */ +#endif /* CONFIG_LPC17_EMC && CONFIG_LPC17_EXTDRAM */ diff --git a/nuttx/configs/open1788/src/open1788.h b/nuttx/configs/open1788/src/open1788.h index 9c5b49a19..7e63a44bc 100644 --- a/nuttx/configs/open1788/src/open1788.h +++ b/nuttx/configs/open1788/src/open1788.h @@ -184,7 +184,7 @@ void weak_function open1788_sspinitialize(void); ************************************************************************************/ #ifdef CONFIG_LPC17_EMC -#ifdef CONFIG_ARCH_EXTDRAM +#ifdef CONFIG_LPC17_EXTDRAM void open1788_sdram_initialize(void); #endif @@ -196,7 +196,7 @@ void open1788_sdram_initialize(void); * ************************************************************************************/ -#ifdef CONFIG_ARCH_EXTNOR +#ifdef CONFIG_LPC17_EXTNOR void open1788_nor_initialize(void); #endif @@ -208,7 +208,7 @@ void open1788_nor_initialize(void); * ************************************************************************************/ -#ifdef CONFIG_ARCH_EXTNAND +#ifdef CONFIG_LPC17_EXTNAND void open1788_nand_initialize(void); #endif #endif /* CONFIG_LPC17_EMC */ diff --git a/nuttx/configs/sam3u-ek/nsh/defconfig b/nuttx/configs/sam3u-ek/nsh/defconfig index efe33a84e..6030251ea 100644 --- a/nuttx/configs/sam3u-ek/nsh/defconfig +++ b/nuttx/configs/sam3u-ek/nsh/defconfig @@ -177,10 +177,10 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTSRAM0=y CONFIG_ARCH_HAVE_EXTSRAM1=y -# CONFIG_ARCH_EXTNAND is not set -# CONFIG_ARCH_EXTNOR is not set -# CONFIG_ARCH_EXTSRAM0 is not set -# CONFIG_ARCH_EXTSRAM1 is not set +# CONFIG_SAM34_EXTNAND is not set +# CONFIG_SAM34_EXTNOR is not set +# CONFIG_SAM34_EXTSRAM0 is not set +# CONFIG_SAM34_EXTSRAM1 is not set # # Architecture Options diff --git a/nuttx/configs/sam3u-ek/nxwm/defconfig b/nuttx/configs/sam3u-ek/nxwm/defconfig index 923528106..fc170c71f 100644 --- a/nuttx/configs/sam3u-ek/nxwm/defconfig +++ b/nuttx/configs/sam3u-ek/nxwm/defconfig @@ -180,10 +180,10 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTSRAM0=y CONFIG_ARCH_HAVE_EXTSRAM1=y -# CONFIG_ARCH_EXTNAND is not set -# CONFIG_ARCH_EXTNOR is not set -# CONFIG_ARCH_EXTSRAM0 is not set -# CONFIG_ARCH_EXTSRAM1 is not set +# CONFIG_SAM34_EXTNAND is not set +# CONFIG_SAM34_EXTNOR is not set +# CONFIG_SAM34_EXTSRAM0 is not set +# CONFIG_SAM34_EXTSRAM1 is not set # # Architecture Options diff --git a/nuttx/configs/sam4s-xplained/README.txt b/nuttx/configs/sam4s-xplained/README.txt index 91ca0e384..bff737db8 100644 --- a/nuttx/configs/sam4s-xplained/README.txt +++ b/nuttx/configs/sam4s-xplained/README.txt @@ -594,8 +594,8 @@ Configuration sub-directories for the on-board SRAM (1MB). System Type -> External Memory Configuration - CONFIG_ARCH_EXTSRAM0=y : Select SRAM on CS0 - CONFIG_ARCH_EXTSRAM0SIZE=1048576 : Size=1MB + CONFIG_SAM34_EXTSRAM0=y : Select SRAM on CS0 + CONFIG_SAM34_EXTSRAM0SIZE=1048576 : Size=1MB Now what are you going to do with the SRAM. There are two choices: @@ -603,7 +603,7 @@ Configuration sub-directories external SRAM: System Type -> External Memory Configuration - CONFIG_ARCH_EXTSRAM0HEAP=n : Don't add to heap + CONFIG_SAM34_EXTSRAM0HEAP=n : Don't add to heap Application Configuration -> System NSH Add-Ons CONFIG_SYSTEM_RAMTEST=y : Enable the RAM test built-in @@ -637,7 +637,7 @@ Configuration sub-directories configuration as follows: System Type -> External Memory Configuration - CONFIG_ARCH_EXTSRAM0HEAP=y : Add external RAM to heap + CONFIG_SAM34_EXTSRAM0HEAP=y : Add external RAM to heap Memory Management -CONFIG_MM_REGIONS=1 : Only the internal SRAM diff --git a/nuttx/configs/sam4s-xplained/nsh/defconfig b/nuttx/configs/sam4s-xplained/nsh/defconfig index b4f877e43..421c05c9f 100644 --- a/nuttx/configs/sam4s-xplained/nsh/defconfig +++ b/nuttx/configs/sam4s-xplained/nsh/defconfig @@ -179,10 +179,10 @@ CONFIG_ARCH_HAVE_EXTNAND=y CONFIG_ARCH_HAVE_EXTNOR=y CONFIG_ARCH_HAVE_EXTSRAM0=y CONFIG_ARCH_HAVE_EXTSRAM1=y -# CONFIG_ARCH_EXTNAND is not set -# CONFIG_ARCH_EXTNOR is not set -# CONFIG_ARCH_EXTSRAM0 is not set -# CONFIG_ARCH_EXTSRAM1 is not set +# CONFIG_SAM34_EXTNAND is not set +# CONFIG_SAM34_EXTNOR is not set +# CONFIG_SAM34_EXTSRAM0 is not set +# CONFIG_SAM34_EXTSRAM1 is not set # # Architecture Options diff --git a/nuttx/configs/sam4s-xplained/src/Makefile b/nuttx/configs/sam4s-xplained/src/Makefile index 4103dd7cf..0a2ee0955 100644 --- a/nuttx/configs/sam4s-xplained/src/Makefile +++ b/nuttx/configs/sam4s-xplained/src/Makefile @@ -42,7 +42,7 @@ AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = sam_boot.c -ifeq ($(CONFIG_ARCH_EXTSRAM0),y) +ifeq ($(CONFIG_SAM34_EXTSRAM0),y) CSRCS += sam_sram.c endif diff --git a/nuttx/configs/sam4s-xplained/src/sam4s-xplained.h b/nuttx/configs/sam4s-xplained/src/sam4s-xplained.h index f84afc5ed..941c99df2 100644 --- a/nuttx/configs/sam4s-xplained/src/sam4s-xplained.h +++ b/nuttx/configs/sam4s-xplained/src/sam4s-xplained.h @@ -131,7 +131,7 @@ * ************************************************************************************/ -#ifdef CONFIG_ARCH_EXTSRAM0 +#ifdef CONFIG_SAM34_EXTSRAM0 void sam_sram_initialize(void); #endif diff --git a/nuttx/configs/sam4s-xplained/src/sam_boot.c b/nuttx/configs/sam4s-xplained/src/sam_boot.c index a302d3efb..bf32af5c1 100644 --- a/nuttx/configs/sam4s-xplained/src/sam_boot.c +++ b/nuttx/configs/sam4s-xplained/src/sam_boot.c @@ -67,7 +67,7 @@ void sam_boardinitialize(void) { -#ifdef CONFIG_ARCH_EXTSRAM0 +#ifdef CONFIG_SAM34_EXTSRAM0 /* Configure and enable SRAM on board the SAM4S Xplained */ sam_sram_initialize(); diff --git a/nuttx/configs/sam4s-xplained/src/sam_sram.c b/nuttx/configs/sam4s-xplained/src/sam_sram.c index 250eda4d8..51a193e33 100644 --- a/nuttx/configs/sam4s-xplained/src/sam_sram.c +++ b/nuttx/configs/sam4s-xplained/src/sam_sram.c @@ -46,7 +46,7 @@ #include "chip/sam3u_smc.h" #include "sam4s-xplained.h" -#ifdef CONFIG_ARCH_EXTSRAM0 +#ifdef CONFIG_SAM34_EXTSRAM0 /************************************************************************************ * Pre-processor Definitions @@ -131,4 +131,4 @@ void sam_sram_initialize(void) sam_gpiowrite(GPIO_EBI_NLB, false); } -#endif /* CONFIG_ARCH_EXTSRAM0 */ +#endif /* CONFIG_SAM34_EXTSRAM0 */ diff --git a/nuttx/configs/sama5d3x-ek/ostest/Make.defs b/nuttx/configs/sama5d3x-ek/ostest/Make.defs index c6128ff06..a72c47d93 100644 --- a/nuttx/configs/sama5d3x-ek/ostest/Make.defs +++ b/nuttx/configs/sama5d3x-ek/ostest/Make.defs @@ -37,7 +37,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk include ${TOPDIR}$(DELIM)arch$(DELIM)arm$(DELIM)src$(DELIM)armv7-a$(DELIM)Toolchain.defs -ifeq ($(CONFIG_SAMA5_BOOT_SRAM),y) +ifeq ($(CONFIG_SAMA5_BOOT_ISRAM),y) LDSCRIPT = isram.ld endif ifeq ($(CONFIG_SAMA5_BOOT_SDRAM),y) diff --git a/nuttx/configs/sama5d3x-ek/ostest/defconfig b/nuttx/configs/sama5d3x-ek/ostest/defconfig index f527d055c..f4a6eb9a1 100644 --- a/nuttx/configs/sama5d3x-ek/ostest/defconfig +++ b/nuttx/configs/sama5d3x-ek/ostest/defconfig @@ -163,16 +163,20 @@ CONFIG_SAMA5_UART0=y # CONFIG_SAMA5_FUSE is not set # CONFIG_SAMA5_MPDDRC is not set # CONFIG_PIO_IRQ is not set -CONFIG_SAMA5_BOOT_SRAM=y -# CONFIG_SAMA5_BOOT_SDRAM is not set -# CONFIG_SAMA5_BOOT_CS0FLASH is not set -# CONFIG_SAMA5_BOOT_CS1FLASH is not set -# CONFIG_SAMA5_BOOT_CS2FLASH is not set -# CONFIG_SAMA5_BOOT_CS3FLASH is not set # # External Memory Configuration # +# CONFIG_SAMA5_DDRCS is not set +# CONFIG_SAMA5_EBICS0 is not set +# CONFIG_SAMA5_EBICS1 is not set +# CONFIG_SAMA5_EBICS2 is not set +# CONFIG_SAMA5_EBICS3 is not set +CONFIG_SAMA5_BOOT_ISRAM=y + +# +# Heap Configuration +# # # Architecture Options @@ -383,7 +387,7 @@ CONFIG_DISABLE_MOUNTPOINT=y # # CONFIG_MM_MULTIHEAP is not set # CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=2 +CONFIG_MM_REGIONS=1 # CONFIG_GRAN is not set # -- cgit v1.2.3