Add support for pandora board
[pandora-x-loader.git] / include / configs / pandora.h
1 /*
2  * (C) Copyright 2006
3  * Texas Instruments <www.ti.com>
4  * Richard Woodruff <r-woodruff2@ti.com>
5  *
6  * X-Loader Configuation settings for the Pandora board.
7  *
8  * Derived from /include/configs/omap3evm.h
9  * John Willis <source@distant-earth.com>
10  * GraÅžvydas Ignotas <notasas@gmail.com>
11  *
12  * See file CREDITS for list of people who contributed to this
13  * project.
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License as
17  * published by the Free Software Foundation; either version 2 of
18  * the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28  * MA 02111-1307 USA
29  */
30
31 #ifndef __CONFIG_H
32 #define __CONFIG_H
33
34 /* serial printf facility takes about 3.5K */
35 #define CFG_PRINTF
36
37 /*
38  * High Level Configuration Options
39  */
40 #define CONFIG_ARMCORTEXA8      1       /* This is an ARM V7 CPU core */
41 #define CONFIG_OMAP             1       /* in a TI OMAP core */
42 #define CONFIG_OMAP34XX         1       /* which is a 34XX */
43 #define CONFIG_OMAP3430         1       /* which is in a 3430 */
44 #define CONFIG_OMAP3_PANDORA    1       /* working with a Pandora */
45
46 /* Enable the below macro if MMC boot support is required */
47 #define CONFIG_MMC              1
48 #define CFG_CMD_MMC             1
49 #define CFG_CMD_FAT             1
50
51 /* Enable I2C stuff */
52 /* I2C to power serial shifter */
53
54 #define CFG_I2C_SPEED           100000
55 #define CFG_I2C_SLAVE           1
56 #define CFG_I2C_BUS             0
57 #define CFG_I2C_BUS_SELECT      1
58 #define CONFIG_DRIVER_OMAP34XX_I2C 1
59
60 #include <asm/arch/cpu.h>        /* get chip and board defs */
61
62 /* Clock Defines */
63 #define V_OSCK                  26000000  /* Clock output from T2 */
64
65 #if (V_OSCK > 19200000)
66 #define V_SCLK                  (V_OSCK >> 1)
67 #else
68 #define V_SCLK                  V_OSCK
69 #endif
70
71 #define PRCM_CLK_CFG2_332MHZ    1       /* VDD2=1.15v - 166MHz DDR */
72 #define PRCM_PCLK_OPP2          1       /* ARM=381MHz - VDD1=1.20v */
73
74 /* Memory type */
75 #define CFG_3430SDRAM_DDR       1
76
77 /* The actual register values are defined in u-boot- mem.h */
78 /* SDRAM Bank Allocation method */
79 #define SDRC_R_B_C              1
80
81 #define NAND_BASE_ADR   NAND_BASE
82
83 #define OMAP34XX_GPMC_CS0_SIZE GPMC_SIZE_128M
84
85 #ifdef CFG_PRINTF
86
87 #define CFG_NS16550
88 #define CFG_NS16550_SERIAL
89 #define CFG_NS16550_REG_SIZE    -4
90 #define CFG_NS16550_CLK         48000000
91 #define CFG_NS16550_COM3        OMAP34XX_UART3
92
93 /*
94  * select serial console configuration
95  */
96 #define CONFIG_SERIAL1          3       /* UART3 for Serial, Thanks */
97 #define CONFIG_CONS_INDEX       3
98
99 #define CONFIG_BAUDRATE         115200
100 #define CFG_PBSIZE              256
101
102 #endif /* CFG_PRINTF */
103
104 /*
105  * Miscellaneous configurable options
106  */
107 #define CFG_LOADADDR            0x80008000
108
109 #undef  CFG_CLKS_IN_HZ          /* everything, incl board info, in Hz */
110
111 /*-----------------------------------------------------------------------
112  * Stack sizes
113  *
114  * The stack sizes are set up in start.S using the settings below
115  */
116 #define CONFIG_STACKSIZE        (128*1024) /* regular stack */
117
118 /*-----------------------------------------------------------------------
119  * Board NAND Info.
120  */
121
122 #define CFG_NAND_K9F1G08R0A     /* Micron 16-bit 256MB chip large page NAND chip */
123 #define NAND_16BIT
124
125 /* NAND is partitioned:
126  * 0x00000000 - 0x0007FFFF  Booting Image
127  * 0x00080000 - 0x0025FFFF  U-Boot Image
128  * 0x00260000 - 0x0027FFFF  U-Boot Env Data (X-loader doesn't care)
129  * 0x00280000 - ...         depends on application
130  */
131 #define NAND_UBOOT_START        0x0080000 /* Leaving first 4 blocks for x-load */
132 #define NAND_UBOOT_END          0x0160000 /* Only read part for faster boot */
133 #define NAND_BLOCK_SIZE         0x20000
134
135 #define GPMC_CONFIG             (OMAP34XX_GPMC_BASE+0x50)
136 #define GPMC_NAND_COMMAND_0     (OMAP34XX_GPMC_BASE+0x7C)
137 #define GPMC_NAND_ADDRESS_0     (OMAP34XX_GPMC_BASE+0x80)
138 #define GPMC_NAND_DATA_0        (OMAP34XX_GPMC_BASE+0x84)
139
140 #ifdef NAND_16BIT
141 #define WRITE_NAND_COMMAND(d, adr) \
142         do {*(volatile u16 *)GPMC_NAND_COMMAND_0 = d; } while (0)
143 #define WRITE_NAND_ADDRESS(d, adr) \
144         do {*(volatile u16 *)GPMC_NAND_ADDRESS_0 = d; } while (0)
145 #define WRITE_NAND(d, adr) \
146         do {*(volatile u16 *)GPMC_NAND_DATA_0 = d; } while (0)
147 #define READ_NAND(adr) \
148         (*(volatile u16 *)GPMC_NAND_DATA_0)
149 #define NAND_WAIT_READY()
150 #define NAND_WP_OFF()  \
151         do {*(volatile u32 *)(GPMC_CONFIG) |= 0x00000010; } while (0)
152 #define NAND_WP_ON()  \
153         do {*(volatile u32 *)(GPMC_CONFIG) &= ~0x00000010; } while (0)
154
155 #else /* to support 8-bit NAND devices */
156 #define WRITE_NAND_COMMAND(d, adr) \
157         do {*(volatile u8 *)GPMC_NAND_COMMAND_0 = d; } while (0)
158 #define WRITE_NAND_ADDRESS(d, adr) \
159         do {*(volatile u8 *)GPMC_NAND_ADDRESS_0 = d; } while (0)
160 #define WRITE_NAND(d, adr) \
161         do {*(volatile u8 *)GPMC_NAND_DATA_0 = d; } while (0)
162 #define READ_NAND(adr) \
163         (*(volatile u8 *)GPMC_NAND_DATA_0);
164 #define NAND_WAIT_READY()
165 #define NAND_WP_OFF()  \
166         do {*(volatile u32 *)(GPMC_CONFIG) |= 0x00000010; } while (0)
167 #define NAND_WP_ON()  \
168         do {*(volatile u32 *)(GPMC_CONFIG) &= ~0x00000010; } while (0)
169
170 #endif
171
172 #define NAND_CTL_CLRALE(adr)
173 #define NAND_CTL_SETALE(adr)
174 #define NAND_CTL_CLRCLE(adr)
175 #define NAND_CTL_SETCLE(adr)
176 #define NAND_DISABLE_CE()
177 #define NAND_ENABLE_CE()
178
179 #endif /* __CONFIG_H */