]> Git Repo - J-u-boot.git/blame - include/configs/am335x_evm.h
Convert CONFIG_SYS_NAND_U_BOOT_LOCATIONS et al to Kconfig
[J-u-boot.git] / include / configs / am335x_evm.h
CommitLineData
5289e83a
CN
1/*
2 * am335x_evm.h
3 *
4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __CONFIG_AM335X_EVM_H
17#define __CONFIG_AM335X_EVM_H
18
87694558 19#include <configs/ti_am335x_common.h>
beffc170 20#include <linux/sizes.h>
5289e83a 21
5cc16cbf 22#ifndef CONFIG_SPL_BUILD
dd42a4ab 23# define CONFIG_TIMESTAMP
5cc16cbf
SG
24#endif
25
beffc170 26#define CONFIG_SYS_BOOTM_LEN SZ_16M
dd42a4ab 27
87694558
TR
28/* Clock Defines */
29#define V_OSCK 24000000 /* Clock output from T2 */
30#define V_SCLK (V_OSCK)
7bf038ec 31
88718be3 32#ifdef CONFIG_MTD_RAW_NAND
317fab2d 33#define NANDARGS \
43ede0bc
TR
34 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
35 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
317fab2d
JW
36 "nandargs=setenv bootargs console=${console} " \
37 "${optargs} " \
38 "root=${nandroot} " \
39 "rootfstype=${nandrootfstype}\0" \
cda60176 40 "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048\0" \
317fab2d 41 "nandrootfstype=ubifs rootwait=1\0" \
aefb7255 42 "nandboot=echo Booting from nand ...; " \
317fab2d 43 "run nandargs; " \
cda60176
RQ
44 "nand read ${fdtaddr} NAND.u-boot-spl-os; " \
45 "nand read ${loadaddr} NAND.kernel; " \
aefb7255 46 "bootz ${loadaddr} - ${fdtaddr}\0"
317fab2d
JW
47#else
48#define NANDARGS ""
49#endif
50
bc3199fd
SS
51#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
52 "bootcmd_" #devtypel "=" \
53 "run nandboot\0"
54
55#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
56 #devtypel #instance " "
57
8c444c18
MK
58#if CONFIG_IS_ENABLED(CMD_USB)
59# define BOOT_TARGET_USB(func) func(USB, usb, 0)
60#else
61# define BOOT_TARGET_USB(func)
62#endif
63
4f38592f
AK
64#if CONFIG_IS_ENABLED(CMD_PXE)
65# define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
66#else
67# define BOOT_TARGET_PXE(func)
68#endif
69
70#if CONFIG_IS_ENABLED(CMD_DHCP)
71# define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
72#else
73# define BOOT_TARGET_DHCP(func)
74#endif
75
bc3199fd
SS
76#define BOOT_TARGET_DEVICES(func) \
77 func(MMC, mmc, 0) \
bc3199fd 78 func(MMC, mmc, 1) \
bc3199fd 79 func(NAND, nand, 0) \
8c444c18 80 BOOT_TARGET_USB(func) \
4f38592f
AK
81 BOOT_TARGET_PXE(func) \
82 BOOT_TARGET_DHCP(func)
bc3199fd 83
bc3199fd
SS
84#include <config_distro_bootcmd.h>
85
a32f42f6 86#ifndef CONFIG_SPL_BUILD
88fdfcd2 87#include <environment/ti/dfu.h>
88fdfcd2 88
5289e83a 89#define CONFIG_EXTRA_ENV_SETTINGS \
fb3ad9bd 90 DEFAULT_LINUX_BOOT_ENV \
a7143215 91 "fdtfile=undefined\0" \
ff8f277e 92 "finduuid=part uuid mmc 0:2 uuid\0" \
7bf038ec 93 "console=ttyO0,115200n8\0" \
01d92b04
TR
94 "partitions=" \
95 "uuid_disk=${uuid_gpt_disk};" \
beffc170
SP
96 "name=bootloader,start=384K,size=1792K," \
97 "uuid=${uuid_gpt_bootloader};" \
98 "name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}\0" \
7bf038ec 99 "optargs=\0" \
18e44ce3 100 "ramroot=/dev/ram0 rw\0" \
7bf038ec 101 "ramrootfstype=ext2\0" \
63ba7c66
CM
102 "spiroot=/dev/mtdblock4 rw\0" \
103 "spirootfstype=jffs2\0" \
104 "spisrcaddr=0xe0000\0" \
105 "spiimgsize=0x362000\0" \
106 "spibusno=0\0" \
107 "spiargs=setenv bootargs console=${console} " \
108 "${optargs} " \
109 "root=${spiroot} " \
110 "rootfstype=${spirootfstype}\0" \
7bf038ec
TR
111 "ramargs=setenv bootargs console=${console} " \
112 "${optargs} " \
113 "root=${ramroot} " \
114 "rootfstype=${ramrootfstype}\0" \
73a27a84 115 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
63ba7c66
CM
116 "spiboot=echo Booting from spi ...; " \
117 "run spiargs; " \
118 "sf probe ${spibusno}:0; " \
119 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
e3cf9692 120 "bootz ${loadaddr}\0" \
7bf038ec
TR
121 "ramboot=echo Booting from ramdisk ...; " \
122 "run ramargs; " \
e3cf9692 123 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
044fc14b
TR
124 "findfdt="\
125 "if test $board_name = A335BONE; then " \
126 "setenv fdtfile am335x-bone.dtb; fi; " \
20775906 127 "if test $board_name = A335BNLT; then " \
f9f9d2d6 128 "setenv fdtfile am335x-boneblack.dtb; fi; " \
eff0c977
JK
129 "if test $board_name = A335PBGL; then " \
130 "setenv fdtfile am335x-pocketbeagle.dtb; fi; " \
4015949f 131 "if test $board_name = BBBW; then " \
132 "setenv fdtfile am335x-boneblack-wireless.dtb; fi; " \
f9f9d2d6 133 "if test $board_name = BBG1; then " \
134 "setenv fdtfile am335x-bonegreen.dtb; fi; " \
2b79fba6 135 "if test $board_name = BBGW; then " \
136 "setenv fdtfile am335x-bonegreen-wireless.dtb; fi; " \
52609d75 137 "if test $board_name = BBBL; then " \
138 "setenv fdtfile am335x-boneblue.dtb; fi; " \
ad6054f1
KK
139 "if test $board_name = BBEN; then " \
140 "setenv fdtfile am335x-sancloud-bbe.dtb; fi; " \
044fc14b
TR
141 "if test $board_name = A33515BB; then " \
142 "setenv fdtfile am335x-evm.dtb; fi; " \
143 "if test $board_name = A335X_SK; then " \
20cb5fbe 144 "setenv fdtfile am335x-evmsk.dtb; fi; " \
426af384
LV
145 "if test $board_name = A335_ICE; then " \
146 "setenv fdtfile am335x-icev2.dtb; fi; " \
a7143215 147 "if test $fdtfile = undefined; then " \
317fab2d 148 "echo WARNING: Could not determine device tree to use; fi; \0" \
426af384
LV
149 "init_console=" \
150 "if test $board_name = A335_ICE; then "\
151 "setenv console ttyO3,115200n8;" \
152 "else " \
153 "setenv console ttyO0,115200n8;" \
154 "fi;\0" \
ba481c58 155 NANDARGS \
2320866b 156 NETARGS \
bc3199fd
SS
157 DFUARGS \
158 BOOTENV
a32f42f6
TR
159#endif
160
5289e83a 161/* NS16550 Configuration */
5289e83a 162#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
c3f8318f
AB
163#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
164#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
165#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
166#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
167#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
5289e83a 168
9721027a
TR
169/* PMIC support */
170#define CONFIG_POWER_TPS65217
171#define CONFIG_POWER_TPS65910
172
87694558 173/* SPL */
c5c7a7c3 174#ifndef CONFIG_NOR_BOOT
abcaa6ee 175/* Bootcount using the RTC block */
78701183 176#define CONFIG_SYS_BOOTCOUNT_BE
abcaa6ee 177
a7a06400 178/* USB gadget RNDIS */
fea9543f 179#endif
8a8f084e 180
88718be3 181#ifdef CONFIG_MTD_RAW_NAND
fea9543f 182/* NAND: device related configs */
fea9543f 183/* NAND: driver related configs */
b4606c6c
IY
184#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
185 10, 11, 12, 13, 14, 15, 16, 17, \
186 18, 19, 20, 21, 22, 23, 24, 25, \
187 26, 27, 28, 29, 30, 31, 32, 33, \
188 34, 35, 36, 37, 38, 39, 40, 41, \
189 42, 43, 44, 45, 46, 47, 48, 49, \
190 50, 51, 52, 53, 54, 55, 56, 57, }
191
192#define CONFIG_SYS_NAND_ECCSIZE 512
193#define CONFIG_SYS_NAND_ECCBYTES 14
3f719069 194#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
fea9543f 195/* NAND: SPL related configs */
434f2cfc 196#ifdef CONFIG_SPL_OS_BOOT
434f2cfc 197#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
434f2cfc 198#endif
88718be3 199#endif /* !CONFIG_MTD_RAW_NAND */
b4606c6c 200
8a8f084e 201/*
87694558
TR
202 * For NOR boot, we must set this to the start of where NOR is mapped
203 * in memory.
8a8f084e 204 */
5289e83a 205
d2aa1154 206/*
85a02aa9
TR
207 * USB configuration. We enable MUSB support, both for host and for
208 * gadget. We set USB0 as peripheral and USB1 as host, based on the
209 * board schematic and physical port wired to each. Then for host we
210 * add mass storage support and for gadget we add both RNDIS ethernet
211 * and DFU.
d2aa1154 212 */
d2aa1154
IY
213#define CONFIG_AM335X_USB0
214#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
215#define CONFIG_AM335X_USB1
216#define CONFIG_AM335X_USB1_MODE MUSB_HOST
217
6ae84363
M
218/*
219 * Disable MMC DM for SPL build and can be re-enabled after adding
220 * DM support in SPL
221 */
222#ifdef CONFIG_SPL_BUILD
e83d61a5 223#undef CONFIG_DM_MMC
ac3507dc 224#undef CONFIG_TIMER
6ae84363
M
225#endif
226
b432b1eb 227#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_ETHER)
fb1bf408 228/* Remove other SPL modes. */
c0e66793 229/* disable host part of MUSB in SPL */
01d92b04 230/* disable EFI partitions and partition UUID support */
c0e66793
IY
231#endif
232
85a02aa9 233/* USB Device Firmware Update support */
fad8edf0 234#ifndef CONFIG_SPL_BUILD
ba481c58 235#define DFUARGS \
dd0829f6 236 DFU_ALT_INFO_EMMC \
ba481c58
TR
237 DFU_ALT_INFO_MMC \
238 DFU_ALT_INFO_RAM \
239 DFU_ALT_INFO_NAND
fad8edf0 240#endif
85a02aa9 241
4adfcd68 242/*
6454028a
TR
243 * Default to using SPI for environment, etc.
244 * 0x000000 - 0x020000 : SPL (128KiB)
245 * 0x020000 - 0x0A0000 : U-Boot (512KiB)
246 * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
247 * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
248 * 0x0E0000 - 0x442000 : Linux Kernel
4adfcd68
TR
249 * 0x442000 - 0x800000 : Userland
250 */
251#if defined(CONFIG_SPI_BOOT)
585d8bc1 252/* SPL related */
8c6ede1f 253#elif defined(CONFIG_EMMC_BOOT)
b1c6a54a 254#define CONFIG_SYS_MMC_MAX_DEVICE 2
8c6ede1f 255#endif
4adfcd68 256
87694558 257/* Network. */
4b00d025 258/* Enable Atheros phy driver */
93042960 259
cd8845d7
SK
260/*
261 * NOR Size = 16 MiB
262 * Number of Sectors/Blocks = 128
263 * Sector Size = 128 KiB
264 * Word length = 16 bits
265 * Default layout:
266 * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
267 * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
268 * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
269 * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
270 * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
271 */
272#if defined(CONFIG_NOR)
cd8845d7
SK
273#define CONFIG_SYS_MAX_FLASH_SECT 128
274#define CONFIG_SYS_MAX_FLASH_BANKS 1
275#define CONFIG_SYS_FLASH_BASE (0x08000000)
276#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
77cd89e7 277#define CONFIG_SYS_FLASH_SIZE 0x01000000
cd8845d7 278#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
cd8845d7
SK
279#endif /* NOR support */
280
97f3a178
LV
281#ifdef CONFIG_DRIVER_TI_CPSW
282#define CONFIG_CLOCK_SYNTHESIZER
283#define CLK_SYNTHESIZER_I2C_ADDR 0x65
284#endif
285
5289e83a 286#endif /* ! __CONFIG_AM335X_EVM_H */
This page took 0.740448 seconds and 4 git commands to generate.