dfb1ec4b6124b4bc2ce84bd04740c249c668262a
[platform/kernel/u-boot.git] / include / configs / omap3_logic.h
1 /*
2  * (C) Copyright 2011 Logic Product Development <www.logicpd.com>
3  *      Peter Barada <peter.barada@logicpd.com>
4  *
5  * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo
6  * reference boards.
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
10
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13
14 /* High Level Configuration Options */
15
16 #define CONFIG_NR_DRAM_BANKS    2       /* CS1 may or may not be populated */
17
18 /*
19  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
20  * 64 bytes before this address should be set aside for u-boot.img's
21  * header. That is 0x800FFFC0--0x80100000 should not be used for any
22  * other needs.  We use this rather than the inherited defines from
23  * ti_armv7_common.h for backwards compatibility.
24  */
25 #define CONFIG_SYS_TEXT_BASE            0x80100000
26 #define CONFIG_SPL_BSS_START_ADDR       0x80000000
27 #define CONFIG_SPL_BSS_MAX_SIZE         (512 << 10)     /* 512 KB */
28 #define CONFIG_SYS_SPL_MALLOC_START     0x80208000
29 #define CONFIG_SYS_SPL_MALLOC_SIZE      0x100000
30
31 #include <configs/ti_omap3_common.h>
32
33 /*
34  * We are only ever GP parts and will utilize all of the "downloaded image"
35  * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
36  * order to allow for BCH8 to fit in.
37  */
38 #undef CONFIG_SPL_TEXT_BASE
39 #define CONFIG_SPL_TEXT_BASE            0x40200000
40
41 /* Display CPU and Board information */
42
43 #define CONFIG_DISPLAY_BOARDINFO
44 #define CONFIG_BOARD_LATE_INIT
45 #define CONFIG_MISC_INIT_R              /* misc_init_r dumps the die id */
46 #define CONFIG_CMDLINE_TAG              /* enable passing of ATAGs */
47 #define CONFIG_SETUP_MEMORY_TAGS
48 #define CONFIG_INITRD_TAG
49 #define CONFIG_REVISION_TAG
50 #define CONFIG_CMDLINE_EDITING          /* cmd line edit/history */
51
52 /* Hardware drivers */
53
54 /* GPIO banks */
55 #define CONFIG_OMAP3_GPIO_6             /* GPIO160..191 is in GPIO bank 6 */
56
57 #define CONFIG_USB_OMAP3
58
59 /* select serial console configuration */
60 #undef CONFIG_CONS_INDEX
61 #define CONFIG_CONS_INDEX               1
62 #define CONFIG_SYS_NS16550_COM1         OMAP34XX_UART1
63 #define CONFIG_SERIAL1                  1       /* UART1 on OMAP Logic boards */
64
65 /* commands to include */
66 #define CONFIG_CMD_NAND
67 #define CONFIG_CMD_MTDPARTS
68 #define CONFIG_CMD_NAND_LOCK_UNLOCK     /* nand (un)lock commands       */
69
70 /* I2C */
71 #define CONFIG_SYS_I2C_OMAP34XX
72 #define CONFIG_SYS_I2C_EEPROM_ADDR      0x50    /* EEPROM AT24C64      */
73 #define EXPANSION_EEPROM_I2C_BUS        2       /* I2C Bus for AT24C64 */
74 #define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
75
76 /* USB */
77 #define CONFIG_USB_MUSB_OMAP2PLUS
78 #define CONFIG_USB_MUSB_PIO_ONLY
79 #define CONFIG_USB_ETHER
80 #define CONFIG_USB_ETHER_RNDIS
81 #define CONFIG_USB_FUNCTION_FASTBOOT
82 #define CONFIG_CMD_FASTBOOT
83 #define CONFIG_ANDROID_BOOT_IMAGE
84 #define CONFIG_FASTBOOT_BUF_ADDR        CONFIG_SYS_LOAD_ADDR
85 #define CONFIG_FASTBOOT_BUF_SIZE        0x07000000
86
87 /* TWL4030 */
88 #define CONFIG_TWL4030_PWM
89 #define CONFIG_TWL4030_USB
90
91 /* Board NAND Info. */
92 #ifdef CONFIG_NAND
93 #define CONFIG_NAND_OMAP_GPMC
94
95 #define CONFIG_CMD_UBIFS                /* Read-only UBI volume operations */
96 #define CONFIG_RBTREE                   /* required by CONFIG_CMD_UBI */
97 #define CONFIG_LZO                      /* required by CONFIG_CMD_UBIFS */
98
99 #define CONFIG_SYS_NAND_ADDR            NAND_BASE /* physical address */
100                                                   /* to access nand */
101 #define CONFIG_SYS_MAX_NAND_DEVICE      1         /* Max number of */
102                                                   /* NAND devices */
103 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
104 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
105 #define CONFIG_SYS_NAND_PAGE_COUNT      64
106 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
107 #define CONFIG_SYS_NAND_OOBSIZE         64
108 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128 * 1024)
109 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
110 #define CONFIG_SYS_NAND_ECCPOS          {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
111                                          13, 14, 16, 17, 18, 19, 20, 21, 22, \
112                                          23, 24, 25, 26, 27, 28, 30, 31, 32, \
113                                          33, 34, 35, 36, 37, 38, 39, 40, 41, \
114                                          42, 44, 45, 46, 47, 48, 49, 50, 51, \
115                                          52, 53, 54, 55, 56}
116
117 #define CONFIG_SYS_NAND_ECCSIZE         512
118 #define CONFIG_SYS_NAND_ECCBYTES        13
119 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
120 #define CONFIG_BCH
121 #define CONFIG_SYS_NAND_MAX_OOBFREE     2
122 #define CONFIG_SYS_NAND_MAX_ECCPOS      56
123 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x80000
124 #define CONFIG_MTD_DEVICE               /* needed for mtdparts commands */
125 #define CONFIG_MTD_PARTITIONS           /* required for UBI partition support */
126 #define MTDIDS_DEFAULT                  "nand0=omap2-nand.0"
127 #define MTDPARTS_DEFAULT                "mtdparts=omap2-nand.0:512k(MLO),"\
128                                         "1920k(u-boot),128k(u-boot-env),"\
129                                         "4m(kernel),-(fs)"
130 #endif
131
132 /* Environment information */
133
134 /*
135  * PREBOOT assumes the 4.3" display is attached.  User can interrupt
136  * and modify display variable to suit their needs.
137  */
138 #define CONFIG_PREBOOT \
139         "echo ======================NOTICE============================;"\
140         "echo \"The u-boot environment is not set.\";"                  \
141         "echo \"If using a display a valid display variable for your panel\";" \
142         "echo \"needs to be set.\";"                                    \
143         "echo \"Valid display options are:\";"                          \
144         "echo \"  2 == LQ121S1DG31     TFT SVGA    (12.1)  Sharp\";"    \
145         "echo \"  3 == LQ036Q1DA01     TFT QVGA    (3.6)   Sharp w/ASIC\";" \
146         "echo \"  5 == LQ064D343       TFT VGA     (6.4)   Sharp\";"    \
147         "echo \"  7 == LQ10D368        TFT VGA     (10.4)  Sharp\";"    \
148         "echo \" 15 == LQ043T1DG01     TFT WQVGA   (4.3)   Sharp (DEFAULT)\";" \
149         "echo \" vga[-dvi or -hdmi]    LCD VGA     640x480\";"          \
150         "echo \" svga[-dvi or -hdmi]   LCD SVGA    800x600\";"          \
151         "echo \" xga[-dvi or -hdmi]    LCD XGA     1024x768\";"         \
152         "echo \" 720p[-dvi or -hdmi]   LCD 720P    1280x720\";"         \
153         "echo \"Defaulting to 4.3 LCD panel (display=15).\";"           \
154         "setenv display 15;"                                            \
155         "setenv preboot;"                                               \
156         "nand unlock;"                                                  \
157         "saveenv;"
158
159 #define CONFIG_EXTRA_ENV_SETTINGS \
160         "loadaddr=0x81000000\0" \
161         "uimage=uImage\0" \
162         "zimage=zImage\0" \
163         "mtdids=" MTDIDS_DEFAULT "\0"   \
164         "mtdparts=" MTDPARTS_DEFAULT "\0" \
165         "mmcdev=0\0" \
166         "mmcroot=/dev/mmcblk0p2 rw\0" \
167         "mmcrootfstype=ext4 rootwait\0" \
168         "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
169         "nandrootfstype=ubifs rootwait\0" \
170         "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
171                         "if run loadbootscript; then " \
172                                 "run bootscript; " \
173                         "else " \
174                                 "run defaultboot;" \
175                         "fi; " \
176                 "else run defaultboot; fi\0" \
177         "defaultboot=run mmcramboot\0" \
178         "consoledevice=ttyO0\0" \
179         "display=15\0" \
180         "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
181         "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
182         "rotation=0\0" \
183         "vrfb_arg=if itest ${rotation} -ne 0; then " \
184                 "setenv bootargs ${bootargs} omapfb.vrfb=y " \
185                 "omapfb.rotate=${rotation}; " \
186                 "fi\0" \
187         "optargs=ignore_loglevel early_printk no_console_suspend\0" \
188         "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
189         "common_bootargs=setenv bootargs ${bootargs} display=${display} " \
190                 "${optargs};" \
191                 "run addmtdparts; " \
192                 "run vrfb_arg\0" \
193         "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
194         "bootscript=echo 'Running bootscript from mmc ...'; " \
195                 "source ${loadaddr}\0" \
196         "loaduimage=mmc rescan; " \
197                 "fatload mmc ${mmcdev} ${loadaddr} ${uimage}\0" \
198         "loadzimage=mmc rescan; " \
199                 "fatload mmc ${mmcdev} ${loadaddr} ${zimage}\0" \
200         "ramdisksize=64000\0" \
201         "ramdiskaddr=0x82000000\0" \
202         "ramdiskimage=rootfs.ext2.gz.uboot\0" \
203         "loadramdisk=mmc rescan; " \
204                 "fatload mmc ${mmcdev} ${ramdiskaddr} ${ramdiskimage}\0" \
205         "ramargs=run setconsole; setenv bootargs console=${console} " \
206                 "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
207         "mmcargs=run setconsole; setenv bootargs console=${console} " \
208                 "${optargs} " \
209                 "root=${mmcroot} " \
210                 "rootfstype=${mmcrootfstype}\0" \
211         "nandargs=run setconsole; setenv bootargs console=${console} " \
212                 "${optargs} " \
213                 "root=${nandroot} " \
214                 "rootfstype=${nandrootfstype}\0" \
215         "fdtaddr=0x86000000\0" \
216         "loadfdtimage=mmc rescan; " \
217                 "fatload mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
218         "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \
219                 "run mmcargs; " \
220                 "run common_bootargs; " \
221                 "run dump_bootargs; " \
222                 "run loadzimage; " \
223                 "run loadfdtimage; " \
224                 "bootz ${loadaddr} - ${fdtaddr}\0" \
225         "mmcramboot=echo 'Booting uImage kernel from mmc w/ramdisk...'; " \
226                 "run ramargs; " \
227                 "run common_bootargs; " \
228                 "run dump_bootargs; " \
229                 "run loaduimage; " \
230                 "run loadramdisk; " \
231                 "bootm ${loadaddr} ${ramdiskaddr}\0" \
232         "mmcrambootz=echo 'Booting zImage kernel from mmc w/ramdisk...'; " \
233                 "run ramargs; " \
234                 "run common_bootargs; " \
235                 "run dump_bootargs; " \
236                 "run loadzimage; " \
237                 "run loadramdisk; " \
238                 "run loadfdtimage; " \
239                 "bootz ${loadaddr} ${ramdiskaddr} ${fdtaddr}\0; " \
240         "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
241                 "run ramargs; " \
242                 "run common_bootargs; " \
243                 "run dump_bootargs; " \
244                 "tftpboot ${loadaddr} ${uimage}; " \
245                 "tftpboot ${ramdiskaddr} ${ramdiskimage}; " \
246                 "bootm ${loadaddr} ${ramdiskaddr}\0"
247
248 #define CONFIG_BOOTCOMMAND \
249         "run autoboot"
250
251 /* Miscellaneous configurable options */
252 #define CONFIG_AUTO_COMPLETE
253
254 /* memtest works on */
255 #define CONFIG_SYS_MEMTEST_START        (OMAP34XX_SDRC_CS0)
256 #define CONFIG_SYS_MEMTEST_END          (OMAP34XX_SDRC_CS0 + \
257                                         0x01F00000) /* 31MB */
258
259 /* FLASH and environment organization */
260
261 /* **** PISMO SUPPORT *** */
262 #if defined(CONFIG_CMD_NAND)
263 #define CONFIG_SYS_FLASH_BASE           NAND_BASE
264 #elif defined(CONFIG_CMD_ONENAND)
265 #define CONFIG_SYS_FLASH_BASE           ONENAND_MAP
266 #endif
267
268 /* Monitor at start of flash */
269 #define CONFIG_SYS_MONITOR_BASE         CONFIG_SYS_FLASH_BASE
270
271 #define CONFIG_ENV_IS_IN_NAND           1
272 #define CONFIG_ENV_SIZE                 (128 << 10)     /* 128 KiB */
273 #define ONENAND_ENV_OFFSET              0x260000 /* environment starts here */
274 #define SMNAND_ENV_OFFSET               0x260000 /* environment starts here */
275
276 #define CONFIG_SYS_ENV_SECT_SIZE        (128 << 10)     /* 128 KiB */
277 #define CONFIG_ENV_OFFSET               SMNAND_ENV_OFFSET
278 #define CONFIG_ENV_ADDR                 SMNAND_ENV_OFFSET
279
280 /* SMSC922x Ethernet */
281 #if defined(CONFIG_CMD_NET)
282 #define CONFIG_SMC911X
283 #define CONFIG_SMC911X_32_BIT
284 #define CONFIG_SMC911X_BASE     0x08000000
285 #endif /* (CONFIG_CMD_NET) */
286
287 /* Defines for SPL */
288
289 #define CONFIG_SPL_OMAP3_ID_NAND
290
291 /* NAND: SPL falcon mode configs */
292 #ifdef CONFIG_SPL_OS_BOOT
293 #define CONFIG_CMD_SPL_NAND_OFS         0x240000
294 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
295 #define CONFIG_CMD_SPL_WRITE_SIZE       0x2000
296 #endif
297
298 #endif /* __CONFIG_H */