Initial checkin
[pandora-x-loader.git] / board / omap1710h3 / omap1710h3.c
1 /*
2  * (C) Copyright 2004
3  * Texas Instruments, <www.ti.com>
4  * Jian Zhang <jzhang@ti.com>
5  *
6  * (C) Copyright 2002
7  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8  * Marius Groeger <mgroeger@sysgo.de>
9  *
10  * (C) Copyright 2002
11  * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
12  *
13  * See file CREDITS for list of people who contributed to this
14  * project.
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License as
18  * published by the Free Software Foundation; either version 2 of
19  * the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29  * MA 02111-1307 USA
30  */
31
32 #include <common.h>
33 #if defined(CONFIG_OMAP1710)
34 #include <./configs/omap1510.h>
35 #endif
36   
37 #define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF)
38
39 int board_init (void)
40 {
41 #ifdef CFG_PRINTF 
42
43         /* setup for UART1 */
44         *(volatile unsigned int *) ((unsigned int)FUNC_MUX_CTRL_0) &= ~(0x02000000);    /* bit 25 */
45         /* bit 29 for UART1 */
46         *(volatile unsigned int *) ((unsigned int)MOD_CONF_CTRL_0) &= ~(0x00002000);
47   
48         /* Enable the power for UART1 */
49 #define UART1_48MHZ_ENABLE      ((unsigned short)0x0200)
50 #define SW_CLOCK_REQUEST        0xFFFE0834
51         *((volatile unsigned short *)SW_CLOCK_REQUEST) |= UART1_48MHZ_ENABLE;
52
53 #endif
54
55         *(volatile unsigned int *) ((unsigned int)COMP_MODE_CTRL_0) = COMP_MODE_ENABLE;
56         return 0;
57 }
58
59 #define GPIO1_DIRECTION         0xFFFBE434
60 #define FUNC_MUX_CTRL_F         0xFFFE1094
61 #define PU_PD_SEL_4                     0xFFFE10C4
62 /*
63  * On H3 board, Nand R/B is tied to GPIO_10
64  * We setup this GPIO pin 
65  */
66 int nand_init (void)
67 {
68         
69         /* GPIO_10 for input. it is in GPIO1 module */
70         *(volatile unsigned int *) ((unsigned int)GPIO1_DIRECTION) |= 0x0400; 
71         
72         /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
73         *(volatile unsigned int *) ((unsigned int)FUNC_MUX_CTRL_F) &= 0xC7FFFFFF;
74         *(volatile unsigned int *) ((unsigned int)FUNC_MUX_CTRL_F) |= 0x08000000;
75           
76         /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
77         *(volatile unsigned int *) ((unsigned int)PU_PD_SEL_4) |= 0x08;
78          
79         if (nand_chip()){
80                 printf("Unsupported Chip!\n");
81                 return 1;
82         }
83         return 0;
84 }
85
86 /* optionally do something like blinking LED */
87 void board_hang (void)
88 {}
89