diff options
author | imp <imp@FreeBSD.org> | 2012-07-14 05:46:52 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2012-07-14 05:46:52 +0000 |
commit | a8c236d935f387b1cb7759c1ca5e8766eb989d5a (patch) | |
tree | 212da9edf2ab06c197ad44b5a1c4b83298b5e89d /sys/arm/at91/board_kb920x.c | |
parent | 3981b9b76aa0266598ee7b724e5981627d8ac129 (diff) | |
download | FreeBSD-src-a8c236d935f387b1cb7759c1ca5e8766eb989d5a.zip FreeBSD-src-a8c236d935f387b1cb7759c1ca5e8766eb989d5a.tar.gz |
Create common routines for configuring the serial ports and use them
on all the at91rm9200 boards.
Diffstat (limited to 'sys/arm/at91/board_kb920x.c')
-rw-r--r-- | sys/arm/at91/board_kb920x.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/sys/arm/at91/board_kb920x.c b/sys/arm/at91/board_kb920x.c index bb8e011..55aec0b 100644 --- a/sys/arm/at91/board_kb920x.c +++ b/sys/arm/at91/board_kb920x.c @@ -44,26 +44,15 @@ board_init(void) at91rm9200_set_subtype(AT91_ST_RM9200_PQFP); /* - * Since the USART supports RS-485 multidrop mode, it allows the - * TX pins to float. However, for RS-232 operations, we don't want - * these pins to float. Instead, they should be pulled up to avoid - * mismatches. Linux does something similar when it configures the - * TX lines. This implies that we also allow the RX lines to float - * rather than be in the state they are left in by the boot loader. - * Since they are input pins, I think that this is the right thing - * to do. + * Setup the serial ports. + * DBGU is the main one, although jumpers can make USART0 default. + * USART1 is IrDA, and USART3 is optional RS485. */ - /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); - /* PIOA's B periph: Turn USART 3's TX/RX pins */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); - /* PIOB's A periph: Turn USART 1's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART0, 1, 0); /* Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART1, 2, 0); /* Tx and Rx - IRDA */ + at91rm9200_config_uart(AT91RM9200_ID_USART3, 3, /* Tx, Rx, CTS, RTS - RS485 */ + AT91_UART_CTS | AT91_UART_RTS); /* MMC/SD Interface */ at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA27_MCCK, 0); |