2001-04-16 Joel Sherrill <joel@OARcorp.com>

* mongoosev/duart/mg5uart.c, mongoosev/duart/mg5uart.h
	Modifications made with Gregory Menke <gregory.menke@gsfc.nasa.gov>
	as he debugged this BSP using a logic analyzer.  In particular,
	there was a mistake where the index not offset of registers was
	in the header file and the baud rate calculation was incorrect.
This commit is contained in:
Joel Sherrill
2001-04-16 20:02:27 +00:00
parent c9e729758c
commit d74a92d1fd
3 changed files with 18 additions and 17 deletions

View File

@@ -1,3 +1,11 @@
2001-04-16 Joel Sherrill <joel@OARcorp.com>
* mongoosev/duart/mg5uart.c, mongoosev/duart/mg5uart.h
Modifications made with Gregory Menke <gregory.menke@gsfc.nasa.gov>
as he debugged this BSP using a logic analyzer. In particular,
there was a mistake where the index not offset of registers was
in the header file and the baud rate calculation was incorrect.
2001-03-13 Joel Sherrill <joel@OARcorp.com> 2001-03-13 Joel Sherrill <joel@OARcorp.com>
* Added mongoose-v, mongoose-v/include, and mongoose-v/vectorisrs * Added mongoose-v, mongoose-v/include, and mongoose-v/vectorisrs

View File

@@ -262,7 +262,7 @@ MG5UART_STATIC int mg5uart_open(
/* XXX default baud rate could be from configuration table */ /* XXX default baud rate could be from configuration table */
(void) mg5uart_baud_rate( minor, B9600, &baudcmd ); (void) mg5uart_baud_rate( minor, B19200, &baudcmd );
/* /*
* Set the DUART channel to a default useable state * Set the DUART channel to a default useable state
@@ -686,7 +686,7 @@ MG5UART_STATIC int mg5uart_baud_rate(
if (!baud_requested) if (!baud_requested)
baud_requested = B9600; /* default to 9600 baud */ baud_requested = B9600; /* default to 9600 baud */
baud_requested = termios_baud_to_number( B9600 ); baud_requested = termios_baud_to_number( baud_requested );
clock = (rtems_unsigned32) Console_Port_Tbl[minor].ulClock; clock = (rtems_unsigned32) Console_Port_Tbl[minor].ulClock;
if (!clock) if (!clock)
@@ -694,16 +694,9 @@ MG5UART_STATIC int mg5uart_baud_rate(
/* /*
* Formula is Code = round(ClockFrequency / Baud - 1). * Formula is Code = round(ClockFrequency / Baud - 1).
*
* Since this is integer math, we will divide by twice the baud and
* check the remaining odd bit.
*/ */
tmp_code = (clock / (baud_requested * 2)); tmp_code = (clock / baud_requested) - 1;
if ( tmp_code & 0x01 )
tmp_code = (tmp_code >> 1) + 1;
else
tmp_code = (tmp_code >> 1);
/* /*
* From section 12.7, "Keep C>100 for best receiver operation." * From section 12.7, "Keep C>100 for best receiver operation."

View File

@@ -34,15 +34,15 @@ extern "C" {
*/ */
/* shared registers from peripheral base (i.e. from ulCtrlPort1) */ /* shared registers from peripheral base (i.e. from ulCtrlPort1) */
#define MG5UART_COMMAND_REGISTER 0 #define MG5UART_COMMAND_REGISTER 0x00
#define MG5UART_STATUS_REGISTER 1 #define MG5UART_STATUS_REGISTER 0x04
#define MG5UART_INTERRUPT_CAUSE_REGISTER 2 #define MG5UART_INTERRUPT_CAUSE_REGISTER 0x08
#define MG5UART_INTERRUPT_MASK_REGISTER 3 #define MG5UART_INTERRUPT_MASK_REGISTER 0x0c
/* port specific registers from uart base (i.e. from ulCtrlPort2) */ /* port specific registers from uart base (i.e. from ulCtrlPort2) */
#define MG5UART_RX_BUFFER 0 #define MG5UART_RX_BUFFER 0x00
#define MG5UART_TX_BUFFER 1 #define MG5UART_TX_BUFFER 0x04
#define MG5UART_BAUD_RATE 2 #define MG5UART_BAUD_RATE 0x08
/* /*
* Interrupt mask values * Interrupt mask values