summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-01 14:13:00 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-02 09:03:27 -0600
commitfb9485901d1b76029678bccaa970dfb430fb5ebd (patch)
tree2494ae7cf265f5df3587c34dd716ab830aedc8bf
parent400af171bc9b11926a8758821b4cf95dff3c4f3d (diff)
downloadnuttx-fb9485901d1b76029678bccaa970dfb430fb5ebd.tar.gz
nuttx-fb9485901d1b76029678bccaa970dfb430fb5ebd.tar.bz2
nuttx-fb9485901d1b76029678bccaa970dfb430fb5ebd.zip
SAMA5 DBGU: Add logic to suppress DBGU reconfiguration when started from a bootloader
-rw-r--r--nuttx/arch/arm/src/sama5/Kconfig14
-rw-r--r--nuttx/arch/arm/src/sama5/sam_dbgu.c14
-rw-r--r--nuttx/configs/sama5d3-xplained/README.txt2
-rw-r--r--nuttx/configs/sama5d3-xplained/nsh/defconfig5
-rw-r--r--nuttx/configs/sama5d3x-ek/README.txt2
5 files changed, 31 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/sama5/Kconfig b/nuttx/arch/arm/src/sama5/Kconfig
index 899e8a6dc..e31197b4b 100644
--- a/nuttx/arch/arm/src/sama5/Kconfig
+++ b/nuttx/arch/arm/src/sama5/Kconfig
@@ -367,6 +367,19 @@ config SAMA5_DBGU_TXBUFSIZE
Characters are buffered before being sent. This specifies
the size of the transmit buffer.
+config SAMA5_DBGU_NOCONFIG
+ bool "Suppress DBGU configuration"
+ default n
+ depends on SAMA5_BOOT_SDRAM && SAMA5_DBGU_CONSOLE
+ ---help---
+ The DBGU is often used by bootloaders to provide the bootloader
+ interface. If the DBGU is also used as the NuttX console, then it
+ would be best to avoid reconfiguring the DBGU so that the user
+ experience is seamless going from the bootloader to the NuttX
+ console.
+
+if !SAMA5_DBGU_NOCONFIG
+
config SAMA5_DBGU_BAUD
int "BAUD rate"
default 115200
@@ -380,6 +393,7 @@ config SAMA5_DBGU_PARITY
---help---
0=no parity, 1=odd parity, 2=even parity
+endif # !SAMA5_DBGU_NOCONFIG
endmenu #DBGU Configuration
if SAMA5_LCDC
diff --git a/nuttx/arch/arm/src/sama5/sam_dbgu.c b/nuttx/arch/arm/src/sama5/sam_dbgu.c
index 4a86921c0..f86cd89a0 100644
--- a/nuttx/arch/arm/src/sama5/sam_dbgu.c
+++ b/nuttx/arch/arm/src/sama5/sam_dbgu.c
@@ -164,9 +164,9 @@ static uart_dev_t g_dbgu_port =
*
****************************************************************************/
+#if !defined(CONFIG_SUPPRESS_UART_CONFIG) && !defined(CONFIG_SAMA5_DBGU_NOCONFIG)
static void dbgu_configure(void)
{
-#ifndef CONFIG_SUPPRESS_UART_CONFIG
uint32_t regval;
/* Set up the mode register. Start with normal DBGU mode and the MCK
@@ -200,9 +200,12 @@ static void dbgu_configure(void)
/* Enable receiver & transmitter */
putreg32((DBGU_CR_RXEN|DBGU_CR_TXEN), SAM_DBGU_CR);
-#endif
}
+#else
+# define dbgu_configure()
+#endif /* !CONFIG_SUPPRESS_UART_CONFIG && !CONFIG_SAMA5_DBGU_NOCONFIG */
+
/****************************************************************************
* Name: dbgu_setup
*
@@ -237,6 +240,12 @@ static int dbgu_setup(struct uart_dev_s *dev)
static void dbgu_shutdown(struct uart_dev_s *dev)
{
+#if !defined(CONFIG_SUPPRESS_UART_CONFIG) && !defined(CONFIG_SAMA5_DBGU_NOCONFIG)
+ /* Disable all interrupts */
+
+ putreg32(DBGU_INT_ALLINTS, SAM_DBGU_IDR);
+
+#else
irqstate_t flags;
/* The following must be atomic */
@@ -251,6 +260,7 @@ static void dbgu_shutdown(struct uart_dev_s *dev)
putreg32(DBGU_INT_ALLINTS, SAM_DBGU_IDR);
irqrestore(flags);
+#endif
}
/****************************************************************************
diff --git a/nuttx/configs/sama5d3-xplained/README.txt b/nuttx/configs/sama5d3-xplained/README.txt
index 4e05e5feb..e5f19ebb5 100644
--- a/nuttx/configs/sama5d3-xplained/README.txt
+++ b/nuttx/configs/sama5d3-xplained/README.txt
@@ -550,7 +550,7 @@ Load NuttX with U-Boot on AT91 boards
Check this U-Boot network BuildRootFAQ entry to choose a proper MAC
address: http://www.denx.de/wiki/DULG/EthernetDoesNotWork
- setenv ethaddr 3e:36:65:ba:6f:be
+ setenv ethaddr 00:e0:de:ad:be:ef
2. Setup IP parameters:
The board ip address
diff --git a/nuttx/configs/sama5d3-xplained/nsh/defconfig b/nuttx/configs/sama5d3-xplained/nsh/defconfig
index 08f30d5e2..0ead1922a 100644
--- a/nuttx/configs/sama5d3-xplained/nsh/defconfig
+++ b/nuttx/configs/sama5d3-xplained/nsh/defconfig
@@ -30,6 +30,9 @@ CONFIG_WINDOWS_CYGWIN=y
CONFIG_INTELHEX_BINARY=y
# CONFIG_MOTOROLA_SREC is not set
CONFIG_RAW_BINARY=y
+CONFIG_UBOOT_UIMAGE=y
+CONFIG_UIMAGE_LOAD_ADDRESS=0x20008000
+CONFIG_UIMAGE_ENTRY_POINT=0x20008000
#
# Customize Header Files
@@ -429,8 +432,6 @@ CONFIG_SERIAL=y
#
# CONFIG_MCU_SERIAL is not set
CONFIG_STANDARD_SERIAL=y
-# CONFIG_USART1_SERIAL_CONSOLE is not set
-# CONFIG_NO_SERIAL_CONSOLE is not set
# CONFIG_SERIAL_IFLOWCONTROL is not set
# CONFIG_SERIAL_OFLOWCONTROL is not set
# CONFIG_USBDEV is not set
diff --git a/nuttx/configs/sama5d3x-ek/README.txt b/nuttx/configs/sama5d3x-ek/README.txt
index e1ac624fa..728356110 100644
--- a/nuttx/configs/sama5d3x-ek/README.txt
+++ b/nuttx/configs/sama5d3x-ek/README.txt
@@ -671,7 +671,7 @@ Load NuttX with U-Boot on AT91 boards
Check this U-Boot network BuildRootFAQ entry to choose a proper MAC
address: http://www.denx.de/wiki/DULG/EthernetDoesNotWork
- setenv ethaddr 3e:36:65:ba:6f:be
+ setenv ethaddr 00:e0:de:ad:be:ef
2. Setup IP parameters:
The board ip address