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 332084f21bSStefano Babic #define CONFIG_BOARD_EARLY_INIT_F 34e5ee9125SBastian Ruppert #define BOARD_LATE_INIT 353c891011SStefano Babic #define CONFIG_VIDEO 36*92e86c8dSStefano Babic #define CONFIG_PREBOOT 37649a33e4SStefano Babic 38649a33e4SStefano Babic /* 39649a33e4SStefano Babic * SoC Configuration 40649a33e4SStefano Babic */ 41649a33e4SStefano Babic #define CONFIG_MACH_DAVINCI_DA850_EVM 42649a33e4SStefano Babic #define CONFIG_ARM926EJS /* arm926ejs CPU core */ 43649a33e4SStefano Babic #define CONFIG_SOC_DA8XX /* TI DA8xx SoC */ 44649a33e4SStefano Babic #define CONFIG_SYS_CLK_FREQ clk_get(DAVINCI_ARM_CLKID) 45649a33e4SStefano Babic #define CONFIG_SYS_OSCIN_FREQ 24000000 46649a33e4SStefano Babic #define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE 47649a33e4SStefano Babic #define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID) 48649a33e4SStefano Babic #define CONFIG_SYS_HZ 1000 49649a33e4SStefano Babic #define CONFIG_SKIP_LOWLEVEL_INIT 50649a33e4SStefano Babic #define CONFIG_SYS_TEXT_BASE 0xc1080000 51649a33e4SStefano Babic 52649a33e4SStefano Babic /* 53649a33e4SStefano Babic * Memory Info 54649a33e4SStefano Babic */ 553c891011SStefano Babic #define CONFIG_SYS_MALLOC_LEN (0x10000 + 4*1024*1024) /* malloc() len */ 56649a33e4SStefano Babic #define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */ 57649a33e4SStefano Babic #define PHYS_SDRAM_1_SIZE (64 << 20) /* SDRAM size 64MB */ 58649a33e4SStefano Babic #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/ 59649a33e4SStefano Babic 60649a33e4SStefano Babic /* memtest start addr */ 61649a33e4SStefano Babic #define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + 0x2000000) 62649a33e4SStefano Babic 63649a33e4SStefano Babic /* memtest will be run on 16MB */ 64649a33e4SStefano Babic #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024) 65649a33e4SStefano Babic 66649a33e4SStefano Babic #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ 67649a33e4SStefano Babic #define CONFIG_STACKSIZE (256*1024) /* regular stack */ 68649a33e4SStefano Babic 69649a33e4SStefano Babic /* 70649a33e4SStefano Babic * Serial Driver info 71649a33e4SStefano Babic */ 72649a33e4SStefano Babic #define CONFIG_SYS_NS16550 73649a33e4SStefano Babic #define CONFIG_SYS_NS16550_SERIAL 74649a33e4SStefano Babic #define CONFIG_SYS_NS16550_REG_SIZE -4 /* NS16550 register size */ 75f9fc237fSBastian Ruppert #define CONFIG_SYS_NS16550_COM1 DAVINCI_UART0_BASE /* Base address of UART0 */ 76649a33e4SStefano Babic #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID) 77649a33e4SStefano Babic #define CONFIG_CONS_INDEX 1 /* use UART0 for console */ 78649a33e4SStefano Babic #define CONFIG_BAUDRATE 115200 /* Default baud rate */ 79649a33e4SStefano Babic #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } 80649a33e4SStefano Babic 81649a33e4SStefano Babic #define CONFIG_SPI 82649a33e4SStefano Babic #define CONFIG_SPI_FLASH 83649a33e4SStefano Babic #define CONFIG_SPI_FLASH_STMICRO 84649a33e4SStefano Babic #define CONFIG_DAVINCI_SPI 85649a33e4SStefano Babic #define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE 86649a33e4SStefano Babic #define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID) 87649a33e4SStefano Babic #define CONFIG_SF_DEFAULT_SPEED 30000000 88649a33e4SStefano Babic #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED 89649a33e4SStefano Babic 90649a33e4SStefano Babic /* 914205987aSStefano Babic * I2C Configuration 924205987aSStefano Babic */ 934205987aSStefano Babic #define CONFIG_HARD_I2C 944205987aSStefano Babic #define CONFIG_DRIVER_DAVINCI_I2C 954205987aSStefano Babic #define CONFIG_SYS_I2C_SPEED 100000 964205987aSStefano Babic 974205987aSStefano Babic /* 98649a33e4SStefano Babic * Network & Ethernet Configuration 99649a33e4SStefano Babic */ 100649a33e4SStefano Babic #ifdef CONFIG_DRIVER_TI_EMAC 101649a33e4SStefano Babic #define CONFIG_MII 102649a33e4SStefano Babic #define CONFIG_BOOTP_DEFAULT 103649a33e4SStefano Babic #define CONFIG_BOOTP_DNS 104649a33e4SStefano Babic #define CONFIG_BOOTP_DNS2 105649a33e4SStefano Babic #define CONFIG_BOOTP_SEND_HOSTNAME 106649a33e4SStefano Babic #define CONFIG_NET_RETRY_COUNT 10 107649a33e4SStefano Babic #endif 108649a33e4SStefano Babic 109649a33e4SStefano Babic #ifdef CONFIG_USE_SPIFLASH 110649a33e4SStefano Babic #undef CONFIG_ENV_IS_IN_FLASH 111649a33e4SStefano Babic #undef CONFIG_ENV_IS_IN_NAND 112649a33e4SStefano Babic #define CONFIG_ENV_IS_IN_SPI_FLASH 113649a33e4SStefano Babic #define CONFIG_ENV_SIZE (8 << 10) 11417a8904bSStefano Babic #define CONFIG_ENV_OFFSET 0x80000 115649a33e4SStefano Babic #define CONFIG_ENV_SECT_SIZE (64 << 10) 116649a33e4SStefano Babic #define CONFIG_SYS_NO_FLASH 117649a33e4SStefano Babic #endif 118649a33e4SStefano Babic 1193c891011SStefano Babic 1203c891011SStefano Babic #if defined(CONFIG_VIDEO) 1213c891011SStefano Babic #define CONFIG_VIDEO_DA8XX 1223c891011SStefano Babic #define CONFIG_CFB_CONSOLE 1233c891011SStefano Babic #define CONFIG_VGA_AS_SINGLE_DEVICE 1243c891011SStefano Babic #define CONFIG_SPLASH_SCREEN 1253c891011SStefano Babic #define CONFIG_VIDEO_LOGO 1263c891011SStefano Babic #define CONFIG_VIDEO_BMP_RLE8 1273c891011SStefano Babic #define CONFIG_CMD_BMP 1283c891011SStefano Babic #endif 1293c891011SStefano Babic 130649a33e4SStefano Babic /* 131649a33e4SStefano Babic * U-Boot general configuration 132649a33e4SStefano Babic */ 133649a33e4SStefano Babic #define CONFIG_BOOTFILE "uImage" /* Boot file name */ 134649a33e4SStefano Babic #define CONFIG_SYS_PROMPT "ea20 > " /* Command Prompt */ 135649a33e4SStefano Babic #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ 136649a33e4SStefano Babic #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) 137649a33e4SStefano Babic #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ 138649a33e4SStefano Babic #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */ 139649a33e4SStefano Babic #define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x700000) 140649a33e4SStefano Babic #define CONFIG_VERSION_VARIABLE 141649a33e4SStefano Babic #define CONFIG_AUTO_COMPLETE 142649a33e4SStefano Babic #define CONFIG_SYS_HUSH_PARSER 143649a33e4SStefano Babic #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " 144649a33e4SStefano Babic #define CONFIG_CMDLINE_EDITING 145649a33e4SStefano Babic #define CONFIG_SYS_LONGHELP 146649a33e4SStefano Babic #define CONFIG_CRC32_VERIFY 147649a33e4SStefano Babic #define CONFIG_MX_CYCLIC 148649a33e4SStefano Babic 149649a33e4SStefano Babic /* 150649a33e4SStefano Babic * Linux Information 151649a33e4SStefano Babic */ 152649a33e4SStefano Babic #define LINUX_BOOT_PARAM_ADDR (PHYS_SDRAM_1 + 0x100) 153649a33e4SStefano Babic #define CONFIG_CMDLINE_TAG 154649a33e4SStefano Babic #define CONFIG_SETUP_MEMORY_TAGS 155649a33e4SStefano Babic #define CONFIG_BOOTDELAY 3 156649a33e4SStefano Babic 157649a33e4SStefano Babic /* 158649a33e4SStefano Babic * U-Boot commands 159649a33e4SStefano Babic */ 160649a33e4SStefano Babic #include <config_cmd_default.h> 161649a33e4SStefano Babic #define CONFIG_CMD_ENV 162649a33e4SStefano Babic #define CONFIG_CMD_ASKENV 163649a33e4SStefano Babic #define CONFIG_CMD_DHCP 164649a33e4SStefano Babic #define CONFIG_CMD_DIAG 165649a33e4SStefano Babic #define CONFIG_CMD_MII 166649a33e4SStefano Babic #define CONFIG_CMD_PING 167649a33e4SStefano Babic #define CONFIG_CMD_SAVES 168649a33e4SStefano Babic #define CONFIG_CMD_MEMORY 1694205987aSStefano Babic #define CONFIG_CMD_I2C 170649a33e4SStefano Babic 171649a33e4SStefano Babic #ifndef CONFIG_DRIVER_TI_EMAC 172649a33e4SStefano Babic #undef CONFIG_CMD_NET 173649a33e4SStefano Babic #undef CONFIG_CMD_DHCP 174649a33e4SStefano Babic #undef CONFIG_CMD_MII 175649a33e4SStefano Babic #undef CONFIG_CMD_PING 176649a33e4SStefano Babic #endif 177649a33e4SStefano Babic 17817a8904bSStefano Babic /* NAND Setup */ 17917a8904bSStefano Babic #ifdef CONFIG_SYS_USE_NAND 180649a33e4SStefano Babic #undef CONFIG_CMD_FLASH 181649a33e4SStefano Babic #undef CONFIG_CMD_IMLS 182649a33e4SStefano Babic #define CONFIG_CMD_NAND 183649a33e4SStefano Babic 184649a33e4SStefano Babic #define CONFIG_CMD_MTDPARTS 185649a33e4SStefano Babic #define CONFIG_MTD_DEVICE 186649a33e4SStefano Babic #define CONFIG_MTD_PARTITIONS 187649a33e4SStefano Babic #define CONFIG_LZO 188649a33e4SStefano Babic #define CONFIG_RBTREE 189649a33e4SStefano Babic #define CONFIG_CMD_UBI 190649a33e4SStefano Babic #define CONFIG_CMD_UBIFS 19117a8904bSStefano Babic 19217a8904bSStefano Babic #define CONFIG_NAND_DAVINCI 19317a8904bSStefano Babic #define CONFIG_SYS_NAND_PAGE_2K 19417a8904bSStefano Babic #define CONFIG_SYS_NAND_CS 2 19517a8904bSStefano Babic #define CONFIG_SYS_NAND_BASE DAVINCI_ASYNC_EMIF_DATA_CE2_BASE 19617a8904bSStefano Babic #undef CONFIG_SYS_NAND_HW_ECC 19717a8904bSStefano Babic #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST 19817a8904bSStefano Babic #define CONFIG_SYS_NAND_USE_FLASH_BBT 19917a8904bSStefano Babic #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND devices */ 20017a8904bSStefano Babic #define NAND_MAX_CHIPS 1 20117a8904bSStefano Babic #define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */ 202649a33e4SStefano Babic #endif 203649a33e4SStefano Babic 20417a8904bSStefano Babic /* SPI Flash */ 205649a33e4SStefano Babic #ifdef CONFIG_USE_SPIFLASH 206649a33e4SStefano Babic #undef CONFIG_CMD_IMLS 207649a33e4SStefano Babic #undef CONFIG_CMD_FLASH 208649a33e4SStefano Babic #define CONFIG_CMD_SPI 209649a33e4SStefano Babic #define CONFIG_CMD_SF 210649a33e4SStefano Babic #define CONFIG_CMD_SAVEENV 211649a33e4SStefano Babic #endif 212649a33e4SStefano Babic 21317a8904bSStefano Babic #if !defined(CONFIG_SYS_USE_NAND) && \ 214649a33e4SStefano Babic !defined(CONFIG_USE_NOR) && \ 215649a33e4SStefano Babic !defined(CONFIG_USE_SPIFLASH) 216649a33e4SStefano Babic #define CONFIG_ENV_IS_NOWHERE 217649a33e4SStefano Babic #define CONFIG_SYS_NO_FLASH 218649a33e4SStefano Babic #define CONFIG_ENV_SIZE (16 << 10) 219649a33e4SStefano Babic #undef CONFIG_CMD_IMLS 220649a33e4SStefano Babic #undef CONFIG_CMD_ENV 221649a33e4SStefano Babic #endif 222649a33e4SStefano Babic 223649a33e4SStefano Babic /* additions for new relocation code, must added to all boards */ 224649a33e4SStefano Babic #define CONFIG_SYS_SDRAM_BASE 0xc0000000 225649a33e4SStefano Babic #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - \ 226649a33e4SStefano Babic GENERATED_GBL_DATA_SIZE) 2272084f21bSStefano Babic /* 2282084f21bSStefano Babic * Default environment and default scripts 2292084f21bSStefano Babic * to update uboot and load kernel 2302084f21bSStefano Babic */ 2312084f21bSStefano Babic #define xstr(s) str(s) 2322084f21bSStefano Babic #define str(s) #s 2332084f21bSStefano Babic 2342084f21bSStefano Babic 2352084f21bSStefano Babic #define CONFIG_HOSTNAME ea20 2362084f21bSStefano Babic #define CONFIG_EXTRA_ENV_SETTINGS \ 2372084f21bSStefano Babic "as=3\0" \ 2382084f21bSStefano Babic "netdev=eth0\0" \ 2392084f21bSStefano Babic "nfsargs=setenv bootargs root=/dev/nfs rw " \ 2402084f21bSStefano Babic "nfsroot=${serverip}:${rootpath}\0" \ 2412084f21bSStefano Babic "rfsbargs=setenv bootargs root=/dev/nfs rw " \ 2422084f21bSStefano Babic "nfsroot=${serverip}:${rfsbpath}\0" \ 2432084f21bSStefano Babic "ramargs=setenv bootargs root=/dev/ram rw\0" \ 2442084f21bSStefano Babic "mtdids=nand0=davinci_nand.0\0" \ 2452084f21bSStefano Babic "mtdparts=mtdparts=davinci_nand.0:8m(Settings),8m(aKernel)," \ 2462084f21bSStefano Babic "8m(bKernel),76m(aRootfs),76m(bRootfs),-(MassSD)\0" \ 2472084f21bSStefano Babic "nandargs=setenv bootargs rootfstype=ubifs ro chk_data_crc " \ 2482084f21bSStefano Babic "ubi.mtd=${as} root=ubi0:rootfs\0" \ 2492084f21bSStefano Babic "addip_sta=setenv bootargs ${bootargs} " \ 2502084f21bSStefano Babic "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ 2512084f21bSStefano Babic ":${hostname}:${netdev}:off panic=1\0" \ 2522084f21bSStefano Babic "addip_dyn=setenv bootargs ${bootargs} ip=dhcp\0" \ 2532084f21bSStefano Babic "addip=if test -n ${ipdyn};then run addip_dyn;" \ 2542084f21bSStefano Babic "else run addip_sta;fi\0" \ 2552084f21bSStefano Babic "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ 2562084f21bSStefano Babic "addtty=setenv bootargs ${bootargs}" \ 2572084f21bSStefano Babic " console=${consoledev},${baudrate}n8\0" \ 2582084f21bSStefano Babic "addmisc=setenv bootargs ${bootargs} ${misc}\0" \ 2592084f21bSStefano Babic "addmem=setenv bootargs ${bootargs} mem=${memory}\0" \ 2602084f21bSStefano Babic "consoledev=ttyS0\0" \ 2612084f21bSStefano Babic "loadaddr=c0000014\0" \ 2622084f21bSStefano Babic "memory=32M\0" \ 2632084f21bSStefano Babic "kernel_addr_r=c0700000\0" \ 2642084f21bSStefano Babic "hostname=" xstr(CONFIG_HOSTNAME) "\0" \ 2652084f21bSStefano Babic "bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0" \ 2662084f21bSStefano Babic "ramdisk_file=" xstr(CONFIG_HOSTNAME) "/uRamdisk\0" \ 2672084f21bSStefano Babic "flash_self=run ramargs addip addtty addmtd addmisc addmem;" \ 2682084f21bSStefano Babic "bootm ${kernel_addr} ${ramdisk_addr}\0" \ 2692084f21bSStefano Babic "flash_nfs=run nfsargs addip addtty addmtd addmisc addmem;" \ 2702084f21bSStefano Babic "bootm ${kernel_addr}\0" \ 2712084f21bSStefano Babic "net_nfs=tftp ${kernel_addr_r} ${bootfile}; " \ 2722084f21bSStefano Babic "run nfsargs addip addtty addmtd addmisc addmem;" \ 2732084f21bSStefano Babic "bootm ${kernel_addr_r}\0" \ 2742084f21bSStefano Babic "net_rfsb=tftp ${kernel_addr_r} ${bootfile}; " \ 2752084f21bSStefano Babic "run rfsbargs addip addtty addmtd addmisc addmem; " \ 2762084f21bSStefano Babic "bootm ${kernel_addr_r}\0" \ 2772084f21bSStefano Babic "net_self_load=tftp ${kernel_addr_r} ${bootfile};" \ 2782084f21bSStefano Babic "tftp ${ramdisk_addr_r} ${ramdisk_file};\0" \ 2792084f21bSStefano Babic "nand_nand=ubi part nand0,${as};ubifsmount rootfs;" \ 2802084f21bSStefano Babic "ubifsload ${kernel_addr_r} /boot/uImage;" \ 2812084f21bSStefano Babic "ubifsumount; run nandargs addip addtty " \ 2822084f21bSStefano Babic "addmtd addmisc addmem;bootm ${kernel_addr_r}\0" \ 2832084f21bSStefano Babic "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin\0" \ 2842084f21bSStefano Babic "load_magic=if sf probe 0;then sf " \ 2852084f21bSStefano Babic "read c0000000 0x10000 0x60000;fi\0" \ 2862084f21bSStefano Babic "load_nand=ubi part nand0,${as};ubifsmount rootfs;" \ 2872084f21bSStefano Babic "if ubifsload c0000014 /boot/u-boot.bin;" \ 2882084f21bSStefano Babic "then mw c0000008 ${filesize};else echo Error reading " \ 2892084f21bSStefano Babic "u-boot from nand!;fi\0" \ 2902084f21bSStefano Babic "load_net=if sf probe 0;then sf read c0000000 0x10000 0x60000;" \ 2912084f21bSStefano Babic "tftp c0000014 ${u-boot};" \ 2922084f21bSStefano Babic "mw c0000008 ${filesize};" \ 2932084f21bSStefano Babic "fi\0" \ 2942084f21bSStefano Babic "upd=if sf probe 0;then sf erase 10000 60000;" \ 2952084f21bSStefano Babic "sf write c0000000 10000 60000;" \ 2962084f21bSStefano Babic "fi\0" \ 2972084f21bSStefano Babic "ubootupd_net=if run load_net;then echo Updating u-boot;" \ 2982084f21bSStefano Babic "if run upd; then echo U-Boot updated;" \ 2992084f21bSStefano Babic "else echo Error updating u-boot !;" \ 3002084f21bSStefano Babic "echo Board without bootloader !!;" \ 3012084f21bSStefano Babic "fi;" \ 3022084f21bSStefano Babic "else echo U-Boot not downloaded..exiting;fi\0" \ 3032084f21bSStefano Babic "ubootupd_nand=echo run load_magic,run load_nand,run upd;\0" \ 3042084f21bSStefano Babic "bootcmd=run net_nfs\0" 3052084f21bSStefano Babic 306649a33e4SStefano Babic #endif /* __CONFIG_H */ 307