1 /* 2 * DO NOT MODIFY THIS FILE 3 * 4 * Changing this file will have subtle consequences 5 * which will almost certainly lead to a nonfunctioning 6 * system. If you do modify this file, be aware that your 7 * changes will be overwritten and lost when this file 8 * is generated again. 9 * 10 * DO NOT MODIFY THIS FILE 11 */ 12 13 /* 14 * License Agreement 15 * 16 * Copyright (c) 2008 17 * Altera Corporation, San Jose, California, USA. 18 * All rights reserved. 19 * 20 * Permission is hereby granted, free of charge, to any person obtaining a 21 * copy of this software and associated documentation files (the "Software"), 22 * to deal in the Software without restriction, including without limitation 23 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 24 * and/or sell copies of the Software, and to permit persons to whom the 25 * Software is furnished to do so, subject to the following conditions: 26 * 27 * The above copyright notice and this permission notice shall be included in 28 * all copies or substantial portions of the Software. 29 * 30 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 31 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 32 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 33 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 34 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 35 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 36 * DEALINGS IN THE SOFTWARE. 37 * 38 * This agreement shall be governed in all respects by the laws of the State 39 * of California and by the laws of the United States of America. 40 */ 41 42 #ifndef __SYSTEM_H_ 43 #define __SYSTEM_H_ 44 45 #include "linker.h" 46 47 /* 48 * CPU configuration 49 * 50 */ 51 52 #define ALT_CPU_ARCHITECTURE "altera_nios2_gen2" 53 #define ALT_CPU_BIG_ENDIAN 0 54 #define ALT_CPU_BREAK_ADDR 0x00200820 55 #define ALT_CPU_CPU_ARCH_NIOS2_R1 56 #define ALT_CPU_CPU_FREQ 50000000u 57 #define ALT_CPU_CPU_ID_SIZE 1 58 #define ALT_CPU_CPU_ID_VALUE 0x00000000 59 #define ALT_CPU_CPU_IMPLEMENTATION "tiny" 60 #define ALT_CPU_DATA_ADDR_WIDTH 0x17 61 #define ALT_CPU_DCACHE_LINE_SIZE 0 62 #define ALT_CPU_DCACHE_LINE_SIZE_LOG2 0 63 #define ALT_CPU_DCACHE_SIZE 0 64 #define ALT_CPU_EXCEPTION_ADDR 0x00400020 65 #define ALT_CPU_FLASH_ACCELERATOR_LINES 0 66 #define ALT_CPU_FLASH_ACCELERATOR_LINE_SIZE 0 67 #define ALT_CPU_FLUSHDA_SUPPORTED 68 #define ALT_CPU_FREQ 50000000 69 #define ALT_CPU_HARDWARE_DIVIDE_PRESENT 1 70 #define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 1 71 #define ALT_CPU_HARDWARE_MULX_PRESENT 1 72 #define ALT_CPU_HAS_DEBUG_CORE 1 73 #define ALT_CPU_HAS_DEBUG_STUB 74 #define ALT_CPU_HAS_ILLEGAL_INSTRUCTION_EXCEPTION 75 #define ALT_CPU_HAS_JMPI_INSTRUCTION 76 #define ALT_CPU_ICACHE_LINE_SIZE 0 77 #define ALT_CPU_ICACHE_LINE_SIZE_LOG2 0 78 #define ALT_CPU_ICACHE_SIZE 0 79 #define ALT_CPU_INST_ADDR_WIDTH 0x17 80 #define ALT_CPU_NAME "nios2_gen2_0" 81 #define ALT_CPU_OCI_VERSION 1 82 #define ALT_CPU_RESET_ADDR 0x00000000 83 #define ALT_CPU_HAS_EXTRA_EXCEPTION_INFO 1 84 85 86 #define ALT_DEVICE_FAMILY "MAX 10" 87 #define ALT_ENHANCED_INTERRUPT_API_PRESENT 88 #define ALT_IRQ_BASE NULL 89 #define ALT_LOG_PORT "/dev/null" 90 #define ALT_LOG_PORT_BASE 0x0 91 #define ALT_LOG_PORT_DEV null 92 #define ALT_LOG_PORT_TYPE "" 93 #define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0 94 #define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1 95 #define ALT_NUM_INTERRUPT_CONTROLLERS 1 96 #define ALT_STDERR "/dev/jtag_uart_0" 97 #define ALT_STDERR_BASE 0x201000 98 #define ALT_STDERR_DEV jtag_uart_0 99 #define ALT_STDERR_IS_JTAG_UART 100 #define ALT_STDERR_PRESENT 101 #define ALT_STDERR_TYPE "altera_avalon_jtag_uart" 102 #define ALT_STDIN "/dev/jtag_uart_0" 103 #define ALT_STDIN_BASE 0x201000 104 #define ALT_STDIN_DEV jtag_uart_0 105 #define ALT_STDIN_IS_JTAG_UART 106 #define ALT_STDIN_PRESENT 107 #define ALT_STDIN_TYPE "altera_avalon_jtag_uart" 108 #define ALT_STDOUT "/dev/jtag_uart_0" 109 #define ALT_STDOUT_BASE 0x201000 110 #define ALT_STDOUT_DEV jtag_uart_0 111 #define ALT_STDOUT_IS_JTAG_UART 112 #define ALT_STDOUT_PRESENT 113 #define ALT_STDOUT_TYPE "altera_avalon_jtag_uart" 114 #define ALT_SYSTEM_NAME "ghrd_10m50da" 115 116 117 /* 118 * a_16550_uart_0 configuration 119 * 120 */ 121 122 #define ALT_MODULE_CLASS_a_16550_uart_0 altera_16550_uart 123 #define A_16550_UART_0_BASE 0x440000 124 #define A_16550_UART_0_FIFO_DEPTH 64 125 #define A_16550_UART_0_FIFO_MODE 1 126 #define A_16550_UART_0_FIO_HWFC 0 127 #define A_16550_UART_0_FIO_SWFC 0 128 #define A_16550_UART_0_FREQ 50000000 129 #define A_16550_UART_0_IRQ 1 130 #define A_16550_UART_0_IRQ_INTERRUPT_CONTROLLER_ID 0 131 #define A_16550_UART_0_NAME "/dev/a_16550_uart_0" 132 #define A_16550_UART_0_SPAN 512 133 #define A_16550_UART_0_TYPE "altera_16550_uart" 134 135 136 /* 137 * hal configuration 138 * 139 */ 140 141 #define ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API 142 #define ALT_MAX_FD 32 143 #define ALT_SYS_CLK none 144 #define ALT_TIMESTAMP_CLK none 145 146 147 /* 148 * jtag_uart_0 configuration 149 * 150 */ 151 152 #define ALT_MODULE_CLASS_jtag_uart_0 altera_avalon_jtag_uart 153 #define JTAG_UART_0_BASE 0x201000 154 #define JTAG_UART_0_IRQ 0 155 #define JTAG_UART_0_IRQ_INTERRUPT_CONTROLLER_ID 0 156 #define JTAG_UART_0_NAME "/dev/jtag_uart_0" 157 #define JTAG_UART_0_READ_DEPTH 64 158 #define JTAG_UART_0_READ_THRESHOLD 8 159 #define JTAG_UART_0_SPAN 8 160 #define JTAG_UART_0_TYPE "altera_avalon_jtag_uart" 161 #define JTAG_UART_0_WRITE_DEPTH 64 162 #define JTAG_UART_0_WRITE_THRESHOLD 8 163 164 165 /* 166 * onchip_flash_0_csr configuration 167 * 168 */ 169 170 #define ALT_MODULE_CLASS_onchip_flash_0_csr altera_onchip_flash 171 #define ONCHIP_FLASH_0_CSR_BASE 0x200000 172 #define ONCHIP_FLASH_0_CSR_BYTES_PER_PAGE 8192 173 #define ONCHIP_FLASH_0_CSR_IRQ -1 174 #define ONCHIP_FLASH_0_CSR_IRQ_INTERRUPT_CONTROLLER_ID -1 175 #define ONCHIP_FLASH_0_CSR_NAME "/dev/onchip_flash_0_csr" 176 #define ONCHIP_FLASH_0_CSR_READ_ONLY_MODE 0 177 #define ONCHIP_FLASH_0_CSR_SECTOR1_ENABLED 1 178 #define ONCHIP_FLASH_0_CSR_SECTOR1_END_ADDR 0x7fff 179 #define ONCHIP_FLASH_0_CSR_SECTOR1_START_ADDR 0 180 #define ONCHIP_FLASH_0_CSR_SECTOR2_ENABLED 1 181 #define ONCHIP_FLASH_0_CSR_SECTOR2_END_ADDR 0xffff 182 #define ONCHIP_FLASH_0_CSR_SECTOR2_START_ADDR 0x8000 183 #define ONCHIP_FLASH_0_CSR_SECTOR3_ENABLED 1 184 #define ONCHIP_FLASH_0_CSR_SECTOR3_END_ADDR 0x6ffff 185 #define ONCHIP_FLASH_0_CSR_SECTOR3_START_ADDR 0x10000 186 #define ONCHIP_FLASH_0_CSR_SECTOR4_ENABLED 1 187 #define ONCHIP_FLASH_0_CSR_SECTOR4_END_ADDR 0xb7fff 188 #define ONCHIP_FLASH_0_CSR_SECTOR4_START_ADDR 0x70000 189 #define ONCHIP_FLASH_0_CSR_SECTOR5_ENABLED 0 190 #define ONCHIP_FLASH_0_CSR_SECTOR5_END_ADDR 0xffffffff 191 #define ONCHIP_FLASH_0_CSR_SECTOR5_START_ADDR 0xffffffff 192 #define ONCHIP_FLASH_0_CSR_SPAN 8 193 #define ONCHIP_FLASH_0_CSR_TYPE "altera_onchip_flash" 194 195 196 /* 197 * onchip_flash_0_data configuration 198 * 199 */ 200 201 #define ALT_MODULE_CLASS_onchip_flash_0_data altera_onchip_flash 202 #define ONCHIP_FLASH_0_DATA_BASE 0x0 203 #define ONCHIP_FLASH_0_DATA_BYTES_PER_PAGE 8192 204 #define ONCHIP_FLASH_0_DATA_IRQ -1 205 #define ONCHIP_FLASH_0_DATA_IRQ_INTERRUPT_CONTROLLER_ID -1 206 #define ONCHIP_FLASH_0_DATA_NAME "/dev/onchip_flash_0_data" 207 #define ONCHIP_FLASH_0_DATA_READ_ONLY_MODE 0 208 #define ONCHIP_FLASH_0_DATA_SECTOR1_ENABLED 1 209 #define ONCHIP_FLASH_0_DATA_SECTOR1_END_ADDR 0x7fff 210 #define ONCHIP_FLASH_0_DATA_SECTOR1_START_ADDR 0 211 #define ONCHIP_FLASH_0_DATA_SECTOR2_ENABLED 1 212 #define ONCHIP_FLASH_0_DATA_SECTOR2_END_ADDR 0xffff 213 #define ONCHIP_FLASH_0_DATA_SECTOR2_START_ADDR 0x8000 214 #define ONCHIP_FLASH_0_DATA_SECTOR3_ENABLED 1 215 #define ONCHIP_FLASH_0_DATA_SECTOR3_END_ADDR 0x6ffff 216 #define ONCHIP_FLASH_0_DATA_SECTOR3_START_ADDR 0x10000 217 #define ONCHIP_FLASH_0_DATA_SECTOR4_ENABLED 1 218 #define ONCHIP_FLASH_0_DATA_SECTOR4_END_ADDR 0xb7fff 219 #define ONCHIP_FLASH_0_DATA_SECTOR4_START_ADDR 0x70000 220 #define ONCHIP_FLASH_0_DATA_SECTOR5_ENABLED 0 221 #define ONCHIP_FLASH_0_DATA_SECTOR5_END_ADDR 0xffffffff 222 #define ONCHIP_FLASH_0_DATA_SECTOR5_START_ADDR 0xffffffff 223 #define ONCHIP_FLASH_0_DATA_SPAN 753664 224 #define ONCHIP_FLASH_0_DATA_TYPE "altera_onchip_flash" 225 226 227 /* 228 * onchip_memory2_0 configuration 229 * 230 */ 231 232 #define ALT_MODULE_CLASS_onchip_memory2_0 altera_avalon_onchip_memory2 233 #define ONCHIP_MEMORY2_0_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0 234 #define ONCHIP_MEMORY2_0_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0 235 #define ONCHIP_MEMORY2_0_BASE 0x400000 236 #define ONCHIP_MEMORY2_0_CONTENTS_INFO "" 237 #define ONCHIP_MEMORY2_0_DUAL_PORT 0 238 #define ONCHIP_MEMORY2_0_GUI_RAM_BLOCK_TYPE "AUTO" 239 #define ONCHIP_MEMORY2_0_INIT_CONTENTS_FILE "ghrd_10m50da_onchip_memory2_0" 240 #define ONCHIP_MEMORY2_0_INIT_MEM_CONTENT 0 241 #define ONCHIP_MEMORY2_0_INSTANCE_ID "NONE" 242 #define ONCHIP_MEMORY2_0_IRQ -1 243 #define ONCHIP_MEMORY2_0_IRQ_INTERRUPT_CONTROLLER_ID -1 244 #define ONCHIP_MEMORY2_0_NAME "/dev/onchip_memory2_0" 245 #define ONCHIP_MEMORY2_0_NON_DEFAULT_INIT_FILE_ENABLED 0 246 #define ONCHIP_MEMORY2_0_RAM_BLOCK_TYPE "AUTO" 247 #define ONCHIP_MEMORY2_0_READ_DURING_WRITE_MODE "DONT_CARE" 248 #define ONCHIP_MEMORY2_0_SINGLE_CLOCK_OP 0 249 #define ONCHIP_MEMORY2_0_SIZE_MULTIPLE 1 250 #define ONCHIP_MEMORY2_0_SIZE_VALUE 262144 251 #define ONCHIP_MEMORY2_0_SPAN 262144 252 #define ONCHIP_MEMORY2_0_TYPE "altera_avalon_onchip_memory2" 253 #define ONCHIP_MEMORY2_0_WRITABLE 1 254 255 256 /* 257 * timer_0 configuration 258 * 259 */ 260 261 #define ALT_MODULE_CLASS_timer_0 altera_avalon_timer 262 #define TIMER_0_ALWAYS_RUN 0 263 #define TIMER_0_BASE 0x440200 264 #define TIMER_0_COUNTER_SIZE 32 265 #define TIMER_0_FIXED_PERIOD 0 266 #define TIMER_0_FREQ 50000000 267 #define TIMER_0_IRQ 2 268 #define TIMER_0_IRQ_INTERRUPT_CONTROLLER_ID 0 269 #define TIMER_0_LOAD_VALUE 49999 270 #define TIMER_0_MULT 0.001 271 #define TIMER_0_NAME "/dev/timer_0" 272 #define TIMER_0_PERIOD 1 273 #define TIMER_0_PERIOD_UNITS "ms" 274 #define TIMER_0_RESET_OUTPUT 0 275 #define TIMER_0_SNAPSHOT 1 276 #define TIMER_0_SPAN 32 277 #define TIMER_0_TICKS_PER_SEC 1000 278 #define TIMER_0_TIMEOUT_PULSE_OUTPUT 0 279 #define TIMER_0_TYPE "altera_avalon_timer" 280 281 #endif /* __SYSTEM_H_ */ 282