blob: 8182a7577bcdc2c26950e528474355810cf1d79d [file] [log] [blame]
Heiko Schocher6c1b1192011-11-01 20:00:35 +00001/*
2 * Copyright (C) 2009 Texas Instruments Incorporated
3 *
4 * Copyright (C) 2011
5 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
6 *
Wolfgang Denkbd8ec7e2013-10-07 13:07:26 +02007 * SPDX-License-Identifier: GPL-2.0+
Heiko Schocher6c1b1192011-11-01 20:00:35 +00008 */
9
10#ifndef __CONFIG_H
11#define __CONFIG_H
12
13#define CONFIG_SYS_NO_FLASH /* that is, no *NOR* flash */
14#define CONFIG_SYS_CONSOLE_INFO_QUIET
15
16/* SoC Configuration */
17#define CONFIG_ARM926EJS /* arm926ejs CPU */
18#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
19#define CONFIG_SYS_HZ_CLOCK 24000000 /* timer0 freq */
Heiko Schocher6c1b1192011-11-01 20:00:35 +000020#define CONFIG_SOC_DM365
21
22#define CONFIG_MACH_TYPE MACH_TYPE_DAVINCI_DM365_EVM
23
24#define CONFIG_HOSTNAME cam_enc_4xx
25
Nobuhiro Iwamatsub346f952012-04-17 16:42:22 +000026#define CONFIG_BOARD_LATE_INIT
Heiko Schocher6c1b1192011-11-01 20:00:35 +000027#define CONFIG_CAM_ENC_LED_MASK 0x0fc00000
28
29/* Memory Info */
30#define CONFIG_NR_DRAM_BANKS 1
31#define PHYS_SDRAM_1 0x80000000
32#define PHYS_SDRAM_1_SIZE (256 << 20) /* 256 MiB */
33#define DDR_4BANKS /* 4-bank DDR2 (256MB) */
34#define CONFIG_MAX_RAM_BANK_SIZE (256 << 20) /* 256 MB */
35#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
36
37/* Serial Driver info: UART0 for console */
38#define CONFIG_SYS_NS16550
39#define CONFIG_SYS_NS16550_SERIAL
40#define CONFIG_SYS_NS16550_REG_SIZE -4
41#define CONFIG_SYS_NS16550_COM1 0x01c20000
42#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK
Heiko Schocher6c1b1192011-11-01 20:00:35 +000043#define CONFIG_CONS_INDEX 1
44#define CONFIG_BAUDRATE 115200
45
46/* Network Configuration */
47#define CONFIG_DRIVER_TI_EMAC
48#define CONFIG_EMAC_MDIO_PHY_NUM 0
49#define CONFIG_SYS_EMAC_TI_CLKDIV 0xa9 /* 1MHz */
50#define CONFIG_MII
Heiko Schocher6c1b1192011-11-01 20:00:35 +000051#define CONFIG_BOOTP_DNS
52#define CONFIG_BOOTP_DNS2
53#define CONFIG_BOOTP_SEND_HOSTNAME
54#define CONFIG_NET_RETRY_COUNT 10
Heiko Schocher6c1b1192011-11-01 20:00:35 +000055#define CONFIG_CMD_MII
56#define CONFIG_SYS_DCACHE_OFF
57#define CONFIG_RESET_PHY_R
58
59/* I2C */
60#define CONFIG_HARD_I2C
61#define CONFIG_DRIVER_DAVINCI_I2C
62#define CONFIG_SYS_I2C_SPEED 400000
63#define CONFIG_SYS_I2C_SLAVE 0x10 /* SMBus host address */
64
65/* NAND: socketed, two chipselects, normally 2 GBytes */
66#define CONFIG_NAND_DAVINCI
67#define CONFIG_SYS_NAND_CS 2
68#define CONFIG_SYS_NAND_USE_FLASH_BBT
69#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
70#define CONFIG_SYS_NAND_PAGE_2K
71
72#define CONFIG_SYS_NAND_LARGEPAGE
73#define CONFIG_SYS_NAND_BASE_LIST { 0x02000000, }
74/* socket has two chipselects, nCE0 gated by address BIT(14) */
75#define CONFIG_SYS_MAX_NAND_DEVICE 1
Heiko Schocher6c1b1192011-11-01 20:00:35 +000076
77/* SPI support */
78#define CONFIG_SPI
79#define CONFIG_SPI_FLASH
80#define CONFIG_SPI_FLASH_STMICRO
81#define CONFIG_DAVINCI_SPI
82#define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE
83#define CONFIG_SYS_SPI_CLK davinci_clk_get(SPI_PLLDIV)
84#define CONFIG_SF_DEFAULT_SPEED 3000000
85#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
86#define CONFIG_CMD_SF
87
88/* SD/MMC */
89#define CONFIG_MMC
90#define CONFIG_GENERIC_MMC
91#define CONFIG_DAVINCI_MMC
92#define CONFIG_MMC_MBLOCK
93
94/* U-Boot command configuration */
95#include <config_cmd_default.h>
96
97#define CONFIG_CMD_BDI
98#undef CONFIG_CMD_FLASH
99#undef CONFIG_CMD_FPGA
100#undef CONFIG_CMD_SETGETDCR
101#define CONFIG_CMD_ASKENV
102#define CONFIG_CMD_CACHE
103#define CONFIG_CMD_DHCP
104#define CONFIG_CMD_I2C
105#define CONFIG_CMD_PING
106#define CONFIG_CMD_SAVES
107
Hadli, Manjunath0dfccbe2012-02-06 00:30:44 +0000108#ifdef CONFIG_CMD_BDI
109#define CONFIG_CLOCKS
110#endif
111
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000112#ifdef CONFIG_MMC
113#define CONFIG_DOS_PARTITION
114#define CONFIG_CMD_EXT2
115#define CONFIG_CMD_FAT
116#define CONFIG_CMD_MMC
117#endif
118
119#ifdef CONFIG_NAND_DAVINCI
120#define CONFIG_CMD_MTDPARTS
121#define CONFIG_MTD_PARTITIONS
122#define CONFIG_MTD_DEVICE
123#define CONFIG_CMD_NAND
124#define CONFIG_CMD_UBI
Heiko Schocher16519be2012-01-16 21:20:09 +0000125#define CONFIG_CMD_UBIFS
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000126#define CONFIG_RBTREE
Heiko Schocher16519be2012-01-16 21:20:09 +0000127#define CONFIG_LZO
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000128#endif
129
130#define CONFIG_CRC32_VERIFY
131#define CONFIG_MX_CYCLIC
132
133/* U-Boot general configuration */
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000134#define CONFIG_BOOTFILE "uImage" /* Boot file name */
135#define CONFIG_SYS_PROMPT "cam_enc_4xx> " /* Monitor Command Prompt */
136#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
137#define CONFIG_SYS_PBSIZE /* Print buffer size */ \
138 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
139#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
140#define CONFIG_SYS_HUSH_PARSER
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000141#define CONFIG_SYS_LONGHELP
142
Heiko Schocher16519be2012-01-16 21:20:09 +0000143#define CONFIG_MENU
144#define CONFIG_MENU_SHOW
145#define CONFIG_FIT
Heiko Schocher16519be2012-01-16 21:20:09 +0000146#define CONFIG_BOARD_IMG_ADDR_R 0x80000000
147
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000148#ifdef CONFIG_NAND_DAVINCI
Heiko Schocher16519be2012-01-16 21:20:09 +0000149#define CONFIG_ENV_SIZE (16 << 10)
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000150#define CONFIG_ENV_IS_IN_NAND
Heiko Schocher16519be2012-01-16 21:20:09 +0000151#define CONFIG_ENV_OFFSET 0x180000
Heiko Schocherb22c74b2012-03-07 04:10:00 +0000152#define CONFIG_ENV_RANGE 0x040000
Heiko Schocher16519be2012-01-16 21:20:09 +0000153#define CONFIG_ENV_OFFSET_REDUND 0x1c0000
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000154#undef CONFIG_ENV_IS_IN_FLASH
155#endif
156
157#if defined(CONFIG_MMC) && !defined(CONFIG_ENV_IS_IN_NAND)
158#define CONFIG_CMD_ENV
Heiko Schocher16519be2012-01-16 21:20:09 +0000159#define CONFIG_SYS_MMC_ENV_DEV 0
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000160#define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB */
161#define CONFIG_ENV_OFFSET (51 << 9) /* Sector 51 */
162#define CONFIG_ENV_IS_IN_MMC
163#undef CONFIG_ENV_IS_IN_FLASH
164#endif
165
166#define CONFIG_BOOTDELAY 3
Heiko Schocher16519be2012-01-16 21:20:09 +0000167/*
168 * 24MHz InputClock / 15 prediv -> 1.6 MHz timer running
169 * Timeout 1 second.
170 */
171#define CONFIG_AIT_TIMER_TIMEOUT 0x186a00
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000172
173#define CONFIG_CMDLINE_EDITING
174#define CONFIG_VERSION_VARIABLE
175#define CONFIG_TIMESTAMP
176
177/* U-Boot memory configuration */
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000178#define CONFIG_SYS_MALLOC_LEN (1 << 20) /* 1 MiB */
179#define CONFIG_SYS_MEMTEST_START 0x80000000 /* physical address */
180#define CONFIG_SYS_MEMTEST_END 0x81000000 /* test 16MB RAM */
181
182/* Linux interfacing */
183#define CONFIG_CMDLINE_TAG
184#define CONFIG_SETUP_MEMORY_TAGS
185#define CONFIG_SYS_BARGSIZE 1024 /* bootarg Size */
186#define CONFIG_SYS_LOAD_ADDR 0x80700000 /* kernel address */
187
188#define MTDIDS_DEFAULT "nand0=davinci_nand.0"
Heiko Schocher16519be2012-01-16 21:20:09 +0000189#define MTDPARTS_DEFAULT \
190 "mtdparts=" \
191 "davinci_nand.0:" \
192 "128k(spl)," \
193 "384k(UBLheader)," \
194 "1m(u-boot)," \
195 "512k(env)," \
196 "-(ubi)"
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000197
Heiko Schocher16519be2012-01-16 21:20:09 +0000198#define CONFIG_SYS_NAND_PAGE_SIZE 0x800
199#define CONFIG_SYS_NAND_BLOCK_SIZE 0x20000
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000200
201/* Defines for SPL */
202#define CONFIG_SPL
Tom Rini12938582012-08-14 12:27:13 -0700203#define CONFIG_SPL_FRAMEWORK
204#define CONFIG_SPL_BOARD_INIT
Heiko Schocherb22c74b2012-03-07 04:10:00 +0000205#define CONFIG_SPL_LIBGENERIC_SUPPORT
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000206#define CONFIG_SPL_NAND_SUPPORT
Scott Woodc352a0c2012-09-20 19:09:07 -0500207#define CONFIG_SPL_NAND_BASE
208#define CONFIG_SPL_NAND_DRIVERS
209#define CONFIG_SPL_NAND_ECC
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000210#define CONFIG_SPL_NAND_SIMPLE
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000211#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
212#define CONFIG_SPL_SERIAL_SUPPORT
213#define CONFIG_SPL_POST_MEM_SUPPORT
214#define CONFIG_SPL_LDSCRIPT "$(BOARDDIR)/u-boot-spl.lds"
215#define CONFIG_SPL_STACK (0x00010000 + 0x7f00)
216
Heiko Schocherb22c74b2012-03-07 04:10:00 +0000217#define CONFIG_SPL_TEXT_BASE 0x00000020 /*CONFIG_SYS_SRAM_START*/
Masahiro Yamada4c08a1d2013-09-01 15:04:27 +0900218/* Provide at least 16MB spacing between us and the Linux Kernel image */
219#define CONFIG_SPL_PAD_TO 12320
Albert ARIBAUDfd2c9812013-04-12 05:14:31 +0000220#define CONFIG_SPL_MAX_FOOTPRINT 12288
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000221
222#ifndef CONFIG_SPL_BUILD
223#define CONFIG_SYS_TEXT_BASE 0x81080000
224#endif
225
226#define CONFIG_SYS_NAND_BASE 0x02000000
227#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
228 CONFIG_SYS_NAND_PAGE_SIZE)
229
230#define CONFIG_SYS_NAND_ECCPOS { \
231 24, 25, 26, 27, 28, \
232 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, \
233 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \
234 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, \
235 59, 60, 61, 62, 63 }
236#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
237#define CONFIG_SYS_NAND_ECCSIZE 0x200
238#define CONFIG_SYS_NAND_ECCBYTES 10
Tom Riniaef40ed2013-12-18 14:43:08 -0500239#define CONFIG_SYS_NAND_MAX_OOBFREE 2
240#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000241#define CONFIG_SYS_NAND_OOBSIZE 64
242#define CONFIG_SYS_NAND_5_ADDR_CYCLE
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000243
244/*
245 * RBL searches from Block n (n = 1..24)
246 * so we can define, how many UBL Headers
247 * we can write before the real spl code
248 */
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000249#define CONFIG_SYS_NROF_PAGES_NAND_SPL 6
250
251#define CONFIG_SYS_NAND_U_BOOT_DST 0x81080000 /* u-boot TEXT_BASE */
252#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_NAND_U_BOOT_DST
253
254/*
255 * Post tests for memory testing
256 */
257#define CONFIG_POST CONFIG_SYS_POST_MEMORY
258#define _POST_WORD_ADDR 0x0
259
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000260#define CONFIG_DISPLAY_BOARDINFO
261
262#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK
263
Heiko Schocher16519be2012-01-16 21:20:09 +0000264#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
265#define CONFIG_SYS_NAND_U_BOOT_SIZE 0xa0000
Heiko Schocherb22c74b2012-03-07 04:10:00 +0000266#define CONFIG_SYS_NAND_U_BOOT_ERA_SIZE 0x100000
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000267
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000268/* for UBL header */
269#define CONFIG_SYS_UBL_BLOCK (CONFIG_SYS_NAND_PAGE_SIZE)
270
271#define CONFIG_SYS_DM36x_PLL1_PLLM 0x55
272#define CONFIG_SYS_DM36x_PLL1_PREDIV 0x8005
273#define CONFIG_SYS_DM36x_PLL2_PLLM 0x09
274#define CONFIG_SYS_DM36x_PLL2_PREDIV 0x8000
275#define CONFIG_SYS_DM36x_PERI_CLK_CTRL 0x243F04FC
276#define CONFIG_SYS_DM36x_PLL1_PLLDIV1 0x801b
277#define CONFIG_SYS_DM36x_PLL1_PLLDIV2 0x8001
278/* POST DIV 680/2 = 340Mhz -> MJCP and HDVICP bus interface clock */
279#define CONFIG_SYS_DM36x_PLL1_PLLDIV3 0x8001
280/*
281 * POST DIV 680/4 = 170Mhz -> EDMA/Peripheral CFG0(1/2 MJCP/HDVICP bus
282 * interface clk)
283 */
284#define CONFIG_SYS_DM36x_PLL1_PLLDIV4 0x8003
285/* POST DIV 680/2 = 340Mhz -> VPSS */
286#define CONFIG_SYS_DM36x_PLL1_PLLDIV5 0x8001
287/* POST DIV 680/9 = 75.6 Mhz -> VENC */
288#define CONFIG_SYS_DM36x_PLL1_PLLDIV6 0x8008
289/*
290 * POST DIV 680/1 = 680Mhz -> DDRx2(with internal divider of 2, clock boils
291 * down to 340 Mhz)
292 */
293#define CONFIG_SYS_DM36x_PLL1_PLLDIV7 0x8000
294/* POST DIV 680/7= 97Mhz-> MMC0/SD0 */
295#define CONFIG_SYS_DM36x_PLL1_PLLDIV8 0x8006
296/* POST DIV 680/28 = 24.3Mhz-> CLKOUT */
297#define CONFIG_SYS_DM36x_PLL1_PLLDIV9 0x801b
298
299#define CONFIG_SYS_DM36x_PLL2_PLLDIV1 0x8011
300/* POST DIV 432/1=432 Mhz -> ARM926/(HDVICP block) clk */
301#define CONFIG_SYS_DM36x_PLL2_PLLDIV2 0x8000
302#define CONFIG_SYS_DM36x_PLL2_PLLDIV3 0x8001
303/* POST DIV 432/21= 20.5714 Mhz->VOICE Codec clk */
304#define CONFIG_SYS_DM36x_PLL2_PLLDIV4 0x8014
305/* POST DIV 432/16=27 Mhz -> VENC(For SD modes, requires) */
306#define CONFIG_SYS_DM36x_PLL2_PLLDIV5 0x800f
307
308/*
309 * READ LATENCY 7 (CL + 2)
310 * CONFIG_PWRDNEN = 1
311 * CONFIG_EXT_STRBEN = 1
312 */
313#define CONFIG_SYS_DM36x_DDR2_DDRPHYCR (0 \
314 | DV_DDR_PHY_EXT_STRBEN \
315 | DV_DDR_PHY_PWRDNEN \
316 | (7 << DV_DDR_PHY_RD_LATENCY_SHIFT))
317
318/*
319 * T_RFC = (trfc/DDR_CLK) - 1 = (195 / 2.941) - 1
320 * T_RP = (trp/DDR_CLK) - 1 = (12.5 / 2.941) - 1
321 * T_RCD = (trcd/DDR_CLK) - 1 = (12.5 / 2.941) - 1
322 * T_WR = (twr/DDR_CLK) - 1 = (15 / 2.941) - 1
323 * T_RAS = (tras/DDR_CLK) - 1 = (45 / 2.941) - 1
324 * T_RC = (trc/DDR_CLK) - 1 = (57.5 / 2.941) - 1
325 * T_RRD = (trrd/DDR_CLK) - 1 = (7.5 / 2.941) - 1
326 * T_WTR = (twtr/DDR_CLK) - 1 = (7.5 / 2.941) - 1
327 */
328#define CONFIG_SYS_DM36x_DDR2_SDTIMR (0 \
329 | (66 << DV_DDR_SDTMR1_RFC_SHIFT) \
330 | (4 << DV_DDR_SDTMR1_RP_SHIFT) \
331 | (4 << DV_DDR_SDTMR1_RCD_SHIFT) \
332 | (5 << DV_DDR_SDTMR1_WR_SHIFT) \
333 | (14 << DV_DDR_SDTMR1_RAS_SHIFT) \
334 | (19 << DV_DDR_SDTMR1_RC_SHIFT) \
335 | (2 << DV_DDR_SDTMR1_RRD_SHIFT) \
336 | (2 << DV_DDR_SDTMR1_WTR_SHIFT))
337
338/*
339 * T_RASMAX = (trasmax/refresh_rate) - 1 = (70K / 7812.6) - 1
340 * T_XP = tCKE - 1 = 3 - 2
341 * T_XSNR= ((trfc + 10)/DDR_CLK) - 1 = (205 / 2.941) - 1
342 * T_XSRD = txsrd - 1 = 200 - 1
343 * T_RTP = (trtp/DDR_CLK) - 1 = (7.5 / 2.941) - 1
344 * T_CKE = tcke - 1 = 3 - 1
345 */
346#define CONFIG_SYS_DM36x_DDR2_SDTIMR2 (0 \
347 | (8 << DV_DDR_SDTMR2_RASMAX_SHIFT) \
348 | (2 << DV_DDR_SDTMR2_XP_SHIFT) \
349 | (69 << DV_DDR_SDTMR2_XSNR_SHIFT) \
350 | (199 << DV_DDR_SDTMR2_XSRD_SHIFT) \
351 | (2 << DV_DDR_SDTMR2_RTP_SHIFT) \
352 | (2 << DV_DDR_SDTMR2_CKE_SHIFT))
353
354/* PR_OLD_COUNT = 0xfe */
355#define CONFIG_SYS_DM36x_DDR2_PBBPR 0x000000FE
356/* refresh rate = 0x768 */
357#define CONFIG_SYS_DM36x_DDR2_SDRCR 0x00000768
358
359#define CONFIG_SYS_DM36x_DDR2_SDBCR (0 \
360 | (2 << DV_DDR_SDCR_PAGESIZE_SHIFT) \
361 | (3 << DV_DDR_SDCR_IBANK_SHIFT) \
362 | (5 << DV_DDR_SDCR_CL_SHIFT) \
363 | (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT) \
364 | (1 << DV_DDR_SDCR_TIMUNLOCK_SHIFT) \
365 | (1 << DV_DDR_SDCR_DDREN_SHIFT) \
366 | (0 << DV_DDR_SDCR_DDRDRIVE0_SHIFT) \
367 | (1 << DV_DDR_SDCR_DDR2EN_SHIFT) \
368 | (1 << DV_DDR_SDCR_DDR_DDQS_SHIFT) \
369 | (1 << DV_DDR_SDCR_BOOTUNLOCK_SHIFT))
370
371#define CONFIG_SYS_DM36x_AWCCR 0xff
372#define CONFIG_SYS_DM36x_AB1CR 0x40400204
373#define CONFIG_SYS_DM36x_AB2CR 0x04ca2650
374
375/* All Video Inputs */
376#define CONFIG_SYS_DM36x_PINMUX0 0x00000000
377/*
378 * All Video Outputs,
379 * GPIO 86, 87 + 90 0x0000f030
380 */
381#define CONFIG_SYS_DM36x_PINMUX1 0x00530002
382#define CONFIG_SYS_DM36x_PINMUX2 0x00001815
383/*
384 * SPI1, UART1, I2C, SD0, SD1, McBSP0, CLKOUTs
385 * GPIO 25 0x60000000
386 */
387#define CONFIG_SYS_DM36x_PINMUX3 0x9b5affff
388/*
389 * MMC/SD0 instead of MS, SPI0
390 * GPIO 34 0x0000c000
391 */
392#define CONFIG_SYS_DM36x_PINMUX4 0x00002655
393
394/*
395 * Default environment settings
396 */
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000397
398#define DVN4XX_UBOOT_ADDR_R_RAM 0x80000000
399/* (DVN4XX_UBOOT_ADDR_R_RAM + CONFIG_SYS_NAND_PAGE_SIZE) */
400#define DVN4XX_UBOOT_ADDR_R_NAND_SPL 0x80000800
401/*
402 * (DVN4XX_UBOOT_ADDR_R_NAND_SPL + (CONFIG_SYS_NROF_PAGES_NAND_SPL * \
403 * CONFIG_SYS_NAND_PAGE_SIZE))
404 */
405#define DVN4XX_UBOOT_ADDR_R_UBOOT 0x80003800
406
407#define CONFIG_EXTRA_ENV_SETTINGS \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200408 "u_boot_addr_r=" __stringify(DVN4XX_UBOOT_ADDR_R_RAM) "\0" \
409 "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.ubl\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000410 "load=tftp ${u_boot_addr_r} ${u-boot}\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200411 "pagesz=" __stringify(CONFIG_SYS_NAND_PAGE_SIZE) "\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000412 "writeheader=nandrbl rbl;nand erase 20000 ${pagesz};" \
413 "nand write ${u_boot_addr_r} 20000 ${pagesz};" \
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000414 "nandrbl uboot\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000415 "writenand_spl=nandrbl rbl;nand erase 0 3000;" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200416 "nand write " __stringify(DVN4XX_UBOOT_ADDR_R_NAND_SPL) \
Heiko Schocher16519be2012-01-16 21:20:09 +0000417 " 0 3000;nandrbl uboot\0" \
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000418 "writeuboot=nandrbl uboot;" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200419 "nand erase " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " "\
420 __stringify(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
421 ";nand write " __stringify(DVN4XX_UBOOT_ADDR_R_UBOOT) \
422 " " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
423 __stringify(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000424 "update=run load writenand_spl writeuboot\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000425 "bootcmd=run net_nfs\0" \
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000426 "rootpath=/opt/eldk-arm/arm\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000427 "mtdids=" MTDIDS_DEFAULT "\0" \
428 "mtdparts=" MTDPARTS_DEFAULT "\0" \
429 "netdev=eth0\0" \
430 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
431 "addmisc=setenv bootargs ${bootargs} app_reset=${app_reset}\0" \
432 "addcon=setenv bootargs ${bootargs} console=ttyS0," \
433 "${baudrate}n8\0" \
434 "addip=setenv bootargs ${bootargs} " \
435 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
436 ":${hostname}:${netdev}:off eth=${ethaddr} panic=1\0" \
437 "rootpath=/opt/eldk-arm/arm\0" \
438 "nfsargs=setenv bootargs root=/dev/nfs rw " \
439 "nfsroot=${serverip}:${rootpath}\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200440 "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage \0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000441 "kernel_addr_r=80600000\0" \
442 "load_kernel=tftp ${kernel_addr_r} ${bootfile}\0" \
Joe Hershberger108458a2012-11-01 16:54:18 +0000443 "ubi_load_kernel=ubi part ubi 2048;ubifsmount ubi:${img_volume};" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000444 "ubifsload ${kernel_addr_r} boot/uImage\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200445 "fit_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0" \
446 "img_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0" \
447 "img_file=" __stringify(CONFIG_HOSTNAME) "/ait.itb\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000448 "header_addr=20000\0" \
449 "img_writeheader=nandrbl rbl;" \
450 "nand erase ${header_addr} ${pagesz};" \
451 "nand write ${img_addr_r} ${header_addr} ${pagesz};" \
452 "nandrbl uboot\0" \
453 "img_writespl=nandrbl rbl;nand erase 0 3000;" \
454 "nand write ${img_addr_r} 0 3000;nandrbl uboot\0" \
455 "img_writeuboot=nandrbl uboot;" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200456 "nand erase " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " "\
457 __stringify(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
Heiko Schocher16519be2012-01-16 21:20:09 +0000458 ";nand write ${img_addr_r} " \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200459 __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
460 __stringify(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000461 "img_writedfenv=ubi part ubi 2048;" \
462 "ubi write ${img_addr_r} default ${filesize}\0" \
463 "img_volume=rootfs1\0" \
Heiko Schocherb22c74b2012-03-07 04:10:00 +0000464 "img_writeramdisk=ubi part ubi 2048;" \
Heiko Schocher16519be2012-01-16 21:20:09 +0000465 "ubi write ${img_addr_r} ${img_volume} ${filesize}\0" \
466 "load_img=tftp ${fit_addr_r} ${img_file}\0" \
467 "net_nfs=run load_kernel; " \
468 "run nfsargs addip addcon addmtd addmisc;" \
469 "bootm ${kernel_addr_r}\0" \
470 "ubi_ubi=run ubi_load_kernel; " \
471 "run ubiargs addip addcon addmtd addmisc;" \
472 "bootm ${kernel_addr_r}\0" \
473 "ubiargs=setenv bootargs ubi.mtd=4,2048" \
474 " root=ubi0:${img_volume} rw rootfstype=ubifs\0" \
475 "app_reset=no\0" \
476 "dvn_app_vers=void\0" \
477 "dvn_boot_vers=void\0" \
478 "savenewvers=run savetmpparms restoreparms; saveenv;" \
479 "run restoretmpparms\0" \
480 "savetmpparms=setenv y_ipaddr ${ipaddr};" \
481 "setenv y_netmask ${netmask};" \
482 "setenv y_serverip ${serverip};" \
483 "setenv y_gatewayip ${gatewayip}\0" \
484 "saveparms=setenv x_ipaddr ${ipaddr};" \
485 "setenv x_netmask ${netmask};" \
486 "setenv x_serverip ${serverip};" \
487 "setenv x_gatewayip ${gatewayip}\0" \
488 "restoreparms=setenv ipaddr ${x_ipaddr};" \
489 "setenv netmask ${x_netmask};" \
490 "setenv serverip ${x_serverip};" \
491 "setenv gatewayip ${x_gatewayip}\0" \
492 "restoretmpparms=setenv ipaddr ${y_ipaddr};" \
493 "setenv netmask ${y_netmask};" \
494 "setenv serverip ${y_serverip};" \
495 "setenv gatewayip ${y_gatewayip}\0" \
Heiko Schocher6c1b1192011-11-01 20:00:35 +0000496 "\0"
497
498/* USB Configuration */
499#define CONFIG_USB_DAVINCI
500#define CONFIG_MUSB_HCD
501#define CONFIG_DV_USBPHY_CTL (USBPHY_SESNDEN | USBPHY_VBDTCTEN | \
502 USBPHY_PHY24MHZ)
503
504#define CONFIG_CMD_USB /* include support for usb cmd */
505#define CONFIG_USB_STORAGE /* MSC class support */
506#define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */
507#define CONFIG_CMD_FAT /* inclue support for FAT/storage */
508#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage */
509
510#undef DAVINCI_DM365EVM
511#define PINMUX4_USBDRVBUS_BITCLEAR 0x3000
512#define PINMUX4_USBDRVBUS_BITSET 0x2000
513
514#endif /* __CONFIG_H */