1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef __CONFIG_BAV335X_H
18#define __CONFIG_BAV335X_H
19
20#include <configs/ti_am335x_common.h>
21
22#ifndef CONFIG_SPL_BUILD
23# define CONFIG_TIMESTAMP
24#endif
25
26#define CONFIG_SYS_BOOTM_LEN (16 << 20)
27
28#define CONFIG_MACH_TYPE MACH_TYPE_AM335XEVM
29
30
31#define V_OSCK 24000000
32#define V_SCLK (V_OSCK)
33
34
35#define CONFIG_SYS_LDSCRIPT "board/birdland/bav335x/u-boot.lds"
36
37
38#define CONFIG_ENV_SIZE (128 << 10)
39
40#ifdef CONFIG_NAND
41#define NANDARGS \
42 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
43 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
44 "nandargs=setenv bootargs console=${console} " \
45 "${optargs} " \
46 "root=${nandroot} " \
47 "rootfstype=${nandrootfstype}\0" \
48 "nandroot=ubi0:rootfs rw ubi.mtd=9,2048\0" \
49 "nandrootfstype=ubifs rootwait=1\0" \
50 "nandboot=echo Booting from nand ...; " \
51 "run nandargs; " \
52 "nand read ${fdtaddr} u-boot-spl-os; " \
53 "nand read ${loadaddr} kernel; " \
54 "bootz ${loadaddr} - ${fdtaddr}\0"
55#else
56#define NANDARGS ""
57#endif
58
59#ifndef CONFIG_SPL_BUILD
60#define CONFIG_EXTRA_ENV_SETTINGS \
61DEFAULT_LINUX_BOOT_ENV \
62"boot_fdt=try\0" \
63"bootpart=0:2\0" \
64"bootdir=\0" \
65"fdtdir=/dtbs\0" \
66"bootfile=zImage\0" \
67"fdtfile=undefined\0" \
68"console=ttyO0,115200n8\0" \
69"loadaddr=0x82000000\0" \
70"fdtaddr=0x88000000\0" \
71"rdaddr=0x88080000\0" \
72"initrd_high=0xffffffff\0" \
73"fdt_high=0xffffffff\0" \
74"partitions=" \
75 "uuid_disk=${uuid_gpt_disk};" \
76 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
77"optargs=\0" \
78"cmdline=\0" \
79"mmcdev=0\0" \
80"mmcpart=1\0" \
81"mmcroot=/dev/mmcblk0p2 ro\0" \
82"mmcrootfstype=ext4 rootwait fixrtc\0" \
83"rootpath=/export/rootfs\0" \
84"nfsopts=nolock\0" \
85"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off\0" \
86"ramroot=/dev/ram0 rw\0" \
87"ramrootfstype=ext2\0" \
88"mmcargs=setenv bootargs console=${console} ${optargs} " \
89 "root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}\0" \
90"server_ip=192.168.1.100\0" \
91"gw_ip=192.168.1.1\0" \
92"netmask=255.255.255.0\0" \
93"hostname=\0" \
94"device=eth0\0" \
95"autoconf=off\0" \
96"root_dir=/home/userid/targetNFS\0" \
97"nfs_options=,vers=3\0" \
98"nfsrootfstype=ext4 rootwait fixrtc\0" \
99"nfsargs=setenv bootargs console=${console} ${optargs} " \
100 "root=/dev/nfs rw rootfstype=${nfsrootfstype} " \
101 "nfsroot=${nfsroot} ip=${ip} ${cmdline}\0" \
102"netargs=setenv bootargs console=${console} " \
103 "${optargs} root=/dev/nfs " \
104 "nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp\0" \
105"bootenv=uEnv.txt\0" \
106"script=boot.scr\0" \
107"scriptfile=${script}\0" \
108"loadbootscript=load mmc ${bootpart} ${loadaddr} ${scriptfile};\0" \
109"bootscript=echo Running bootscript from mmc${bootpart} ...; " \
110 "source ${loadaddr}\0" \
111 "loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootenv}\0" \
112"importbootenv=echo Importing environment from mmc ...; " \
113 "env import -t -r $loadaddr $filesize\0" \
114"ramargs=setenv bootargs console=${console} " \
115 "${optargs} root=${ramroot} rootfstype=${ramrootfstype}\0" \
116"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
117"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
118 "loadrd=load mmc ${bootpart} ${rdaddr} " \
119 "${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
120"loadfdt=echo loading ${fdtdir}/${fdtfile} ...; " \
121 "load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
122"mmcboot=mmc dev ${mmcdev}; " \
123 "if mmc rescan; then " \
124 "gpio set 54;" \
125 "setenv bootpart ${mmcdev}:1; " \
126 "if test -e mmc ${bootpart} /etc/fstab; then " \
127 "setenv mmcpart 1;" \
128 "fi; " \
129 "echo Checking for: /uEnv.txt ...;" \
130 "if test -e mmc ${bootpart} /uEnv.txt; then " \
131 "if run loadbootenv; then " \
132 "gpio set 55;" \
133 "echo Loaded environment from ${bootenv};" \
134 "run importbootenv;" \
135 "fi;" \
136 "echo Checking if uenvcmd is set ...;" \
137 "if test -n ${uenvcmd}; then " \
138 "gpio set 56; " \
139 "echo Running uenvcmd ...;" \
140 "run uenvcmd;" \
141 "fi;" \
142 "echo Checking if client_ip is set ...;" \
143 "if test -n ${client_ip}; then " \
144 "if test -n ${dtb}; then " \
145 "setenv fdtfile ${dtb};" \
146 "echo using ${fdtfile} ...;" \
147 "fi;" \
148 "gpio set 56; " \
149 "if test -n ${uname_r}; then " \
150 "echo Running nfsboot_uname_r ...;" \
151 "run nfsboot_uname_r;" \
152 "fi;" \
153 "echo Running nfsboot ...;" \
154 "run nfsboot;" \
155 "fi;" \
156 "fi; " \
157 "echo Checking for: /${script} ...;" \
158 "if test -e mmc ${bootpart} /${script}; then " \
159 "gpio set 55;" \
160 "setenv scriptfile ${script};" \
161 "run loadbootscript;" \
162 "echo Loaded script from ${scriptfile};" \
163 "gpio set 56; " \
164 "run bootscript;" \
165 "fi; " \
166 "echo Checking for: /boot/${script} ...;" \
167 "if test -e mmc ${bootpart} /boot/${script}; then " \
168 "gpio set 55;" \
169 "setenv scriptfile /boot/${script};" \
170 "run loadbootscript;" \
171 "echo Loaded script from ${scriptfile};" \
172 "gpio set 56; " \
173 "run bootscript;" \
174 "fi; " \
175 "echo Checking for: /boot/uEnv.txt ...;" \
176 "for i in 1 2 3 4 5 6 7 ; do " \
177 "setenv mmcpart ${i};" \
178 "setenv bootpart ${mmcdev}:${mmcpart};" \
179 "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
180 "gpio set 55;" \
181 "load mmc ${bootpart} ${loadaddr} " \
182 "/boot/uEnv.txt;" \
183 "env import -t ${loadaddr} ${filesize};" \
184 "echo Loaded environment from /boot/uEnv.txt;" \
185 "if test -n ${dtb}; then " \
186 "setenv fdtfile ${dtb};" \
187 "echo Using: dtb=${fdtfile} ...;" \
188 "fi;" \
189 "echo Checking if uname_r is set in " \
190 "/boot/uEnv.txt...;" \
191 "if test -n ${uname_r}; then " \
192 "gpio set 56; " \
193 "echo Running uname_boot ...;" \
194 "setenv mmcroot /dev/mmcblk${mmcdev}" \
195 "p${mmcpart} ro;" \
196 "run uname_boot;" \
197 "fi;" \
198 "fi;" \
199 "done;" \
200 "fi;\0" \
201"netboot=echo Booting from network ...; " \
202 "setenv autoload no; " \
203 "dhcp; " \
204 "tftp ${loadaddr} ${bootfile}; " \
205 "tftp ${fdtaddr} ${fdtfile}; " \
206 "run netargs; " \
207 "bootz ${loadaddr} - ${fdtaddr}\0" \
208"nfsboot=echo Booting from ${server_ip} ...; " \
209 "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
210 "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
211 ":${device}:${autoconf}; " \
212 "setenv autoload no; " \
213 "setenv serverip ${server_ip}; " \
214 "setenv ipaddr ${client_ip}; " \
215 "tftp ${loadaddr} ${bootfile}; " \
216 "tftp ${fdtaddr} dtbs/${fdtfile}; " \
217 "run nfsargs; " \
218 "bootz ${loadaddr} - ${fdtaddr}\0" \
219"nfsboot_uname_r=echo Booting from ${server_ip} ...; " \
220 "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
221 "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
222 ":${device}:${autoconf}; " \
223 "setenv autoload no; " \
224 "setenv serverip ${server_ip}; " \
225 "setenv ipaddr ${client_ip}; " \
226 "tftp ${loadaddr} vmlinuz-${uname_r}; " \
227 "tftp ${fdtaddr} dtbs/${uname_r}/${fdtfile}; " \
228 "run nfsargs; " \
229 "bootz ${loadaddr} - ${fdtaddr}\0" \
230"ramboot=echo Booting from ramdisk ...; " \
231 "run ramargs; " \
232 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
233"findfdt="\
234 "if test $board_rev = B; then " \
235 "setenv fdtfile birdland_bav335b.dtb; " \
236 "setenv fdtbase am335x-boneblack; fi; " \
237 "if test $board_rev = A; then " \
238 "setenv fdtfile birdland_bav335a.dtb; " \
239 "setenv fdtbase am335x-boneblack; fi; " \
240 "if test $fdtfile = undefined; then " \
241 "echo WARNING: Could not determine device tree to use; fi; \0" \
242"uname_boot="\
243 "setenv bootdir /boot; " \
244 "setenv bootfile vmlinuz-${uname_r}; " \
245 "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
246 "echo loading ${bootdir}/${bootfile} ...; "\
247 "run loadimage;" \
248 "setenv fdtdir /boot/dtbs/${uname_r}; " \
249 "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \
250 "run loadfdt;" \
251 "else " \
252 "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
253 "if test -e mmc ${bootpart} ${fdtdir}/" \
254 "${fdtfile}; then " \
255 "run loadfdt;" \
256 "else " \
257 "setenv fdtdir /boot/dtb-${uname_r}; " \
258 "if test -e mmc ${bootpart} ${fdtdir}" \
259 "/${fdtfile}; then " \
260 "run loadfdt;" \
261 "else " \
262 "setenv fdtdir /boot/dtbs; " \
263 "if test -e mmc ${bootpart} ${fdtdir}" \
264 "/${fdtfile}; then " \
265 "run loadfdt;" \
266 "else " \
267 "echo; echo unable to find " \
268 "[${fdtfile}] " \
269 "did you name it correctly?" \
270 "echo booting fallback " \
271 "[/boot/dtbs/" \
272 "${uname_r}" \
273 "/${fdtbase}.dtb]...;" \
274 "setenv fdtdir /boot/dtbs/" \
275 "${uname_r}; " \
276 "setenv fdtfile " \
277 "${fdtbase}.dtb; " \
278 "run loadfdt;" \
279 "fi;" \
280 "fi;" \
281 "fi;" \
282 "fi;" \
283 "fi; " \
284 "setenv rdfile initrd.img-${uname_r}; " \
285 "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \
286 "echo loading ${bootdir}/${rdfile} ...; "\
287 "run loadrd;" \
288 "if test -n ${uuid}; then " \
289 "setenv mmcroot UUID=${uuid} ro;" \
290 "fi;" \
291 "run mmcargs;" \
292 "echo debug: [${bootargs}] ... ;" \
293 "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} " \
294 "${fdtaddr}] ... ;" \
295 "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
296 "else " \
297 "run mmcargs;" \
298 "echo debug: [${bootargs}] ... ;" \
299 "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
300 "bootz ${loadaddr} - ${fdtaddr}; " \
301 "fi;" \
302"fi;\0" \
303 NANDARGS \
304 DFUARGS
305#endif
306
307#define CONFIG_BOOTCOMMAND \
308 "gpio set 53; " \
309 "i2c mw 0x24 1 0x3e; " \
310 "run findfdt; " \
311 "setenv mmcdev 0; " \
312 "setenv bootpart 0:1; " \
313 "run mmcboot;" \
314 "gpio clear 56; " \
315 "gpio clear 55; " \
316 "gpio clear 54; " \
317 "setenv mmcdev 1; " \
318 "setenv bootpart 1:1; " \
319 "run mmcboot;"
320
321
322#define CONFIG_SYS_NS16550_COM1 0x44e09000
323#define CONFIG_SYS_NS16550_COM2 0x48022000
324#define CONFIG_SYS_NS16550_COM3 0x48024000
325#define CONFIG_SYS_NS16550_COM4 0x481a6000
326#define CONFIG_SYS_NS16550_COM5 0x481a8000
327#define CONFIG_SYS_NS16550_COM6 0x481aa000
328
329#define CONFIG_ENV_EEPROM_IS_ON_I2C
330#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
331#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
332
333
334#define CONFIG_POWER_TPS65217
335#define CONFIG_POWER_TPS65910
336
337
338#ifndef CONFIG_NOR_BOOT
339
340#define CONFIG_SYS_BOOTCOUNT_BE
341
342
343#endif
344
345#ifdef CONFIG_NAND
346
347#define CONFIG_SYS_NAND_5_ADDR_CYCLE
348#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
349 CONFIG_SYS_NAND_PAGE_SIZE)
350#define CONFIG_SYS_NAND_PAGE_SIZE 2048
351#define CONFIG_SYS_NAND_OOBSIZE 64
352#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
353
354#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
355#define CONFIG_SYS_NAND_ECCPOS { \
356 2, 3, 4, 5, 6, 7, 8, 9, \
357 10, 11, 12, 13, 14, 15, 16, 17, \
358 18, 19, 20, 21, 22, 23, 24, 25, \
359 26, 27, 28, 29, 30, 31, 32, 33, \
360 34, 35, 36, 37, 38, 39, 40, 41, \
361 42, 43, 44, 45, 46, 47, 48, 49, \
362 50, 51, 52, 53, 54, 55, 56, 57, }
363
364#define CONFIG_SYS_NAND_ECCSIZE 512
365#define CONFIG_SYS_NAND_ECCBYTES 14
366#define CONFIG_SYS_NAND_ONFI_DETECTION
367#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
368#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000
369#define CONFIG_ENV_OFFSET 0x001c0000
370#define CONFIG_ENV_OFFSET_REDUND 0x001e0000
371#define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
372
373#ifdef CONFIG_SPL_OS_BOOT
374#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000
375#endif
376#endif
377
378
379
380
381
382
383
384
385
386
387
388
389
390#define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
391#define CONFIG_AM335X_USB0
392#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
393#define CONFIG_AM335X_USB1
394#define CONFIG_AM335X_USB1_MODE MUSB_HOST
395
396#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_ETHER)
397
398
399#endif
400
401
402#ifndef CONFIG_SPL_BUILD
403#define DFU_ALT_INFO_MMC \
404 "dfu_alt_info_mmc=" \
405 "boot part 0 1;" \
406 "rootfs part 0 2;" \
407 "MLO fat 0 1;" \
408 "MLO.raw raw 0x100 0x100;" \
409 "u-boot.img.raw raw 0x300 0x400;" \
410 "spl-os-args.raw raw 0x80 0x80;" \
411 "spl-os-image.raw raw 0x900 0x2000;" \
412 "spl-os-args fat 0 1;" \
413 "spl-os-image fat 0 1;" \
414 "u-boot.img fat 0 1;" \
415 "uEnv.txt fat 0 1\0"
416#ifdef CONFIG_NAND
417#define DFU_ALT_INFO_NAND \
418 "dfu_alt_info_nand=" \
419 "SPL part 0 1;" \
420 "SPL.backup1 part 0 2;" \
421 "SPL.backup2 part 0 3;" \
422 "SPL.backup3 part 0 4;" \
423 "u-boot part 0 5;" \
424 "u-boot-spl-os part 0 6;" \
425 "kernel part 0 8;" \
426 "rootfs part 0 9\0"
427#else
428#define DFU_ALT_INFO_NAND ""
429#endif
430#define DFU_ALT_INFO_RAM \
431 "dfu_alt_info_ram=" \
432 "kernel ram 0x80200000 0xD80000;" \
433 "fdt ram 0x80F80000 0x80000;" \
434 "ramdisk ram 0x81000000 0x4000000\0"
435#define DFUARGS \
436 "dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \
437 DFU_ALT_INFO_MMC \
438 DFU_ALT_INFO_RAM \
439 DFU_ALT_INFO_NAND
440#endif
441
442
443
444
445
446
447
448
449
450
451#if defined(CONFIG_SPI_BOOT)
452
453#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
454
455#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
456#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
457#define CONFIG_ENV_SECT_SIZE (4 << 10)
458#define CONFIG_ENV_OFFSET (768 << 10)
459#define CONFIG_ENV_OFFSET_REDUND (896 << 10)
460#elif defined(CONFIG_EMMC_BOOT)
461#define CONFIG_SYS_MMC_ENV_DEV 1
462#define CONFIG_SYS_MMC_ENV_PART 2
463#define CONFIG_ENV_OFFSET 0x0
464#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
465#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
466#endif
467
468
469#define CONFIG_SF_DEFAULT_SPEED 24000000
470
471
472#define CONFIG_PHY_SMSC
473
474
475
476
477
478
479
480
481
482
483
484
485
486#if defined(CONFIG_NOR)
487#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
488#define CONFIG_SYS_FLASH_PROTECTION
489#define CONFIG_SYS_FLASH_CFI
490#define CONFIG_FLASH_CFI_DRIVER
491#define CONFIG_FLASH_CFI_MTD
492#define CONFIG_SYS_MAX_FLASH_SECT 128
493#define CONFIG_SYS_MAX_FLASH_BANKS 1
494#define CONFIG_SYS_FLASH_BASE (0x08000000)
495#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
496#define CONFIG_SYS_FLASH_SIZE 0x01000000
497#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
498
499#ifdef CONFIG_NOR_BOOT
500#define CONFIG_ENV_SECT_SIZE (128 << 10)
501#define CONFIG_ENV_OFFSET (512 << 10)
502#define CONFIG_ENV_OFFSET_REDUND (768 << 10)
503#endif
504#endif
505
506#endif
507