1
0
Fork 0
forked from nuttx/nuttx-update

AT91SAM3 now supports kernel-mode heap; SAM3U-EK knsh configuration converted to use kconfig-frontends tool

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5726 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2013-03-10 19:31:10 +00:00
parent 1ef904003e
commit 18ca1965b6
17 changed files with 920 additions and 567 deletions

View file

@ -4274,7 +4274,7 @@
the socket was not closed, but lost the connection through an abnormal
event, then poll/select will hang. That needs to be revisited.
(2013-03-07)
* fs/fs_selected.c: Was not checking if the timeout parameter was NULL
* fs/fs_select.c: Was not checking if the timeout parameter was NULL
but would, instead, setup a bogus timeout based on whatever it found at
address zero. Also, improved some of the memory allocation logic so
that it will not use so much memory. (2013-03-07)
@ -4295,4 +4295,11 @@
a good test and helped me a lot when I wrote the memory manager, but
now it is in the way and paralyzing other efforts. So the memory unit
test was deleted. (2013-03-08)
* sched/sched_free.c: Rename sched_free() to sched_ufree(); Add
sched_kfree() to handler deferred kernel heap allocations. (2013-03-10)
* arch/: User user-accessible heap to allocate all stacks. (2013-03-10)
* arch/arm/src/sam3u: The AT91SAM3U will now support a kernel heap if
so configured. (2013-03-10)
* configs/sam3u-ek/knsh: This configuration was converted to use the
kconfigs-frontends build tool. (2013-03-10)

View file

@ -150,7 +150,7 @@ config BUILD_2PASS
if BUILD_2PASS
config PASS1_TARGET
string "Pass one target"
default ""
default "all"
---help---
The name of the first pass build target. This
can be specific build target, a special build target (all, default, etc.)
@ -458,6 +458,9 @@ endmenu
menu "RTOS Features"
source sched/Kconfig
if NUTTX_KERNEL
source syscall/Kconfig
endif
endmenu
menu "Device Drivers"

View file

@ -104,11 +104,11 @@ config ARCH_CHIP_NUC1XX
NPX LPC43XX architectures (ARM Cortex-M4).
config ARCH_CHIP_SAM3U
bool "Atmel AT91SAM3U"
bool "Atmel AT91SAM3"
select ARCH_CORTEXM3
select ARCH_HAVE_MPU
---help---
Atmel AT91SAM3U architectures (ARM Cortex-M3)
Atmel AT91SAM3 architectures (ARM Cortex-M3)
config ARCH_CHIP_STM32
bool "STMicro STM32"

View file

@ -3,4 +3,95 @@
# see misc/tools/kconfig-language.txt.
#
comment "AT91SAM3U Configuration Options"
comment "AT91SAM3 Configuration Options"
choice
prompt "AT91SAM3 Chip Selection"
default ARCH_CHIP_AT91SAM3U4E
depends on ARCH_CHIP_SAM3U
config ARCH_CHIP_AT91SAM3U4E
bool "AT91SAM3U4E"
endchoice
menu "AT91SAM3 Peripheral Support"
config SAM3U_DMA
bool "DMA"
default n
config SAM3U_NAND
bool "NAND support"
default n
config SAM3U_HSMCI
bool "HSMCI"
default n
config SAM3U_UART
bool "UART"
default y
select ARCH_HAVE_UART
config SAM3U_USART0
bool "USART0"
default n
config SAM3U_USART1
bool "USART1"
default n
config SAM3U_USART2
bool "USART2"
default n
config SAM3U_USART3
bool "USART3"
default n
endmenu
menu "AT91SAM3 UART Configuration"
config USART0_ISUART
bool "USART0 is a UART"
default y
depends on SAM3U_USART0
select ARCH_HAVE_USART0
config USART1_ISUART
bool "USART1 is a UART"
default y
depends on SAM3U_USART1
select ARCH_HAVE_USART1
config USART2_ISUART
bool "USART2 is a UART"
default n
depends on SAM3U_USART2
select ARCH_HAVE_USART2
config USART3_ISUART
bool "USART3 is a UART"
default y
depends on SAM3U_USART3
select ARCH_HAVE_USART2
endmenu
menu "AT91SAM3 GPIO Interrupt Configuration"
config GPIOA_IRQ
bool "GPIOA interrupts"
default n
config GPIOB_IRQ
bool "GPIOB interrupts"
default n
config GPIOC_IRQ
bool "GPIOC interrupts"
default n
endmenu

