3d29a1f7af8b8e33a08de3cae572373e40afbf47
[platform/kernel/u-boot.git] / include / configs / nios2-generic.h
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  * SPDX-License-Identifier:     GPL-2.0+
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_BOARD_EARLY_INIT_R
19 #define CONFIG_DISPLAY_CPUINFO
20 #define CONFIG_DISPLAY_BOARDINFO
21 #define CONFIG_SYS_NIOS_SYSID_BASE      CONFIG_SYS_SYSID_BASE
22
23 /*
24  * SERIAL
25  */
26 #define CONFIG_ALTERA_JTAG_UART
27 #if defined(CONFIG_ALTERA_JTAG_UART)
28 # define CONFIG_SYS_NIOS_CONSOLE        CONFIG_SYS_JTAG_UART_BASE
29 #else
30 # define CONFIG_SYS_NIOS_CONSOLE        CONFIG_SYS_UART_BASE
31 #endif
32
33 #define CONFIG_ALTERA_JTAG_UART_BYPASS
34 #define CONFIG_SYS_NIOS_FIXEDBAUD
35 #define CONFIG_BAUDRATE         CONFIG_SYS_UART_BAUD
36 #define CONFIG_SYS_BAUDRATE_TABLE       {CONFIG_BAUDRATE}
37 #define CONFIG_SYS_CONSOLE_INFO_QUIET   /* Suppress console info */
38
39 /*
40  * TIMER
41  */
42 #define CONFIG_SYS_TIMER_RATE           CONFIG_SYS_TIMER_FREQ
43
44 /*
45  * STATUS LED
46  */
47 #define CONFIG_ALTERA_PIO
48 #define CONFIG_SYS_ALTERA_PIO_NUM       1
49 #define CONFIG_SYS_ALTERA_PIO_GPIO_NUM  LED_PIO_WIDTH
50
51 #define CONFIG_STATUS_LED               /* Enable status driver */
52 #define CONFIG_BOARD_SPECIFIC_LED
53 #define CONFIG_GPIO_LED         /* Enable GPIO LED driver */
54 #define CONFIG_GPIO                     /* Enable GPIO driver */
55 #define LED_PIO_BASE                    USER_LED_PIO_8OUT_BASE
56 #define LED_PIO_WIDTH                   8
57 #define LED_PIO_RSTVAL                  0xff
58
59 #define STATUS_LED_BIT                  0       /* Bit-0 on GPIO */
60 #define STATUS_LED_STATE                1       /* Blinking */
61 #define STATUS_LED_PERIOD       (CONFIG_SYS_HZ / 2)     /* 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  * FDT options
73  */
74 #define CONFIG_OF_LIBFDT
75 #define CONFIG_OF_BOARD_SETUP
76 #define CONFIG_LMB
77
78 /*
79  * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
80  * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
81  * reset address, no? This will keep the environment in user region
82  * of flash. NOTE: the monitor length must be multiple of sector size
83  * (which is common practice).
84  */
85 #define CONFIG_ENV_IS_IN_FLASH
86
87 #define CONFIG_ENV_SIZE         0x20000 /* 128k, 1 sector */
88 #define CONFIG_ENV_OVERWRITE            /* Serial change Ok     */
89 #define CONFIG_ENV_ADDR         ((CONFIG_SYS_RESET_ADDR + \
90                                           CONFIG_SYS_MONITOR_LEN) | \
91                                          CONFIG_SYS_FLASH_BASE)
92
93 /*
94  * MEMORY ORGANIZATION
95  * -Monitor at top of sdram.
96  * -The heap is placed below the monitor
97  * -The stack is placed below the heap (&grows down).
98  */
99 #define CONFIG_MONITOR_IS_IN_RAM
100 #define CONFIG_SYS_MONITOR_LEN          0x40000 /* Reserve 256k */
101 #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \
102                                          CONFIG_SYS_SDRAM_SIZE - \
103                                          CONFIG_SYS_MONITOR_LEN)
104 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + 0x20000)
105 #define CONFIG_SYS_MALLOC_BASE          (CONFIG_SYS_MONITOR_BASE - \
106                                          CONFIG_SYS_MALLOC_LEN)
107 #define CONFIG_SYS_INIT_SP              CONFIG_SYS_MALLOC_BASE
108
109 /*
110  * MISC
111  */
112 #define CONFIG_SYS_LONGHELP             /* Provide extended help */
113 #define CONFIG_SYS_CBSIZE               256     /* Console I/O buf size */
114 #define CONFIG_SYS_MAXARGS              16      /* Max command args     */
115 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE /* Bootarg buf size */
116 #define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE + \
117                                         sizeof(CONFIG_SYS_PROMPT) + \
118                                          16)    /* Print buf size */
119 #define CONFIG_SYS_LOAD_ADDR            CONFIG_SYS_SDRAM_BASE
120 #define CONFIG_SYS_MEMTEST_START        CONFIG_SYS_SDRAM_BASE
121 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_INIT_SP - 0x20000)
122 #define CONFIG_CMDLINE_EDITING
123
124 #endif /* __CONFIG_H */