blob: a5d3ea65d96fa6b4c35d6ef20d82b3780c6c961a [file] [log] [blame]
Haavard Skinnemoendf548d32006-11-19 18:06:53 +01001/*
2 * Copyright (C) 2006 Atmel Corporation
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22#include <common.h>
23
24#include <asm/arch/gpio.h>
25
26/*
27 * Lots of small functions here. We depend on --gc-sections getting
28 * rid of the ones we don't need.
29 */
30void gpio_enable_ebi(void)
31{
32#ifdef CFG_HSDRAMC
33#ifndef CFG_SDRAM_16BIT
34 gpio_select_periph_A(GPIO_PIN_PE0, 0);
35 gpio_select_periph_A(GPIO_PIN_PE1, 0);
36 gpio_select_periph_A(GPIO_PIN_PE2, 0);
37 gpio_select_periph_A(GPIO_PIN_PE3, 0);
38 gpio_select_periph_A(GPIO_PIN_PE4, 0);
39 gpio_select_periph_A(GPIO_PIN_PE5, 0);
40 gpio_select_periph_A(GPIO_PIN_PE6, 0);
41 gpio_select_periph_A(GPIO_PIN_PE7, 0);
42 gpio_select_periph_A(GPIO_PIN_PE8, 0);
43 gpio_select_periph_A(GPIO_PIN_PE9, 0);
44 gpio_select_periph_A(GPIO_PIN_PE10, 0);
45 gpio_select_periph_A(GPIO_PIN_PE11, 0);
46 gpio_select_periph_A(GPIO_PIN_PE12, 0);
47 gpio_select_periph_A(GPIO_PIN_PE13, 0);
48 gpio_select_periph_A(GPIO_PIN_PE14, 0);
49 gpio_select_periph_A(GPIO_PIN_PE15, 0);
50#endif
51 gpio_select_periph_A(GPIO_PIN_PE26, 0);
52#endif
53}
54
55void gpio_enable_usart0(void)
56{
57 gpio_select_periph_B(GPIO_PIN_PA8, 0);
58 gpio_select_periph_B(GPIO_PIN_PA9, 0);
59}
60
61void gpio_enable_usart1(void)
62{
63 gpio_select_periph_A(GPIO_PIN_PA17, 0);
64 gpio_select_periph_A(GPIO_PIN_PA18, 0);
65}
66
67void gpio_enable_usart2(void)
68{
69 gpio_select_periph_B(GPIO_PIN_PB26, 0);
70 gpio_select_periph_B(GPIO_PIN_PB27, 0);
71}
72
73void gpio_enable_usart3(void)
74{
75 gpio_select_periph_B(GPIO_PIN_PB18, 0);
76 gpio_select_periph_B(GPIO_PIN_PB19, 0);
77}