blob: e61a3e1095f1c78eac39e485d886f15e26345e4d [file] [log] [blame]
wdenke28cf632004-03-14 15:20:55 +00001/*
2 * (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
3 * Stephan Linz <linz@li-pro.net>
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24#ifndef __CONFIG_H
25#define __CONFIG_H
26
27/***********************************************************************
28 * Include the whole NIOS CPU configuration.
29 *
30 * !!! HAVE TO BE HERE !!! DON'T MOVE THIS PART !!!
31 *
32 ***********************************************************************/
33
34#if defined(CONFIG_NIOS_BASE_32)
35#include <configs/ADNPESC1_base_32.h>
36#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020037#error *** CONFIG_SYS_ERROR: you have to setup right NIOS CPU configuration
wdenke28cf632004-03-14 15:20:55 +000038#endif
39
40/*------------------------------------------------------------------------
41 * BOARD/CPU -- TOP-LEVEL
42 *----------------------------------------------------------------------*/
43#define CONFIG_NIOS 1 /* NIOS-32 core */
44#define CONFIG_ADNPESC1 1 /* SSV ADNP/ESC1 board */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020045#define CONFIG_SYS_CLK_FREQ CONFIG_SYS_NIOS_CPU_CLK/* 50 MHz core clock */
46#define CONFIG_SYS_HZ 1000 /* 1 msec time tick */
47#undef CONFIG_SYS_CLKS_IN_HZ
wdenke28cf632004-03-14 15:20:55 +000048#define CONFIG_BOARD_EARLY_INIT_F 1 /* enable early board-spec. init*/
49
50/*------------------------------------------------------------------------
51 * BASE ADDRESSES / SIZE (Flash, SRAM, SDRAM)
52 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020053#if (CONFIG_SYS_NIOS_CPU_SDRAM_SIZE != 0)
wdenke28cf632004-03-14 15:20:55 +000054
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020055#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_NIOS_CPU_SDRAM_BASE
56#define CONFIG_SYS_SDRAM_SIZE CONFIG_SYS_NIOS_CPU_SDRAM_SIZE
wdenke28cf632004-03-14 15:20:55 +000057
58#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020059#error *** CONFIG_SYS_ERROR: you have to setup any SDRAM in NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +000060#endif
61
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020062#if defined(CONFIG_SYS_NIOS_CPU_SRAM_BASE) && defined(CONFIG_SYS_NIOS_CPU_SRAM_SIZE)
wdenke28cf632004-03-14 15:20:55 +000063
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020064#define CONFIG_SYS_SRAM_BASE CONFIG_SYS_NIOS_CPU_SRAM_BASE
65#define CONFIG_SYS_SRAM_SIZE CONFIG_SYS_NIOS_CPU_SRAM_SIZE
wdenke28cf632004-03-14 15:20:55 +000066
67#else
68
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020069#undef CONFIG_SYS_SRAM_BASE
70#undef CONFIG_SYS_SRAM_SIZE
wdenke28cf632004-03-14 15:20:55 +000071
72#endif
73
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020074#define CONFIG_SYS_VECT_BASE CONFIG_SYS_NIOS_CPU_VEC_BASE
wdenke28cf632004-03-14 15:20:55 +000075
76/*------------------------------------------------------------------------
77 * MEMORY ORGANIZATION - For the most part, you can put things pretty
78 * much anywhere. This is pretty flexible for Nios. So here we make some
79 * arbitrary choices & assume that the monitor is placed at the end of
80 * a memory resource (so you must make sure TEXT_BASE is chosen
81 * appropriately -- this is very important if you plan to move your
82 * memory to another place as configured at this time !!!).
83 *
Wolfgang Denka1be4762008-05-20 16:00:29 +020084 * -The heap is placed below the monitor.
85 * -Global data is placed below the heap.
86 * -The stack is placed below global data (&grows down).
wdenke28cf632004-03-14 15:20:55 +000087 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020088#define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256k */
89#define CONFIG_SYS_GBL_DATA_SIZE 128 /* Global data size rsvd*/
90#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024)
wdenke28cf632004-03-14 15:20:55 +000091
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020092#define CONFIG_SYS_MONITOR_BASE TEXT_BASE
93#define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
94#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_MALLOC_BASE - CONFIG_SYS_GBL_DATA_SIZE)
95#define CONFIG_SYS_INIT_SP CONFIG_SYS_GBL_DATA_OFFSET
wdenke28cf632004-03-14 15:20:55 +000096
97/*------------------------------------------------------------------------
98 * FLASH (AM29LV065D)
99 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200100#if (CONFIG_SYS_NIOS_CPU_FLASH_SIZE != 0)
wdenke28cf632004-03-14 15:20:55 +0000101
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200102#define CONFIG_SYS_FLASH_BASE CONFIG_SYS_NIOS_CPU_FLASH_BASE
103#define CONFIG_SYS_FLASH_SIZE CONFIG_SYS_NIOS_CPU_FLASH_SIZE
104#define CONFIG_SYS_MAX_FLASH_SECT 128 /* Max # sects per bank */
105#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* Max # of flash banks */
106#define CONFIG_SYS_FLASH_ERASE_TOUT 8000 /* Erase timeout (msec) */
107#define CONFIG_SYS_FLASH_WRITE_TOUT 100 /* Write timeout (msec) */
108#define CONFIG_SYS_FLASH_WORD_SIZE unsigned short /* flash word size */
wdenke28cf632004-03-14 15:20:55 +0000109
110#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200111#error *** CONFIG_SYS_ERROR: you have to setup any Flash memory in NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +0000112#endif
113
114/*------------------------------------------------------------------------
115 * ENVIRONMENT
116 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200117#if (CONFIG_SYS_NIOS_CPU_FLASH_SIZE != 0)
wdenke28cf632004-03-14 15:20:55 +0000118
Jean-Christophe PLAGNIOL-VILLARD53db4cd2008-09-10 22:48:04 +0200119#define CONFIG_ENV_IS_IN_FLASH 1 /* Environment in flash */
wdenke28cf632004-03-14 15:20:55 +0000120
121/* Mem addr of environment */
122#if defined(CONFIG_NIOS_BASE_32)
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200123#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
wdenke28cf632004-03-14 15:20:55 +0000124#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200125#error *** CONFIG_SYS_ERROR: you have to setup the environment base address CONFIG_ENV_ADDR
wdenke28cf632004-03-14 15:20:55 +0000126#endif
127
Jean-Christophe PLAGNIOL-VILLARD7e1cda62008-09-10 22:48:06 +0200128#define CONFIG_ENV_SIZE (64 * 1024) /* 64 KByte (1 sector) */
wdenke28cf632004-03-14 15:20:55 +0000129#define CONFIG_ENV_OVERWRITE /* Serial/eth change Ok */
130
131#else
Jean-Christophe PLAGNIOL-VILLARD68a87562008-09-10 22:48:00 +0200132#define CONFIG_ENV_IS_NOWHERE 1 /* NO Environment */
wdenke28cf632004-03-14 15:20:55 +0000133#endif
134
135/*------------------------------------------------------------------------
136 * NIOS APPLICATION CODE BASE AREA
137 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD7e1cda62008-09-10 22:48:06 +0200138#if ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) == 0x1050000)
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200139#define CONFIG_SYS_ADNPESC1_UPDATE_LOAD_ADDR "0x2000100"
140#define CONFIG_SYS_ADNPESC1_NIOS_APPL_ENTRY "0x1050000"
141#define CONFIG_SYS_ADNPESC1_NIOS_APPL_IDENT "0x105000c"
142#define CONFIG_SYS_ADNPESC1_NIOS_APPL_END "0x11fffff"
143#define CONFIG_SYS_ADNPESC1_FILESYSTEM_BASE "0x1200000"
144#define CONFIG_SYS_ADNPESC1_FILESYSTEM_END "0x17fffff"
wdenke28cf632004-03-14 15:20:55 +0000145#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200146#error *** CONFIG_SYS_ERROR: missing right appl.code base configuration, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000147#endif
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200148#define CONFIG_SYS_ADNPESC1_NIOS_IDENTIFIER "Nios"
wdenke28cf632004-03-14 15:20:55 +0000149
150/*------------------------------------------------------------------------
151 * BOOT ENVIRONMENT
152 *----------------------------------------------------------------------*/
153#ifdef CONFIG_DNPEVA2 /* DNP/EVA2 base board */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200154#define CONFIG_SYS_ADNPESC1_SLED_BOOT_OFF "sled boot off; "
155#define CONFIG_SYS_ADNPESC1_SLED_RED_BLINK "sled red blink; "
wdenke28cf632004-03-14 15:20:55 +0000156#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200157#define CONFIG_SYS_ADNPESC1_SLED_BOOT_OFF
158#define CONFIG_SYS_ADNPESC1_SLED_RED_BLINK
wdenke28cf632004-03-14 15:20:55 +0000159#endif
160
161#define CONFIG_BOOTDELAY 5
162#define CONFIG_BOOTCOMMAND \
163 "if itest.s *$appl_ident_addr == \"$appl_ident_str\"; " \
164 "then " \
165 "wd off; " \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200166 CONFIG_SYS_ADNPESC1_SLED_BOOT_OFF \
wdenke28cf632004-03-14 15:20:55 +0000167 "go $appl_entry_addr; " \
168 "else " \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200169 CONFIG_SYS_ADNPESC1_SLED_RED_BLINK \
wdenke28cf632004-03-14 15:20:55 +0000170 "echo *** missing \"$appl_ident_str\" at $appl_ident_addr; "\
171 "echo *** invalid application at $appl_entry_addr; " \
172 "echo *** stop bootup...; " \
173 "fi"
174
175/*------------------------------------------------------------------------
176 * EXTRA ENVIRONMENT
177 *----------------------------------------------------------------------*/
178#ifdef CONFIG_DNPEVA2 /* DNP/EVA2 base board */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200179#define CONFIG_SYS_ADNPESC1_SLED_YELLO_ON "sled yellow on; "
180#define CONFIG_SYS_ADNPESC1_SLED_YELLO_OFF "sled yellow off; "
wdenke28cf632004-03-14 15:20:55 +0000181#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200182#define CONFIG_SYS_ADNPESC1_SLED_YELLO_ON
183#define CONFIG_SYS_ADNPESC1_SLED_YELLO_OFF
wdenke28cf632004-03-14 15:20:55 +0000184#endif
185
186#define CONFIG_EXTRA_ENV_SETTINGS \
187 "update_allowed=0\0" \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200188 "update_load_addr=" CONFIG_SYS_ADNPESC1_UPDATE_LOAD_ADDR "\0" \
189 "appl_entry_addr=" CONFIG_SYS_ADNPESC1_NIOS_APPL_ENTRY "\0" \
190 "appl_end_addr=" CONFIG_SYS_ADNPESC1_NIOS_APPL_END "\0" \
191 "appl_ident_addr=" CONFIG_SYS_ADNPESC1_NIOS_APPL_IDENT "\0" \
192 "appl_ident_str=" CONFIG_SYS_ADNPESC1_NIOS_IDENTIFIER "\0" \
wdenke28cf632004-03-14 15:20:55 +0000193 "appl_name=ADNPESC1/base32/linux.bin\0" \
194 "appl_update=" \
195 "if itest.b $update_allowed != 0; " \
196 "then " \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200197 CONFIG_SYS_ADNPESC1_SLED_YELLO_ON \
wdenke28cf632004-03-14 15:20:55 +0000198 "tftp $update_load_addr $appl_name; " \
199 "protect off $appl_entry_addr $appl_end_addr; " \
200 "era $appl_entry_addr $appl_end_addr; " \
201 "cp.b $update_load_addr $appl_entry_addr $filesize; "\
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200202 CONFIG_SYS_ADNPESC1_SLED_YELLO_OFF \
wdenke28cf632004-03-14 15:20:55 +0000203 "else " \
204 "echo *** update not allowed (update_allowed=$update_allowed); "\
205 "fi\0" \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200206 "fs_base_addr=" CONFIG_SYS_ADNPESC1_FILESYSTEM_BASE "\0" \
207 "fs_end_addr=" CONFIG_SYS_ADNPESC1_FILESYSTEM_END "\0" \
wdenke28cf632004-03-14 15:20:55 +0000208 "fs_name=ADNPESC1/base32/romfs.img\0" \
209 "fs_update=" \
210 "if itest.b $update_allowed != 0; " \
211 "then " \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200212 CONFIG_SYS_ADNPESC1_SLED_YELLO_ON \
wdenke28cf632004-03-14 15:20:55 +0000213 "tftp $update_load_addr $fs_name; " \
214 "protect off $fs_base_addr $fs_end_addr; " \
215 "era $fs_base_addr $fs_end_addr; " \
216 "cp.b $update_load_addr $fs_base_addr $filesize; "\
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200217 CONFIG_SYS_ADNPESC1_SLED_YELLO_OFF \
wdenke28cf632004-03-14 15:20:55 +0000218 "else " \
219 "echo *** update not allowed (update_allowed=$update_allowed); "\
220 "fi\0" \
221 "uboot_name=ADNPESC1/base32/u-boot.bin\0" \
222 "uboot_loadnrun=" \
223 "if ping $serverip; " \
224 "then " \
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200225 CONFIG_SYS_ADNPESC1_SLED_YELLO_ON \
wdenke28cf632004-03-14 15:20:55 +0000226 "tftp $update_load_addr $uboot_name; " \
227 "wd off; " \
228 "go $update_load_addr; " \
229 "else " \
230 "echo *** missing connection to $serverip; " \
231 "echo *** check your network and try again...; "\
232 "fi\0"
233
234/*------------------------------------------------------------------------
235 * CONSOLE
236 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200237#if (CONFIG_SYS_NIOS_CPU_UART_NUMS != 0)
wdenke28cf632004-03-14 15:20:55 +0000238
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200239#define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_NIOS_CPU_UART0 /* 1st UART is Cons. */
wdenke28cf632004-03-14 15:20:55 +0000240
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200241#if (CONFIG_SYS_NIOS_CPU_UART0_BR != 0)
242#define CONFIG_SYS_NIOS_FIXEDBAUD 1 /* Baudrate is fixed */
243#define CONFIG_BAUDRATE CONFIG_SYS_NIOS_CPU_UART0_BR
wdenke28cf632004-03-14 15:20:55 +0000244#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200245#undef CONFIG_SYS_NIOS_FIXEDBAUD
wdenke28cf632004-03-14 15:20:55 +0000246#define CONFIG_BAUDRATE 115200
247#endif
248
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200249#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
wdenke28cf632004-03-14 15:20:55 +0000250
251#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200252#error *** CONFIG_SYS_ERROR: you have to setup at least one UART in NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +0000253#endif
254
255/*------------------------------------------------------------------------
256 * TIMER FOR TIMEBASE -- Nios doesn't have the equivalent of ppc PIT,
257 * so an avalon bus timer is required.
258 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200259#if (CONFIG_SYS_NIOS_CPU_TIMER_NUMS != 0) && defined(CONFIG_SYS_NIOS_CPU_TICK_TIMER)
wdenke28cf632004-03-14 15:20:55 +0000260
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200261#if (CONFIG_SYS_NIOS_CPU_TICK_TIMER == 0)
wdenke28cf632004-03-14 15:20:55 +0000262
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200263#define CONFIG_SYS_NIOS_TMRBASE CONFIG_SYS_NIOS_CPU_TIMER0 /* TIMER0 as tick */
264#define CONFIG_SYS_NIOS_TMRIRQ CONFIG_SYS_NIOS_CPU_TIMER0_IRQ
wdenke28cf632004-03-14 15:20:55 +0000265
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200266#if (CONFIG_SYS_NIOS_CPU_TIMER0_FP == 1) /* fixed period */
wdenke28cf632004-03-14 15:20:55 +0000267
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200268#if (CONFIG_SYS_NIOS_CPU_TIMER0_PER >= CONFIG_SYS_HZ)
269#define CONFIG_SYS_NIOS_TMRMS (CONFIG_SYS_NIOS_CPU_TIMER0_PER / CONFIG_SYS_HZ)
wdenke28cf632004-03-14 15:20:55 +0000270#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200271#error *** CONFIG_SYS_ERROR: you have to use a timer periode greater than CONFIG_SYS_HZ
wdenke28cf632004-03-14 15:20:55 +0000272#endif
273
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200274#undef CONFIG_SYS_NIOS_TMRCNT /* no preloadable counter value */
wdenke28cf632004-03-14 15:20:55 +0000275
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200276#elif (CONFIG_SYS_NIOS_CPU_TIMER0_FP == 0) /* variable period */
wdenke28cf632004-03-14 15:20:55 +0000277
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200278#if (CONFIG_SYS_HZ <= 1000)
279#define CONFIG_SYS_NIOS_TMRMS (1000 / CONFIG_SYS_HZ)
wdenke28cf632004-03-14 15:20:55 +0000280#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200281#error *** CONFIG_SYS_ERROR: sorry, CONFIG_SYS_HZ have to be less than 1000
wdenke28cf632004-03-14 15:20:55 +0000282#endif
283
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200284#define CONFIG_SYS_NIOS_TMRCNT (CONFIG_SYS_CLK_FREQ / CONFIG_SYS_HZ)
wdenke28cf632004-03-14 15:20:55 +0000285
286#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200287#error *** CONFIG_SYS_ERROR: you have to define CONFIG_SYS_NIOS_CPU_TIMER0_FP correct
wdenke28cf632004-03-14 15:20:55 +0000288#endif
289
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200290#elif (CONFIG_SYS_NIOS_CPU_TICK_TIMER == 1)
wdenke28cf632004-03-14 15:20:55 +0000291
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200292#define CONFIG_SYS_NIOS_TMRBASE CONFIG_SYS_NIOS_CPU_TIMER1 /* TIMER1 as tick */
293#define CONFIG_SYS_NIOS_TMRIRQ CONFIG_SYS_NIOS_CPU_TIMER1_IRQ
wdenke28cf632004-03-14 15:20:55 +0000294
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200295#if (CONFIG_SYS_NIOS_CPU_TIMER1_FP == 1) /* fixed period */
wdenke28cf632004-03-14 15:20:55 +0000296
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200297#if (CONFIG_SYS_NIOS_CPU_TIMER1_PER >= CONFIG_SYS_HZ)
298#define CONFIG_SYS_NIOS_TMRMS (CONFIG_SYS_NIOS_CPU_TIMER1_PER / CONFIG_SYS_HZ)
wdenke28cf632004-03-14 15:20:55 +0000299#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200300#error *** CONFIG_SYS_ERROR: you have to use a timer periode greater than CONFIG_SYS_HZ
wdenke28cf632004-03-14 15:20:55 +0000301#endif
302
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200303#undef CONFIG_SYS_NIOS_TMRCNT /* no preloadable counter value */
wdenke28cf632004-03-14 15:20:55 +0000304
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200305#elif (CONFIG_SYS_NIOS_CPU_TIMER1_FP == 0) /* variable period */
wdenke28cf632004-03-14 15:20:55 +0000306
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200307#if (CONFIG_SYS_HZ <= 1000)
308#define CONFIG_SYS_NIOS_TMRMS (1000 / CONFIG_SYS_HZ)
wdenke28cf632004-03-14 15:20:55 +0000309#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200310#error *** CONFIG_SYS_ERROR: sorry, CONFIG_SYS_HZ have to be less than 1000
wdenke28cf632004-03-14 15:20:55 +0000311#endif
312
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200313#define CONFIG_SYS_NIOS_TMRCNT (CONFIG_SYS_CLK_FREQ / CONFIG_SYS_HZ)
wdenke28cf632004-03-14 15:20:55 +0000314
315#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200316#error *** CONFIG_SYS_ERROR: you have to define CONFIG_SYS_NIOS_CPU_TIMER1_FP correct
wdenke28cf632004-03-14 15:20:55 +0000317#endif
318
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200319#endif /* CONFIG_SYS_NIOS_CPU_TICK_TIMER */
wdenke28cf632004-03-14 15:20:55 +0000320
321#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200322#error *** CONFIG_SYS_ERROR: you have to setup at least one TIMER in NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +0000323#endif
324
325/*------------------------------------------------------------------------
326 * WATCHDOG (or better MAX823 supervisory circuite access)
327 *----------------------------------------------------------------------*/
328#define CONFIG_HW_WATCHDOG 1 /* board specific WD */
329
330#ifdef CONFIG_HW_WATCHDOG
331
332/* MAX823 supervisor -- watchdog enable port at: */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200333#if (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 0)
334#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO0 /* PIO0 */
335#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 1)
336#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO1 /* PIO1 */
337#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 2)
338#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO2 /* PIO2 */
339#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 3)
340#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO3 /* PIO3 */
341#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 4)
342#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO4 /* PIO4 */
343#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 5)
344#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO5 /* PIO5 */
345#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 6)
346#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO6 /* PIO6 */
347#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 7)
348#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO7 /* PIO7 */
349#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 8)
350#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO8 /* PIO8 */
351#elif (CONFIG_SYS_NIOS_CPU_WDENA_PIO == 9)
352#define CONFIG_HW_WDENA_BASE CONFIG_SYS_NIOS_CPU_PIO9 /* PIO9 */
wdenke28cf632004-03-14 15:20:55 +0000353#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200354#error *** CONFIG_SYS_ERROR: you have to setup at least one WDENA_PIO in NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +0000355#endif
356
357/* MAX823 supervisor -- watchdog trigger port at: */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200358#if (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 0)
359#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO0 /* PIO0 */
360#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 1)
361#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO1 /* PIO1 */
362#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 2)
363#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO2 /* PIO2 */
364#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 3)
365#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO3 /* PIO3 */
366#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 4)
367#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO4 /* PIO4 */
368#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 5)
369#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO5 /* PIO5 */
370#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 6)
371#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO6 /* PIO6 */
372#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 7)
373#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO7 /* PIO7 */
374#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 8)
375#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO8 /* PIO8 */
376#elif (CONFIG_SYS_NIOS_CPU_WDTOG_PIO == 9)
377#define CONFIG_HW_WDTOG_BASE CONFIG_SYS_NIOS_CPU_PIO9 /* PIO9 */
wdenke28cf632004-03-14 15:20:55 +0000378#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200379#error *** CONFIG_SYS_ERROR: you have to setup at least one WDTOG_PIO in NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +0000380#endif
381
382#if defined(CONFIG_NIOS_BASE_32) /* NIOS CPU specifics */
383#define CONFIG_HW_WDENA_BIT 0 /* WD enable @ Bit 0 */
384#define CONFIG_HW_WDTOG_BIT 0 /* WD trigger @ Bit 0 */
385#define CONFIG_HW_WDPORT_WRONLY 1 /* each WD port wr/only*/
386#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200387#error *** CONFIG_SYS_ERROR: missing watchdog bit configuration, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000388#endif
389
390#endif /* CONFIG_HW_WATCHDOG */
391
392/*------------------------------------------------------------------------
393 * SERIAL PERIPHAREL INTERFACE
394 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200395#if (CONFIG_SYS_NIOS_CPU_SPI_NUMS == 1)
wdenke28cf632004-03-14 15:20:55 +0000396
397#define CONFIG_NIOS_SPI 1 /* SPI support active */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200398#define CONFIG_SYS_NIOS_SPIBASE CONFIG_SYS_NIOS_CPU_SPI0
399#define CONFIG_SYS_NIOS_SPIBITS CONFIG_SYS_NIOS_CPU_SPI0_BITS
wdenke28cf632004-03-14 15:20:55 +0000400
401#define CONFIG_RTC_DS1306 1 /* Dallas 1306 real time clock */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200402#define CONFIG_SYS_SPI_RTC_DEVID 0 /* as 1st SPI device */
wdenke28cf632004-03-14 15:20:55 +0000403
wdenke28cf632004-03-14 15:20:55 +0000404#else
405#undef CONFIG_NIOS_SPI /* NO SPI support */
wdenke28cf632004-03-14 15:20:55 +0000406#endif
407
408/*------------------------------------------------------------------------
409 * Ethernet -- needs work!
410 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200411#if (CONFIG_SYS_NIOS_CPU_LAN_NUMS == 1)
wdenke28cf632004-03-14 15:20:55 +0000412
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200413#if (CONFIG_SYS_NIOS_CPU_LAN0_TYPE == 0) /* LAN91C111 */
wdenke28cf632004-03-14 15:20:55 +0000414
415#define CONFIG_DRIVER_SMC91111 /* Using SMC91c111 */
416#undef CONFIG_SMC91111_EXT_PHY /* Internal PHY */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200417#define CONFIG_SMC91111_BASE (CONFIG_SYS_NIOS_CPU_LAN0_BASE + CONFIG_SYS_NIOS_CPU_LAN0_OFFS)
wdenke28cf632004-03-14 15:20:55 +0000418
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200419#if (CONFIG_SYS_NIOS_CPU_LAN0_BUSW == 32)
wdenke28cf632004-03-14 15:20:55 +0000420#define CONFIG_SMC_USE_32_BIT 1
421#else /* no */
422#undef CONFIG_SMC_USE_32_BIT
423#endif
424
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200425#elif (CONFIG_SYS_NIOS_CPU_LAN0_TYPE == 1) /* CS8900A */
wdenke28cf632004-03-14 15:20:55 +0000426
427 /********************************************/
428 /* !!! CS8900 is __not__ tested on NIOS !!! */
429 /********************************************/
430#define CONFIG_DRIVER_CS8900 /* Using CS8900 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200431#define CS8900_BASE (CONFIG_SYS_NIOS_CPU_LAN0_BASE + CONFIG_SYS_NIOS_CPU_LAN0_OFFS)
wdenke28cf632004-03-14 15:20:55 +0000432
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200433#if (CONFIG_SYS_NIOS_CPU_LAN0_BUSW == 32)
wdenke28cf632004-03-14 15:20:55 +0000434#undef CS8900_BUS16
435#define CS8900_BUS32 1
436#else /* no */
437#define CS8900_BUS16 1
438#undef CS8900_BUS32
439#endif
440
441#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200442#error *** CONFIG_SYS_ERROR: invalid LAN0 chip type, check your NIOS CPU config
wdenke28cf632004-03-14 15:20:55 +0000443#endif
444
445#define CONFIG_ETHADDR 02:80:ae:20:60:6f
446#define CONFIG_NETMASK 255.255.255.248
447#define CONFIG_IPADDR 192.168.161.84
448#define CONFIG_SERVERIP 192.168.161.85
449
450#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200451#error *** CONFIG_SYS_ERROR: you have to setup just one LAN only or expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000452#endif
453
454/*------------------------------------------------------------------------
455 * STATUS LEDs
456 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200457#if (CONFIG_SYS_NIOS_CPU_PIO_NUMS != 0) && defined(CONFIG_SYS_NIOS_CPU_LED_PIO)
wdenke28cf632004-03-14 15:20:55 +0000458
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200459#if (CONFIG_SYS_NIOS_CPU_LED_PIO == 0)
wdenke28cf632004-03-14 15:20:55 +0000460
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200461#define STATUS_LED_BASE CONFIG_SYS_NIOS_CPU_PIO0
462#define STATUS_LED_BITS CONFIG_SYS_NIOS_CPU_PIO0_BITS
wdenke28cf632004-03-14 15:20:55 +0000463#define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */
464
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200465#if (CONFIG_SYS_NIOS_CPU_PIO0_TYPE == 1)
wdenke28cf632004-03-14 15:20:55 +0000466#define STATUS_LED_WRONLY 1
467#else
468#undef STATUS_LED_WRONLY
469#endif
470
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200471#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 1)
wdenke28cf632004-03-14 15:20:55 +0000472
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200473#define STATUS_LED_BASE CONFIG_SYS_NIOS_CPU_PIO1
474#define STATUS_LED_BITS CONFIG_SYS_NIOS_CPU_PIO1_BITS
wdenke28cf632004-03-14 15:20:55 +0000475#define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */
476
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200477#if (CONFIG_SYS_NIOS_CPU_PIO1_TYPE == 1)
wdenke28cf632004-03-14 15:20:55 +0000478#define STATUS_LED_WRONLY 1
479#else
480#undef STATUS_LED_WRONLY
481#endif
482
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200483#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 2)
wdenke28cf632004-03-14 15:20:55 +0000484
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200485#define STATUS_LED_BASE CONFIG_SYS_NIOS_CPU_PIO2
486#define STATUS_LED_BITS CONFIG_SYS_NIOS_CPU_PIO2_BITS
wdenke28cf632004-03-14 15:20:55 +0000487#define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */
488
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200489#if (CONFIG_SYS_NIOS_CPU_PIO2_TYPE == 1)
wdenke28cf632004-03-14 15:20:55 +0000490#define STATUS_LED_WRONLY 1
491#else
492#undef STATUS_LED_WRONLY
493#endif
494
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200495#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 3)
wdenke28cf632004-03-14 15:20:55 +0000496
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200497#error *** CONFIG_SYS_ERROR: status LEDs at PIO3 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000498
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200499#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 4)
wdenke28cf632004-03-14 15:20:55 +0000500
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200501#error *** CONFIG_SYS_ERROR: status LEDs at PIO4 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000502
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200503#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 5)
wdenke28cf632004-03-14 15:20:55 +0000504
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200505#error *** CONFIG_SYS_ERROR: status LEDs at PIO5 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000506
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200507#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 6)
wdenke28cf632004-03-14 15:20:55 +0000508
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200509#error *** CONFIG_SYS_ERROR: status LEDs at PIO6 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000510
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200511#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 7)
wdenke28cf632004-03-14 15:20:55 +0000512
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200513#error *** CONFIG_SYS_ERROR: status LEDs at PIO7 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000514
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200515#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 8)
wdenke28cf632004-03-14 15:20:55 +0000516
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200517#error *** CONFIG_SYS_ERROR: status LEDs at PIO8 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000518
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200519#elif (CONFIG_SYS_NIOS_CPU_LED_PIO == 9)
wdenke28cf632004-03-14 15:20:55 +0000520
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200521#error *** CONFIG_SYS_ERROR: status LEDs at PIO9 not supported, expand your config.h
wdenke28cf632004-03-14 15:20:55 +0000522
523#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200524#error *** CONFIG_SYS_ERROR: you have to set CONFIG_SYS_NIOS_CPU_LED_PIO in right case
wdenke28cf632004-03-14 15:20:55 +0000525#endif
526
527#define CONFIG_STATUS_LED 1 /* enable status led driver */
528
529#define STATUS_LED_BIT (1 << 0) /* LED[0] */
530#define STATUS_LED_STATE STATUS_LED_BLINKING
531#define STATUS_LED_BOOT_STATE STATUS_LED_OFF
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200532#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* ca. 1 Hz */
wdenke28cf632004-03-14 15:20:55 +0000533#define STATUS_LED_BOOT 0 /* boot LED */
534
535#if (STATUS_LED_BITS > 1)
536#define STATUS_LED_BIT1 (1 << 1) /* LED[1] */
537#define STATUS_LED_STATE1 STATUS_LED_OFF
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200538#define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 10) /* ca. 5 Hz */
wdenke28cf632004-03-14 15:20:55 +0000539#define STATUS_LED_RED 1 /* fail LED */
540#endif
541
542#if (STATUS_LED_BITS > 2)
543#define STATUS_LED_BIT2 (1 << 2) /* LED[2] */
544#define STATUS_LED_STATE2 STATUS_LED_OFF
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200545#define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 2) /* ca. 1 Hz */
wdenke28cf632004-03-14 15:20:55 +0000546#define STATUS_LED_YELLOW 2 /* info LED */
547#endif
548
549#if (STATUS_LED_BITS > 3)
550#define STATUS_LED_BIT3 (1 << 3) /* LED[3] */
551#define STATUS_LED_STATE3 STATUS_LED_OFF
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200552#define STATUS_LED_PERIOD3 (CONFIG_SYS_HZ / 2) /* ca. 1 Hz */
wdenke28cf632004-03-14 15:20:55 +0000553#define STATUS_LED_GREEN 3 /* info LED */
554#endif
555
556#define STATUS_LED_PAR 1 /* makes status_led.h happy */
557
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200558#endif /* CONFIG_SYS_NIOS_CPU_PIO_NUMS */
wdenke28cf632004-03-14 15:20:55 +0000559
560/*------------------------------------------------------------------------
561 * Diagnostics / Power On Self Tests
562 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200563#define CONFIG_POST CONFIG_SYS_POST_RTC
564#define CONFIG_SYS_NIOS_POST_WORD_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
wdenke28cf632004-03-14 15:20:55 +0000565
Jon Loeligerf5709d12007-07-10 09:02:57 -0500566/*
567 * BOOTP options
568 */
569#define CONFIG_BOOTP_BOOTFILESIZE
570#define CONFIG_BOOTP_BOOTPATH
571#define CONFIG_BOOTP_GATEWAY
572#define CONFIG_BOOTP_HOSTNAME
573
Jon Loeligerea240f42007-07-05 19:13:52 -0500574/*
575 * Command line configuration.
576 */
Jean-Christophe PLAGNIOL-VILLARD5c97fa72007-10-24 18:16:01 +0200577#include <config_cmd_default.h>
wdenke28cf632004-03-14 15:20:55 +0000578
Jean-Christophe PLAGNIOL-VILLARD5c97fa72007-10-24 18:16:01 +0200579#define CONFIG_CMD_BSP
580#define CONFIG_CMD_CDP
581#define CONFIG_CMD_DHCP
582#define CONFIG_CMD_DIAG
583#define CONFIG_CMD_DISPLAY
584#define CONFIG_CMD_EXT2
585#define CONFIG_CMD_IMMAP
586#define CONFIG_CMD_IRQ
587#define CONFIG_CMD_PING
588#define CONFIG_CMD_PORTIO
589#define CONFIG_CMD_REGINFO
590#define CONFIG_CMD_REISER
591#define CONFIG_CMD_SAVES
592#define CONFIG_CMD_SDRAM
593#define CONFIG_CMD_SNTP
594
Jon Loeligerea240f42007-07-05 19:13:52 -0500595#undef CONFIG_CMD_NFS
Jon Loeligerea240f42007-07-05 19:13:52 -0500596#undef CONFIG_CMD_XIMG
597
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200598#if (CONFIG_SYS_NIOS_CPU_SPI_NUMS == 1)
Jean-Christophe PLAGNIOL-VILLARD5c97fa72007-10-24 18:16:01 +0200599#define CONFIG_CMD_DATE
600#define CONFIG_CMD_SPI
Jon Loeligerea240f42007-07-05 19:13:52 -0500601#endif
602
wdenke28cf632004-03-14 15:20:55 +0000603/*------------------------------------------------------------------------
604 * KGDB
605 *----------------------------------------------------------------------*/
Jon Loeligerea240f42007-07-05 19:13:52 -0500606#if defined(CONFIG_CMD_KGDB)
wdenke28cf632004-03-14 15:20:55 +0000607#define CONFIG_KGDB_BAUDRATE 9600
608#endif
609
610/*------------------------------------------------------------------------
611 * MISC
612 *----------------------------------------------------------------------*/
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200613#define CONFIG_SYS_LONGHELP /* undef to save memory */
614#define CONFIG_SYS_HUSH_PARSER 1 /* use "hush" command parser
wdenke28cf632004-03-14 15:20:55 +0000615 undef to save memory */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200616#define CONFIG_SYS_PROMPT "ADNPESC1 > " /* Monitor Command Prompt */
617#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
618#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
619#define CONFIG_SYS_MAXARGS 64 /* max number of command args*/
620#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
wdenke28cf632004-03-14 15:20:55 +0000621
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200622#ifdef CONFIG_SYS_HUSH_PARSER
623#define CONFIG_SYS_PROMPT_HUSH_PS2 "[]> "
wdenke28cf632004-03-14 15:20:55 +0000624#endif
625
626/* Default load address */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200627#if (CONFIG_SYS_SRAM_SIZE != 0)
wdenke28cf632004-03-14 15:20:55 +0000628
629/* default in SRAM */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200630#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SRAM_BASE
wdenke28cf632004-03-14 15:20:55 +0000631
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200632#elif (CONFIG_SYS_SDRAM_SIZE != 0)
wdenke28cf632004-03-14 15:20:55 +0000633
634/* default in SDRAM */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200635#if (CONFIG_SYS_SDRAM_BASE == CONFIG_SYS_NIOS_CPU_VEC_BASE)
wdenke28cf632004-03-14 15:20:55 +0000636#if 1
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200637#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_NIOS_CPU_VEC_SIZE)
wdenke28cf632004-03-14 15:20:55 +0000638#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200639#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x400000)
wdenke28cf632004-03-14 15:20:55 +0000640#endif
641#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200642#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
wdenke28cf632004-03-14 15:20:55 +0000643#endif
644
645#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200646#undef CONFIG_SYS_LOAD_ADDR /* force error break */
wdenke28cf632004-03-14 15:20:55 +0000647#endif
648
wdenke28cf632004-03-14 15:20:55 +0000649/* MEM test area */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200650#if (CONFIG_SYS_SDRAM_SIZE != 0)
wdenke28cf632004-03-14 15:20:55 +0000651
652/* SDRAM begin to stack area (1MB stack) */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200653#if (CONFIG_SYS_SDRAM_BASE == CONFIG_SYS_NIOS_CPU_VEC_BASE)
wdenke28cf632004-03-14 15:20:55 +0000654#if 0
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200655#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_NIOS_CPU_VEC_SIZE)
wdenke28cf632004-03-14 15:20:55 +0000656#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200657#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + 0x400000)
wdenke28cf632004-03-14 15:20:55 +0000658#endif
659#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200660#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
wdenke28cf632004-03-14 15:20:55 +0000661#endif
662
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200663#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - (1024 * 1024))
664#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - (1024 * 1024))
wdenke28cf632004-03-14 15:20:55 +0000665
666#else
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200667#undef CONFIG_SYS_MEMTEST_START /* force error break */
668#undef CONFIG_SYS_MEMTEST_END
wdenke28cf632004-03-14 15:20:55 +0000669#endif
670
Wolfgang Denk47f57792005-08-08 01:03:24 +0200671/*
672 * JFFS2 partitions
673 *
674 */
675/* No command line, one static partition */
676#undef CONFIG_JFFS2_CMDLINE
677#define CONFIG_JFFS2_DEV "nor"
678#define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
679#define CONFIG_JFFS2_PART_OFFSET 0x00000000
680
681/* mtdparts command line support */
682/*
683#define CONFIG_JFFS2_CMDLINE
684#define MTDIDS_DEFAULT ""
685#define MTDPARTS_DEFAULT ""
686*/
wdenke28cf632004-03-14 15:20:55 +0000687
688#endif /* __CONFIG_H */