View file

@ -78,6 +78,68 @@
# warning "CONFIG_DRAM_END is before end of SRAM0... not all of SRAM0 used"
#endif
#ifdef CONFIG_MM_KERNEL_HEAPSIZE
# if CONFIG_MM_KERNEL_HEAPSIZE < (1 << 5) /* Kernel heap size < 2**5 */
# define KHEAP_SIZE (1 << 4) /* Use size 2**4 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 6) /* Kernel heap size < 2**6 */
# define KHEAP_SIZE (1 << 5) /* Use size 2**5 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 7) /* Kernel heap size < 2**7 */
# define KHEAP_SIZE (1 << 6) /* Use size 2**6 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 8) /* Kernel heap size < 2**8 */
# define KHEAP_SIZE (1 << 7) /* Use size 2**7 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 9) /* Kernel heap size < 2**9 */
# define KHEAP_SIZE (1 << 8) /* Use size 2**8 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 10) /* Kernel heap size < 2**10 */
# define KHEAP_SIZE (1 << 9) /* Use size 2**9 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 11) /* Kernel heap size < 2**11 */
# define KHEAP_SIZE (1 << 10) /* Use size 2**10 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 12) /* Kernel heap size < 2**12 */
# define KHEAP_SIZE (1 << 11) /* Use size 2**11 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 13) /* Kernel heap size < 2**13 */
# define KHEAP_SIZE (1 << 12) /* Use size 2**12 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 14) /* Kernel heap size < 2**14 */
# define KHEAP_SIZE (1 << 13) /* Use size 2**13 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 15) /* Kernel heap size < 2**15 */
# define KHEAP_SIZE (1 << 14) /* Use size 2**14 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 16) /* Kernel heap size < 2**16 */
# define KHEAP_SIZE (1 << 15) /* Use size 2**15 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 17) /* Kernel heap size < 2**17 */
# define KHEAP_SIZE (1 << 16) /* Use size 2**16 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 18) /* Kernel heap size < 2**18 */
# define KHEAP_SIZE (1 << 17) /* Use size 2**17 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 19) /* Kernel heap size < 2**19 */
# define KHEAP_SIZE (1 << 18) /* Use size 2**18 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 20) /* Kernel heap size < 2**20 */
# define KHEAP_SIZE (1 << 19) /* Use size 2**19 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 21) /* Kernel heap size < 2**21 */
# define KHEAP_SIZE (1 << 20) /* Use size 2**20 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 22) /* Kernel heap size < 2**22 */
# define KHEAP_SIZE (1 << 21) /* Use size 2**21 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 23) /* Kernel heap size < 2**23 */
# define KHEAP_SIZE (1 << 22) /* Use size 2**22 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 24) /* Kernel heap size < 2**24 */
# define KHEAP_SIZE (1 << 23) /* Use size 2**23 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 25) /* Kernel heap size < 2**25 */
# define KHEAP_SIZE (1 << 24) /* Use size 2**24 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 26) /* Kernel heap size < 2**26 */
# define KHEAP_SIZE (1 << 25) /* Use size 2**25 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 27) /* Kernel heap size < 2**27 */
# define KHEAP_SIZE (1 << 26) /* Use size 2**26 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 28) /* Kernel heap size < 2**28 */
# define KHEAP_SIZE (1 << 27) /* Use size 2**27 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 29) /* Kernel heap size < 2**29 */
# define KHEAP_SIZE (1 << 28) /* Use size 2**28 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 30) /* Kernel heap size < 2**30 */
# define KHEAP_SIZE (1 << 29) /* Use size 2**29 */
# elif CONFIG_MM_KERNEL_HEAPSIZE < (1 << 31) /* Kernel heap size < 2**31 */
# define KHEAP_SIZE (1 << 30) /* Use size 2**30 */
# else
# define KHEAP_SIZE (1 << 31) /* Use size 2**31 */
# endif
# define KHEAP_MASK (KHEAP_SIZE - 1)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
@ -107,6 +169,24 @@
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
{
#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
uintptr_t kbase = ((uintptr_t)g_heapbase + KHEAP_MASK) & ~KHEAP_MASK;
uintptr_t ubase = kbase + KHEAP_SIZE;
size_t usize = CONFIG_DRAM_END - ubase;
DEBUGASSERT(ubase < (uintptr_t)CONFIG_DRAM_END);
/* Return the heap settings */
up_ledon(LED_HEAPALLOCATE);
*heap_start = (FAR void*)ubase;
*heap_size = usize;
/* Allow access to the heap memory */
sam3u_mpu_uheap((uintptr_t)ubase, usize);
#else
size_t size = CONFIG_DRAM_END - g_heapbase;
/* Return the heap settings */
@ -115,11 +195,41 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
*heap_start = (FAR void*)g_heapbase;
*heap_size = size;
/* Allow access to the heap memory */
/* Allow user access to the user heap memory */
sam3u_mpuheap((uintptr_t)g_heapbase, size);
sam3u_mpu_uheap((uintptr_t)g_heapbase, size);
#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
* (and protects) the kernel-space heap.
*
****************************************************************************/
#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
{
uintptr_t kbase = ((uintptr_t)g_heapbase + KHEAP_MASK) & ~KHEAP_MASK;
DEBUGASSERT((kbase + KHEAP_SIZE) < (uintptr_t)CONFIG_DRAM_END);
/* Return the heap settings */
*heap_start = (FAR void*)kbase;
*heap_size = KHEAP_SIZE;
/* Prohibit user access to the kernel heap memory */
sam3u_mpu_kheap((uintptr_t)kbase, KHEAP_SIZE);
}
#endif
/************************************************************************
* Name: up_addregion
*
@ -136,18 +246,18 @@ void up_addregion(void)
kmm_addregion((FAR void*)SAM3U_INTSRAM1_BASE, CONFIG_SAM3U_SRAM1_SIZE);
/* Allow access to the heap memory */
/* Allow user access to the heap memory */
sam3u_mpuheap(SAM3U_INTSRAM1_BASE, CONFIG_SAM3U_SRAM1_SIZE);
sam3u_mpu_uheap(SAM3U_INTSRAM1_BASE, CONFIG_SAM3U_SRAM1_SIZE);
/* Add the region */
#if CONFIG_MM_REGIONS > 2
kmm_addregion((FAR void*)SAM3U_NFCSRAM_BASE, CONFIG_SAM3U_NFCSRAM_SIZE);
/* Allow access to the heap memory */
/* Allow user access to the heap memory */
sam3u_mpuheap(SAM3U_NFCSRAM_BASE, CONFIG_SAM3U_NFCSRAM_SIZE);
sam3u_mpu_uheap(SAM3U_NFCSRAM_BASE, CONFIG_SAM3U_NFCSRAM_SIZE);
#endif
}
#endif

