PERFORCE change 88426 for review
Warner Losh
imp at FreeBSD.org
Mon Dec 19 13:36:29 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=88426
Change 88426 by imp at imp_Speedy on 2005/12/19 21:35:29
Default RCLK is the system's master clock. Add some comments.
Affected files ...
.. //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#3 edit
Differences ...
==== //depot/projects/arm/src/sys/arm/at91/uart_dev_at91usart.c#3 (text+ko) ====
@@ -43,7 +43,7 @@
#include "uart_if.h"
-#define DEFAULT_RCLK 3686400
+#define DEFAULT_RCLK AT91C_MASTER_CLOCK
/*
* Low-level UART interface.
@@ -71,9 +71,13 @@
static int
usart_at91rm92_probe(struct uart_bas *bas)
{
+ /* We know that this is always here */
return (0);
}
+/*
+ * Initialize this device (I think as the console)
+ */
static void
usart_at91rm92_init(struct uart_bas *bas, int baudrate, int databits, int stopbits,
int parity)
@@ -84,12 +88,19 @@
uart_setreg(bas, USART_IER, USART_CSR_TXRDY | USART_CSR_RXRDY);
}
+/*
+ * Free resources now that we're no longer the console.
+ */
static void
usart_at91rm92_term(struct uart_bas *bas)
{
/* XXX */
}
+/*
+ * Put a character of console output (so we do it here polling rather than
+ * interrutp driven).
+ */
static void
usart_at91rm92_putc(struct uart_bas *bas, int c)
{
@@ -99,6 +110,9 @@
uart_setreg(bas, USART_THR, c);
}
+/*
+ * Poll for a character available
+ */
static int
usart_at91rm92_poll(struct uart_bas *bas)
{
@@ -108,6 +122,9 @@
return (uart_getreg(bas, USART_RHR) & 0xff);
}
+/*
+ * Block waiting for a character.
+ */
static int
usart_at91rm92_getc(struct uart_bas *bas)
{
@@ -212,5 +229,5 @@
usart_at91rm92_methods,
1,
.uc_range = 8,
- .uc_rclk = 3686400
+ .uc_rclk = DEFAULT_RCLK
};
More information about the p4-projects
mailing list