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 | * |
Wolfgang Denk | 3765b3e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 7 | */ |
| 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 Russ | e110c4f | 2011-07-15 02:18:56 +0000 | [diff] [blame] | 39 | #define CONFIG_SYS_LOW_RES_TIMER |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 40 | #define CONFIG_SYS_NIOS_TMRBASE CONFIG_SYS_TIMER_BASE |
| 41 | #define CONFIG_SYS_NIOS_TMRIRQ CONFIG_SYS_TIMER_IRQ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 42 | #define CONFIG_SYS_NIOS_TMRMS 10 /* Desired period (msec)*/ |
| 43 | #define CONFIG_SYS_NIOS_TMRCNT \ |
| 44 | (CONFIG_SYS_NIOS_TMRMS * (CONFIG_SYS_TIMER_FREQ / 1000) - 1) |
| 45 | |
| 46 | /* |
| 47 | * STATUS LED |
| 48 | */ |
Joachim Foerster | df969b5 | 2011-10-21 15:48:51 +0200 | [diff] [blame] | 49 | #define CONFIG_ALTERA_PIO |
| 50 | #define CONFIG_SYS_ALTERA_PIO_NUM 1 |
| 51 | #define CONFIG_SYS_ALTERA_PIO_GPIO_NUM LED_PIO_WIDTH |
| 52 | |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 53 | #define CONFIG_STATUS_LED /* Enable status driver */ |
Thomas Chou | db71964 | 2012-11-05 12:51:54 +0800 | [diff] [blame] | 54 | #define CONFIG_BOARD_SPECIFIC_LED |
Thomas Chou | 1e8e9ba | 2010-04-30 11:34:15 +0800 | [diff] [blame] | 55 | #define CONFIG_GPIO_LED /* Enable GPIO LED driver */ |
| 56 | #define CONFIG_GPIO /* Enable GPIO driver */ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 57 | |
Thomas Chou | 1e8e9ba | 2010-04-30 11:34:15 +0800 | [diff] [blame] | 58 | #define STATUS_LED_BIT 0 /* Bit-0 on GPIO */ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 59 | #define STATUS_LED_STATE 1 /* Blinking */ |
| 60 | #define STATUS_LED_PERIOD (500 / CONFIG_SYS_NIOS_TMRMS) /* 500 msec */ |
| 61 | |
| 62 | /* |
| 63 | * BOOTP options |
| 64 | */ |
| 65 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 66 | #define CONFIG_BOOTP_BOOTPATH |
| 67 | #define CONFIG_BOOTP_GATEWAY |
| 68 | #define CONFIG_BOOTP_HOSTNAME |
| 69 | |
| 70 | /* |
| 71 | * Command line configuration. |
| 72 | */ |
| 73 | #include <config_cmd_default.h> |
| 74 | #undef CONFIG_CMD_BOOTD |
| 75 | #undef CONFIG_CMD_FPGA |
| 76 | #undef CONFIG_CMD_IMLS |
| 77 | #undef CONFIG_CMD_ITEST |
| 78 | #undef CONFIG_CMD_NFS |
| 79 | #undef CONFIG_CMD_SETGETDCR |
| 80 | #undef CONFIG_CMD_XIMG |
| 81 | |
| 82 | #ifdef CONFIG_CMD_NET |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 83 | # define CONFIG_CMD_DHCP |
| 84 | # define CONFIG_CMD_PING |
| 85 | #endif |
| 86 | |
| 87 | /* |
| 88 | * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above |
| 89 | * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the |
| 90 | * reset address, no? This will keep the environment in user region |
| 91 | * of flash. NOTE: the monitor length must be multiple of sector size |
| 92 | * (which is common practice). |
| 93 | */ |
| 94 | #define CONFIG_ENV_IS_IN_FLASH |
| 95 | |
| 96 | #define CONFIG_ENV_SIZE 0x10000 /* 64k, 1 sector */ |
| 97 | #define CONFIG_ENV_OVERWRITE /* Serial change Ok */ |
| 98 | #define CONFIG_ENV_ADDR ((CONFIG_SYS_RESET_ADDR + \ |
| 99 | CONFIG_SYS_MONITOR_LEN) | \ |
| 100 | CONFIG_SYS_FLASH_BASE) |
| 101 | |
| 102 | /* |
| 103 | * MEMORY ORGANIZATION |
Thomas Chou | 7dfb060 | 2012-04-23 10:55:02 +0800 | [diff] [blame] | 104 | * -Monitor at top of sdram. |
| 105 | * -The heap is placed below the monitor |
| 106 | * -The stack is placed below the heap (&grows down). |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 107 | */ |
| 108 | #define CONFIG_MONITOR_IS_IN_RAM |
| 109 | #define CONFIG_SYS_MONITOR_LEN 0x40000 /* Reserve 256k */ |
| 110 | #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \ |
| 111 | CONFIG_SYS_SDRAM_SIZE - \ |
| 112 | CONFIG_SYS_MONITOR_LEN) |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 113 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000) |
| 114 | #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - \ |
| 115 | CONFIG_SYS_MALLOC_LEN) |
Thomas Chou | 7dfb060 | 2012-04-23 10:55:02 +0800 | [diff] [blame] | 116 | #define CONFIG_SYS_INIT_SP CONFIG_SYS_MALLOC_BASE |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 117 | |
| 118 | /* |
| 119 | * MISC |
| 120 | */ |
| 121 | #define CONFIG_SYS_LONGHELP /* Provide extended help */ |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 122 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */ |
| 123 | #define CONFIG_SYS_MAXARGS 16 /* Max command args */ |
| 124 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */ |
| 125 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 126 | sizeof(CONFIG_SYS_PROMPT) + \ |
| 127 | 16) /* Print buf size */ |
| 128 | #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE |
| 129 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
| 130 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000) |
| 131 | #define CONFIG_CMDLINE_EDITING |
| 132 | |
| 133 | #define CONFIG_SYS_HUSH_PARSER |
Thomas Chou | 8cbb0dd | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 134 | |
| 135 | #endif /* __CONFIG_H */ |