View file

@ -1,7 +1,7 @@
/************************************************************************************
* arch/arm/src/sam3u/sam3u_internal.h
*
* Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -409,7 +409,8 @@ struct sam3u_dmaregs_s
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -431,7 +432,7 @@ extern "C" {
*
************************************************************************************/
EXTERN void sam3u_clockconfig(void);
void sam3u_clockconfig(void);
/************************************************************************************
* Name: sam3u_lowsetup
@ -443,7 +444,7 @@ EXTERN void sam3u_clockconfig(void);
*
************************************************************************************/
EXTERN void sam3u_lowsetup(void);
void sam3u_lowsetup(void);
/****************************************************************************
* Name: sam3u_userspace
@ -457,7 +458,7 @@ EXTERN void sam3u_lowsetup(void);
****************************************************************************/
#ifdef CONFIG_NUTTX_KERNEL
EXTERN void sam3u_userspace(void);
void sam3u_userspace(void);
#endif
/****************************************************************************
@ -470,23 +471,29 @@ EXTERN void sam3u_userspace(void);
****************************************************************************/
#ifdef CONFIG_NUTTX_KERNEL
EXTERN void sam3u_mpuinitialize(void);
void sam3u_mpuinitialize(void);
#else
# define sam3u_mpuinitialize()
#endif
/****************************************************************************
* Name: sam3u_mpuheap
* Name: sam3u_mpu_uheap and sam3u_mpu_uheap
*
* Description:
* Map a heap region.
* Map a user- or kernel-heap region.
*
****************************************************************************/
#ifdef CONFIG_NUTTX_KERNEL
EXTERN void sam3u_mpuheap(uintptr_t start, size_t size);
void sam3u_mpu_uheap(uintptr_t start, size_t size);
#else
# define sam3u_mpuheap(start,size)
# define sam3u_mpu_uheap(start,size)
#endif
#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP)
void sam3u_mpu_kheap(uintptr_t start, size_t size);
#else
# define sam3u_mpu_kheap(start,size)
#endif
/************************************************************************************
@ -498,7 +505,7 @@ EXTERN void sam3u_mpuheap(uintptr_t start, size_t size);
************************************************************************************/
#ifdef CONFIG_GPIO_IRQ
EXTERN void sam3u_gpioirqinitialize(void);
void sam3u_gpioirqinitialize(void);
#else
# define sam3u_gpioirqinitialize()
#endif
@ -511,7 +518,7 @@ EXTERN void sam3u_gpioirqinitialize(void);
*
************************************************************************************/
EXTERN int sam3u_configgpio(uint16_t cfgset);
int sam3u_configgpio(uint16_t cfgset);
/************************************************************************************
* Name: sam3u_gpiowrite
@ -521,7 +528,7 @@ EXTERN int sam3u_configgpio(uint16_t cfgset);
*
************************************************************************************/
EXTERN void sam3u_gpiowrite(uint16_t pinset, bool value);
void sam3u_gpiowrite(uint16_t pinset, bool value);
/************************************************************************************
* Name: sam3u_gpioread
@ -531,7 +538,7 @@ EXTERN void sam3u_gpiowrite(uint16_t pinset, bool value);
*
************************************************************************************/
EXTERN bool sam3u_gpioread(uint16_t pinset);
bool sam3u_gpioread(uint16_t pinset);
/************************************************************************************
* Name: sam3u_gpioirq
@ -542,7 +549,7 @@ EXTERN bool sam3u_gpioread(uint16_t pinset);
************************************************************************************/
#ifdef CONFIG_GPIO_IRQ
EXTERN void sam3u_gpioirq(uint16_t pinset);
void sam3u_gpioirq(uint16_t pinset);
#else
# define sam3u_gpioirq(pinset)
#endif
@ -556,7 +563,7 @@ EXTERN void sam3u_gpioirq(uint16_t pinset);
************************************************************************************/
#ifdef CONFIG_GPIO_IRQ
EXTERN void sam3u_gpioirqenable(int irq);
void sam3u_gpioirqenable(int irq);
#else
# define sam3u_gpioirqenable(irq)
#endif
@ -570,7 +577,7 @@ EXTERN void sam3u_gpioirqenable(int irq);
************************************************************************************/
#ifdef CONFIG_GPIO_IRQ
EXTERN void sam3u_gpioirqdisable(int irq);
void sam3u_gpioirqdisable(int irq);
#else
# define sam3u_gpioirqdisable(irq)
#endif
@ -584,7 +591,7 @@ EXTERN void sam3u_gpioirqdisable(int irq);
************************************************************************************/
#ifdef CONFIG_DEBUG_GPIO
EXTERN int sam3u_dumpgpio(uint32_t pinset, const char *msg);
int sam3u_dumpgpio(uint32_t pinset, const char *msg);
#else
# define sam3u_dumpgpio(p,m)
#endif
@ -609,7 +616,7 @@ EXTERN int sam3u_dumpgpio(uint32_t pinset, const char *msg);
*
****************************************************************************/
EXTERN DMA_HANDLE sam3u_dmachannel(uint32_t dmach_flags);
DMA_HANDLE sam3u_dmachannel(uint32_t dmach_flags);
/****************************************************************************
* Name: sam3u_dmafree
@ -624,7 +631,7 @@ EXTERN DMA_HANDLE sam3u_dmachannel(uint32_t dmach_flags);
*
****************************************************************************/
EXTERN void sam3u_dmafree(DMA_HANDLE handle);
void sam3u_dmafree(DMA_HANDLE handle);
/****************************************************************************
* Name: sam3u_dmatxsetup
@ -637,8 +644,8 @@ EXTERN void sam3u_dmafree(DMA_HANDLE handle);
*
****************************************************************************/
EXTERN int sam3u_dmatxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t nbytes);
int sam3u_dmatxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t nbytes);
/****************************************************************************
* Name: sam3u_dmarxsetup
@ -651,8 +658,8 @@ EXTERN int sam3u_dmatxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
*
****************************************************************************/
EXTERN int sam3u_dmarxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t nbytes);
int sam3u_dmarxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
size_t nbytes);
/****************************************************************************
* Name: sam3u_dmastart
@ -662,7 +669,7 @@ EXTERN int sam3u_dmarxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
*
****************************************************************************/
EXTERN int sam3u_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg);
int sam3u_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg);
/****************************************************************************
* Name: sam3u_dmastop
@ -674,7 +681,7 @@ EXTERN int sam3u_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg)
*
****************************************************************************/
EXTERN void sam3u_dmastop(DMA_HANDLE handle);
void sam3u_dmastop(DMA_HANDLE handle);
/****************************************************************************
* Name: sam3u_dmasample
@ -685,7 +692,7 @@ EXTERN void sam3u_dmastop(DMA_HANDLE handle);
****************************************************************************/
#ifdef CONFIG_DEBUG_DMA
EXTERN void sam3u_dmasample(DMA_HANDLE handle, struct sam3u_dmaregs_s *regs);
void sam3u_dmasample(DMA_HANDLE handle, struct sam3u_dmaregs_s *regs);
#else
# define sam3u_dmasample(handle,regs)
#endif
@ -699,8 +706,8 @@ EXTERN void sam3u_dmasample(DMA_HANDLE handle, struct sam3u_dmaregs_s *regs);
****************************************************************************/
#ifdef CONFIG_DEBUG_DMA
EXTERN void sam3u_dmadump(DMA_HANDLE handle, const struct sam3u_dmaregs_s *regs,
const char *msg);
void sam3u_dmadump(DMA_HANDLE handle, const struct sam3u_dmaregs_s *regs,
const char *msg);
#else
# define sam3u_dmadump(handle,regs,msg)
#endif
@ -720,7 +727,7 @@ EXTERN void sam3u_dmadump(DMA_HANDLE handle, const struct sam3u_dmaregs_s *regs,
****************************************************************************/
struct sdio_dev_s; /* See include/nuttx/sdio.h */
EXTERN FAR struct sdio_dev_s *sdio_initialize(int slotno);
FAR struct sdio_dev_s *sdio_initialize(int slotno);
/****************************************************************************
* Name: sdio_mediachange
@ -741,7 +748,7 @@ EXTERN FAR struct sdio_dev_s *sdio_initialize(int slotno);
*
****************************************************************************/
EXTERN void sdio_mediachange(FAR struct sdio_dev_s *dev, bool cardinslot);
void sdio_mediachange(FAR struct sdio_dev_s *dev, bool cardinslot);
/****************************************************************************
* Name: sdio_wrprotect
@ -759,7 +766,7 @@ EXTERN void sdio_mediachange(FAR struct sdio_dev_s *dev, bool cardinslot);
*
****************************************************************************/
EXTERN void sdio_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect);
void sdio_wrprotect(FAR struct sdio_dev_s *dev, bool wrprotect);
/****************************************************************************
* Name: sam3u_spicsnumber, sam3u_spiselect, sam3u_spistatus, and
@ -825,7 +832,7 @@ enum spi_dev_e;
*
****************************************************************************/
EXTERN int sam3u_spicsnumber(enum spi_dev_e devid);
int sam3u_spicsnumber(enum spi_dev_e devid);
/****************************************************************************
* Name: sam3u_spiselect
@ -853,7 +860,7 @@ EXTERN int sam3u_spicsnumber(enum spi_dev_e devid);
*
****************************************************************************/
EXTERN void sam3u_spiselect(enum spi_dev_e devid, bool selected);
void sam3u_spiselect(enum spi_dev_e devid, bool selected);
/****************************************************************************
* Name: sam3u_spistatus
@ -870,7 +877,7 @@ EXTERN void sam3u_spiselect(enum spi_dev_e devid, bool selected);
*
****************************************************************************/
EXTERN uint8_t sam3u_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
uint8_t sam3u_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
/****************************************************************************
* Name: sam3u_spicmddata
@ -897,7 +904,7 @@ EXTERN uint8_t sam3u_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
****************************************************************************/
#ifdef CONFIG_SPI_CMDDATA
EXTERN int sam3u_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
int sam3u_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd);
#endif
#endif /* CONFIG_SAM3U_SPI */

