1 // SPDX-License-Identifier: GPL-2.0+
3 * [partely copied from arch/arm/cpu/arm926ejs/at91/arm9260_devices.c]
6 * Andreas Bießmann <andreas@biessmann.org>
8 * (C) Copyright 2007-2008
9 * Stelian Pop <stelian@popies.net>
10 * Lead Tech Design <www.leadtechdesign.com>
15 #include <asm/arch/at91_common.h>
16 #include <asm/arch/clk.h>
17 #include <asm/arch/gpio.h>
20 * if CONFIG_AT91_GPIO_PULLUP ist set, keep pullups on on all
21 * peripheral pins. Good to have if hardware is soldered optionally
22 * or in case of SPI no slave is selected. Avoid lines to float
23 * needlessly. Use a short local PUP define.
25 * Due to errata "TXD floats when CTS is inactive" pullups are always
28 #ifdef CONFIG_AT91_GPIO_PULLUP
29 # define PUP CONFIG_AT91_GPIO_PULLUP
34 void at91_serial0_hw_init(void)
36 at91_set_a_periph(AT91_PIO_PORTA, 17, 1); /* TXD0 */
37 at91_set_a_periph(AT91_PIO_PORTA, 18, PUP); /* RXD0 */
38 at91_periph_clk_enable(ATMEL_ID_USART0);
41 void at91_serial1_hw_init(void)
43 at91_set_a_periph(AT91_PIO_PORTB, 20, PUP); /* RXD1 */
44 at91_set_a_periph(AT91_PIO_PORTB, 21, 1); /* TXD1 */
45 at91_periph_clk_enable(ATMEL_ID_USART1);
48 void at91_serial2_hw_init(void)
50 at91_set_a_periph(AT91_PIO_PORTA, 22, PUP); /* RXD2 */
51 at91_set_a_periph(AT91_PIO_PORTA, 23, 1); /* TXD2 */
52 at91_periph_clk_enable(ATMEL_ID_USART2);
55 void at91_seriald_hw_init(void)
57 at91_set_a_periph(AT91_PIO_PORTA, 30, PUP); /* DRXD */
58 at91_set_a_periph(AT91_PIO_PORTA, 31, 1); /* DTXD */
59 /* writing SYS to PCER has no effect on AT91RM9200 */