diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-10 04:13:44 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-10 04:13:44 +0000 |
commit | 3306e7be0283dd220a33eb83f88b568b915ea7b8 (patch) | |
tree | c7111ddf0a0ce2476e3f6dc1ec5ff131f03a528c /nuttx/arch | |
parent | c6ac5f39311cceded51db709503502a0fd2b1e60 (diff) | |
download | px4-nuttx-3306e7be0283dd220a33eb83f88b568b915ea7b8.tar.gz px4-nuttx-3306e7be0283dd220a33eb83f88b568b915ea7b8.tar.bz2 px4-nuttx-3306e7be0283dd220a33eb83f88b568b915ea7b8.zip |
Add QEMU NSH configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3358 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/x86/src/qemu/qemu_lowsetup.c | 6 | ||||
-rw-r--r-- | nuttx/arch/x86/src/qemu/qemu_serial.c | 29 |
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 bc5aa52e7..20250c33d 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 743ccb691..527ca0c05 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 */ /**************************************************************************** |