2 * [partely copied from arch/arm/cpu/arm926ejs/at91/arm9260_devices.c]
5 * Andreas Bießmann <andreas.devel@googlemail.com>
7 * (C) Copyright 2007-2008
8 * Stelian Pop <stelian@popies.net>
9 * Lead Tech Design <www.leadtechdesign.com>
11 * SPDX-License-Identifier: GPL-2.0+
16 #include <asm/arch/at91_common.h>
17 #include <asm/arch/at91_pmc.h>
18 #include <asm/arch/gpio.h>
21 * if CONFIG_AT91_GPIO_PULLUP ist set, keep pullups on on all
22 * peripheral pins. Good to have if hardware is soldered optionally
23 * or in case of SPI no slave is selected. Avoid lines to float
24 * needlessly. Use a short local PUP define.
26 * Due to errata "TXD floats when CTS is inactive" pullups are always
29 #ifdef CONFIG_AT91_GPIO_PULLUP
30 # define PUP CONFIG_AT91_GPIO_PULLUP
35 void at91_serial0_hw_init(void)
37 at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
39 at91_set_a_periph(AT91_PIO_PORTA, 17, 1); /* TXD0 */
40 at91_set_a_periph(AT91_PIO_PORTA, 18, PUP); /* RXD0 */
41 writel(1 << ATMEL_ID_USART0, &pmc->pcer);
44 void at91_serial1_hw_init(void)
46 at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
48 at91_set_a_periph(AT91_PIO_PORTB, 20, PUP); /* RXD1 */
49 at91_set_a_periph(AT91_PIO_PORTB, 21, 1); /* TXD1 */
50 writel(1 << ATMEL_ID_USART1, &pmc->pcer);
53 void at91_serial2_hw_init(void)
55 at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
57 at91_set_a_periph(AT91_PIO_PORTA, 22, PUP); /* RXD2 */
58 at91_set_a_periph(AT91_PIO_PORTA, 23, 1); /* TXD2 */
59 writel(1 << ATMEL_ID_USART2, &pmc->pcer);
62 void at91_seriald_hw_init(void)
64 at91_set_a_periph(AT91_PIO_PORTA, 30, PUP); /* DRXD */
65 at91_set_a_periph(AT91_PIO_PORTA, 31, 1); /* DTXD */
66 /* writing SYS to PCER has no effect on AT91RM9200 */