From b5980f024df4c797ccfa6d6e1fc373f60ca26746 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 10 Mar 2015 16:11:28 -0600 Subject: [PATCH] SAMV71-XULT: Some bugfixes from early bring-up work --- arch/arm/src/samv7/sam_allocateheap.c | 12 +++++++++--- arch/arm/src/samv7/sam_serial.c | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/arm/src/samv7/sam_allocateheap.c b/arch/arm/src/samv7/sam_allocateheap.c index e63b38e806..47cb12c088 100644 --- a/arch/arm/src/samv7/sam_allocateheap.c +++ b/arch/arm/src/samv7/sam_allocateheap.c @@ -128,11 +128,17 @@ /* Check internal SRAM configuration */ -#if CONFIG_RAM_END > (SAM_DTCM_BASE+SAMV7_SRAM_SIZE) +#ifdef CONFIG_ARMV7M_DTCM +# define SRAM_BASE SAM_DTCM_BASE +#else +# define SRAM_BASE SAM_SRAM_BASE +#endif + +#if CONFIG_RAM_END > (SRAM_BASE+SAMV7_SRAM_SIZE) # error "CONFIG_RAM_END is beyond the end of SRAM" # undef CONFIG_RAM_END -# define CONFIG_RAM_END (SAM_DTCM_BASE+SAMV7_SRAM_SIZE) -#elif CONFIG_RAM_END < (SAM_DTCM_BASE+SAMV7_SRAM_SIZE) +# define CONFIG_RAM_END (SRAM_BASE+SAMV7_SRAM_SIZE) +#elif CONFIG_RAM_END < (SRAM_BASE+SAMV7_SRAM_SIZE) # warning "CONFIG_RAM_END is before end of SRAM... not all of SRAM used" #endif diff --git a/arch/arm/src/samv7/sam_serial.c b/arch/arm/src/samv7/sam_serial.c index 579efe09ac..224e887ff7 100644 --- a/arch/arm/src/samv7/sam_serial.c +++ b/arch/arm/src/samv7/sam_serial.c @@ -177,13 +177,13 @@ #if defined(CONFIG_SAMV7_UART1) && !defined(UART1_ASSIGNED) # define TTYS2_DEV g_uart1port /* UART1 is ttyS2 */ # define UART1_ASSIGNED 1 -#elif defined(CONFIG_SAMV7_UART2) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_SAMV7_UART2) && !defined(UART2_ASSIGNED) # define TTYS2_DEV g_uart2port /* UART2 is ttyS2 */ # define UART2_ASSIGNED 1 -#elif defined(CONFIG_SAMV7_UART3) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_SAMV7_UART3) && !defined(UART3_ASSIGNED) # define TTYS2_DEV g_uart3port /* UART3 is ttyS2 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_SAMV7_UART4) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_SAMV7_UART4) && !defined(UART4_ASSIGNED) # define TTYS2_DEV g_uart4port /* UART4 is ttyS2 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_SAMV7_USART0) && !defined(USART0_ASSIGNED) @@ -202,13 +202,13 @@ * these could also be the console. */ -#if defined(CONFIG_SAMV7_UART2) && !defined(UART1_ASSIGNED) +#if defined(CONFIG_SAMV7_UART2) && !defined(UART2_ASSIGNED) # define TTYS3_DEV g_uart2port /* UART2 is ttyS3 */ # define UART2_ASSIGNED 1 -#elif defined(CONFIG_SAMV7_UART3) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_SAMV7_UART3) && !defined(UART3_ASSIGNED) # define TTYS3_DEV g_uart3port /* UART3 is ttyS3 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_SAMV7_UART4) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_SAMV7_UART4) && !defined(UART4_ASSIGNED) # define TTYS3_DEV g_uart4port /* UART4 is ttyS3 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_SAMV7_USART0) && !defined(USART0_ASSIGNED) @@ -227,10 +227,10 @@ * these could also be the console. */ -#if defined(CONFIG_SAMV7_UART3) && !defined(UART1_ASSIGNED) +#if defined(CONFIG_SAMV7_UART3) && !defined(UART3_ASSIGNED) # define TTYS4_DEV g_uart3port /* UART3 is ttyS4 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_SAMV7_UART4) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_SAMV7_UART4) && !defined(UART4_ASSIGNED) # define TTYS4_DEV g_uart4port /* UART4 is ttyS4 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_SAMV7_USART0) && !defined(USART0_ASSIGNED) @@ -249,7 +249,7 @@ * of these could also be the console. */ -#if defined(CONFIG_SAMV7_UART4) && !defined(UART1_ASSIGNED) +#if defined(CONFIG_SAMV7_UART4) && !defined(UART4_ASSIGNED) # define TTYS5_DEV g_uart4port /* UART4 is ttyS5 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_SAMV7_USART0) && !defined(USART0_ASSIGNED) @@ -1003,7 +1003,7 @@ static int sam_interrupt(struct uart_dev_s *dev) int passes; bool handled; - DEBUGASSERT(dev && priv->priv); + DEBUGASSERT(dev && dev->priv); priv = (struct sam_dev_s*)dev->priv; /* Loop until there are no characters to be transferred or, until we have