1649a33e4SStefano Babic /* 2649a33e4SStefano Babic * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ 3649a33e4SStefano Babic * 4649a33e4SStefano Babic * Based on davinci_dvevm.h. Original Copyrights follow: 5649a33e4SStefano Babic * 6649a33e4SStefano Babic * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net> 7649a33e4SStefano Babic * 8649a33e4SStefano Babic * This program is free software; you can redistribute it and/or modify 9649a33e4SStefano Babic * it under the terms of the GNU General Public License as published by 10649a33e4SStefano Babic * the Free Software Foundation; either version 2 of the License, or 11649a33e4SStefano Babic * (at your option) any later version. 12649a33e4SStefano Babic * 13649a33e4SStefano Babic * This program is distributed in the hope that it will be useful, 14649a33e4SStefano Babic * but WITHOUT ANY WARRANTY; without even the implied warranty of 15649a33e4SStefano Babic * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16649a33e4SStefano Babic * GNU General Public License for more details. 17649a33e4SStefano Babic * 18649a33e4SStefano Babic * You should have received a copy of the GNU General Public License 19649a33e4SStefano Babic * along with this program; if not, write to the Free Software 20649a33e4SStefano Babic * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21649a33e4SStefano Babic */ 22649a33e4SStefano Babic 23649a33e4SStefano Babic #ifndef __CONFIG_H 24649a33e4SStefano Babic #define __CONFIG_H 25649a33e4SStefano Babic 26649a33e4SStefano Babic /* 27649a33e4SStefano Babic * Board 28649a33e4SStefano Babic */ 29649a33e4SStefano Babic #define CONFIG_DRIVER_TI_EMAC 30649a33e4SStefano Babic #define CONFIG_USE_SPIFLASH 3117a8904bSStefano Babic #define CONFIG_SYS_USE_NAND 32649a33e4SStefano Babic #define CONFIG_DRIVER_TI_EMAC_USE_RMII 33*2084f21bSStefano Babic #define CONFIG_BOARD_EARLY_INIT_F 34649a33e4SStefano Babic 35649a33e4SStefano Babic /* 36649a33e4SStefano Babic * SoC Configuration 37649a33e4SStefano Babic */ 38649a33e4SStefano Babic #define CONFIG_MACH_DAVINCI_DA850_EVM 39649a33e4SStefano Babic #define CONFIG_ARM926EJS /* arm926ejs CPU core */ 40649a33e4SStefano Babic #define CONFIG_SOC_DA8XX /* TI DA8xx SoC */ 41649a33e4SStefano Babic #define CONFIG_SYS_CLK_FREQ clk_get(DAVINCI_ARM_CLKID) 42649a33e4SStefano Babic #define CONFIG_SYS_OSCIN_FREQ 24000000 43649a33e4SStefano Babic #define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE 44649a33e4SStefano Babic #define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID) 45649a33e4SStefano Babic #define CONFIG_SYS_HZ 1000 46649a33e4SStefano Babic #define CONFIG_SKIP_LOWLEVEL_INIT 47649a33e4SStefano Babic #define CONFIG_SYS_TEXT_BASE 0xc1080000 48649a33e4SStefano Babic 49649a33e4SStefano Babic /* 50649a33e4SStefano Babic * Memory Info 51649a33e4SStefano Babic */ 52649a33e4SStefano Babic #define CONFIG_SYS_MALLOC_LEN (0x10000 + 1*1024*1024) /* malloc() len */ 53649a33e4SStefano Babic #define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */ 54649a33e4SStefano Babic #define PHYS_SDRAM_1_SIZE (64 << 20) /* SDRAM size 64MB */ 55649a33e4SStefano Babic #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/ 56649a33e4SStefano Babic 57649a33e4SStefano Babic /* memtest start addr */ 58649a33e4SStefano Babic #define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + 0x2000000) 59649a33e4SStefano Babic 60649a33e4SStefano Babic /* memtest will be run on 16MB */ 61649a33e4SStefano Babic #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024) 62649a33e4SStefano Babic 63649a33e4SStefano Babic #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ 64649a33e4SStefano Babic #define CONFIG_STACKSIZE (256*1024) /* regular stack */ 65649a33e4SStefano Babic 66649a33e4SStefano Babic /* 67649a33e4SStefano Babic * Serial Driver info 68649a33e4SStefano Babic */ 69649a33e4SStefano Babic #define CONFIG_SYS_NS16550 70649a33e4SStefano Babic #define CONFIG_SYS_NS16550_SERIAL 71649a33e4SStefano Babic #define CONFIG_SYS_NS16550_REG_SIZE -4 /* NS16550 register size */ 72f9fc237fSBastian Ruppert #define CONFIG_SYS_NS16550_COM1 DAVINCI_UART0_BASE /* Base address of UART0 */ 73649a33e4SStefano Babic #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID) 74649a33e4SStefano Babic #define CONFIG_CONS_INDEX 1 /* use UART0 for console */ 75649a33e4SStefano Babic #define CONFIG_BAUDRATE 115200 /* Default baud rate */ 76649a33e4SStefano Babic #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } 77649a33e4SStefano Babic 78649a33e4SStefano Babic #define CONFIG_SPI 79649a33e4SStefano Babic #define CONFIG_SPI_FLASH 80649a33e4SStefano Babic #define CONFIG_SPI_FLASH_STMICRO 81649a33e4SStefano Babic #define CONFIG_DAVINCI_SPI 82649a33e4SStefano Babic #define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE 83649a33e4SStefano Babic #define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID) 84649a33e4SStefano Babic #define CONFIG_SF_DEFAULT_SPEED 30000000 85649a33e4SStefano Babic #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED 86649a33e4SStefano Babic 87649a33e4SStefano Babic /* 88649a33e4SStefano Babic * Network & Ethernet Configuration 89649a33e4SStefano Babic */ 90649a33e4SStefano Babic #ifdef CONFIG_DRIVER_TI_EMAC 91649a33e4SStefano Babic #define CONFIG_MII 92649a33e4SStefano Babic #define CONFIG_BOOTP_DEFAULT 93649a33e4SStefano Babic #define CONFIG_BOOTP_DNS 94649a33e4SStefano Babic #define CONFIG_BOOTP_DNS2 95649a33e4SStefano Babic #define CONFIG_BOOTP_SEND_HOSTNAME 96649a33e4SStefano Babic #define CONFIG_NET_RETRY_COUNT 10 97649a33e4SStefano Babic #endif 98649a33e4SStefano Babic 99649a33e4SStefano Babic #ifdef CONFIG_USE_SPIFLASH 100649a33e4SStefano Babic #undef CONFIG_ENV_IS_IN_FLASH 101649a33e4SStefano Babic #undef CONFIG_ENV_IS_IN_NAND 102649a33e4SStefano Babic #define CONFIG_ENV_IS_IN_SPI_FLASH 103649a33e4SStefano Babic #define CONFIG_ENV_SIZE (8 << 10) 10417a8904bSStefano Babic #define CONFIG_ENV_OFFSET 0x80000 105649a33e4SStefano Babic #define CONFIG_ENV_SECT_SIZE (64 << 10) 106649a33e4SStefano Babic #define CONFIG_SYS_NO_FLASH 107649a33e4SStefano Babic #endif 108649a33e4SStefano Babic 109649a33e4SStefano Babic /* 110649a33e4SStefano Babic * U-Boot general configuration 111649a33e4SStefano Babic */ 112649a33e4SStefano Babic #define CONFIG_BOOTFILE "uImage" /* Boot file name */ 113649a33e4SStefano Babic #define CONFIG_SYS_PROMPT "ea20 > " /* Command Prompt */ 114649a33e4SStefano Babic #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ 115649a33e4SStefano Babic #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) 116649a33e4SStefano Babic #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ 117649a33e4SStefano Babic #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */ 118649a33e4SStefano Babic #define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x700000) 119649a33e4SStefano Babic #define CONFIG_VERSION_VARIABLE 120649a33e4SStefano Babic #define CONFIG_AUTO_COMPLETE 121649a33e4SStefano Babic #define CONFIG_SYS_HUSH_PARSER 122649a33e4SStefano Babic #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " 123649a33e4SStefano Babic #define CONFIG_CMDLINE_EDITING 124649a33e4SStefano Babic #define CONFIG_SYS_LONGHELP 125649a33e4SStefano Babic #define CONFIG_CRC32_VERIFY 126649a33e4SStefano Babic #define CONFIG_MX_CYCLIC 127649a33e4SStefano Babic 128649a33e4SStefano Babic /* 129649a33e4SStefano Babic * Linux Information 130649a33e4SStefano Babic */ 131649a33e4SStefano Babic #define LINUX_BOOT_PARAM_ADDR (PHYS_SDRAM_1 + 0x100) 132649a33e4SStefano Babic #define CONFIG_CMDLINE_TAG 133649a33e4SStefano Babic #define CONFIG_SETUP_MEMORY_TAGS 134649a33e4SStefano Babic #define CONFIG_BOOTDELAY 3 135649a33e4SStefano Babic 136649a33e4SStefano Babic /* 137649a33e4SStefano Babic * U-Boot commands 138649a33e4SStefano Babic */ 139649a33e4SStefano Babic #include <config_cmd_default.h> 140649a33e4SStefano Babic #define CONFIG_CMD_ENV 141649a33e4SStefano Babic #define CONFIG_CMD_ASKENV 142649a33e4SStefano Babic #define CONFIG_CMD_DHCP 143649a33e4SStefano Babic #define CONFIG_CMD_DIAG 144649a33e4SStefano Babic #define CONFIG_CMD_MII 145649a33e4SStefano Babic #define CONFIG_CMD_PING 146649a33e4SStefano Babic #define CONFIG_CMD_SAVES 147649a33e4SStefano Babic #define CONFIG_CMD_MEMORY 148649a33e4SStefano Babic 149649a33e4SStefano Babic #ifndef CONFIG_DRIVER_TI_EMAC 150649a33e4SStefano Babic #undef CONFIG_CMD_NET 151649a33e4SStefano Babic #undef CONFIG_CMD_DHCP 152649a33e4SStefano Babic #undef CONFIG_CMD_MII 153649a33e4SStefano Babic #undef CONFIG_CMD_PING 154649a33e4SStefano Babic #endif 155649a33e4SStefano Babic 15617a8904bSStefano Babic /* NAND Setup */ 15717a8904bSStefano Babic #ifdef CONFIG_SYS_USE_NAND 158649a33e4SStefano Babic #undef CONFIG_CMD_FLASH 159649a33e4SStefano Babic #undef CONFIG_CMD_IMLS 160649a33e4SStefano Babic #define CONFIG_CMD_NAND 161649a33e4SStefano Babic 162649a33e4SStefano Babic #define CONFIG_CMD_MTDPARTS 163649a33e4SStefano Babic #define CONFIG_MTD_DEVICE 164649a33e4SStefano Babic #define CONFIG_MTD_PARTITIONS 165649a33e4SStefano Babic #define CONFIG_LZO 166649a33e4SStefano Babic #define CONFIG_RBTREE 167649a33e4SStefano Babic #define CONFIG_CMD_UBI 168649a33e4SStefano Babic #define CONFIG_CMD_UBIFS 16917a8904bSStefano Babic 17017a8904bSStefano Babic #define CONFIG_NAND_DAVINCI 17117a8904bSStefano Babic #define CONFIG_SYS_NAND_PAGE_2K 17217a8904bSStefano Babic #define CONFIG_SYS_NAND_CS 2 17317a8904bSStefano Babic #define CONFIG_SYS_NAND_BASE DAVINCI_ASYNC_EMIF_DATA_CE2_BASE 17417a8904bSStefano Babic #undef CONFIG_SYS_NAND_HW_ECC 17517a8904bSStefano Babic #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST 17617a8904bSStefano Babic #define CONFIG_SYS_NAND_USE_FLASH_BBT 17717a8904bSStefano Babic #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND devices */ 17817a8904bSStefano Babic #define NAND_MAX_CHIPS 1 17917a8904bSStefano Babic #define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */ 180649a33e4SStefano Babic #endif 181649a33e4SStefano Babic 18217a8904bSStefano Babic /* SPI Flash */ 183649a33e4SStefano Babic #ifdef CONFIG_USE_SPIFLASH 184649a33e4SStefano Babic #undef CONFIG_CMD_IMLS 185649a33e4SStefano Babic #undef CONFIG_CMD_FLASH 186649a33e4SStefano Babic #define CONFIG_CMD_SPI 187649a33e4SStefano Babic #define CONFIG_CMD_SF 188649a33e4SStefano Babic #define CONFIG_CMD_SAVEENV 189649a33e4SStefano Babic #endif 190649a33e4SStefano Babic 19117a8904bSStefano Babic #if !defined(CONFIG_SYS_USE_NAND) && \ 192649a33e4SStefano Babic !defined(CONFIG_USE_NOR) && \ 193649a33e4SStefano Babic !defined(CONFIG_USE_SPIFLASH) 194649a33e4SStefano Babic #define CONFIG_ENV_IS_NOWHERE 195649a33e4SStefano Babic #define CONFIG_SYS_NO_FLASH 196649a33e4SStefano Babic #define CONFIG_ENV_SIZE (16 << 10) 197649a33e4SStefano Babic #undef CONFIG_CMD_IMLS 198649a33e4SStefano Babic #undef CONFIG_CMD_ENV 199649a33e4SStefano Babic #endif 200649a33e4SStefano Babic 201649a33e4SStefano Babic /* additions for new relocation code, must added to all boards */ 202649a33e4SStefano Babic #define CONFIG_SYS_SDRAM_BASE 0xc0000000 203649a33e4SStefano Babic #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - \ 204649a33e4SStefano Babic GENERATED_GBL_DATA_SIZE) 205*2084f21bSStefano Babic /* 206*2084f21bSStefano Babic * Default environment and default scripts 207*2084f21bSStefano Babic * to update uboot and load kernel 208*2084f21bSStefano Babic */ 209*2084f21bSStefano Babic #define xstr(s) str(s) 210*2084f21bSStefano Babic #define str(s) #s 211*2084f21bSStefano Babic 212*2084f21bSStefano Babic 213*2084f21bSStefano Babic #define CONFIG_HOSTNAME ea20 214*2084f21bSStefano Babic #define CONFIG_EXTRA_ENV_SETTINGS \ 215*2084f21bSStefano Babic "as=3\0" \ 216*2084f21bSStefano Babic "netdev=eth0\0" \ 217*2084f21bSStefano Babic "nfsargs=setenv bootargs root=/dev/nfs rw " \ 218*2084f21bSStefano Babic "nfsroot=${serverip}:${rootpath}\0" \ 219*2084f21bSStefano Babic "rfsbargs=setenv bootargs root=/dev/nfs rw " \ 220*2084f21bSStefano Babic "nfsroot=${serverip}:${rfsbpath}\0" \ 221*2084f21bSStefano Babic "ramargs=setenv bootargs root=/dev/ram rw\0" \ 222*2084f21bSStefano Babic "mtdids=nand0=davinci_nand.0\0" \ 223*2084f21bSStefano Babic "mtdparts=mtdparts=davinci_nand.0:8m(Settings),8m(aKernel)," \ 224*2084f21bSStefano Babic "8m(bKernel),76m(aRootfs),76m(bRootfs),-(MassSD)\0" \ 225*2084f21bSStefano Babic "nandargs=setenv bootargs rootfstype=ubifs ro chk_data_crc " \ 226*2084f21bSStefano Babic "ubi.mtd=${as} root=ubi0:rootfs\0" \ 227*2084f21bSStefano Babic "addip_sta=setenv bootargs ${bootargs} " \ 228*2084f21bSStefano Babic "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ 229*2084f21bSStefano Babic ":${hostname}:${netdev}:off panic=1\0" \ 230*2084f21bSStefano Babic "addip_dyn=setenv bootargs ${bootargs} ip=dhcp\0" \ 231*2084f21bSStefano Babic "addip=if test -n ${ipdyn};then run addip_dyn;" \ 232*2084f21bSStefano Babic "else run addip_sta;fi\0" \ 233*2084f21bSStefano Babic "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ 234*2084f21bSStefano Babic "addtty=setenv bootargs ${bootargs}" \ 235*2084f21bSStefano Babic " console=${consoledev},${baudrate}n8\0" \ 236*2084f21bSStefano Babic "addmisc=setenv bootargs ${bootargs} ${misc}\0" \ 237*2084f21bSStefano Babic "addmem=setenv bootargs ${bootargs} mem=${memory}\0" \ 238*2084f21bSStefano Babic "consoledev=ttyS0\0" \ 239*2084f21bSStefano Babic "loadaddr=c0000014\0" \ 240*2084f21bSStefano Babic "memory=32M\0" \ 241*2084f21bSStefano Babic "kernel_addr_r=c0700000\0" \ 242*2084f21bSStefano Babic "hostname=" xstr(CONFIG_HOSTNAME) "\0" \ 243*2084f21bSStefano Babic "bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0" \ 244*2084f21bSStefano Babic "ramdisk_file=" xstr(CONFIG_HOSTNAME) "/uRamdisk\0" \ 245*2084f21bSStefano Babic "flash_self=run ramargs addip addtty addmtd addmisc addmem;" \ 246*2084f21bSStefano Babic "bootm ${kernel_addr} ${ramdisk_addr}\0" \ 247*2084f21bSStefano Babic "flash_nfs=run nfsargs addip addtty addmtd addmisc addmem;" \ 248*2084f21bSStefano Babic "bootm ${kernel_addr}\0" \ 249*2084f21bSStefano Babic "net_nfs=tftp ${kernel_addr_r} ${bootfile}; " \ 250*2084f21bSStefano Babic "run nfsargs addip addtty addmtd addmisc addmem;" \ 251*2084f21bSStefano Babic "bootm ${kernel_addr_r}\0" \ 252*2084f21bSStefano Babic "net_rfsb=tftp ${kernel_addr_r} ${bootfile}; " \ 253*2084f21bSStefano Babic "run rfsbargs addip addtty addmtd addmisc addmem; " \ 254*2084f21bSStefano Babic "bootm ${kernel_addr_r}\0" \ 255*2084f21bSStefano Babic "net_self_load=tftp ${kernel_addr_r} ${bootfile};" \ 256*2084f21bSStefano Babic "tftp ${ramdisk_addr_r} ${ramdisk_file};\0" \ 257*2084f21bSStefano Babic "nand_nand=ubi part nand0,${as};ubifsmount rootfs;" \ 258*2084f21bSStefano Babic "ubifsload ${kernel_addr_r} /boot/uImage;" \ 259*2084f21bSStefano Babic "ubifsumount; run nandargs addip addtty " \ 260*2084f21bSStefano Babic "addmtd addmisc addmem;bootm ${kernel_addr_r}\0" \ 261*2084f21bSStefano Babic "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin\0" \ 262*2084f21bSStefano Babic "load_magic=if sf probe 0;then sf " \ 263*2084f21bSStefano Babic "read c0000000 0x10000 0x60000;fi\0" \ 264*2084f21bSStefano Babic "load_nand=ubi part nand0,${as};ubifsmount rootfs;" \ 265*2084f21bSStefano Babic "if ubifsload c0000014 /boot/u-boot.bin;" \ 266*2084f21bSStefano Babic "then mw c0000008 ${filesize};else echo Error reading " \ 267*2084f21bSStefano Babic "u-boot from nand!;fi\0" \ 268*2084f21bSStefano Babic "load_net=if sf probe 0;then sf read c0000000 0x10000 0x60000;" \ 269*2084f21bSStefano Babic "tftp c0000014 ${u-boot};" \ 270*2084f21bSStefano Babic "mw c0000008 ${filesize};" \ 271*2084f21bSStefano Babic "fi\0" \ 272*2084f21bSStefano Babic "upd=if sf probe 0;then sf erase 10000 60000;" \ 273*2084f21bSStefano Babic "sf write c0000000 10000 60000;" \ 274*2084f21bSStefano Babic "fi\0" \ 275*2084f21bSStefano Babic "ubootupd_net=if run load_net;then echo Updating u-boot;" \ 276*2084f21bSStefano Babic "if run upd; then echo U-Boot updated;" \ 277*2084f21bSStefano Babic "else echo Error updating u-boot !;" \ 278*2084f21bSStefano Babic "echo Board without bootloader !!;" \ 279*2084f21bSStefano Babic "fi;" \ 280*2084f21bSStefano Babic "else echo U-Boot not downloaded..exiting;fi\0" \ 281*2084f21bSStefano Babic "ubootupd_nand=echo run load_magic,run load_nand,run upd;\0" \ 282*2084f21bSStefano Babic "bootcmd=run net_nfs\0" 283*2084f21bSStefano Babic 284649a33e4SStefano Babic #endif /* __CONFIG_H */ 285