View file

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/sam3u_mpuinit.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -102,17 +102,26 @@ void sam3u_mpuinitialize(void)
}
/****************************************************************************
* Name: sam3u_mpuheap
* Name: sam3u_mpu_uheap and sam3u_mpu_uheap
*
* Description:
* Map a heap region (probably needs to extension to handle external SRAM).
* Map a user- or kernel-heap region.
*
* This logic may need an extension to handle external SRAM).
*
****************************************************************************/
void sam3u_mpuheap(uintptr_t start, size_t size)
void sam3u_mpu_uheap(uintptr_t start, size_t size)
{
mpu_userintsram(start, size);
}
#ifdef CONFIG_MM_KERNEL_HEAP
void sam3u_mpu_kheap(uintptr_t start, size_t size)
{
mpu_privintsram(start, size);
}
#endif
#endif /* CONFIG_NUTTX_KERNEL */

View file

@ -1,44 +0,0 @@
############################################################################
# configs/sam3u-ek/nsh/appconfig
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
############################################################################
# Path to example in apps/examples containing the user_start entry point
CONFIGURED_APPS += examples/nsh
# The NSH library
CONFIGURED_APPS += system/readline
CONFIGURED_APPS += nshlib

File diff suppressed because it is too large Load diff

View file

@ -35,36 +35,47 @@
-include $(TOPDIR)/Make.defs
CFLAGS += -I$(TOPDIR)/sched
CFLAGS += -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = up_boot.c up_leds.c up_buttons.c up_spi.c up_usbdev.c
CSRCS = up_boot.c up_leds.c up_buttons.c up_spi.c up_usbdev.c up_lcd.c
ifeq ($(CONFIG_NSH_ARCHINIT),y)
CSRCS += up_nsh.c
endif
ifeq ($(CONFIG_SAM3U_HSMCI),y)
CSRCS += up_mmcsd.c
CSRCS += up_lcd.c
endif
ifeq ($(CONFIG_NSH_ARCHINIT),y)
CSRCS += up_nsh.c
endif
ifeq ($(CONFIG_SAM3U_HSMCI),y)
CSRCS += up_mmcsd.c
endif
ifeq ($(CONFIG_USBMSC),y)
CSRCS += up_usbmsc.c
CSRCS += up_usbmsc.c
endif
ifeq ($(CONFIG_INPUT_ADS7843E),y)
CSRCS += up_touchscreen.c
CSRCS += up_touchscreen.c
endif
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
COBJS = $(CSRCS:.c=$(OBJEXT))
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
ifeq ($(WINTOOL),y)
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
-I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
else
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m
CFLAGS += -I$(ARCH_SRCDIR)/chip
CFLAGS += -I$(ARCH_SRCDIR)/common
CFLAGS += -I$(ARCH_SRCDIR)/armv7-m
endif
all: libboard$(LIBEXT)

