blob: b528f5a6225a2e0156204cb3e96b660676c2b5a3 [file] [log] [blame]
Thomas Chou8cbb0dd2010-04-21 08:40:59 +08001/*
2 * (C) Copyright 2005, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
4 * (C) Copyright 2010, Thomas Chou <thomas@wytron.com.tw>
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Thomas Chou8cbb0dd2010-04-21 08:40:59 +08007 */
8
9#ifndef __CONFIG_H
10#define __CONFIG_H
11
12/*
13 * BOARD/CPU
14 */
15#include "../board/altera/nios2-generic/custom_fpga.h" /* fpga parameters */
16#define CONFIG_BOARD_NAME "nios2-generic" /* custom board name */
17#define CONFIG_BOARD_EARLY_INIT_F /* enable early board-spec. init */
18#define CONFIG_SYS_NIOS_SYSID_BASE CONFIG_SYS_SYSID_BASE
19
20/*
21 * SERIAL
22 */
23#define CONFIG_ALTERA_UART
24#if defined(CONFIG_ALTERA_JTAG_UART)
25# define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_JTAG_UART_BASE
26#else
27# define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE
28#endif
29
30#define CONFIG_ALTERA_JTAG_UART_BYPASS
31#define CONFIG_SYS_NIOS_FIXEDBAUD
32#define CONFIG_BAUDRATE CONFIG_SYS_UART_BAUD
33#define CONFIG_SYS_BAUDRATE_TABLE {CONFIG_BAUDRATE}
34#define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console info */
35
36/*
37 * TIMER
38 */
Graeme Russe110c4f2011-07-15 02:18:56 +000039#define CONFIG_SYS_LOW_RES_TIMER
Thomas Chou8cbb0dd2010-04-21 08:40:59 +080040#define CONFIG_SYS_NIOS_TMRBASE CONFIG_SYS_TIMER_BASE
41#define CONFIG_SYS_NIOS_TMRIRQ CONFIG_SYS_TIMER_IRQ
42#define CONFIG_SYS_HZ 1000 /* Always 1000 */
43#define CONFIG_SYS_NIOS_TMRMS 10 /* Desired period (msec)*/
44#define CONFIG_SYS_NIOS_TMRCNT \
45 (CONFIG_SYS_NIOS_TMRMS * (CONFIG_SYS_TIMER_FREQ / 1000) - 1)
46
47/*
48 * STATUS LED
49 */
Joachim Foersterdf969b52011-10-21 15:48:51 +020050#define CONFIG_ALTERA_PIO
51#define CONFIG_SYS_ALTERA_PIO_NUM 1
52#define CONFIG_SYS_ALTERA_PIO_GPIO_NUM LED_PIO_WIDTH
53
Thomas Chou8cbb0dd2010-04-21 08:40:59 +080054#define CONFIG_STATUS_LED /* Enable status driver */
Thomas Choudb719642012-11-05 12:51:54 +080055#define CONFIG_BOARD_SPECIFIC_LED
Thomas Chou1e8e9ba2010-04-30 11:34:15 +080056#define CONFIG_GPIO_LED /* Enable GPIO LED driver */
57#define CONFIG_GPIO /* Enable GPIO driver */
Thomas Chou8cbb0dd2010-04-21 08:40:59 +080058
Thomas Chou1e8e9ba2010-04-30 11:34:15 +080059#define STATUS_LED_BIT 0 /* Bit-0 on GPIO */
Thomas Chou8cbb0dd2010-04-21 08:40:59 +080060#define STATUS_LED_STATE 1 /* Blinking */
61#define STATUS_LED_PERIOD (500 / CONFIG_SYS_NIOS_TMRMS) /* 500 msec */
62
63/*
64 * BOOTP options
65 */
66#define CONFIG_BOOTP_BOOTFILESIZE
67#define CONFIG_BOOTP_BOOTPATH
68#define CONFIG_BOOTP_GATEWAY
69#define CONFIG_BOOTP_HOSTNAME
70
71/*
72 * Command line configuration.
73 */
74#include <config_cmd_default.h>
75#undef CONFIG_CMD_BOOTD
76#undef CONFIG_CMD_FPGA
77#undef CONFIG_CMD_IMLS
78#undef CONFIG_CMD_ITEST
79#undef CONFIG_CMD_NFS
80#undef CONFIG_CMD_SETGETDCR
81#undef CONFIG_CMD_XIMG
82
83#ifdef CONFIG_CMD_NET
Thomas Chou8cbb0dd2010-04-21 08:40:59 +080084# define CONFIG_CMD_DHCP
85# define CONFIG_CMD_PING
86#endif
87
88/*
89 * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
90 * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
91 * reset address, no? This will keep the environment in user region
92 * of flash. NOTE: the monitor length must be multiple of sector size
93 * (which is common practice).
94 */
95#define CONFIG_ENV_IS_IN_FLASH
96
97#define CONFIG_ENV_SIZE 0x10000 /* 64k, 1 sector */
98#define CONFIG_ENV_OVERWRITE /* Serial change Ok */
99#define CONFIG_ENV_ADDR ((CONFIG_SYS_RESET_ADDR + \
100 CONFIG_SYS_MONITOR_LEN) | \
101 CONFIG_SYS_FLASH_BASE)
102
103/*
104 * MEMORY ORGANIZATION
Thomas Chou7dfb0602012-04-23 10:55:02 +0800105 * -Monitor at top of sdram.
106 * -The heap is placed below the monitor
107 * -The stack is placed below the heap (&grows down).
Thomas Chou8cbb0dd2010-04-21 08:40:59 +0800108 */
109#define CONFIG_MONITOR_IS_IN_RAM
110#define CONFIG_SYS_MONITOR_LEN 0x40000 /* Reserve 256k */
111#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \
112 CONFIG_SYS_SDRAM_SIZE - \
113 CONFIG_SYS_MONITOR_LEN)
Thomas Chou8cbb0dd2010-04-21 08:40:59 +0800114#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000)
115#define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - \
116 CONFIG_SYS_MALLOC_LEN)
Thomas Chou7dfb0602012-04-23 10:55:02 +0800117#define CONFIG_SYS_INIT_SP CONFIG_SYS_MALLOC_BASE
Thomas Chou8cbb0dd2010-04-21 08:40:59 +0800118
119/*
120 * MISC
121 */
122#define CONFIG_SYS_LONGHELP /* Provide extended help */
123#define CONFIG_SYS_PROMPT "==> " /* Command prompt */
124#define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */
125#define CONFIG_SYS_MAXARGS 16 /* Max command args */
126#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */
127#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
128 sizeof(CONFIG_SYS_PROMPT) + \
129 16) /* Print buf size */
130#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
131#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
132#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000)
133#define CONFIG_CMDLINE_EDITING
134
135#define CONFIG_SYS_HUSH_PARSER
Thomas Chou8cbb0dd2010-04-21 08:40:59 +0800136
137#endif /* __CONFIG_H */