code cleanup

This commit is contained in:
Thomas Doerfler committed 2009-07-17 13:53:24 +00:00
1 parent 7ae2775132
commit ec5d45053b
3 files changed
+118 -153

No files matched your search

+6
View File
@@ -5,6 +5,12 @@
now use the same macros.
* aclocal/bsp-bspcleanup-options.m4: New file.
2009-07-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libchip/serial/ns16550.c, libchip/serial/ns16550_p.h: Removed
obsolete defines and declarations. Set initial baud during device
open. Fixed interrupt mode.
2009-06-12 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/i2c/spi-sd-card.c, libchip/ide/ata.c: Eliminate using the
File diff suppressed because it is too large. Load diff
+12 -43
View File
@@ -29,48 +29,17 @@ extern "C" {
#define NS16550_STATIC static
/*
* Define serial port read registers structure.
*/
typedef volatile struct _SP_READ_REGISTERS {
unsigned char ReceiveBuffer;
unsigned char InterruptEnable;
unsigned char InterruptId;
unsigned char LineControl;
unsigned char ModemControl;
unsigned char LineStatus;
unsigned char ModemStatus;
unsigned char ScratchPad;
} SP_READ_REGISTERS, *PSP_READ_REGISTERS;
#define NS16550_RECEIVE_BUFFER 0
#define NS16550_TRANSMIT_BUFFER 0
#define NS16550_INTERRUPT_ENABLE 1
#define NS16550_INTERRUPT_ID 2
#define NS16550_FIFO_CONTROL 2
#define NS16550_LINE_CONTROL 3
#define NS16550_MODEM_CONTROL 4
#define NS16550_LINE_STATUS 5
#define NS16550_MODEM_STATUS 6
#define NS16550_SCRATCH_PAD 7
/*
* Define serial port write registers structure.
*/
typedef volatile struct _SP_WRITE_REGISTERS {
unsigned char TransmitBuffer;
unsigned char InterruptEnable;
unsigned char FifoControl;
unsigned char LineControl;
unsigned char ModemControl;
unsigned char Reserved1;
unsigned char ModemStatus;
unsigned char ScratchPad;
} SP_WRITE_REGISTERS, *PSP_WRITE_REGISTERS;
#define NS16550_TRANSMIT_BUFFER 0
#define NS16550_FIFO_CONTROL 2
/*
* Define serial port interrupt enable register structure.
*/
@@ -85,15 +54,13 @@ typedef volatile struct _SP_WRITE_REGISTERS {
#define NS16550_ENABLE_ALL_INTR_EXCEPT_TX (SP_INT_RX_ENABLE)
/*
* Define serial port interrupt id register structure.
* Define serial port interrupt ID register structure.
*/
typedef struct _SP_INTERRUPT_ID {
unsigned char InterruptPending : 1;
unsigned char Identification : 3;
unsigned char Reserved1 : 2;
unsigned char FifoEnabled : 2;
} SP_INTERRUPT_ID, *PSP_INTERRUPT_ID;
#define SP_IID_0 0x01
#define SP_IID_1 0x02
#define SP_IID_2 0x04
#define SP_IID_3 0x08
/*
* Define serial port fifo control register structure.
@@ -105,6 +72,8 @@ typedef struct _SP_INTERRUPT_ID {
#define SP_FIFO_DMA 0x08
#define SP_FIFO_RXLEVEL 0xc0
#define SP_FIFO_SIZE 16
/*
* Define serial port line control register structure.
*/
@@ -156,9 +125,9 @@ typedef struct _SP_INTERRUPT_ID {
#define SP_LSR_TX 0x40
#define SP_LSR_EFIFO 0x80
typedef struct _ns16550_context
{
uint8_t ucModemCtrl;
typedef struct {
uint8_t ucModemCtrl;
int transmitFifoChars;
} ns16550_context;
/*