152a822edSMichal Simek /* 252a822edSMichal Simek * (C) Copyright 2007-2008 Michal Simek 352a822edSMichal Simek * 452a822edSMichal Simek * Michal SIMEK <monstr@monstr.eu> 552a822edSMichal Simek * 652a822edSMichal Simek * See file CREDITS for list of people who contributed to this 752a822edSMichal Simek * project. 852a822edSMichal Simek * 952a822edSMichal Simek * This program is free software; you can redistribute it and/or 1052a822edSMichal Simek * modify it under the terms of the GNU General Public License as 1152a822edSMichal Simek * published by the Free Software Foundation; either version 2 of 1252a822edSMichal Simek * the License, or (at your option) any later version. 1352a822edSMichal Simek * 1452a822edSMichal Simek * This program is distributed in the hope that it will be useful, 1552a822edSMichal Simek * but WITHOUT ANY WARRANTY; without even the implied warranty of 1652a822edSMichal Simek * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1752a822edSMichal Simek * GNU General Public License for more details. 1852a822edSMichal Simek * 1952a822edSMichal Simek * You should have received a copy of the GNU General Public License 2052a822edSMichal Simek * along with this program; if not, write to the Free Software 2152a822edSMichal Simek * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 2252a822edSMichal Simek * MA 02111-1307 USA 2352a822edSMichal Simek */ 2452a822edSMichal Simek 2552a822edSMichal Simek #ifndef __CONFIG_H 2652a822edSMichal Simek #define __CONFIG_H 2752a822edSMichal Simek 2852a822edSMichal Simek #include "../board/xilinx/microblaze-generic/xparameters.h" 2952a822edSMichal Simek 3052a822edSMichal Simek #define CONFIG_MICROBLAZE 1 /* MicroBlaze CPU */ 3152a822edSMichal Simek #define MICROBLAZE_V5 1 3252a822edSMichal Simek 3352a822edSMichal Simek /* uart */ 3452a822edSMichal Simek #ifdef XILINX_UARTLITE_BASEADDR 3552a822edSMichal Simek #define CONFIG_XILINX_UARTLITE 3652a822edSMichal Simek #define CONFIG_SERIAL_BASE XILINX_UARTLITE_BASEADDR 3752a822edSMichal Simek #define CONFIG_BAUDRATE XILINX_UARTLITE_BAUDRATE 3852a822edSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE { CONFIG_BAUDRATE } 39330e5545SMichal Simek #define CONSOLE_ARG "console=console=ttyUL0,115200\0" 4052a822edSMichal Simek #elif XILINX_UART16550_BASEADDR 4152a822edSMichal Simek #define CONFIG_SYS_NS16550 1 4252a822edSMichal Simek #define CONFIG_SYS_NS16550_SERIAL 4352a822edSMichal Simek #define CONFIG_SYS_NS16550_REG_SIZE -4 4452a822edSMichal Simek #define CONFIG_CONS_INDEX 1 4552a822edSMichal Simek #define CONFIG_SYS_NS16550_COM1 (XILINX_UART16550_BASEADDR + 0x1000 + 0x3) 4652a822edSMichal Simek #define CONFIG_SYS_NS16550_CLK XILINX_UART16550_CLOCK_HZ 4752a822edSMichal Simek #define CONFIG_BAUDRATE 115200 4852a822edSMichal Simek 4952a822edSMichal Simek /* The following table includes the supported baudrates */ 5052a822edSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE \ 5152a822edSMichal Simek {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400} 52330e5545SMichal Simek #define CONSOLE_ARG "console=console=ttyS0,115200\0" 5352a822edSMichal Simek #else 5452a822edSMichal Simek #error Undefined uart 5552a822edSMichal Simek #endif 5652a822edSMichal Simek 5752a822edSMichal Simek /* setting reset address */ 5852a822edSMichal Simek /*#define CONFIG_SYS_RESET_ADDRESS TEXT_BASE*/ 5952a822edSMichal Simek 6052a822edSMichal Simek /* ethernet */ 6152a822edSMichal Simek #ifdef XILINX_EMAC_BASEADDR 6252a822edSMichal Simek #define CONFIG_XILINX_EMAC 1 6352a822edSMichal Simek #define CONFIG_SYS_ENET 64330e5545SMichal Simek #elif XILINX_EMACLITE_BASEADDR 6552a822edSMichal Simek #define CONFIG_XILINX_EMACLITE 1 6652a822edSMichal Simek #define CONFIG_SYS_ENET 67330e5545SMichal Simek #elif XILINX_LLTEMAC_BASEADDR 68330e5545SMichal Simek #define CONFIG_XILINX_LL_TEMAC 1 69330e5545SMichal Simek #define CONFIG_SYS_ENET 7052a822edSMichal Simek #endif 71330e5545SMichal Simek 7252a822edSMichal Simek #undef ET_DEBUG 7352a822edSMichal Simek 7452a822edSMichal Simek /* gpio */ 7552a822edSMichal Simek #ifdef XILINX_GPIO_BASEADDR 7652a822edSMichal Simek #define CONFIG_SYS_GPIO_0 1 7752a822edSMichal Simek #define CONFIG_SYS_GPIO_0_ADDR XILINX_GPIO_BASEADDR 7852a822edSMichal Simek #endif 7952a822edSMichal Simek 8052a822edSMichal Simek /* interrupt controller */ 8152a822edSMichal Simek #ifdef XILINX_INTC_BASEADDR 8252a822edSMichal Simek #define CONFIG_SYS_INTC_0 1 8352a822edSMichal Simek #define CONFIG_SYS_INTC_0_ADDR XILINX_INTC_BASEADDR 8452a822edSMichal Simek #define CONFIG_SYS_INTC_0_NUM XILINX_INTC_NUM_INTR_INPUTS 8552a822edSMichal Simek #endif 8652a822edSMichal Simek 8752a822edSMichal Simek /* timer */ 8852a822edSMichal Simek #ifdef XILINX_TIMER_BASEADDR 8952a822edSMichal Simek #if (XILINX_TIMER_IRQ != -1) 9052a822edSMichal Simek #define CONFIG_SYS_TIMER_0 1 9152a822edSMichal Simek #define CONFIG_SYS_TIMER_0_ADDR XILINX_TIMER_BASEADDR 9252a822edSMichal Simek #define CONFIG_SYS_TIMER_0_IRQ XILINX_TIMER_IRQ 9352a822edSMichal Simek #define FREQUENCE XILINX_CLOCK_FREQ 9452a822edSMichal Simek #define CONFIG_SYS_TIMER_0_PRELOAD ( FREQUENCE/1000 ) 9552a822edSMichal Simek #endif 96330e5545SMichal Simek #elif XILINX_CLOCK_FREQ 9752a822edSMichal Simek #define CONFIG_XILINX_CLOCK_FREQ XILINX_CLOCK_FREQ 9852a822edSMichal Simek #else 9952a822edSMichal Simek #error BAD CLOCK FREQ 10052a822edSMichal Simek #endif 10152a822edSMichal Simek /* FSL */ 10252a822edSMichal Simek /* #define CONFIG_SYS_FSL_2 */ 10352a822edSMichal Simek /* #define FSL_INTR_2 1 */ 10452a822edSMichal Simek 10552a822edSMichal Simek /* 10652a822edSMichal Simek * memory layout - Example 10752a822edSMichal Simek * TEXT_BASE = 0x1200_0000; 10852a822edSMichal Simek * CONFIG_SYS_SRAM_BASE = 0x1000_0000; 10952a822edSMichal Simek * CONFIG_SYS_SRAM_SIZE = 0x0400_0000; 11052a822edSMichal Simek * 11152a822edSMichal Simek * CONFIG_SYS_GBL_DATA_OFFSET = 0x1000_0000 + 0x0400_0000 - 0x1000 = 0x13FF_F000 11252a822edSMichal Simek * CONFIG_SYS_MONITOR_BASE = 0x13FF_F000 - 0x40000 = 0x13FB_F000 11352a822edSMichal Simek * CONFIG_SYS_MALLOC_BASE = 0x13FB_F000 - 0x40000 = 0x13F7_F000 11452a822edSMichal Simek * 11552a822edSMichal Simek * 0x1000_0000 CONFIG_SYS_SDRAM_BASE 11652a822edSMichal Simek * FREE 11752a822edSMichal Simek * 0x1200_0000 TEXT_BASE 11852a822edSMichal Simek * U-BOOT code 11952a822edSMichal Simek * 0x1202_0000 12052a822edSMichal Simek * FREE 12152a822edSMichal Simek * 12252a822edSMichal Simek * STACK 12352a822edSMichal Simek * 0x13F7_F000 CONFIG_SYS_MALLOC_BASE 12452a822edSMichal Simek * MALLOC_AREA 256kB Alloc 12552a822edSMichal Simek * 0x11FB_F000 CONFIG_SYS_MONITOR_BASE 12652a822edSMichal Simek * MONITOR_CODE 256kB Env 12752a822edSMichal Simek * 0x13FF_F000 CONFIG_SYS_GBL_DATA_OFFSET 12852a822edSMichal Simek * GLOBAL_DATA 4kB bd, gd 12952a822edSMichal Simek * 0x1400_0000 CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE 13052a822edSMichal Simek */ 13152a822edSMichal Simek 13252a822edSMichal Simek /* ddr sdram - main memory */ 13352a822edSMichal Simek #define CONFIG_SYS_SDRAM_BASE XILINX_RAM_START 13452a822edSMichal Simek #define CONFIG_SYS_SDRAM_SIZE XILINX_RAM_SIZE 13552a822edSMichal Simek #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 13652a822edSMichal Simek #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x1000) 13752a822edSMichal Simek 13852a822edSMichal Simek /* global pointer */ 13952a822edSMichal Simek #define CONFIG_SYS_GBL_DATA_SIZE 0x1000 /* size of global data */ 14052a822edSMichal Simek /* start of global data */ 14152a822edSMichal Simek #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE - CONFIG_SYS_GBL_DATA_SIZE) 14252a822edSMichal Simek 14352a822edSMichal Simek /* monitor code */ 14452a822edSMichal Simek #define SIZE 0x40000 14552a822edSMichal Simek #define CONFIG_SYS_MONITOR_LEN SIZE 14652a822edSMichal Simek #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_MONITOR_LEN) 14752a822edSMichal Simek #define CONFIG_SYS_MONITOR_END (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) 14852a822edSMichal Simek #define CONFIG_SYS_MALLOC_LEN SIZE 14952a822edSMichal Simek #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN) 15052a822edSMichal Simek 15152a822edSMichal Simek /* stack */ 15252a822edSMichal Simek #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_MONITOR_BASE 15352a822edSMichal Simek 15452a822edSMichal Simek /*#define RAMENV */ 15552a822edSMichal Simek #define FLASH 15652a822edSMichal Simek 15752a822edSMichal Simek #ifdef FLASH 15852a822edSMichal Simek #define CONFIG_SYS_FLASH_BASE XILINX_FLASH_START 15952a822edSMichal Simek #define CONFIG_SYS_FLASH_SIZE XILINX_FLASH_SIZE 16052a822edSMichal Simek #define CONFIG_SYS_FLASH_CFI 1 16152a822edSMichal Simek #define CONFIG_FLASH_CFI_DRIVER 1 16252a822edSMichal Simek #define CONFIG_SYS_FLASH_EMPTY_INFO 1 /* ?empty sector */ 16352a822edSMichal Simek #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */ 164330e5545SMichal Simek #define CONFIG_SYS_MAX_FLASH_SECT 512 /* max number of sectors on one chip */ 16552a822edSMichal Simek #define CONFIG_SYS_FLASH_PROTECTION /* hardware flash protection */ 16652a822edSMichal Simek 16752a822edSMichal Simek #ifdef RAMENV 16852a822edSMichal Simek #define CONFIG_ENV_IS_NOWHERE 1 16952a822edSMichal Simek #define CONFIG_ENV_SIZE 0x1000 17052a822edSMichal Simek #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE) 17152a822edSMichal Simek 17252a822edSMichal Simek #else /* !RAMENV */ 17352a822edSMichal Simek #define CONFIG_ENV_IS_IN_FLASH 1 174330e5545SMichal Simek #define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */ 17552a822edSMichal Simek #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + (2 * CONFIG_ENV_SECT_SIZE)) 176330e5545SMichal Simek #define CONFIG_ENV_SIZE 0x20000 17752a822edSMichal Simek #endif /* !RAMBOOT */ 17852a822edSMichal Simek #else /* !FLASH */ 17952a822edSMichal Simek /* ENV in RAM */ 18052a822edSMichal Simek #define CONFIG_SYS_NO_FLASH 1 18152a822edSMichal Simek #define CONFIG_ENV_IS_NOWHERE 1 18252a822edSMichal Simek #define CONFIG_ENV_SIZE 0x1000 18352a822edSMichal Simek #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE) 18452a822edSMichal Simek #define CONFIG_SYS_FLASH_PROTECTION /* hardware flash protection */ 18552a822edSMichal Simek #endif /* !FLASH */ 18652a822edSMichal Simek 18752a822edSMichal Simek /* system ace */ 18852a822edSMichal Simek #ifdef XILINX_SYSACE_BASEADDR 18952a822edSMichal Simek #define CONFIG_SYSTEMACE 19052a822edSMichal Simek /* #define DEBUG_SYSTEMACE */ 19152a822edSMichal Simek #define SYSTEMACE_CONFIG_FPGA 19252a822edSMichal Simek #define CONFIG_SYS_SYSTEMACE_BASE XILINX_SYSACE_BASEADDR 19352a822edSMichal Simek #define CONFIG_SYS_SYSTEMACE_WIDTH XILINX_SYSACE_MEM_WIDTH 19452a822edSMichal Simek #define CONFIG_DOS_PARTITION 19552a822edSMichal Simek #endif 19652a822edSMichal Simek 197e9b737deSMichal Simek #if defined(XILINX_USE_ICACHE) 198e9b737deSMichal Simek #define CONFIG_ICACHE 199e9b737deSMichal Simek #else 200e9b737deSMichal Simek #undef CONFIG_ICACHE 201e9b737deSMichal Simek #endif 202e9b737deSMichal Simek 203e9b737deSMichal Simek #if defined(XILINX_USE_DCACHE) 204e9b737deSMichal Simek #define CONFIG_DCACHE 205e9b737deSMichal Simek #else 206e9b737deSMichal Simek #undef CONFIG_DCACHE 207e9b737deSMichal Simek #endif 208e9b737deSMichal Simek 20952a822edSMichal Simek /* 21052a822edSMichal Simek * BOOTP options 21152a822edSMichal Simek */ 21252a822edSMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE 21352a822edSMichal Simek #define CONFIG_BOOTP_BOOTPATH 21452a822edSMichal Simek #define CONFIG_BOOTP_GATEWAY 21552a822edSMichal Simek #define CONFIG_BOOTP_HOSTNAME 21652a822edSMichal Simek 21752a822edSMichal Simek /* 21852a822edSMichal Simek * Command line configuration. 21952a822edSMichal Simek */ 22052a822edSMichal Simek #include <config_cmd_default.h> 22152a822edSMichal Simek 22252a822edSMichal Simek #define CONFIG_CMD_ASKENV 22352a822edSMichal Simek #define CONFIG_CMD_IRQ 22452a822edSMichal Simek #define CONFIG_CMD_MFSL 225330e5545SMichal Simek #define CONFIG_CMD_ECHO 22652a822edSMichal Simek 227e9b737deSMichal Simek #if defined(CONFIG_DCACHE) || defined(CONFIG_ICACHE) 228e9b737deSMichal Simek #define CONFIG_CMD_CACHE 229e9b737deSMichal Simek #else 230e9b737deSMichal Simek #undef CONFIG_CMD_CACHE 231e9b737deSMichal Simek #endif 232e9b737deSMichal Simek 23352a822edSMichal Simek #ifndef CONFIG_SYS_ENET 23452a822edSMichal Simek #undef CONFIG_CMD_NET 23552a822edSMichal Simek #else 23652a822edSMichal Simek #define CONFIG_CMD_PING 23752a822edSMichal Simek #endif 23852a822edSMichal Simek 23952a822edSMichal Simek #if defined(CONFIG_SYSTEMACE) 24052a822edSMichal Simek #define CONFIG_CMD_EXT2 24152a822edSMichal Simek #define CONFIG_CMD_FAT 24252a822edSMichal Simek #endif 24352a822edSMichal Simek 24452a822edSMichal Simek #if defined(FLASH) 24552a822edSMichal Simek #define CONFIG_CMD_ECHO 24652a822edSMichal Simek #define CONFIG_CMD_FLASH 24752a822edSMichal Simek #define CONFIG_CMD_IMLS 24852a822edSMichal Simek #define CONFIG_CMD_JFFS2 24952a822edSMichal Simek 25052a822edSMichal Simek #if !defined(RAMENV) 251*bdab39d3SMike Frysinger #define CONFIG_CMD_SAVEENV 25252a822edSMichal Simek #define CONFIG_CMD_SAVES 25352a822edSMichal Simek #endif 25452a822edSMichal Simek #else 255330e5545SMichal Simek #undef CONFIG_CMD_IMLS 25652a822edSMichal Simek #undef CONFIG_CMD_FLASH 257330e5545SMichal Simek #undef CONFIG_CMD_JFFS2 25852a822edSMichal Simek #endif 25952a822edSMichal Simek 26052a822edSMichal Simek #if defined(CONFIG_CMD_JFFS2) 26152a822edSMichal Simek /* JFFS2 partitions */ 26252a822edSMichal Simek #define CONFIG_JFFS2_CMDLINE /* mtdparts command line support */ 26352a822edSMichal Simek #define MTDIDS_DEFAULT "nor0=ml401-0" 26452a822edSMichal Simek 26552a822edSMichal Simek /* default mtd partition table */ 26652a822edSMichal Simek #define MTDPARTS_DEFAULT "mtdparts=ml401-0:256k(u-boot),"\ 26752a822edSMichal Simek "256k(env),3m(kernel),1m(romfs),"\ 26852a822edSMichal Simek "1m(cramfs),-(jffs2)" 26952a822edSMichal Simek #endif 27052a822edSMichal Simek 27152a822edSMichal Simek /* Miscellaneous configurable options */ 27252a822edSMichal Simek #define CONFIG_SYS_PROMPT "U-Boot-mONStR> " 27352a822edSMichal Simek #define CONFIG_SYS_CBSIZE 512 /* size of console buffer */ 27452a822edSMichal Simek #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) /* print buffer size */ 27552a822edSMichal Simek #define CONFIG_SYS_MAXARGS 15 /* max number of command args */ 27652a822edSMichal Simek #define CONFIG_SYS_LONGHELP 277330e5545SMichal Simek #define CONFIG_SYS_LOAD_ADDR XILINX_RAM_START /* default load address */ 27852a822edSMichal Simek 279330e5545SMichal Simek #define CONFIG_BOOTDELAY -1 /* -1 disables auto-boot */ 28052a822edSMichal Simek #define CONFIG_BOOTARGS "root=romfs" 281330e5545SMichal Simek #define CONFIG_HOSTNAME XILINX_BOARD_NAME 28252a822edSMichal Simek #define CONFIG_BOOTCOMMAND "base 0;tftp 11000000 image.img;bootm" 28352a822edSMichal Simek #define CONFIG_IPADDR 192.168.0.3 28452a822edSMichal Simek #define CONFIG_SERVERIP 192.168.0.5 28552a822edSMichal Simek #define CONFIG_GATEWAYIP 192.168.0.1 28652a822edSMichal Simek #define CONFIG_ETHADDR 00:E0:0C:00:00:FD 28752a822edSMichal Simek 28852a822edSMichal Simek /* architecture dependent code */ 28952a822edSMichal Simek #define CONFIG_SYS_USR_EXCEP /* user exception */ 29052a822edSMichal Simek #define CONFIG_SYS_HZ 1000 29152a822edSMichal Simek 292330e5545SMichal Simek #define CONFIG_PREBOOT "echo U-BOOT for $(hostname);setenv preboot;echo" 29352a822edSMichal Simek 29452a822edSMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS "unlock=yes\0" /* hardware flash protection */\ 29552a822edSMichal Simek "nor0=ml401-0\0"\ 29652a822edSMichal Simek "mtdparts=mtdparts=ml401-0:"\ 29752a822edSMichal Simek "256k(u-boot),256k(env),3m(kernel),"\ 29852a822edSMichal Simek "1m(romfs),1m(cramfs),-(jffs2)\0" 29952a822edSMichal Simek 30052a822edSMichal Simek #define CONFIG_CMDLINE_EDITING 30152a822edSMichal Simek 30252a822edSMichal Simek #endif /* __CONFIG_H */ 303