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