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 * See file CREDITS for list of people who contributed to this
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 #include <asm/arch/at91_common.h>
33 #include <asm/arch/at91_pmc.h>
34 #include <asm/arch/gpio.h>
37 * if CONFIG_AT91_GPIO_PULLUP ist set, keep pullups on on all
38 * peripheral pins. Good to have if hardware is soldered optionally
39 * or in case of SPI no slave is selected. Avoid lines to float
40 * needlessly. Use a short local PUP define.
42 * Due to errata "TXD floats when CTS is inactive" pullups are always
45 #ifdef CONFIG_AT91_GPIO_PULLUP
46 # define PUP CONFIG_AT91_GPIO_PULLUP
51 void at91_serial0_hw_init(void)
53 at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
55 at91_set_a_periph(AT91_PIO_PORTA, 17, 1); /* TXD0 */
56 at91_set_a_periph(AT91_PIO_PORTA, 18, PUP); /* RXD0 */
57 writel(1 << ATMEL_ID_USART0, &pmc->pcer);
60 void at91_serial1_hw_init(void)
62 at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
64 at91_set_a_periph(AT91_PIO_PORTB, 20, PUP); /* RXD1 */
65 at91_set_a_periph(AT91_PIO_PORTB, 21, 1); /* TXD1 */
66 writel(1 << ATMEL_ID_USART1, &pmc->pcer);
69 void at91_serial2_hw_init(void)
71 at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
73 at91_set_a_periph(AT91_PIO_PORTA, 22, PUP); /* RXD2 */
74 at91_set_a_periph(AT91_PIO_PORTA, 23, 1); /* TXD2 */
75 writel(1 << ATMEL_ID_USART2, &pmc->pcer);
78 void at91_seriald_hw_init(void)
80 at91_set_a_periph(AT91_PIO_PORTA, 30, PUP); /* DRXD */
81 at91_set_a_periph(AT91_PIO_PORTA, 31, 1); /* DTXD */
82 /* writing SYS to PCER has no effect on AT91RM9200 */