blob: e0ee04784eedac714bcd8cc40e82aa5eaa5652b6 [file] [log] [blame]
Thomas Chou7ffbbf52010-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 Denkbd8ec7e2013-10-07 13:07:26 +02006 * SPDX-License-Identifier: GPL-2.0+
Thomas Chou7ffbbf52010-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 */
Thomas Chou3fc0ac22015-09-04 16:19:16 +080018#define CONFIG_BOARD_EARLY_INIT_R
Thomas Choucce3e752014-08-22 11:36:47 +080019#define CONFIG_DISPLAY_CPUINFO
20#define CONFIG_DISPLAY_BOARDINFO
Thomas Chou7ffbbf52010-04-21 08:40:59 +080021#define CONFIG_SYS_NIOS_SYSID_BASE CONFIG_SYS_SYSID_BASE
22
23/*
24 * SERIAL
25 */
Thomas Chou7ffbbf52010-04-21 08:40:59 +080026#if defined(CONFIG_ALTERA_JTAG_UART)
Thomas Chou7ffbbf52010-04-21 08:40:59 +080027#else
28# define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE
29#endif
30
Thomas Chou7ffbbf52010-04-21 08:40:59 +080031#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 */
Thomas Chou47903a62015-10-08 21:17:42 +080039#define CONFIG_SYS_TIMER_RATE CONFIG_SYS_TIMER_FREQ
Thomas Chou7ffbbf52010-04-21 08:40:59 +080040
41/*
42 * STATUS LED
43 */
Joachim Foersterb19bfad2011-10-21 15:48:51 +020044#define CONFIG_ALTERA_PIO
45#define CONFIG_SYS_ALTERA_PIO_NUM 1
46#define CONFIG_SYS_ALTERA_PIO_GPIO_NUM LED_PIO_WIDTH
47
Thomas Chou7ffbbf52010-04-21 08:40:59 +080048#define CONFIG_STATUS_LED /* Enable status driver */
Thomas Choud3db57b2012-11-05 12:51:54 +080049#define CONFIG_BOARD_SPECIFIC_LED
Thomas Chouf6a59cb2010-04-30 11:34:15 +080050#define CONFIG_GPIO_LED /* Enable GPIO LED driver */
51#define CONFIG_GPIO /* Enable GPIO driver */
Thomas Chou2f8e2562014-08-30 17:45:23 +080052#define LED_PIO_BASE USER_LED_PIO_8OUT_BASE
53#define LED_PIO_WIDTH 8
54#define LED_PIO_RSTVAL 0xff
Thomas Chou7ffbbf52010-04-21 08:40:59 +080055
Thomas Chouf6a59cb2010-04-30 11:34:15 +080056#define STATUS_LED_BIT 0 /* Bit-0 on GPIO */
Thomas Chou7ffbbf52010-04-21 08:40:59 +080057#define STATUS_LED_STATE 1 /* Blinking */
Thomas Chou16dc04b2015-10-08 21:23:37 +080058#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* 500 msec */
Thomas Chou7ffbbf52010-04-21 08:40:59 +080059
60/*
61 * BOOTP options
62 */
63#define CONFIG_BOOTP_BOOTFILESIZE
64#define CONFIG_BOOTP_BOOTPATH
65#define CONFIG_BOOTP_GATEWAY
66#define CONFIG_BOOTP_HOSTNAME
67
68/*
Thomas Chou44d3cf42015-08-26 21:24:35 +080069 * FDT options
Thomas Chou7ffbbf52010-04-21 08:40:59 +080070 */
Thomas Chou2f8e2562014-08-30 17:45:23 +080071#define CONFIG_OF_LIBFDT
72#define CONFIG_OF_BOARD_SETUP
73#define CONFIG_LMB
74
Thomas Chou7ffbbf52010-04-21 08:40:59 +080075/*
76 * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
77 * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
78 * reset address, no? This will keep the environment in user region
79 * of flash. NOTE: the monitor length must be multiple of sector size
80 * (which is common practice).
81 */
82#define CONFIG_ENV_IS_IN_FLASH
83
Thomas Chou2f8e2562014-08-30 17:45:23 +080084#define CONFIG_ENV_SIZE 0x20000 /* 128k, 1 sector */
Thomas Chou7ffbbf52010-04-21 08:40:59 +080085#define CONFIG_ENV_OVERWRITE /* Serial change Ok */
86#define CONFIG_ENV_ADDR ((CONFIG_SYS_RESET_ADDR + \
87 CONFIG_SYS_MONITOR_LEN) | \
88 CONFIG_SYS_FLASH_BASE)
89
90/*
91 * MEMORY ORGANIZATION
Thomas Choufe06c182012-04-23 10:55:02 +080092 * -Monitor at top of sdram.
93 * -The heap is placed below the monitor
94 * -The stack is placed below the heap (&grows down).
Thomas Chou7ffbbf52010-04-21 08:40:59 +080095 */
96#define CONFIG_MONITOR_IS_IN_RAM
97#define CONFIG_SYS_MONITOR_LEN 0x40000 /* Reserve 256k */
98#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \
99 CONFIG_SYS_SDRAM_SIZE - \
100 CONFIG_SYS_MONITOR_LEN)
Thomas Chou7ffbbf52010-04-21 08:40:59 +0800101#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000)
102#define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - \
103 CONFIG_SYS_MALLOC_LEN)
Thomas Choufe06c182012-04-23 10:55:02 +0800104#define CONFIG_SYS_INIT_SP CONFIG_SYS_MALLOC_BASE
Thomas Chou7ffbbf52010-04-21 08:40:59 +0800105
106/*
107 * MISC
108 */
109#define CONFIG_SYS_LONGHELP /* Provide extended help */
Thomas Chou7ffbbf52010-04-21 08:40:59 +0800110#define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */
111#define CONFIG_SYS_MAXARGS 16 /* Max command args */
112#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */
113#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
114 sizeof(CONFIG_SYS_PROMPT) + \
115 16) /* Print buf size */
116#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
117#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
118#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000)
119#define CONFIG_CMDLINE_EDITING
120
Thomas Chou7ffbbf52010-04-21 08:40:59 +0800121#endif /* __CONFIG_H */