View file

@ -61,27 +61,22 @@
/* PORT and SLOT number probably depend on the board configuration */
#ifdef CONFIG_ARCH_BOARD_SAM3UEK
# define NSH_HAVEUSBDEV 1
# define NSH_HAVEMMCSD 1
# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != 0
# error "Only one MMC/SD slot"
# undef CONFIG_NSH_MMCSDSLOTNO
# endif
# ifndef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
# endif
#else
/* Add configuration for new SAM3U boards here */
# error "Unrecognized SAM3U board"
# undef NSH_HAVEUSBDEV
# undef NSH_HAVEMMCSD
#define NSH_HAVE_USBDEV 1
#define NSH_HAVE_MMCSD 1
#if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != 0
# error "Only one MMC/SD slot"
# undef CONFIG_NSH_MMCSDSLOTNO
#endif
#ifndef CONFIG_NSH_MMCSDSLOTNO
# define CONFIG_NSH_MMCSDSLOTNO 0
#endif
/* Can't support USB features if USB is not enabled */
#ifndef CONFIG_USBDEV
# undef NSH_HAVEUSBDEV
# undef NSH_HAVE_USBDEV
#endif
/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support
@ -89,7 +84,7 @@
*/
#if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_SAM3U_HSMCI)
# undef NSH_HAVEMMCSD
# undef NSH_HAVE_MMCSD
#endif
#ifndef CONFIG_NSH_MMCSDMINOR
@ -126,7 +121,7 @@
int nsh_archinitialize(void)
{
#ifdef NSH_HAVEMMCSD
#ifdef NSH_HAVE_MMCSD
FAR struct sdio_dev_s *sdio;
int ret;

View file

@ -75,5 +75,13 @@ config SDIO_WIDTH_D1_ONLY
---help---
Select 1-bit transfer mode. Default:
4-bit transfer mode.
config SDIO_BLOCKSETUP
bool "SDIO block setup"
default n
---help---
Some hardward needs to be informed of the selected blocksize and the
number of blocks. Others just work on the byte stream. This option
enables the block setup method in the SDIO vtable.
endif

View file

@ -38,6 +38,9 @@
************************************************************************/
#include <nuttx/config.h>
#include <assert.h>
#include <nuttx/kmalloc.h>
#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) && defined(__KERNEL__)

View file

@ -38,6 +38,9 @@
************************************************************************/
#include <nuttx/config.h>
#include <assert.h>
#include <nuttx/kmalloc.h>
#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__)
@ -245,7 +248,7 @@ FAR void *kurealloc(FAR void *oldmem, size_t newsize)
void kufree(FAR void *mem)
{
#ifdef CONFIG_MM_KERNEL_HEAP
#if defined(CONFIG_MM_KERNEL_HEAP) && defined(CONFIG_DEBUG)
DEBUGASSERT(!kmm_heapmember(mem));
#endif
return KFREE(mem);

View file

@ -95,14 +95,14 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem,
if (!oldmem)
{
return malloc(size);
return mm_malloc(heap, size);
}
/* If size is zero, then realloc is equivalent to free */
if (size <= 0)
{
free(oldmem);
mm_free(heap, oldmem);
return NULL;
}
@ -348,11 +348,11 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem,
*/
mm_givesemaphore(heap);
newmem = (FAR void*)malloc(size);
newmem = (FAR void*)mm_malloc(heap, size);
if (newmem)
{
memcpy(newmem, oldmem, oldsize);
free(oldmem);
mm_free(heap, oldmem);
}
return newmem;

View file

@ -2,3 +2,18 @@
# For a description of the syntax of this configuration file,
# see misc/tools/kconfig-language.txt.
#
if NUTTX_KERNEL
config SYS_RESERVED
int "Number of reserved system calls"
default 0
---help---
Kernel system calls may share the same software trapping mechanism
as other functions used by architecture port. Those software traps
must be reserved for use exclusively by the architecture. These
value specifies the number of reserved software traps used by the
architecture; number of the kernel system calls will begin with this
number.
endif

View file

@ -65,6 +65,8 @@ static const char *dequote_list[] =
"CONFIG_USER_ENTRYPOINT", /* Name of entry point function */
"CONFIG_EXECFUNCS_SYMTAB", /* Symbol table used by exec[l|v] */
"CONFIG_PASS1_BUILDIR", /* Pass1 build directory */
"CONFIG_PASS1_TARGET", /* Pass1 build target */
/* NxWidgets/NxWM */