summaryrefslogtreecommitdiffstats
path: root/nuttx/arch
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2011-03-10 04:13:44 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2011-03-10 04:13:44 +0000
commit583fe718e27044c44c8da7fb32d03209f4652236 (patch)
treec7111ddf0a0ce2476e3f6dc1ec5ff131f03a528c /nuttx/arch
parentc374856154033ae7bf55c7bf290c443798ba32d2 (diff)
Add QEMU NSH configuration
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3358 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/x86/src/qemu/qemu_lowsetup.c6
-rw-r--r--nuttx/arch/x86/src/qemu/qemu_serial.c29
2 files changed, 34 insertions, 1 deletions
diff --git a/nuttx/arch/x86/src/qemu/qemu_lowsetup.c b/nuttx/arch/x86/src/qemu/qemu_lowsetup.c
index bc5aa52e71..20250c33d4 100644
--- a/nuttx/arch/x86/src/qemu/qemu_lowsetup.c
+++ b/nuttx/arch/x86/src/qemu/qemu_lowsetup.c
@@ -127,6 +127,12 @@ void up_lowsetup(void)
up_gdtinit();
+ /* Early serial driver initialization */
+
+#ifdef CONFIG_USE_EARLYSERIALINIT
+ up_earlyserialinit();
+#endif
+
/* Now perform board-specific initializations */
up_boardinitialize();
diff --git a/nuttx/arch/x86/src/qemu/qemu_serial.c b/nuttx/arch/x86/src/qemu/qemu_serial.c
index 743ccb6915..527ca0c053 100644
--- a/nuttx/arch/x86/src/qemu/qemu_serial.c
+++ b/nuttx/arch/x86/src/qemu/qemu_serial.c
@@ -40,10 +40,18 @@
#include <nuttx/config.h>
#include <nuttx/arch.h>
+#include <nuttx/uart_16550.h>
+
+#include <arch/io.h>
+
#include "up_internal.h"
+/* This is a "stub" file to suppport up_putc if no real serial driver is
+ * configured. Normally, drivers/serial/uart_16550.c provides the serial
+ * driver for this platform.
+ */
+
#ifdef CONFIG_USE_SERIALDRIVER
-#error "Serial driver support not initialized"
/****************************************************************************
* Pre-processor Definitions
@@ -61,6 +69,25 @@
* Public Functions
****************************************************************************/
+/****************************************************************************
+ * Name: uart_getreg(), uart_putreg()
+ *
+ * Description:
+ * These functions must be provided by the processor-specific code in order
+ * to correctly access 16550 registers
+ *
+ ****************************************************************************/
+
+uart_datawidth_t uart_getreg(uart_addrwidth_t base, unsigned int offset)
+{
+ return inb(base + offset);
+}
+
+void uart_putreg(uart_addrwidth_t base, unsigned int offset, uart_datawidth_t value)
+{
+ outb(value, base + offset);
+}
+
#else /* CONFIG_USE_SERIALDRIVER */
/****************************************************************************