]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/configs/bav335x.h
configs: Migrate RBTREE, LZO, CMD_MTDPARTS, CMD_UBI and CMD_UBIFS
[people/ms/u-boot.git] / include / configs / bav335x.h
CommitLineData
a2bc4321
GG
1/*
2 * bav335x.h
3 *
4 * Copyright (c) 2012-2014 Birdland Audio - http://birdland.com/oem
5 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
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 version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __CONFIG_BAV335X_H
18#define __CONFIG_BAV335X_H
19
20#include <configs/ti_am335x_common.h>
21#define CONFIG_ENV_IS_NOWHERE
22
23#ifndef CONFIG_SPL_BUILD
a2bc4321 24# define CONFIG_TIMESTAMP
a2bc4321
GG
25#endif
26
27#define CONFIG_SYS_BOOTM_LEN (16 << 20)
28
92a1babf 29#define CONFIG_MACH_TYPE MACH_TYPE_AM335XEVM
a2bc4321
GG
30
31/* Clock Defines */
32#define V_OSCK 24000000 /* Clock output from T2 */
33#define V_SCLK (V_OSCK)
34
35/* Custom script for NOR */
36#define CONFIG_SYS_LDSCRIPT "board/birdland/bav335x/u-boot.lds"
37
38/* Always 128 KiB env size */
39#define CONFIG_ENV_SIZE (128 << 10)
40
a2bc4321
GG
41#ifdef CONFIG_NAND
42#define NANDARGS \
43 "mtdids=" MTDIDS_DEFAULT "\0" \
44 "mtdparts=" MTDPARTS_DEFAULT "\0" \
45 "nandargs=setenv bootargs console=${console} " \
46 "${optargs} " \
47 "root=${nandroot} " \
48 "rootfstype=${nandrootfstype}\0" \
49 "nandroot=ubi0:rootfs rw ubi.mtd=9,2048\0" \
50 "nandrootfstype=ubifs rootwait=1\0" \
51 "nandboot=echo Booting from nand ...; " \
52 "run nandargs; " \
53 "nand read ${fdtaddr} u-boot-spl-os; " \
54 "nand read ${loadaddr} kernel; " \
55 "bootz ${loadaddr} - ${fdtaddr}\0"
56#else
57#define NANDARGS ""
58#endif
59
60#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
61
62#ifndef CONFIG_SPL_BUILD
63#define CONFIG_EXTRA_ENV_SETTINGS \
64DEFAULT_LINUX_BOOT_ENV \
65"boot_fdt=try\0" \
66"bootpart=0:2\0" \
67"bootdir=\0" \
68"fdtdir=/dtbs\0" \
69"bootfile=zImage\0" \
70"fdtfile=undefined\0" \
71"console=ttyO0,115200n8\0" \
72"loadaddr=0x82000000\0" \
73"fdtaddr=0x88000000\0" \
74"rdaddr=0x88080000\0" \
75"initrd_high=0xffffffff\0" \
76"fdt_high=0xffffffff\0" \
77"partitions=" \
78 "uuid_disk=${uuid_gpt_disk};" \
79 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
80"optargs=\0" \
81"cmdline=\0" \
82"mmcdev=0\0" \
83"mmcpart=1\0" \
84"mmcroot=/dev/mmcblk0p2 ro\0" \
85"mmcrootfstype=ext4 rootwait fixrtc\0" \
86"rootpath=/export/rootfs\0" \
87"nfsopts=nolock\0" \
88"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off\0" \
89"ramroot=/dev/ram0 rw\0" \
90"ramrootfstype=ext2\0" \
91"mmcargs=setenv bootargs console=${console} ${optargs} " \
92 "root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}\0" \
93"server_ip=192.168.1.100\0" \
94"gw_ip=192.168.1.1\0" \
95"netmask=255.255.255.0\0" \
96"hostname=\0" \
97"device=eth0\0" \
98"autoconf=off\0" \
99"root_dir=/home/userid/targetNFS\0" \
100"nfs_options=,vers=3\0" \
101"nfsrootfstype=ext4 rootwait fixrtc\0" \
102"nfsargs=setenv bootargs console=${console} ${optargs} " \
103 "root=/dev/nfs rw rootfstype=${nfsrootfstype} " \
104 "nfsroot=${nfsroot} ip=${ip} ${cmdline}\0" \
105"netargs=setenv bootargs console=${console} " \
106 "${optargs} root=/dev/nfs " \
107 "nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp\0" \
108"bootenv=uEnv.txt\0" \
109"script=boot.scr\0" \
110"scriptfile=${script}\0" \
111"loadbootscript=load mmc ${bootpart} ${loadaddr} ${scriptfile};\0" \
112"bootscript=echo Running bootscript from mmc${bootpart} ...; " \
113 "source ${loadaddr}\0" \
114 "loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootenv}\0" \
115"importbootenv=echo Importing environment from mmc ...; " \
116 "env import -t -r $loadaddr $filesize\0" \
117"ramargs=setenv bootargs console=${console} " \
118 "${optargs} root=${ramroot} rootfstype=${ramrootfstype}\0" \
119"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
120"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
121 "loadrd=load mmc ${bootpart} ${rdaddr} " \
122 "${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
123"loadfdt=echo loading ${fdtdir}/${fdtfile} ...; " \
124 "load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
125"mmcboot=mmc dev ${mmcdev}; " \
126 "if mmc rescan; then " \
127 "gpio set 54;" \
128 "setenv bootpart ${mmcdev}:1; " \
129 "if test -e mmc ${bootpart} /etc/fstab; then " \
130 "setenv mmcpart 1;" \
131 "fi; " \
132 "echo Checking for: /uEnv.txt ...;" \
133 "if test -e mmc ${bootpart} /uEnv.txt; then " \
134 "if run loadbootenv; then " \
135 "gpio set 55;" \
136 "echo Loaded environment from ${bootenv};" \
137 "run importbootenv;" \
138 "fi;" \
139 "echo Checking if uenvcmd is set ...;" \
140 "if test -n ${uenvcmd}; then " \
141 "gpio set 56; " \
142 "echo Running uenvcmd ...;" \
143 "run uenvcmd;" \
144 "fi;" \
145 "echo Checking if client_ip is set ...;" \
146 "if test -n ${client_ip}; then " \
147 "if test -n ${dtb}; then " \
148 "setenv fdtfile ${dtb};" \
149 "echo using ${fdtfile} ...;" \
150 "fi;" \
151 "gpio set 56; " \
152 "if test -n ${uname_r}; then " \
153 "echo Running nfsboot_uname_r ...;" \
154 "run nfsboot_uname_r;" \
155 "fi;" \
156 "echo Running nfsboot ...;" \
157 "run nfsboot;" \
158 "fi;" \
159 "fi; " \
160 "echo Checking for: /${script} ...;" \
161 "if test -e mmc ${bootpart} /${script}; then " \
162 "gpio set 55;" \
163 "setenv scriptfile ${script};" \
164 "run loadbootscript;" \
165 "echo Loaded script from ${scriptfile};" \
166 "gpio set 56; " \
167 "run bootscript;" \
168 "fi; " \
169 "echo Checking for: /boot/${script} ...;" \
170 "if test -e mmc ${bootpart} /boot/${script}; then " \
171 "gpio set 55;" \
172 "setenv scriptfile /boot/${script};" \
173 "run loadbootscript;" \
174 "echo Loaded script from ${scriptfile};" \
175 "gpio set 56; " \
176 "run bootscript;" \
177 "fi; " \
178 "echo Checking for: /boot/uEnv.txt ...;" \
179 "for i in 1 2 3 4 5 6 7 ; do " \
180 "setenv mmcpart ${i};" \
181 "setenv bootpart ${mmcdev}:${mmcpart};" \
182 "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
183 "gpio set 55;" \
184 "load mmc ${bootpart} ${loadaddr} " \
185 "/boot/uEnv.txt;" \
186 "env import -t ${loadaddr} ${filesize};" \
187 "echo Loaded environment from /boot/uEnv.txt;" \
188 "if test -n ${dtb}; then " \
189 "setenv fdtfile ${dtb};" \
190 "echo Using: dtb=${fdtfile} ...;" \
191 "fi;" \
192 "echo Checking if uname_r is set in " \
193 "/boot/uEnv.txt...;" \
194 "if test -n ${uname_r}; then " \
195 "gpio set 56; " \
196 "echo Running uname_boot ...;" \
197 "setenv mmcroot /dev/mmcblk${mmcdev}" \
198 "p${mmcpart} ro;" \
199 "run uname_boot;" \
200 "fi;" \
201 "fi;" \
202 "done;" \
203 "fi;\0" \
204"netboot=echo Booting from network ...; " \
205 "setenv autoload no; " \
206 "dhcp; " \
207 "tftp ${loadaddr} ${bootfile}; " \
208 "tftp ${fdtaddr} ${fdtfile}; " \
209 "run netargs; " \
210 "bootz ${loadaddr} - ${fdtaddr}\0" \
211"nfsboot=echo Booting from ${server_ip} ...; " \
212 "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
213 "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
214 ":${device}:${autoconf}; " \
215 "setenv autoload no; " \
216 "setenv serverip ${server_ip}; " \
217 "setenv ipaddr ${client_ip}; " \
218 "tftp ${loadaddr} ${bootfile}; " \
219 "tftp ${fdtaddr} dtbs/${fdtfile}; " \
220 "run nfsargs; " \
221 "bootz ${loadaddr} - ${fdtaddr}\0" \
222"nfsboot_uname_r=echo Booting from ${server_ip} ...; " \
223 "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
224 "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
225 ":${device}:${autoconf}; " \
226 "setenv autoload no; " \
227 "setenv serverip ${server_ip}; " \
228 "setenv ipaddr ${client_ip}; " \
229 "tftp ${loadaddr} vmlinuz-${uname_r}; " \
230 "tftp ${fdtaddr} dtbs/${uname_r}/${fdtfile}; " \
231 "run nfsargs; " \
232 "bootz ${loadaddr} - ${fdtaddr}\0" \
233"ramboot=echo Booting from ramdisk ...; " \
234 "run ramargs; " \
235 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
236"findfdt="\
237 "if test $board_rev = B; then " \
238 "setenv fdtfile birdland_bav335b.dtb; " \
239 "setenv fdtbase am335x-boneblack; fi; " \
240 "if test $board_rev = A; then " \
241 "setenv fdtfile birdland_bav335a.dtb; " \
242 "setenv fdtbase am335x-boneblack; fi; " \
243 "if test $fdtfile = undefined; then " \
244 "echo WARNING: Could not determine device tree to use; fi; \0" \
245"uname_boot="\
246 "setenv bootdir /boot; " \
247 "setenv bootfile vmlinuz-${uname_r}; " \
248 "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
249 "echo loading ${bootdir}/${bootfile} ...; "\
250 "run loadimage;" \
251 "setenv fdtdir /boot/dtbs/${uname_r}; " \
252 "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \
253 "run loadfdt;" \
254 "else " \
255 "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
256 "if test -e mmc ${bootpart} ${fdtdir}/" \
257 "${fdtfile}; then " \
258 "run loadfdt;" \
259 "else " \
260 "setenv fdtdir /boot/dtb-${uname_r}; " \
261 "if test -e mmc ${bootpart} ${fdtdir}" \
262 "/${fdtfile}; then " \
263 "run loadfdt;" \
264 "else " \
265 "setenv fdtdir /boot/dtbs; " \
266 "if test -e mmc ${bootpart} ${fdtdir}" \
267 "/${fdtfile}; then " \
268 "run loadfdt;" \
269 "else " \
270 "echo; echo unable to find " \
271 "[${fdtfile}] " \
272 "did you name it correctly?" \
273 "echo booting fallback " \
274 "[/boot/dtbs/" \
275 "${uname_r}" \
276 "/${fdtbase}.dtb]...;" \
277 "setenv fdtdir /boot/dtbs/" \
278 "${uname_r}; " \
279 "setenv fdtfile " \
280 "${fdtbase}.dtb; " \
281 "run loadfdt;" \
282 "fi;" \
283 "fi;" \
284 "fi;" \
285 "fi;" \
286 "fi; " \
287 "setenv rdfile initrd.img-${uname_r}; " \
288 "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \
289 "echo loading ${bootdir}/${rdfile} ...; "\
290 "run loadrd;" \
291 "if test -n ${uuid}; then " \
292 "setenv mmcroot UUID=${uuid} ro;" \
293 "fi;" \
294 "run mmcargs;" \
295 "echo debug: [${bootargs}] ... ;" \
296 "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} " \
297 "${fdtaddr}] ... ;" \
298 "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
299 "else " \
300 "run mmcargs;" \
301 "echo debug: [${bootargs}] ... ;" \
302 "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
303 "bootz ${loadaddr} - ${fdtaddr}; " \
304 "fi;" \
305"fi;\0" \
306 NANDARGS \
307 DFUARGS
308#endif
309
310#define CONFIG_BOOTCOMMAND \
311 "gpio set 53; " \
312 "i2c mw 0x24 1 0x3e; " \
313 "run findfdt; " \
314 "setenv mmcdev 0; " \
315 "setenv bootpart 0:1; " \
316 "run mmcboot;" \
317 "gpio clear 56; " \
318 "gpio clear 55; " \
319 "gpio clear 54; " \
320 "setenv mmcdev 1; " \
321 "setenv bootpart 1:1; " \
322 "run mmcboot;"
323
324/* NS16550 Configuration */
325#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
326#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
327#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
328#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
329#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
330#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
a2bc4321 331
a2bc4321
GG
332#define CONFIG_ENV_EEPROM_IS_ON_I2C
333#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
334#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
a2bc4321
GG
335
336/* PMIC support */
337#define CONFIG_POWER_TPS65217
338#define CONFIG_POWER_TPS65910
339
340/* SPL */
341#ifndef CONFIG_NOR_BOOT
a2bc4321
GG
342/* Bootcount using the RTC block */
343#define CONFIG_BOOTCOUNT_LIMIT
344#define CONFIG_BOOTCOUNT_AM33XX
345#define CONFIG_SYS_BOOTCOUNT_BE
346
347/* USB gadget RNDIS */
a2bc4321 348
3a517fdc 349#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
a2bc4321
GG
350#endif
351
352#ifdef CONFIG_NAND
353/* NAND: device related configs */
354#define CONFIG_SYS_NAND_5_ADDR_CYCLE
355#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
356 CONFIG_SYS_NAND_PAGE_SIZE)
357#define CONFIG_SYS_NAND_PAGE_SIZE 2048
358#define CONFIG_SYS_NAND_OOBSIZE 64
359#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
360/* NAND: driver related configs */
361#define CONFIG_NAND_OMAP_GPMC
362#define CONFIG_NAND_OMAP_ELM
363#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
364#define CONFIG_SYS_NAND_ECCPOS { \
365 2, 3, 4, 5, 6, 7, 8, 9, \
366 10, 11, 12, 13, 14, 15, 16, 17, \
367 18, 19, 20, 21, 22, 23, 24, 25, \
368 26, 27, 28, 29, 30, 31, 32, 33, \
369 34, 35, 36, 37, 38, 39, 40, 41, \
370 42, 43, 44, 45, 46, 47, 48, 49, \
371 50, 51, 52, 53, 54, 55, 56, 57, }
372
373#define CONFIG_SYS_NAND_ECCSIZE 512
374#define CONFIG_SYS_NAND_ECCBYTES 14
375#define CONFIG_SYS_NAND_ONFI_DETECTION
376#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
377#define MTDIDS_DEFAULT "nand0=nand.0"
378#define MTDPARTS_DEFAULT \
379 "mtdparts=nand.0:" \
380 "128k(NAND.SPL)," \
381 "128k(NAND.SPL.backup1)," \
382 "128k(NAND.SPL.backup2)," \
383 "128k(NAND.SPL.backup3)," \
384 "256k(NAND.u-boot-spl-os)," \
385 "1m(NAND.u-boot)," \
386 "128k(NAND.u-boot-env)," \
387 "128k(NAND.u-boot-env.backup1)," \
388 "8m(NAND.kernel)," \
389 "-(NAND.rootfs)"
390#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000
391#undef CONFIG_ENV_IS_NOWHERE
392#define CONFIG_ENV_IS_IN_NAND
393#define CONFIG_ENV_OFFSET 0x001c0000
394#define CONFIG_ENV_OFFSET_REDUND 0x001e0000
395#define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
396/* NAND: SPL related configs */
397#ifdef CONFIG_SPL_NAND_SUPPORT
398#define CONFIG_SPL_NAND_AM33XX_BCH
399#endif
400#ifdef CONFIG_SPL_OS_BOOT
401#define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */
402#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
403#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
404#endif
405#endif /* !CONFIG_NAND */
406
407/*
408 * For NOR boot, we must set this to the start of where NOR is mapped
409 * in memory.
410 */
411#ifdef CONFIG_NOR_BOOT
412#define CONFIG_SYS_TEXT_BASE 0x08000000
413#endif
414
415/*
416 * USB configuration. We enable MUSB support, both for host and for
417 * gadget. We set USB0 as peripheral and USB1 as host, based on the
418 * board schematic and physical port wired to each. Then for host we
419 * add mass storage support and for gadget we add both RNDIS ethernet
420 * and DFU.
421 */
422#define CONFIG_USB_MUSB_DSPS
95de1e2f
PK
423#define CONFIG_USB_MUSB_PIO_ONLY
424#define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
a2bc4321
GG
425#define CONFIG_AM335X_USB0
426#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
427#define CONFIG_AM335X_USB1
428#define CONFIG_AM335X_USB1_MODE MUSB_HOST
429
430#ifndef CONFIG_SPL_USBETH_SUPPORT
431/* Fastboot */
17da3c0c 432#define CONFIG_USB_FUNCTION_FASTBOOT
a2bc4321
GG
433#define CONFIG_CMD_FASTBOOT
434#define CONFIG_ANDROID_BOOT_IMAGE
a588d99a
PK
435#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
436#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
a2bc4321 437
a2bc4321
GG
438#define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
439#endif
440
95de1e2f 441#ifdef CONFIG_USB_MUSB_GADGET
01acd6ab 442#define CONFIG_USB_FUNCTION_MASS_STORAGE
95de1e2f 443#endif /* CONFIG_USB_MUSB_GADGET */
a2bc4321
GG
444
445#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
446/* disable host part of MUSB in SPL */
a2bc4321 447/* disable EFI partitions and partition UUID support */
a2bc4321
GG
448#endif
449
450/* USB Device Firmware Update support */
451#ifndef CONFIG_SPL_BUILD
a2bc4321
GG
452#define DFU_ALT_INFO_MMC \
453 "dfu_alt_info_mmc=" \
454 "boot part 0 1;" \
455 "rootfs part 0 2;" \
456 "MLO fat 0 1;" \
457 "MLO.raw raw 0x100 0x100;" \
458 "u-boot.img.raw raw 0x300 0x400;" \
459 "spl-os-args.raw raw 0x80 0x80;" \
460 "spl-os-image.raw raw 0x900 0x2000;" \
461 "spl-os-args fat 0 1;" \
462 "spl-os-image fat 0 1;" \
463 "u-boot.img fat 0 1;" \
464 "uEnv.txt fat 0 1\0"
465#ifdef CONFIG_NAND
a2bc4321
GG
466#define DFU_ALT_INFO_NAND \
467 "dfu_alt_info_nand=" \
468 "SPL part 0 1;" \
469 "SPL.backup1 part 0 2;" \
470 "SPL.backup2 part 0 3;" \
471 "SPL.backup3 part 0 4;" \
472 "u-boot part 0 5;" \
473 "u-boot-spl-os part 0 6;" \
474 "kernel part 0 8;" \
475 "rootfs part 0 9\0"
476#else
477#define DFU_ALT_INFO_NAND ""
478#endif
a2bc4321
GG
479#define DFU_ALT_INFO_RAM \
480 "dfu_alt_info_ram=" \
481 "kernel ram 0x80200000 0xD80000;" \
482 "fdt ram 0x80F80000 0x80000;" \
483 "ramdisk ram 0x81000000 0x4000000\0"
484#define DFUARGS \
485 "dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \
486 DFU_ALT_INFO_MMC \
487 DFU_ALT_INFO_RAM \
488 DFU_ALT_INFO_NAND
489#endif
490
491/*
492 * Default to using SPI for environment, etc.
493 * 0x000000 - 0x020000 : SPL (128KiB)
494 * 0x020000 - 0x0A0000 : U-Boot (512KiB)
495 * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
496 * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
497 * 0x0E0000 - 0x442000 : Linux Kernel
498 * 0x442000 - 0x800000 : Userland
499 */
500#if defined(CONFIG_SPI_BOOT)
501/* SPL related */
a2bc4321
GG
502#define CONFIG_SPL_SPI_LOAD
503#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
504
505#define CONFIG_ENV_IS_IN_SPI_FLASH
506#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
507#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
508#define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
509#define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
510#define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
511#define MTDIDS_DEFAULT "nor0=m25p80-flash.0"
512#define MTDPARTS_DEFAULT "mtdparts=m25p80-flash.0:128k(SPL)," \
513 "512k(u-boot),128k(u-boot-env1)," \
514 "128k(u-boot-env2),3464k(kernel)," \
515 "-(rootfs)"
516#elif defined(CONFIG_EMMC_BOOT)
517#undef CONFIG_ENV_IS_NOWHERE
518#define CONFIG_ENV_IS_IN_MMC
a2bc4321
GG
519#define CONFIG_SYS_MMC_ENV_DEV 1
520#define CONFIG_SYS_MMC_ENV_PART 2
521#define CONFIG_ENV_OFFSET 0x0
522#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
523#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
524#endif
525
526/* SPI flash. */
a2bc4321
GG
527#define CONFIG_SF_DEFAULT_SPEED 24000000
528
529/* Network. */
530#define CONFIG_PHY_GIGE
531#define CONFIG_PHYLIB
532#define CONFIG_PHY_SMSC
533
534/*
535 * NOR Size = 16 MiB
536 * Number of Sectors/Blocks = 128
537 * Sector Size = 128 KiB
538 * Word length = 16 bits
539 * Default layout:
540 * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
541 * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
542 * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
543 * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
544 * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
545 */
546#if defined(CONFIG_NOR)
a2bc4321
GG
547#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
548#define CONFIG_SYS_FLASH_PROTECTION
549#define CONFIG_SYS_FLASH_CFI
550#define CONFIG_FLASH_CFI_DRIVER
551#define CONFIG_FLASH_CFI_MTD
552#define CONFIG_SYS_MAX_FLASH_SECT 128
553#define CONFIG_SYS_MAX_FLASH_BANKS 1
554#define CONFIG_SYS_FLASH_BASE (0x08000000)
555#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
556#define CONFIG_SYS_FLASH_SIZE 0x01000000
557#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
558/* Reduce SPL size by removing unlikey targets */
559#ifdef CONFIG_NOR_BOOT
560#define CONFIG_ENV_IS_IN_FLASH
561#define CONFIG_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
562#define CONFIG_ENV_OFFSET (512 << 10) /* 512 KiB */
563#define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */
564#define MTDIDS_DEFAULT "nor0=physmap-flash.0"
565#define MTDPARTS_DEFAULT \
566 "mtdparts=physmap-flash.0:" \
567 "512k(u-boot)," \
568 "128k(u-boot-env1)," \
569 "128k(u-boot-env2)," \
570 "4m(kernel),-(rootfs)"
571#endif
572#endif /* NOR support */
573
574#endif /* ! __CONFIG_AM335X_EVM_H */