Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 1 | /* |
| 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 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | #ifndef __CONFIG_H |
| 26 | #define __CONFIG_H |
| 27 | |
| 28 | /* |
| 29 | * BOARD/CPU |
| 30 | */ |
| 31 | #include "../board/altera/nios2-generic/custom_fpga.h" /* fpga parameters */ |
| 32 | #define CONFIG_BOARD_NAME "nios2-generic" /* custom board name */ |
| 33 | #define CONFIG_BOARD_EARLY_INIT_F /* enable early board-spec. init */ |
| 34 | #define CONFIG_SYS_NIOS_SYSID_BASE CONFIG_SYS_SYSID_BASE |
| 35 | |
| 36 | /* |
| 37 | * SERIAL |
| 38 | */ |
| 39 | #define CONFIG_ALTERA_UART |
| 40 | #if defined(CONFIG_ALTERA_JTAG_UART) |
| 41 | # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_JTAG_UART_BASE |
| 42 | #else |
| 43 | # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE |
| 44 | #endif |
| 45 | |
| 46 | #define CONFIG_ALTERA_JTAG_UART_BYPASS |
| 47 | #define CONFIG_SYS_NIOS_FIXEDBAUD |
| 48 | #define CONFIG_BAUDRATE CONFIG_SYS_UART_BAUD |
| 49 | #define CONFIG_SYS_BAUDRATE_TABLE {CONFIG_BAUDRATE} |
| 50 | #define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console info */ |
| 51 | |
| 52 | /* |
| 53 | * TIMER |
| 54 | */ |
Graeme Russ | e110c4f | 2011-07-15 02:18:56 +0000 | [diff] [blame] | 55 | #define CONFIG_SYS_LOW_RES_TIMER |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 56 | #define CONFIG_SYS_NIOS_TMRBASE CONFIG_SYS_TIMER_BASE |
| 57 | #define CONFIG_SYS_NIOS_TMRIRQ CONFIG_SYS_TIMER_IRQ |
| 58 | #define CONFIG_SYS_HZ 1000 /* Always 1000 */ |
| 59 | #define CONFIG_SYS_NIOS_TMRMS 10 /* Desired period (msec)*/ |
| 60 | #define CONFIG_SYS_NIOS_TMRCNT \ |
| 61 | (CONFIG_SYS_NIOS_TMRMS * (CONFIG_SYS_TIMER_FREQ / 1000) - 1) |
| 62 | |
| 63 | /* |
| 64 | * STATUS LED |
| 65 | */ |
Joachim Foerster | df969b5 | 2011-10-21 15:48:51 +0200 | [diff] [blame] | 66 | #define CONFIG_ALTERA_PIO |
| 67 | #define CONFIG_SYS_ALTERA_PIO_NUM 1 |
| 68 | #define CONFIG_SYS_ALTERA_PIO_GPIO_NUM LED_PIO_WIDTH |
| 69 | |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 70 | #define CONFIG_STATUS_LED /* Enable status driver */ |
Thomas Chou | 1e8e9ba | 2010-04-30 11:34:15 +0800 | [diff] [blame] | 71 | #define CONFIG_GPIO_LED /* Enable GPIO LED driver */ |
| 72 | #define CONFIG_GPIO /* Enable GPIO driver */ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 73 | |
Thomas Chou | 1e8e9ba | 2010-04-30 11:34:15 +0800 | [diff] [blame] | 74 | #define STATUS_LED_BIT 0 /* Bit-0 on GPIO */ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 75 | #define STATUS_LED_STATE 1 /* Blinking */ |
| 76 | #define STATUS_LED_PERIOD (500 / CONFIG_SYS_NIOS_TMRMS) /* 500 msec */ |
| 77 | |
| 78 | /* |
| 79 | * BOOTP options |
| 80 | */ |
| 81 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 82 | #define CONFIG_BOOTP_BOOTPATH |
| 83 | #define CONFIG_BOOTP_GATEWAY |
| 84 | #define CONFIG_BOOTP_HOSTNAME |
| 85 | |
| 86 | /* |
| 87 | * Command line configuration. |
| 88 | */ |
| 89 | #include <config_cmd_default.h> |
| 90 | #undef CONFIG_CMD_BOOTD |
| 91 | #undef CONFIG_CMD_FPGA |
| 92 | #undef CONFIG_CMD_IMLS |
| 93 | #undef CONFIG_CMD_ITEST |
| 94 | #undef CONFIG_CMD_NFS |
| 95 | #undef CONFIG_CMD_SETGETDCR |
| 96 | #undef CONFIG_CMD_XIMG |
| 97 | |
| 98 | #ifdef CONFIG_CMD_NET |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 99 | # define CONFIG_CMD_DHCP |
| 100 | # define CONFIG_CMD_PING |
| 101 | #endif |
| 102 | |
| 103 | /* |
| 104 | * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above |
| 105 | * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the |
| 106 | * reset address, no? This will keep the environment in user region |
| 107 | * of flash. NOTE: the monitor length must be multiple of sector size |
| 108 | * (which is common practice). |
| 109 | */ |
| 110 | #define CONFIG_ENV_IS_IN_FLASH |
| 111 | |
| 112 | #define CONFIG_ENV_SIZE 0x10000 /* 64k, 1 sector */ |
| 113 | #define CONFIG_ENV_OVERWRITE /* Serial change Ok */ |
| 114 | #define CONFIG_ENV_ADDR ((CONFIG_SYS_RESET_ADDR + \ |
| 115 | CONFIG_SYS_MONITOR_LEN) | \ |
| 116 | CONFIG_SYS_FLASH_BASE) |
| 117 | |
| 118 | /* |
| 119 | * MEMORY ORGANIZATION |
| 120 | * -Monitor at top of sdram. |
| 121 | * -The heap is placed below the monitor |
| 122 | * -Global data is placed below the heap. |
| 123 | * -The stack is placed below global data (&grows down). |
| 124 | */ |
| 125 | #define CONFIG_MONITOR_IS_IN_RAM |
| 126 | #define CONFIG_SYS_MONITOR_LEN 0x40000 /* Reserve 256k */ |
| 127 | #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \ |
| 128 | CONFIG_SYS_SDRAM_SIZE - \ |
| 129 | CONFIG_SYS_MONITOR_LEN) |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 130 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000) |
| 131 | #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - \ |
| 132 | CONFIG_SYS_MALLOC_LEN) |
| 133 | #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_MALLOC_BASE - \ |
Alex Hornung | bb60db6 | 2012-02-20 23:45:45 +0000 | [diff] [blame] | 134 | GENERATED_GBL_DATA_SIZE - \ |
| 135 | GENERATED_BD_INFO_SIZE) |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 136 | #define CONFIG_SYS_INIT_SP CONFIG_SYS_GBL_DATA_OFFSET |
| 137 | |
| 138 | /* |
| 139 | * MISC |
| 140 | */ |
| 141 | #define CONFIG_SYS_LONGHELP /* Provide extended help */ |
| 142 | #define CONFIG_SYS_PROMPT "==> " /* Command prompt */ |
| 143 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */ |
| 144 | #define CONFIG_SYS_MAXARGS 16 /* Max command args */ |
| 145 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */ |
| 146 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 147 | sizeof(CONFIG_SYS_PROMPT) + \ |
| 148 | 16) /* Print buf size */ |
| 149 | #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE |
| 150 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
| 151 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000) |
| 152 | #define CONFIG_CMDLINE_EDITING |
| 153 | |
| 154 | #define CONFIG_SYS_HUSH_PARSER |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 155 | |
| 156 | #endif /* __CONFIG_H */ |