blob: 56dc1cbbd51d9309f099c4e7f3275331cb26571b [file] [log] [blame]
Heiko Schocher4dd83492011-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 *
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; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23#ifndef __CONFIG_H
24#define __CONFIG_H
25
26#define CONFIG_SYS_NO_FLASH /* that is, no *NOR* flash */
27#define CONFIG_SYS_CONSOLE_INFO_QUIET
28
29/* SoC Configuration */
30#define CONFIG_ARM926EJS /* arm926ejs CPU */
31#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
32#define CONFIG_SYS_HZ_CLOCK 24000000 /* timer0 freq */
33#define CONFIG_SYS_HZ 1000
34#define CONFIG_SOC_DM365
35
36#define CONFIG_MACH_TYPE MACH_TYPE_DAVINCI_DM365_EVM
37
38#define CONFIG_HOSTNAME cam_enc_4xx
39
Nobuhiro Iwamatsu8913e6b2012-04-17 16:42:22 +000040#define CONFIG_BOARD_LATE_INIT
Heiko Schocher4dd83492011-11-01 20:00:35 +000041#define CONFIG_CAM_ENC_LED_MASK 0x0fc00000
42
43/* Memory Info */
44#define CONFIG_NR_DRAM_BANKS 1
45#define PHYS_SDRAM_1 0x80000000
46#define PHYS_SDRAM_1_SIZE (256 << 20) /* 256 MiB */
47#define DDR_4BANKS /* 4-bank DDR2 (256MB) */
48#define CONFIG_MAX_RAM_BANK_SIZE (256 << 20) /* 256 MB */
49#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
50
51/* Serial Driver info: UART0 for console */
52#define CONFIG_SYS_NS16550
53#define CONFIG_SYS_NS16550_SERIAL
54#define CONFIG_SYS_NS16550_REG_SIZE -4
55#define CONFIG_SYS_NS16550_COM1 0x01c20000
56#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK
Heiko Schocher4dd83492011-11-01 20:00:35 +000057#define CONFIG_CONS_INDEX 1
58#define CONFIG_BAUDRATE 115200
59
60/* Network Configuration */
61#define CONFIG_DRIVER_TI_EMAC
62#define CONFIG_EMAC_MDIO_PHY_NUM 0
63#define CONFIG_SYS_EMAC_TI_CLKDIV 0xa9 /* 1MHz */
64#define CONFIG_MII
65#define CONFIG_BOOTP_DEFAULT
66#define CONFIG_BOOTP_DNS
67#define CONFIG_BOOTP_DNS2
68#define CONFIG_BOOTP_SEND_HOSTNAME
69#define CONFIG_NET_RETRY_COUNT 10
Heiko Schocher4dd83492011-11-01 20:00:35 +000070#define CONFIG_CMD_MII
71#define CONFIG_SYS_DCACHE_OFF
72#define CONFIG_RESET_PHY_R
73
74/* I2C */
75#define CONFIG_HARD_I2C
76#define CONFIG_DRIVER_DAVINCI_I2C
77#define CONFIG_SYS_I2C_SPEED 400000
78#define CONFIG_SYS_I2C_SLAVE 0x10 /* SMBus host address */
79
80/* NAND: socketed, two chipselects, normally 2 GBytes */
81#define CONFIG_NAND_DAVINCI
82#define CONFIG_SYS_NAND_CS 2
83#define CONFIG_SYS_NAND_USE_FLASH_BBT
84#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
85#define CONFIG_SYS_NAND_PAGE_2K
86
87#define CONFIG_SYS_NAND_LARGEPAGE
88#define CONFIG_SYS_NAND_BASE_LIST { 0x02000000, }
89/* socket has two chipselects, nCE0 gated by address BIT(14) */
90#define CONFIG_SYS_MAX_NAND_DEVICE 1
Heiko Schocher4dd83492011-11-01 20:00:35 +000091
92/* SPI support */
93#define CONFIG_SPI
94#define CONFIG_SPI_FLASH
95#define CONFIG_SPI_FLASH_STMICRO
96#define CONFIG_DAVINCI_SPI
97#define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE
98#define CONFIG_SYS_SPI_CLK davinci_clk_get(SPI_PLLDIV)
99#define CONFIG_SF_DEFAULT_SPEED 3000000
100#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
101#define CONFIG_CMD_SF
102
103/* SD/MMC */
104#define CONFIG_MMC
105#define CONFIG_GENERIC_MMC
106#define CONFIG_DAVINCI_MMC
107#define CONFIG_MMC_MBLOCK
108
109/* U-Boot command configuration */
110#include <config_cmd_default.h>
111
112#define CONFIG_CMD_BDI
113#undef CONFIG_CMD_FLASH
114#undef CONFIG_CMD_FPGA
115#undef CONFIG_CMD_SETGETDCR
116#define CONFIG_CMD_ASKENV
117#define CONFIG_CMD_CACHE
118#define CONFIG_CMD_DHCP
119#define CONFIG_CMD_I2C
120#define CONFIG_CMD_PING
121#define CONFIG_CMD_SAVES
122
Hadli, Manjunath8f5d4682012-02-06 00:30:44 +0000123#ifdef CONFIG_CMD_BDI
124#define CONFIG_CLOCKS
125#endif
126
Heiko Schocher4dd83492011-11-01 20:00:35 +0000127#ifdef CONFIG_MMC
128#define CONFIG_DOS_PARTITION
129#define CONFIG_CMD_EXT2
130#define CONFIG_CMD_FAT
131#define CONFIG_CMD_MMC
132#endif
133
134#ifdef CONFIG_NAND_DAVINCI
135#define CONFIG_CMD_MTDPARTS
136#define CONFIG_MTD_PARTITIONS
137#define CONFIG_MTD_DEVICE
138#define CONFIG_CMD_NAND
139#define CONFIG_CMD_UBI
Heiko Schocher6be6db52012-01-16 21:20:09 +0000140#define CONFIG_CMD_UBIFS
Heiko Schocher4dd83492011-11-01 20:00:35 +0000141#define CONFIG_RBTREE
Heiko Schocher6be6db52012-01-16 21:20:09 +0000142#define CONFIG_LZO
Heiko Schocher4dd83492011-11-01 20:00:35 +0000143#endif
144
145#define CONFIG_CRC32_VERIFY
146#define CONFIG_MX_CYCLIC
147
148/* U-Boot general configuration */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000149#define CONFIG_BOOTFILE "uImage" /* Boot file name */
150#define CONFIG_SYS_PROMPT "cam_enc_4xx> " /* Monitor Command Prompt */
151#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
152#define CONFIG_SYS_PBSIZE /* Print buffer size */ \
153 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
154#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
155#define CONFIG_SYS_HUSH_PARSER
Heiko Schocher4dd83492011-11-01 20:00:35 +0000156#define CONFIG_SYS_LONGHELP
157
Heiko Schocher6be6db52012-01-16 21:20:09 +0000158#define CONFIG_MENU
159#define CONFIG_MENU_SHOW
160#define CONFIG_FIT
Heiko Schocher6be6db52012-01-16 21:20:09 +0000161#define CONFIG_BOARD_IMG_ADDR_R 0x80000000
162
Heiko Schocher4dd83492011-11-01 20:00:35 +0000163#ifdef CONFIG_NAND_DAVINCI
Heiko Schocher6be6db52012-01-16 21:20:09 +0000164#define CONFIG_ENV_SIZE (16 << 10)
Heiko Schocher4dd83492011-11-01 20:00:35 +0000165#define CONFIG_ENV_IS_IN_NAND
Heiko Schocher6be6db52012-01-16 21:20:09 +0000166#define CONFIG_ENV_OFFSET 0x180000
Heiko Schocher24efef92012-03-07 04:10:00 +0000167#define CONFIG_ENV_RANGE 0x040000
Heiko Schocher6be6db52012-01-16 21:20:09 +0000168#define CONFIG_ENV_OFFSET_REDUND 0x1c0000
Heiko Schocher4dd83492011-11-01 20:00:35 +0000169#undef CONFIG_ENV_IS_IN_FLASH
170#endif
171
172#if defined(CONFIG_MMC) && !defined(CONFIG_ENV_IS_IN_NAND)
173#define CONFIG_CMD_ENV
Heiko Schocher6be6db52012-01-16 21:20:09 +0000174#define CONFIG_SYS_MMC_ENV_DEV 0
Heiko Schocher4dd83492011-11-01 20:00:35 +0000175#define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB */
176#define CONFIG_ENV_OFFSET (51 << 9) /* Sector 51 */
177#define CONFIG_ENV_IS_IN_MMC
178#undef CONFIG_ENV_IS_IN_FLASH
179#endif
180
181#define CONFIG_BOOTDELAY 3
Heiko Schocher6be6db52012-01-16 21:20:09 +0000182/*
183 * 24MHz InputClock / 15 prediv -> 1.6 MHz timer running
184 * Timeout 1 second.
185 */
186#define CONFIG_AIT_TIMER_TIMEOUT 0x186a00
Heiko Schocher4dd83492011-11-01 20:00:35 +0000187
188#define CONFIG_CMDLINE_EDITING
189#define CONFIG_VERSION_VARIABLE
190#define CONFIG_TIMESTAMP
191
192/* U-Boot memory configuration */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000193#define CONFIG_SYS_MALLOC_LEN (1 << 20) /* 1 MiB */
194#define CONFIG_SYS_MEMTEST_START 0x80000000 /* physical address */
195#define CONFIG_SYS_MEMTEST_END 0x81000000 /* test 16MB RAM */
196
197/* Linux interfacing */
198#define CONFIG_CMDLINE_TAG
199#define CONFIG_SETUP_MEMORY_TAGS
200#define CONFIG_SYS_BARGSIZE 1024 /* bootarg Size */
201#define CONFIG_SYS_LOAD_ADDR 0x80700000 /* kernel address */
202
203#define MTDIDS_DEFAULT "nand0=davinci_nand.0"
Heiko Schocher6be6db52012-01-16 21:20:09 +0000204#define MTDPARTS_DEFAULT \
205 "mtdparts=" \
206 "davinci_nand.0:" \
207 "128k(spl)," \
208 "384k(UBLheader)," \
209 "1m(u-boot)," \
210 "512k(env)," \
211 "-(ubi)"
Heiko Schocher4dd83492011-11-01 20:00:35 +0000212
Heiko Schocher6be6db52012-01-16 21:20:09 +0000213#define CONFIG_SYS_NAND_PAGE_SIZE 0x800
214#define CONFIG_SYS_NAND_BLOCK_SIZE 0x20000
Heiko Schocher4dd83492011-11-01 20:00:35 +0000215
216/* Defines for SPL */
217#define CONFIG_SPL
Tom Rini3f7f2412012-08-14 12:27:13 -0700218#define CONFIG_SPL_FRAMEWORK
219#define CONFIG_SPL_BOARD_INIT
Heiko Schocher24efef92012-03-07 04:10:00 +0000220#define CONFIG_SPL_LIBGENERIC_SUPPORT
Heiko Schocher4dd83492011-11-01 20:00:35 +0000221#define CONFIG_SPL_NAND_SUPPORT
222#define CONFIG_SPL_NAND_SIMPLE
Heiko Schocher4dd83492011-11-01 20:00:35 +0000223#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
224#define CONFIG_SPL_SERIAL_SUPPORT
225#define CONFIG_SPL_POST_MEM_SUPPORT
226#define CONFIG_SPL_LDSCRIPT "$(BOARDDIR)/u-boot-spl.lds"
227#define CONFIG_SPL_STACK (0x00010000 + 0x7f00)
228
Heiko Schocher24efef92012-03-07 04:10:00 +0000229#define CONFIG_SPL_TEXT_BASE 0x00000020 /*CONFIG_SYS_SRAM_START*/
Heiko Schocher4dd83492011-11-01 20:00:35 +0000230#define CONFIG_SPL_MAX_SIZE 12320
231
232#ifndef CONFIG_SPL_BUILD
233#define CONFIG_SYS_TEXT_BASE 0x81080000
234#endif
235
236#define CONFIG_SYS_NAND_BASE 0x02000000
237#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
238 CONFIG_SYS_NAND_PAGE_SIZE)
239
240#define CONFIG_SYS_NAND_ECCPOS { \
241 24, 25, 26, 27, 28, \
242 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, \
243 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \
244 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, \
245 59, 60, 61, 62, 63 }
246#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
247#define CONFIG_SYS_NAND_ECCSIZE 0x200
248#define CONFIG_SYS_NAND_ECCBYTES 10
249#define CONFIG_SYS_NAND_OOBSIZE 64
250#define CONFIG_SYS_NAND_5_ADDR_CYCLE
Heiko Schocher4dd83492011-11-01 20:00:35 +0000251
252/*
253 * RBL searches from Block n (n = 1..24)
254 * so we can define, how many UBL Headers
255 * we can write before the real spl code
256 */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000257#define CONFIG_SYS_NROF_PAGES_NAND_SPL 6
258
259#define CONFIG_SYS_NAND_U_BOOT_DST 0x81080000 /* u-boot TEXT_BASE */
260#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_NAND_U_BOOT_DST
261
262/*
263 * Post tests for memory testing
264 */
265#define CONFIG_POST CONFIG_SYS_POST_MEMORY
266#define _POST_WORD_ADDR 0x0
267
Heiko Schocher4dd83492011-11-01 20:00:35 +0000268#define CONFIG_DISPLAY_BOARDINFO
269
270#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK
271
Heiko Schocher6be6db52012-01-16 21:20:09 +0000272#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
273#define CONFIG_SYS_NAND_U_BOOT_SIZE 0xa0000
Heiko Schocher24efef92012-03-07 04:10:00 +0000274#define CONFIG_SYS_NAND_U_BOOT_ERA_SIZE 0x100000
Heiko Schocher4dd83492011-11-01 20:00:35 +0000275
Heiko Schocher4dd83492011-11-01 20:00:35 +0000276/* for UBL header */
277#define CONFIG_SYS_UBL_BLOCK (CONFIG_SYS_NAND_PAGE_SIZE)
278
279#define CONFIG_SYS_DM36x_PLL1_PLLM 0x55
280#define CONFIG_SYS_DM36x_PLL1_PREDIV 0x8005
281#define CONFIG_SYS_DM36x_PLL2_PLLM 0x09
282#define CONFIG_SYS_DM36x_PLL2_PREDIV 0x8000
283#define CONFIG_SYS_DM36x_PERI_CLK_CTRL 0x243F04FC
284#define CONFIG_SYS_DM36x_PLL1_PLLDIV1 0x801b
285#define CONFIG_SYS_DM36x_PLL1_PLLDIV2 0x8001
286/* POST DIV 680/2 = 340Mhz -> MJCP and HDVICP bus interface clock */
287#define CONFIG_SYS_DM36x_PLL1_PLLDIV3 0x8001
288/*
289 * POST DIV 680/4 = 170Mhz -> EDMA/Peripheral CFG0(1/2 MJCP/HDVICP bus
290 * interface clk)
291 */
292#define CONFIG_SYS_DM36x_PLL1_PLLDIV4 0x8003
293/* POST DIV 680/2 = 340Mhz -> VPSS */
294#define CONFIG_SYS_DM36x_PLL1_PLLDIV5 0x8001
295/* POST DIV 680/9 = 75.6 Mhz -> VENC */
296#define CONFIG_SYS_DM36x_PLL1_PLLDIV6 0x8008
297/*
298 * POST DIV 680/1 = 680Mhz -> DDRx2(with internal divider of 2, clock boils
299 * down to 340 Mhz)
300 */
301#define CONFIG_SYS_DM36x_PLL1_PLLDIV7 0x8000
302/* POST DIV 680/7= 97Mhz-> MMC0/SD0 */
303#define CONFIG_SYS_DM36x_PLL1_PLLDIV8 0x8006
304/* POST DIV 680/28 = 24.3Mhz-> CLKOUT */
305#define CONFIG_SYS_DM36x_PLL1_PLLDIV9 0x801b
306
307#define CONFIG_SYS_DM36x_PLL2_PLLDIV1 0x8011
308/* POST DIV 432/1=432 Mhz -> ARM926/(HDVICP block) clk */
309#define CONFIG_SYS_DM36x_PLL2_PLLDIV2 0x8000
310#define CONFIG_SYS_DM36x_PLL2_PLLDIV3 0x8001
311/* POST DIV 432/21= 20.5714 Mhz->VOICE Codec clk */
312#define CONFIG_SYS_DM36x_PLL2_PLLDIV4 0x8014
313/* POST DIV 432/16=27 Mhz -> VENC(For SD modes, requires) */
314#define CONFIG_SYS_DM36x_PLL2_PLLDIV5 0x800f
315
316/*
317 * READ LATENCY 7 (CL + 2)
318 * CONFIG_PWRDNEN = 1
319 * CONFIG_EXT_STRBEN = 1
320 */
321#define CONFIG_SYS_DM36x_DDR2_DDRPHYCR (0 \
322 | DV_DDR_PHY_EXT_STRBEN \
323 | DV_DDR_PHY_PWRDNEN \
324 | (7 << DV_DDR_PHY_RD_LATENCY_SHIFT))
325
326/*
327 * T_RFC = (trfc/DDR_CLK) - 1 = (195 / 2.941) - 1
328 * T_RP = (trp/DDR_CLK) - 1 = (12.5 / 2.941) - 1
329 * T_RCD = (trcd/DDR_CLK) - 1 = (12.5 / 2.941) - 1
330 * T_WR = (twr/DDR_CLK) - 1 = (15 / 2.941) - 1
331 * T_RAS = (tras/DDR_CLK) - 1 = (45 / 2.941) - 1
332 * T_RC = (trc/DDR_CLK) - 1 = (57.5 / 2.941) - 1
333 * T_RRD = (trrd/DDR_CLK) - 1 = (7.5 / 2.941) - 1
334 * T_WTR = (twtr/DDR_CLK) - 1 = (7.5 / 2.941) - 1
335 */
336#define CONFIG_SYS_DM36x_DDR2_SDTIMR (0 \
337 | (66 << DV_DDR_SDTMR1_RFC_SHIFT) \
338 | (4 << DV_DDR_SDTMR1_RP_SHIFT) \
339 | (4 << DV_DDR_SDTMR1_RCD_SHIFT) \
340 | (5 << DV_DDR_SDTMR1_WR_SHIFT) \
341 | (14 << DV_DDR_SDTMR1_RAS_SHIFT) \
342 | (19 << DV_DDR_SDTMR1_RC_SHIFT) \
343 | (2 << DV_DDR_SDTMR1_RRD_SHIFT) \
344 | (2 << DV_DDR_SDTMR1_WTR_SHIFT))
345
346/*
347 * T_RASMAX = (trasmax/refresh_rate) - 1 = (70K / 7812.6) - 1
348 * T_XP = tCKE - 1 = 3 - 2
349 * T_XSNR= ((trfc + 10)/DDR_CLK) - 1 = (205 / 2.941) - 1
350 * T_XSRD = txsrd - 1 = 200 - 1
351 * T_RTP = (trtp/DDR_CLK) - 1 = (7.5 / 2.941) - 1
352 * T_CKE = tcke - 1 = 3 - 1
353 */
354#define CONFIG_SYS_DM36x_DDR2_SDTIMR2 (0 \
355 | (8 << DV_DDR_SDTMR2_RASMAX_SHIFT) \
356 | (2 << DV_DDR_SDTMR2_XP_SHIFT) \
357 | (69 << DV_DDR_SDTMR2_XSNR_SHIFT) \
358 | (199 << DV_DDR_SDTMR2_XSRD_SHIFT) \
359 | (2 << DV_DDR_SDTMR2_RTP_SHIFT) \
360 | (2 << DV_DDR_SDTMR2_CKE_SHIFT))
361
362/* PR_OLD_COUNT = 0xfe */
363#define CONFIG_SYS_DM36x_DDR2_PBBPR 0x000000FE
364/* refresh rate = 0x768 */
365#define CONFIG_SYS_DM36x_DDR2_SDRCR 0x00000768
366
367#define CONFIG_SYS_DM36x_DDR2_SDBCR (0 \
368 | (2 << DV_DDR_SDCR_PAGESIZE_SHIFT) \
369 | (3 << DV_DDR_SDCR_IBANK_SHIFT) \
370 | (5 << DV_DDR_SDCR_CL_SHIFT) \
371 | (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT) \
372 | (1 << DV_DDR_SDCR_TIMUNLOCK_SHIFT) \
373 | (1 << DV_DDR_SDCR_DDREN_SHIFT) \
374 | (0 << DV_DDR_SDCR_DDRDRIVE0_SHIFT) \
375 | (1 << DV_DDR_SDCR_DDR2EN_SHIFT) \
376 | (1 << DV_DDR_SDCR_DDR_DDQS_SHIFT) \
377 | (1 << DV_DDR_SDCR_BOOTUNLOCK_SHIFT))
378
379#define CONFIG_SYS_DM36x_AWCCR 0xff
380#define CONFIG_SYS_DM36x_AB1CR 0x40400204
381#define CONFIG_SYS_DM36x_AB2CR 0x04ca2650
382
383/* All Video Inputs */
384#define CONFIG_SYS_DM36x_PINMUX0 0x00000000
385/*
386 * All Video Outputs,
387 * GPIO 86, 87 + 90 0x0000f030
388 */
389#define CONFIG_SYS_DM36x_PINMUX1 0x00530002
390#define CONFIG_SYS_DM36x_PINMUX2 0x00001815
391/*
392 * SPI1, UART1, I2C, SD0, SD1, McBSP0, CLKOUTs
393 * GPIO 25 0x60000000
394 */
395#define CONFIG_SYS_DM36x_PINMUX3 0x9b5affff
396/*
397 * MMC/SD0 instead of MS, SPI0
398 * GPIO 34 0x0000c000
399 */
400#define CONFIG_SYS_DM36x_PINMUX4 0x00002655
401
402/*
403 * Default environment settings
404 */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000405
406#define DVN4XX_UBOOT_ADDR_R_RAM 0x80000000
407/* (DVN4XX_UBOOT_ADDR_R_RAM + CONFIG_SYS_NAND_PAGE_SIZE) */
408#define DVN4XX_UBOOT_ADDR_R_NAND_SPL 0x80000800
409/*
410 * (DVN4XX_UBOOT_ADDR_R_NAND_SPL + (CONFIG_SYS_NROF_PAGES_NAND_SPL * \
411 * CONFIG_SYS_NAND_PAGE_SIZE))
412 */
413#define DVN4XX_UBOOT_ADDR_R_UBOOT 0x80003800
414
415#define CONFIG_EXTRA_ENV_SETTINGS \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200416 "u_boot_addr_r=" __stringify(DVN4XX_UBOOT_ADDR_R_RAM) "\0" \
417 "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.ubl\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000418 "load=tftp ${u_boot_addr_r} ${u-boot}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200419 "pagesz=" __stringify(CONFIG_SYS_NAND_PAGE_SIZE) "\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000420 "writeheader=nandrbl rbl;nand erase 20000 ${pagesz};" \
421 "nand write ${u_boot_addr_r} 20000 ${pagesz};" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000422 "nandrbl uboot\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000423 "writenand_spl=nandrbl rbl;nand erase 0 3000;" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200424 "nand write " __stringify(DVN4XX_UBOOT_ADDR_R_NAND_SPL) \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000425 " 0 3000;nandrbl uboot\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000426 "writeuboot=nandrbl uboot;" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200427 "nand erase " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " "\
428 __stringify(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
429 ";nand write " __stringify(DVN4XX_UBOOT_ADDR_R_UBOOT) \
430 " " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
431 __stringify(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000432 "update=run load writenand_spl writeuboot\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000433 "bootcmd=run net_nfs\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000434 "rootpath=/opt/eldk-arm/arm\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000435 "mtdids=" MTDIDS_DEFAULT "\0" \
436 "mtdparts=" MTDPARTS_DEFAULT "\0" \
437 "netdev=eth0\0" \
438 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
439 "addmisc=setenv bootargs ${bootargs} app_reset=${app_reset}\0" \
440 "addcon=setenv bootargs ${bootargs} console=ttyS0," \
441 "${baudrate}n8\0" \
442 "addip=setenv bootargs ${bootargs} " \
443 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
444 ":${hostname}:${netdev}:off eth=${ethaddr} panic=1\0" \
445 "rootpath=/opt/eldk-arm/arm\0" \
446 "nfsargs=setenv bootargs root=/dev/nfs rw " \
447 "nfsroot=${serverip}:${rootpath}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200448 "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage \0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000449 "kernel_addr_r=80600000\0" \
450 "load_kernel=tftp ${kernel_addr_r} ${bootfile}\0" \
451 "ubi_load_kernel=ubi part ubi 2048;ubifsmount ${img_volume};" \
452 "ubifsload ${kernel_addr_r} boot/uImage\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200453 "fit_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0" \
454 "img_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0" \
455 "img_file=" __stringify(CONFIG_HOSTNAME) "/ait.itb\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000456 "header_addr=20000\0" \
457 "img_writeheader=nandrbl rbl;" \
458 "nand erase ${header_addr} ${pagesz};" \
459 "nand write ${img_addr_r} ${header_addr} ${pagesz};" \
460 "nandrbl uboot\0" \
461 "img_writespl=nandrbl rbl;nand erase 0 3000;" \
462 "nand write ${img_addr_r} 0 3000;nandrbl uboot\0" \
463 "img_writeuboot=nandrbl uboot;" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200464 "nand erase " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " "\
465 __stringify(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000466 ";nand write ${img_addr_r} " \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200467 __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
468 __stringify(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000469 "img_writedfenv=ubi part ubi 2048;" \
470 "ubi write ${img_addr_r} default ${filesize}\0" \
471 "img_volume=rootfs1\0" \
Heiko Schocher24efef92012-03-07 04:10:00 +0000472 "img_writeramdisk=ubi part ubi 2048;" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000473 "ubi write ${img_addr_r} ${img_volume} ${filesize}\0" \
474 "load_img=tftp ${fit_addr_r} ${img_file}\0" \
475 "net_nfs=run load_kernel; " \
476 "run nfsargs addip addcon addmtd addmisc;" \
477 "bootm ${kernel_addr_r}\0" \
478 "ubi_ubi=run ubi_load_kernel; " \
479 "run ubiargs addip addcon addmtd addmisc;" \
480 "bootm ${kernel_addr_r}\0" \
481 "ubiargs=setenv bootargs ubi.mtd=4,2048" \
482 " root=ubi0:${img_volume} rw rootfstype=ubifs\0" \
483 "app_reset=no\0" \
484 "dvn_app_vers=void\0" \
485 "dvn_boot_vers=void\0" \
486 "savenewvers=run savetmpparms restoreparms; saveenv;" \
487 "run restoretmpparms\0" \
488 "savetmpparms=setenv y_ipaddr ${ipaddr};" \
489 "setenv y_netmask ${netmask};" \
490 "setenv y_serverip ${serverip};" \
491 "setenv y_gatewayip ${gatewayip}\0" \
492 "saveparms=setenv x_ipaddr ${ipaddr};" \
493 "setenv x_netmask ${netmask};" \
494 "setenv x_serverip ${serverip};" \
495 "setenv x_gatewayip ${gatewayip}\0" \
496 "restoreparms=setenv ipaddr ${x_ipaddr};" \
497 "setenv netmask ${x_netmask};" \
498 "setenv serverip ${x_serverip};" \
499 "setenv gatewayip ${x_gatewayip}\0" \
500 "restoretmpparms=setenv ipaddr ${y_ipaddr};" \
501 "setenv netmask ${y_netmask};" \
502 "setenv serverip ${y_serverip};" \
503 "setenv gatewayip ${y_gatewayip}\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000504 "\0"
505
506/* USB Configuration */
507#define CONFIG_USB_DAVINCI
508#define CONFIG_MUSB_HCD
509#define CONFIG_DV_USBPHY_CTL (USBPHY_SESNDEN | USBPHY_VBDTCTEN | \
510 USBPHY_PHY24MHZ)
511
512#define CONFIG_CMD_USB /* include support for usb cmd */
513#define CONFIG_USB_STORAGE /* MSC class support */
514#define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */
515#define CONFIG_CMD_FAT /* inclue support for FAT/storage */
516#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage */
517
518#undef DAVINCI_DM365EVM
519#define PINMUX4_USBDRVBUS_BITCLEAR 0x3000
520#define PINMUX4_USBDRVBUS_BITSET 0x2000
521
522#endif /* __CONFIG_H */