blob: 3400dd46f97f76521ef2e90d72895b7ac83ce4f4 [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 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02007 * SPDX-License-Identifier: GPL-2.0+
Heiko Schocher4dd83492011-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 */
Heiko Schocher4dd83492011-11-01 20:00:35 +000017#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
18#define CONFIG_SYS_HZ_CLOCK 24000000 /* timer0 freq */
Heiko Schocher4dd83492011-11-01 20:00:35 +000019#define CONFIG_SOC_DM365
20
21#define CONFIG_MACH_TYPE MACH_TYPE_DAVINCI_DM365_EVM
22
23#define CONFIG_HOSTNAME cam_enc_4xx
24
Nobuhiro Iwamatsu8913e6b2012-04-17 16:42:22 +000025#define CONFIG_BOARD_LATE_INIT
Heiko Schocher4dd83492011-11-01 20:00:35 +000026#define CONFIG_CAM_ENC_LED_MASK 0x0fc00000
27
28/* Memory Info */
29#define CONFIG_NR_DRAM_BANKS 1
30#define PHYS_SDRAM_1 0x80000000
31#define PHYS_SDRAM_1_SIZE (256 << 20) /* 256 MiB */
32#define DDR_4BANKS /* 4-bank DDR2 (256MB) */
33#define CONFIG_MAX_RAM_BANK_SIZE (256 << 20) /* 256 MB */
34#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
35
36/* Serial Driver info: UART0 for console */
37#define CONFIG_SYS_NS16550
38#define CONFIG_SYS_NS16550_SERIAL
39#define CONFIG_SYS_NS16550_REG_SIZE -4
40#define CONFIG_SYS_NS16550_COM1 0x01c20000
41#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK
Heiko Schocher4dd83492011-11-01 20:00:35 +000042#define CONFIG_CONS_INDEX 1
43#define CONFIG_BAUDRATE 115200
44
45/* Network Configuration */
46#define CONFIG_DRIVER_TI_EMAC
47#define CONFIG_EMAC_MDIO_PHY_NUM 0
48#define CONFIG_SYS_EMAC_TI_CLKDIV 0xa9 /* 1MHz */
49#define CONFIG_MII
Heiko Schocher4dd83492011-11-01 20:00:35 +000050#define CONFIG_BOOTP_DNS
51#define CONFIG_BOOTP_DNS2
52#define CONFIG_BOOTP_SEND_HOSTNAME
53#define CONFIG_NET_RETRY_COUNT 10
Heiko Schocher4dd83492011-11-01 20:00:35 +000054#define CONFIG_CMD_MII
55#define CONFIG_SYS_DCACHE_OFF
56#define CONFIG_RESET_PHY_R
57
58/* I2C */
Vitaly Andrianove8459dc2014-04-04 13:16:52 -040059#define CONFIG_SYS_I2C
60#define CONFIG_SYS_I2C_DAVINCI
61#define CONFIG_SYS_DAVINCI_I2C_SPEED 400000
62#define CONFIG_SYS_DAVINCI_I2C_SLAVE 0x10 /* SMBus host address */
Heiko Schocher4dd83492011-11-01 20:00:35 +000063
64/* NAND: socketed, two chipselects, normally 2 GBytes */
65#define CONFIG_NAND_DAVINCI
66#define CONFIG_SYS_NAND_CS 2
67#define CONFIG_SYS_NAND_USE_FLASH_BBT
68#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
69#define CONFIG_SYS_NAND_PAGE_2K
70
71#define CONFIG_SYS_NAND_LARGEPAGE
72#define CONFIG_SYS_NAND_BASE_LIST { 0x02000000, }
73/* socket has two chipselects, nCE0 gated by address BIT(14) */
74#define CONFIG_SYS_MAX_NAND_DEVICE 1
Heiko Schocher4dd83492011-11-01 20:00:35 +000075
76/* SPI support */
77#define CONFIG_SPI
Heiko Schocher4dd83492011-11-01 20:00:35 +000078#define CONFIG_SPI_FLASH_STMICRO
79#define CONFIG_DAVINCI_SPI
80#define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE
81#define CONFIG_SYS_SPI_CLK davinci_clk_get(SPI_PLLDIV)
82#define CONFIG_SF_DEFAULT_SPEED 3000000
83#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
84#define CONFIG_CMD_SF
85
86/* SD/MMC */
87#define CONFIG_MMC
88#define CONFIG_GENERIC_MMC
89#define CONFIG_DAVINCI_MMC
90#define CONFIG_MMC_MBLOCK
91
92/* U-Boot command configuration */
Heiko Schocher4dd83492011-11-01 20:00:35 +000093#define CONFIG_CMD_ASKENV
94#define CONFIG_CMD_CACHE
95#define CONFIG_CMD_DHCP
96#define CONFIG_CMD_I2C
97#define CONFIG_CMD_PING
98#define CONFIG_CMD_SAVES
99
Hadli, Manjunath8f5d4682012-02-06 00:30:44 +0000100#ifdef CONFIG_CMD_BDI
101#define CONFIG_CLOCKS
102#endif
103
Heiko Schocher4dd83492011-11-01 20:00:35 +0000104#ifdef CONFIG_MMC
105#define CONFIG_DOS_PARTITION
106#define CONFIG_CMD_EXT2
107#define CONFIG_CMD_FAT
108#define CONFIG_CMD_MMC
109#endif
110
111#ifdef CONFIG_NAND_DAVINCI
112#define CONFIG_CMD_MTDPARTS
113#define CONFIG_MTD_PARTITIONS
114#define CONFIG_MTD_DEVICE
115#define CONFIG_CMD_NAND
116#define CONFIG_CMD_UBI
Heiko Schocher6be6db52012-01-16 21:20:09 +0000117#define CONFIG_CMD_UBIFS
Heiko Schocher4dd83492011-11-01 20:00:35 +0000118#define CONFIG_RBTREE
Heiko Schocher6be6db52012-01-16 21:20:09 +0000119#define CONFIG_LZO
Heiko Schocher4dd83492011-11-01 20:00:35 +0000120#endif
121
122#define CONFIG_CRC32_VERIFY
123#define CONFIG_MX_CYCLIC
124
125/* U-Boot general configuration */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000126#define CONFIG_BOOTFILE "uImage" /* Boot file name */
127#define CONFIG_SYS_PROMPT "cam_enc_4xx> " /* Monitor Command Prompt */
128#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
129#define CONFIG_SYS_PBSIZE /* Print buffer size */ \
130 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
131#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
132#define CONFIG_SYS_HUSH_PARSER
Heiko Schocher4dd83492011-11-01 20:00:35 +0000133#define CONFIG_SYS_LONGHELP
134
Heiko Schocher6be6db52012-01-16 21:20:09 +0000135#define CONFIG_MENU
136#define CONFIG_MENU_SHOW
137#define CONFIG_FIT
Heiko Schocher6be6db52012-01-16 21:20:09 +0000138#define CONFIG_BOARD_IMG_ADDR_R 0x80000000
139
Heiko Schocher4dd83492011-11-01 20:00:35 +0000140#ifdef CONFIG_NAND_DAVINCI
Heiko Schocher6be6db52012-01-16 21:20:09 +0000141#define CONFIG_ENV_SIZE (16 << 10)
Heiko Schocher4dd83492011-11-01 20:00:35 +0000142#define CONFIG_ENV_IS_IN_NAND
Heiko Schocher6be6db52012-01-16 21:20:09 +0000143#define CONFIG_ENV_OFFSET 0x180000
Heiko Schocher24efef92012-03-07 04:10:00 +0000144#define CONFIG_ENV_RANGE 0x040000
Heiko Schocher6be6db52012-01-16 21:20:09 +0000145#define CONFIG_ENV_OFFSET_REDUND 0x1c0000
Heiko Schocher4dd83492011-11-01 20:00:35 +0000146#undef CONFIG_ENV_IS_IN_FLASH
147#endif
148
149#if defined(CONFIG_MMC) && !defined(CONFIG_ENV_IS_IN_NAND)
150#define CONFIG_CMD_ENV
Heiko Schocher6be6db52012-01-16 21:20:09 +0000151#define CONFIG_SYS_MMC_ENV_DEV 0
Heiko Schocher4dd83492011-11-01 20:00:35 +0000152#define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB */
153#define CONFIG_ENV_OFFSET (51 << 9) /* Sector 51 */
154#define CONFIG_ENV_IS_IN_MMC
155#undef CONFIG_ENV_IS_IN_FLASH
156#endif
157
158#define CONFIG_BOOTDELAY 3
Heiko Schocher6be6db52012-01-16 21:20:09 +0000159/*
160 * 24MHz InputClock / 15 prediv -> 1.6 MHz timer running
161 * Timeout 1 second.
162 */
163#define CONFIG_AIT_TIMER_TIMEOUT 0x186a00
Heiko Schocher4dd83492011-11-01 20:00:35 +0000164
165#define CONFIG_CMDLINE_EDITING
166#define CONFIG_VERSION_VARIABLE
167#define CONFIG_TIMESTAMP
168
169/* U-Boot memory configuration */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000170#define CONFIG_SYS_MALLOC_LEN (1 << 20) /* 1 MiB */
171#define CONFIG_SYS_MEMTEST_START 0x80000000 /* physical address */
172#define CONFIG_SYS_MEMTEST_END 0x81000000 /* test 16MB RAM */
173
174/* Linux interfacing */
175#define CONFIG_CMDLINE_TAG
176#define CONFIG_SETUP_MEMORY_TAGS
177#define CONFIG_SYS_BARGSIZE 1024 /* bootarg Size */
178#define CONFIG_SYS_LOAD_ADDR 0x80700000 /* kernel address */
179
180#define MTDIDS_DEFAULT "nand0=davinci_nand.0"
Heiko Schocher6be6db52012-01-16 21:20:09 +0000181#define MTDPARTS_DEFAULT \
182 "mtdparts=" \
183 "davinci_nand.0:" \
184 "128k(spl)," \
185 "384k(UBLheader)," \
186 "1m(u-boot)," \
187 "512k(env)," \
188 "-(ubi)"
Heiko Schocher4dd83492011-11-01 20:00:35 +0000189
Heiko Schocher6be6db52012-01-16 21:20:09 +0000190#define CONFIG_SYS_NAND_PAGE_SIZE 0x800
191#define CONFIG_SYS_NAND_BLOCK_SIZE 0x20000
Heiko Schocher4dd83492011-11-01 20:00:35 +0000192
193/* Defines for SPL */
Tom Rini3f7f2412012-08-14 12:27:13 -0700194#define CONFIG_SPL_FRAMEWORK
195#define CONFIG_SPL_BOARD_INIT
Heiko Schocher24efef92012-03-07 04:10:00 +0000196#define CONFIG_SPL_LIBGENERIC_SUPPORT
Heiko Schocher4dd83492011-11-01 20:00:35 +0000197#define CONFIG_SPL_NAND_SUPPORT
Scott Wood6f2f01b2012-09-20 19:09:07 -0500198#define CONFIG_SPL_NAND_BASE
199#define CONFIG_SPL_NAND_DRIVERS
200#define CONFIG_SPL_NAND_ECC
Heiko Schocher4dd83492011-11-01 20:00:35 +0000201#define CONFIG_SPL_NAND_SIMPLE
Heiko Schocher4dd83492011-11-01 20:00:35 +0000202#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
203#define CONFIG_SPL_SERIAL_SUPPORT
204#define CONFIG_SPL_POST_MEM_SUPPORT
205#define CONFIG_SPL_LDSCRIPT "$(BOARDDIR)/u-boot-spl.lds"
206#define CONFIG_SPL_STACK (0x00010000 + 0x7f00)
207
Heiko Schocher24efef92012-03-07 04:10:00 +0000208#define CONFIG_SPL_TEXT_BASE 0x00000020 /*CONFIG_SYS_SRAM_START*/
Masahiro Yamada1affd4d2013-09-01 15:04:27 +0900209/* Provide at least 16MB spacing between us and the Linux Kernel image */
210#define CONFIG_SPL_PAD_TO 12320
Albert ARIBAUDe7497892013-04-12 05:14:31 +0000211#define CONFIG_SPL_MAX_FOOTPRINT 12288
Heiko Schocher4dd83492011-11-01 20:00:35 +0000212
213#ifndef CONFIG_SPL_BUILD
214#define CONFIG_SYS_TEXT_BASE 0x81080000
215#endif
216
217#define CONFIG_SYS_NAND_BASE 0x02000000
218#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
219 CONFIG_SYS_NAND_PAGE_SIZE)
220
221#define CONFIG_SYS_NAND_ECCPOS { \
222 24, 25, 26, 27, 28, \
223 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, \
224 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, \
225 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, \
226 59, 60, 61, 62, 63 }
227#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
228#define CONFIG_SYS_NAND_ECCSIZE 0x200
229#define CONFIG_SYS_NAND_ECCBYTES 10
Tom Rinid8794da2013-12-18 14:43:08 -0500230#define CONFIG_SYS_NAND_MAX_OOBFREE 2
231#define CONFIG_SYS_NAND_MAX_ECCPOS 56
Heiko Schocher4dd83492011-11-01 20:00:35 +0000232#define CONFIG_SYS_NAND_OOBSIZE 64
233#define CONFIG_SYS_NAND_5_ADDR_CYCLE
Heiko Schocher4dd83492011-11-01 20:00:35 +0000234
235/*
236 * RBL searches from Block n (n = 1..24)
237 * so we can define, how many UBL Headers
238 * we can write before the real spl code
239 */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000240#define CONFIG_SYS_NROF_PAGES_NAND_SPL 6
241
242#define CONFIG_SYS_NAND_U_BOOT_DST 0x81080000 /* u-boot TEXT_BASE */
243#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_NAND_U_BOOT_DST
244
245/*
246 * Post tests for memory testing
247 */
248#define CONFIG_POST CONFIG_SYS_POST_MEMORY
249#define _POST_WORD_ADDR 0x0
250
Heiko Schocher4dd83492011-11-01 20:00:35 +0000251#define CONFIG_DISPLAY_BOARDINFO
252
253#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK
254
Heiko Schocher6be6db52012-01-16 21:20:09 +0000255#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
256#define CONFIG_SYS_NAND_U_BOOT_SIZE 0xa0000
Heiko Schocher24efef92012-03-07 04:10:00 +0000257#define CONFIG_SYS_NAND_U_BOOT_ERA_SIZE 0x100000
Heiko Schocher4dd83492011-11-01 20:00:35 +0000258
Heiko Schocher4dd83492011-11-01 20:00:35 +0000259/* for UBL header */
260#define CONFIG_SYS_UBL_BLOCK (CONFIG_SYS_NAND_PAGE_SIZE)
261
262#define CONFIG_SYS_DM36x_PLL1_PLLM 0x55
263#define CONFIG_SYS_DM36x_PLL1_PREDIV 0x8005
264#define CONFIG_SYS_DM36x_PLL2_PLLM 0x09
265#define CONFIG_SYS_DM36x_PLL2_PREDIV 0x8000
266#define CONFIG_SYS_DM36x_PERI_CLK_CTRL 0x243F04FC
267#define CONFIG_SYS_DM36x_PLL1_PLLDIV1 0x801b
268#define CONFIG_SYS_DM36x_PLL1_PLLDIV2 0x8001
269/* POST DIV 680/2 = 340Mhz -> MJCP and HDVICP bus interface clock */
270#define CONFIG_SYS_DM36x_PLL1_PLLDIV3 0x8001
271/*
272 * POST DIV 680/4 = 170Mhz -> EDMA/Peripheral CFG0(1/2 MJCP/HDVICP bus
273 * interface clk)
274 */
275#define CONFIG_SYS_DM36x_PLL1_PLLDIV4 0x8003
276/* POST DIV 680/2 = 340Mhz -> VPSS */
277#define CONFIG_SYS_DM36x_PLL1_PLLDIV5 0x8001
278/* POST DIV 680/9 = 75.6 Mhz -> VENC */
279#define CONFIG_SYS_DM36x_PLL1_PLLDIV6 0x8008
280/*
281 * POST DIV 680/1 = 680Mhz -> DDRx2(with internal divider of 2, clock boils
282 * down to 340 Mhz)
283 */
284#define CONFIG_SYS_DM36x_PLL1_PLLDIV7 0x8000
285/* POST DIV 680/7= 97Mhz-> MMC0/SD0 */
286#define CONFIG_SYS_DM36x_PLL1_PLLDIV8 0x8006
287/* POST DIV 680/28 = 24.3Mhz-> CLKOUT */
288#define CONFIG_SYS_DM36x_PLL1_PLLDIV9 0x801b
289
290#define CONFIG_SYS_DM36x_PLL2_PLLDIV1 0x8011
291/* POST DIV 432/1=432 Mhz -> ARM926/(HDVICP block) clk */
292#define CONFIG_SYS_DM36x_PLL2_PLLDIV2 0x8000
293#define CONFIG_SYS_DM36x_PLL2_PLLDIV3 0x8001
294/* POST DIV 432/21= 20.5714 Mhz->VOICE Codec clk */
295#define CONFIG_SYS_DM36x_PLL2_PLLDIV4 0x8014
296/* POST DIV 432/16=27 Mhz -> VENC(For SD modes, requires) */
297#define CONFIG_SYS_DM36x_PLL2_PLLDIV5 0x800f
298
299/*
300 * READ LATENCY 7 (CL + 2)
301 * CONFIG_PWRDNEN = 1
302 * CONFIG_EXT_STRBEN = 1
303 */
304#define CONFIG_SYS_DM36x_DDR2_DDRPHYCR (0 \
305 | DV_DDR_PHY_EXT_STRBEN \
306 | DV_DDR_PHY_PWRDNEN \
307 | (7 << DV_DDR_PHY_RD_LATENCY_SHIFT))
308
309/*
310 * T_RFC = (trfc/DDR_CLK) - 1 = (195 / 2.941) - 1
311 * T_RP = (trp/DDR_CLK) - 1 = (12.5 / 2.941) - 1
312 * T_RCD = (trcd/DDR_CLK) - 1 = (12.5 / 2.941) - 1
313 * T_WR = (twr/DDR_CLK) - 1 = (15 / 2.941) - 1
314 * T_RAS = (tras/DDR_CLK) - 1 = (45 / 2.941) - 1
315 * T_RC = (trc/DDR_CLK) - 1 = (57.5 / 2.941) - 1
316 * T_RRD = (trrd/DDR_CLK) - 1 = (7.5 / 2.941) - 1
317 * T_WTR = (twtr/DDR_CLK) - 1 = (7.5 / 2.941) - 1
318 */
319#define CONFIG_SYS_DM36x_DDR2_SDTIMR (0 \
320 | (66 << DV_DDR_SDTMR1_RFC_SHIFT) \
321 | (4 << DV_DDR_SDTMR1_RP_SHIFT) \
322 | (4 << DV_DDR_SDTMR1_RCD_SHIFT) \
323 | (5 << DV_DDR_SDTMR1_WR_SHIFT) \
324 | (14 << DV_DDR_SDTMR1_RAS_SHIFT) \
325 | (19 << DV_DDR_SDTMR1_RC_SHIFT) \
326 | (2 << DV_DDR_SDTMR1_RRD_SHIFT) \
327 | (2 << DV_DDR_SDTMR1_WTR_SHIFT))
328
329/*
330 * T_RASMAX = (trasmax/refresh_rate) - 1 = (70K / 7812.6) - 1
331 * T_XP = tCKE - 1 = 3 - 2
332 * T_XSNR= ((trfc + 10)/DDR_CLK) - 1 = (205 / 2.941) - 1
333 * T_XSRD = txsrd - 1 = 200 - 1
334 * T_RTP = (trtp/DDR_CLK) - 1 = (7.5 / 2.941) - 1
335 * T_CKE = tcke - 1 = 3 - 1
336 */
337#define CONFIG_SYS_DM36x_DDR2_SDTIMR2 (0 \
338 | (8 << DV_DDR_SDTMR2_RASMAX_SHIFT) \
339 | (2 << DV_DDR_SDTMR2_XP_SHIFT) \
340 | (69 << DV_DDR_SDTMR2_XSNR_SHIFT) \
341 | (199 << DV_DDR_SDTMR2_XSRD_SHIFT) \
342 | (2 << DV_DDR_SDTMR2_RTP_SHIFT) \
343 | (2 << DV_DDR_SDTMR2_CKE_SHIFT))
344
345/* PR_OLD_COUNT = 0xfe */
346#define CONFIG_SYS_DM36x_DDR2_PBBPR 0x000000FE
347/* refresh rate = 0x768 */
348#define CONFIG_SYS_DM36x_DDR2_SDRCR 0x00000768
349
350#define CONFIG_SYS_DM36x_DDR2_SDBCR (0 \
351 | (2 << DV_DDR_SDCR_PAGESIZE_SHIFT) \
352 | (3 << DV_DDR_SDCR_IBANK_SHIFT) \
353 | (5 << DV_DDR_SDCR_CL_SHIFT) \
354 | (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT) \
355 | (1 << DV_DDR_SDCR_TIMUNLOCK_SHIFT) \
356 | (1 << DV_DDR_SDCR_DDREN_SHIFT) \
357 | (0 << DV_DDR_SDCR_DDRDRIVE0_SHIFT) \
358 | (1 << DV_DDR_SDCR_DDR2EN_SHIFT) \
359 | (1 << DV_DDR_SDCR_DDR_DDQS_SHIFT) \
360 | (1 << DV_DDR_SDCR_BOOTUNLOCK_SHIFT))
361
362#define CONFIG_SYS_DM36x_AWCCR 0xff
363#define CONFIG_SYS_DM36x_AB1CR 0x40400204
364#define CONFIG_SYS_DM36x_AB2CR 0x04ca2650
365
366/* All Video Inputs */
367#define CONFIG_SYS_DM36x_PINMUX0 0x00000000
368/*
369 * All Video Outputs,
370 * GPIO 86, 87 + 90 0x0000f030
371 */
372#define CONFIG_SYS_DM36x_PINMUX1 0x00530002
373#define CONFIG_SYS_DM36x_PINMUX2 0x00001815
374/*
375 * SPI1, UART1, I2C, SD0, SD1, McBSP0, CLKOUTs
376 * GPIO 25 0x60000000
377 */
378#define CONFIG_SYS_DM36x_PINMUX3 0x9b5affff
379/*
380 * MMC/SD0 instead of MS, SPI0
381 * GPIO 34 0x0000c000
382 */
383#define CONFIG_SYS_DM36x_PINMUX4 0x00002655
384
385/*
386 * Default environment settings
387 */
Heiko Schocher4dd83492011-11-01 20:00:35 +0000388
389#define DVN4XX_UBOOT_ADDR_R_RAM 0x80000000
390/* (DVN4XX_UBOOT_ADDR_R_RAM + CONFIG_SYS_NAND_PAGE_SIZE) */
391#define DVN4XX_UBOOT_ADDR_R_NAND_SPL 0x80000800
392/*
393 * (DVN4XX_UBOOT_ADDR_R_NAND_SPL + (CONFIG_SYS_NROF_PAGES_NAND_SPL * \
394 * CONFIG_SYS_NAND_PAGE_SIZE))
395 */
396#define DVN4XX_UBOOT_ADDR_R_UBOOT 0x80003800
397
398#define CONFIG_EXTRA_ENV_SETTINGS \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200399 "u_boot_addr_r=" __stringify(DVN4XX_UBOOT_ADDR_R_RAM) "\0" \
400 "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.ubl\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000401 "load=tftp ${u_boot_addr_r} ${u-boot}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200402 "pagesz=" __stringify(CONFIG_SYS_NAND_PAGE_SIZE) "\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000403 "writeheader=nandrbl rbl;nand erase 20000 ${pagesz};" \
404 "nand write ${u_boot_addr_r} 20000 ${pagesz};" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000405 "nandrbl uboot\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000406 "writenand_spl=nandrbl rbl;nand erase 0 3000;" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200407 "nand write " __stringify(DVN4XX_UBOOT_ADDR_R_NAND_SPL) \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000408 " 0 3000;nandrbl uboot\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000409 "writeuboot=nandrbl uboot;" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200410 "nand erase " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " "\
411 __stringify(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
412 ";nand write " __stringify(DVN4XX_UBOOT_ADDR_R_UBOOT) \
413 " " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
414 __stringify(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000415 "update=run load writenand_spl writeuboot\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000416 "bootcmd=run net_nfs\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000417 "rootpath=/opt/eldk-arm/arm\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000418 "mtdids=" MTDIDS_DEFAULT "\0" \
419 "mtdparts=" MTDPARTS_DEFAULT "\0" \
420 "netdev=eth0\0" \
421 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
422 "addmisc=setenv bootargs ${bootargs} app_reset=${app_reset}\0" \
423 "addcon=setenv bootargs ${bootargs} console=ttyS0," \
424 "${baudrate}n8\0" \
425 "addip=setenv bootargs ${bootargs} " \
426 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
427 ":${hostname}:${netdev}:off eth=${ethaddr} panic=1\0" \
428 "rootpath=/opt/eldk-arm/arm\0" \
429 "nfsargs=setenv bootargs root=/dev/nfs rw " \
430 "nfsroot=${serverip}:${rootpath}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200431 "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage \0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000432 "kernel_addr_r=80600000\0" \
433 "load_kernel=tftp ${kernel_addr_r} ${bootfile}\0" \
Joe Hershberger949a7712012-11-01 16:54:18 +0000434 "ubi_load_kernel=ubi part ubi 2048;ubifsmount ubi:${img_volume};" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000435 "ubifsload ${kernel_addr_r} boot/uImage\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200436 "fit_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0" \
437 "img_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0" \
438 "img_file=" __stringify(CONFIG_HOSTNAME) "/ait.itb\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000439 "header_addr=20000\0" \
440 "img_writeheader=nandrbl rbl;" \
441 "nand erase ${header_addr} ${pagesz};" \
442 "nand write ${img_addr_r} ${header_addr} ${pagesz};" \
443 "nandrbl uboot\0" \
444 "img_writespl=nandrbl rbl;nand erase 0 3000;" \
445 "nand write ${img_addr_r} 0 3000;nandrbl uboot\0" \
446 "img_writeuboot=nandrbl uboot;" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200447 "nand erase " __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " "\
448 __stringify(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000449 ";nand write ${img_addr_r} " \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200450 __stringify(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
451 __stringify(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000452 "img_writedfenv=ubi part ubi 2048;" \
453 "ubi write ${img_addr_r} default ${filesize}\0" \
454 "img_volume=rootfs1\0" \
Heiko Schocher24efef92012-03-07 04:10:00 +0000455 "img_writeramdisk=ubi part ubi 2048;" \
Heiko Schocher6be6db52012-01-16 21:20:09 +0000456 "ubi write ${img_addr_r} ${img_volume} ${filesize}\0" \
457 "load_img=tftp ${fit_addr_r} ${img_file}\0" \
458 "net_nfs=run load_kernel; " \
459 "run nfsargs addip addcon addmtd addmisc;" \
460 "bootm ${kernel_addr_r}\0" \
461 "ubi_ubi=run ubi_load_kernel; " \
462 "run ubiargs addip addcon addmtd addmisc;" \
463 "bootm ${kernel_addr_r}\0" \
464 "ubiargs=setenv bootargs ubi.mtd=4,2048" \
465 " root=ubi0:${img_volume} rw rootfstype=ubifs\0" \
466 "app_reset=no\0" \
467 "dvn_app_vers=void\0" \
468 "dvn_boot_vers=void\0" \
469 "savenewvers=run savetmpparms restoreparms; saveenv;" \
470 "run restoretmpparms\0" \
471 "savetmpparms=setenv y_ipaddr ${ipaddr};" \
472 "setenv y_netmask ${netmask};" \
473 "setenv y_serverip ${serverip};" \
474 "setenv y_gatewayip ${gatewayip}\0" \
475 "saveparms=setenv x_ipaddr ${ipaddr};" \
476 "setenv x_netmask ${netmask};" \
477 "setenv x_serverip ${serverip};" \
478 "setenv x_gatewayip ${gatewayip}\0" \
479 "restoreparms=setenv ipaddr ${x_ipaddr};" \
480 "setenv netmask ${x_netmask};" \
481 "setenv serverip ${x_serverip};" \
482 "setenv gatewayip ${x_gatewayip}\0" \
483 "restoretmpparms=setenv ipaddr ${y_ipaddr};" \
484 "setenv netmask ${y_netmask};" \
485 "setenv serverip ${y_serverip};" \
486 "setenv gatewayip ${y_gatewayip}\0" \
Heiko Schocher4dd83492011-11-01 20:00:35 +0000487 "\0"
488
489/* USB Configuration */
490#define CONFIG_USB_DAVINCI
Paul Kocialkowski95de1e22015-08-04 17:04:06 +0200491#define CONFIG_USB_MUSB_HCD
Heiko Schocher4dd83492011-11-01 20:00:35 +0000492#define CONFIG_DV_USBPHY_CTL (USBPHY_SESNDEN | USBPHY_VBDTCTEN | \
493 USBPHY_PHY24MHZ)
494
495#define CONFIG_CMD_USB /* include support for usb cmd */
496#define CONFIG_USB_STORAGE /* MSC class support */
497#define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */
498#define CONFIG_CMD_FAT /* inclue support for FAT/storage */
499#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage */
500
501#undef DAVINCI_DM365EVM
502#define PINMUX4_USBDRVBUS_BITCLEAR 0x3000
503#define PINMUX4_USBDRVBUS_BITSET 0x2000
504
505#endif /* __CONFIG_H */