Thomas Chou | 7ffbbf5 | 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 | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Thomas Chou | 7ffbbf5 | 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 */ |
Thomas Chou | 3fc0ac2 | 2015-09-04 16:19:16 +0800 | [diff] [blame] | 18 | #define CONFIG_BOARD_EARLY_INIT_R |
Thomas Chou | cce3e75 | 2014-08-22 11:36:47 +0800 | [diff] [blame] | 19 | #define CONFIG_DISPLAY_CPUINFO |
| 20 | #define CONFIG_DISPLAY_BOARDINFO |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 21 | #define CONFIG_SYS_NIOS_SYSID_BASE CONFIG_SYS_SYSID_BASE |
| 22 | |
| 23 | /* |
| 24 | * SERIAL |
| 25 | */ |
Thomas Chou | 6917a5d | 2015-10-21 21:26:54 +0800 | [diff] [blame^] | 26 | #define CONFIG_BAUDRATE 115200 |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 27 | #define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console info */ |
| 28 | |
| 29 | /* |
| 30 | * TIMER |
| 31 | */ |
Thomas Chou | 47903a6 | 2015-10-08 21:17:42 +0800 | [diff] [blame] | 32 | #define CONFIG_SYS_TIMER_RATE CONFIG_SYS_TIMER_FREQ |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 33 | |
| 34 | /* |
| 35 | * STATUS LED |
| 36 | */ |
Joachim Foerster | b19bfad | 2011-10-21 15:48:51 +0200 | [diff] [blame] | 37 | #define CONFIG_ALTERA_PIO |
| 38 | #define CONFIG_SYS_ALTERA_PIO_NUM 1 |
| 39 | #define CONFIG_SYS_ALTERA_PIO_GPIO_NUM LED_PIO_WIDTH |
| 40 | |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 41 | #define CONFIG_STATUS_LED /* Enable status driver */ |
Thomas Chou | d3db57b | 2012-11-05 12:51:54 +0800 | [diff] [blame] | 42 | #define CONFIG_BOARD_SPECIFIC_LED |
Thomas Chou | f6a59cb | 2010-04-30 11:34:15 +0800 | [diff] [blame] | 43 | #define CONFIG_GPIO_LED /* Enable GPIO LED driver */ |
| 44 | #define CONFIG_GPIO /* Enable GPIO driver */ |
Thomas Chou | 2f8e256 | 2014-08-30 17:45:23 +0800 | [diff] [blame] | 45 | #define LED_PIO_BASE USER_LED_PIO_8OUT_BASE |
| 46 | #define LED_PIO_WIDTH 8 |
| 47 | #define LED_PIO_RSTVAL 0xff |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 48 | |
Thomas Chou | f6a59cb | 2010-04-30 11:34:15 +0800 | [diff] [blame] | 49 | #define STATUS_LED_BIT 0 /* Bit-0 on GPIO */ |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 50 | #define STATUS_LED_STATE 1 /* Blinking */ |
Thomas Chou | 16dc04b | 2015-10-08 21:23:37 +0800 | [diff] [blame] | 51 | #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* 500 msec */ |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 52 | |
| 53 | /* |
| 54 | * BOOTP options |
| 55 | */ |
| 56 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 57 | #define CONFIG_BOOTP_BOOTPATH |
| 58 | #define CONFIG_BOOTP_GATEWAY |
| 59 | #define CONFIG_BOOTP_HOSTNAME |
| 60 | |
| 61 | /* |
Thomas Chou | 44d3cf4 | 2015-08-26 21:24:35 +0800 | [diff] [blame] | 62 | * FDT options |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 63 | */ |
Thomas Chou | 2f8e256 | 2014-08-30 17:45:23 +0800 | [diff] [blame] | 64 | #define CONFIG_OF_LIBFDT |
| 65 | #define CONFIG_OF_BOARD_SETUP |
| 66 | #define CONFIG_LMB |
| 67 | |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 68 | /* |
| 69 | * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above |
| 70 | * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the |
| 71 | * reset address, no? This will keep the environment in user region |
| 72 | * of flash. NOTE: the monitor length must be multiple of sector size |
| 73 | * (which is common practice). |
| 74 | */ |
| 75 | #define CONFIG_ENV_IS_IN_FLASH |
| 76 | |
Thomas Chou | 2f8e256 | 2014-08-30 17:45:23 +0800 | [diff] [blame] | 77 | #define CONFIG_ENV_SIZE 0x20000 /* 128k, 1 sector */ |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 78 | #define CONFIG_ENV_OVERWRITE /* Serial change Ok */ |
| 79 | #define CONFIG_ENV_ADDR ((CONFIG_SYS_RESET_ADDR + \ |
| 80 | CONFIG_SYS_MONITOR_LEN) | \ |
| 81 | CONFIG_SYS_FLASH_BASE) |
| 82 | |
| 83 | /* |
| 84 | * MEMORY ORGANIZATION |
Thomas Chou | fe06c18 | 2012-04-23 10:55:02 +0800 | [diff] [blame] | 85 | * -Monitor at top of sdram. |
| 86 | * -The heap is placed below the monitor |
| 87 | * -The stack is placed below the heap (&grows down). |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 88 | */ |
| 89 | #define CONFIG_MONITOR_IS_IN_RAM |
| 90 | #define CONFIG_SYS_MONITOR_LEN 0x40000 /* Reserve 256k */ |
| 91 | #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \ |
| 92 | CONFIG_SYS_SDRAM_SIZE - \ |
| 93 | CONFIG_SYS_MONITOR_LEN) |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 94 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000) |
| 95 | #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - \ |
| 96 | CONFIG_SYS_MALLOC_LEN) |
Thomas Chou | fe06c18 | 2012-04-23 10:55:02 +0800 | [diff] [blame] | 97 | #define CONFIG_SYS_INIT_SP CONFIG_SYS_MALLOC_BASE |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 98 | |
| 99 | /* |
| 100 | * MISC |
| 101 | */ |
| 102 | #define CONFIG_SYS_LONGHELP /* Provide extended help */ |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 103 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */ |
| 104 | #define CONFIG_SYS_MAXARGS 16 /* Max command args */ |
| 105 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */ |
| 106 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 107 | sizeof(CONFIG_SYS_PROMPT) + \ |
| 108 | 16) /* Print buf size */ |
| 109 | #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE |
| 110 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
| 111 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000) |
| 112 | #define CONFIG_CMDLINE_EDITING |
| 113 | |
Thomas Chou | 7ffbbf5 | 2010-04-21 08:40:59 +0800 | [diff] [blame] | 114 | #endif /* __CONFIG_H */ |