nios2-generic.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. #ifndef __CONFIG_H
  25. #define __CONFIG_H
  26. /*
  27. * BOARD/CPU
  28. */
  29. #include "../board/altera/nios2-generic/custom_fpga.h" /* fpga parameters */
  30. #define CONFIG_BOARD_NAME "nios2-generic" /* custom board name */
  31. #define CONFIG_BOARD_EARLY_INIT_F /* enable early board-spec. init */
  32. #define CONFIG_SYS_NIOS_SYSID_BASE CONFIG_SYS_SYSID_BASE
  33. /*
  34. * SERIAL
  35. */
  36. #define CONFIG_ALTERA_UART
  37. #if defined(CONFIG_ALTERA_JTAG_UART)
  38. # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_JTAG_UART_BASE
  39. #else
  40. # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE
  41. #endif
  42. #define CONFIG_ALTERA_JTAG_UART_BYPASS
  43. #define CONFIG_SYS_NIOS_FIXEDBAUD
  44. #define CONFIG_BAUDRATE CONFIG_SYS_UART_BAUD
  45. #define CONFIG_SYS_BAUDRATE_TABLE {CONFIG_BAUDRATE}
  46. #define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console info */
  47. /*
  48. * TIMER
  49. */
  50. #define CONFIG_SYS_LOW_RES_TIMER
  51. #define CONFIG_SYS_NIOS_TMRBASE CONFIG_SYS_TIMER_BASE
  52. #define CONFIG_SYS_NIOS_TMRIRQ CONFIG_SYS_TIMER_IRQ
  53. #define CONFIG_SYS_HZ 1000 /* Always 1000 */
  54. #define CONFIG_SYS_NIOS_TMRMS 10 /* Desired period (msec)*/
  55. #define CONFIG_SYS_NIOS_TMRCNT \
  56. (CONFIG_SYS_NIOS_TMRMS * (CONFIG_SYS_TIMER_FREQ / 1000) - 1)
  57. /*
  58. * STATUS LED
  59. */
  60. #define CONFIG_STATUS_LED /* Enable status driver */
  61. #define CONFIG_GPIO_LED /* Enable GPIO LED driver */
  62. #define CONFIG_GPIO /* Enable GPIO driver */
  63. #define STATUS_LED_BIT 0 /* Bit-0 on GPIO */
  64. #define STATUS_LED_STATE 1 /* Blinking */
  65. #define STATUS_LED_PERIOD (500 / CONFIG_SYS_NIOS_TMRMS) /* 500 msec */
  66. /*
  67. * BOOTP options
  68. */
  69. #define CONFIG_BOOTP_BOOTFILESIZE
  70. #define CONFIG_BOOTP_BOOTPATH
  71. #define CONFIG_BOOTP_GATEWAY
  72. #define CONFIG_BOOTP_HOSTNAME
  73. /*
  74. * Command line configuration.
  75. */
  76. #include <config_cmd_default.h>
  77. #undef CONFIG_CMD_BOOTD
  78. #undef CONFIG_CMD_FPGA
  79. #undef CONFIG_CMD_IMLS
  80. #undef CONFIG_CMD_ITEST
  81. #undef CONFIG_CMD_NFS
  82. #undef CONFIG_CMD_SETGETDCR
  83. #undef CONFIG_CMD_XIMG
  84. #ifdef CONFIG_CMD_NET
  85. # define CONFIG_CMD_DHCP
  86. # define CONFIG_CMD_PING
  87. #endif
  88. /*
  89. * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
  90. * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
  91. * reset address, no? This will keep the environment in user region
  92. * of flash. NOTE: the monitor length must be multiple of sector size
  93. * (which is common practice).
  94. */
  95. #define CONFIG_ENV_IS_IN_FLASH
  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. * MEMORY ORGANIZATION
  103. * -Monitor at top of sdram.
  104. * -The heap is placed below the monitor
  105. * -Global data is placed below the heap.
  106. * -The stack is placed below global data (&grows down).
  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)
  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)
  116. #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_MALLOC_BASE - \
  117. GENERATED_GBL_DATA_SIZE)
  118. #define CONFIG_SYS_INIT_SP CONFIG_SYS_GBL_DATA_OFFSET
  119. /*
  120. * MISC
  121. */
  122. #define CONFIG_SYS_LONGHELP /* Provide extended help */
  123. #define CONFIG_SYS_PROMPT "==> " /* Command prompt */
  124. #define CONFIG_SYS_CBSIZE 256 /* Console I/O buf size */
  125. #define CONFIG_SYS_MAXARGS 16 /* Max command args */
  126. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Bootarg buf size */
  127. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  128. sizeof(CONFIG_SYS_PROMPT) + \
  129. 16) /* Print buf size */
  130. #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
  131. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  132. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000)
  133. #define CONFIG_CMDLINE_EDITING
  134. #define CONFIG_SYS_HUSH_PARSER
  135. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  136. #endif /* __CONFIG_H */