socfpga_cyclone5.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /*
  2. * Copyright (C) 2012 Altera Corporation <www.altera.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __CONFIG_H
  18. #define __CONFIG_H
  19. #include <asm/arch/socfpga_base_addrs.h>
  20. /*
  21. * High level configuration
  22. */
  23. #define CONFIG_ARMV7
  24. #define CONFIG_L2_OFF
  25. #define CONFIG_SYS_DCACHE_OFF
  26. #undef CONFIG_USE_IRQ
  27. #define CONFIG_MISC_INIT_R
  28. #define CONFIG_SINGLE_BOOTLOADER
  29. #define CONFIG_SOCFPGA
  30. #define CONFIG_SYS_TEXT_BASE 0x08000040
  31. #define V_NS16550_CLK 1000000
  32. #define CONFIG_BAUDRATE 57600
  33. #define CONFIG_SYS_HZ 1000
  34. #define CONFIG_TIMER_CLOCK_KHZ 2400
  35. #define CONFIG_SYS_LOAD_ADDR 0x7fc0
  36. /* Console I/O Buffer Size */
  37. #define CONFIG_SYS_CBSIZE 256
  38. /* Monitor Command Prompt */
  39. #define CONFIG_SYS_PROMPT "SOCFPGA_CYCLONE5 # "
  40. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  41. sizeof(CONFIG_SYS_PROMPT) + 16)
  42. /*
  43. * Display CPU and Board Info
  44. */
  45. #define CONFIG_DISPLAY_CPUINFO
  46. #define CONFIG_DISPLAY_BOARDINFO
  47. /*
  48. * Enable early stage initialization at C environment
  49. */
  50. #define CONFIG_BOARD_EARLY_INIT_F
  51. /* flat device tree */
  52. #define CONFIG_OF_LIBFDT
  53. /* skip updating the FDT blob */
  54. #define CONFIG_FDT_BLOB_SKIP_UPDATE
  55. /* Initial Memory map size for Linux, minus 4k alignment for DFT blob */
  56. #define CONFIG_SYS_BOOTMAPSZ ((256*1024*1024) - (4*1024))
  57. #define CONFIG_SPL_RAM_DEVICE
  58. #define CONFIG_SPL_STACK (&__stack_start)
  59. #define CONFIG_SYS_SPL_MALLOC_START ((unsigned long) (&__malloc_start))
  60. #define CONFIG_SYS_SPL_MALLOC_SIZE (&__malloc_end - &__malloc_start)
  61. /*
  62. * Memory allocation (MALLOC)
  63. */
  64. /* Room required on the stack for the environment data */
  65. #define CONFIG_ENV_SIZE 1024
  66. /* Size of DRAM reserved for malloc() use */
  67. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024)
  68. /* SP location before relocation, must use scratch RAM */
  69. #define CONFIG_SYS_INIT_RAM_ADDR 0xFFFF0000
  70. /* Reserving 0x100 space at back of scratch RAM for debug info */
  71. #define CONFIG_SYS_INIT_RAM_SIZE (0x10000 - 0x100)
  72. /* Stack pointer prior relocation, must situated at on-chip RAM */
  73. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  74. CONFIG_SYS_INIT_RAM_SIZE - \
  75. GENERATED_GBL_DATA_SIZE)
  76. /*
  77. * Command line configuration.
  78. */
  79. #define CONFIG_SYS_NO_FLASH
  80. #include <config_cmd_default.h>
  81. /* FAT file system support */
  82. #define CONFIG_CMD_FAT
  83. /*
  84. * Misc
  85. */
  86. #define CONFIG_DOS_PARTITION 1
  87. #ifdef CONFIG_SPL_BUILD
  88. #undef CONFIG_PARTITIONS
  89. #endif
  90. /*
  91. * Environment setup
  92. */
  93. /* Delay before automatically booting the default image */
  94. #define CONFIG_BOOTDELAY 3
  95. /* Enable auto completion of commands using TAB */
  96. #define CONFIG_AUTO_COMPLETE
  97. /* use "hush" command parser */
  98. #define CONFIG_SYS_HUSH_PARSER
  99. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  100. #define CONFIG_CMD_RUN
  101. #define CONFIG_BOOTCOMMAND "run ramboot"
  102. /*
  103. * arguments passed to the bootm command. The value of
  104. * CONFIG_BOOTARGS goes into the environment value "bootargs".
  105. * Do note the value will overide also the chosen node in FDT blob.
  106. */
  107. #define CONFIG_BOOTARGS "console=ttyS0,57600,mem=256M@0x0"
  108. #define CONFIG_EXTRA_ENV_SETTINGS \
  109. "verify=n\0" \
  110. "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
  111. "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
  112. "bootm ${loadaddr} - ${fdt_addr}\0" \
  113. "bootimage=uImage\0" \
  114. "fdt_addr=100\0" \
  115. "fsloadcmd=ext2load\0" \
  116. "bootm ${loadaddr} - ${fdt_addr}\0" \
  117. "qspiroot=/dev/mtdblock0\0" \
  118. "qspirootfstype=jffs2\0" \
  119. "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
  120. " root=${qspiroot} rw rootfstype=${qspirootfstype};"\
  121. "bootm ${loadaddr} - ${fdt_addr}\0"
  122. /* using environment setting for stdin, stdout, stderr */
  123. #define CONFIG_SYS_CONSOLE_IS_IN_ENV
  124. /* Enable the call to overwrite_console() */
  125. #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
  126. /* Enable overwrite of previous console environment settings */
  127. #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
  128. /* max number of command args */
  129. #define CONFIG_SYS_MAXARGS 16
  130. /*
  131. * Hardware drivers
  132. */
  133. /*
  134. * SDRAM Memory Map
  135. */
  136. /* We have 1 bank of DRAM */
  137. #define CONFIG_NR_DRAM_BANKS 1
  138. /* SDRAM Bank #1 */
  139. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  140. /* SDRAM memory size */
  141. #define PHYS_SDRAM_1_SIZE 0x80000000
  142. #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE
  143. #define CONFIG_SYS_MEMTEST_START 0x00000000
  144. #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM_1_SIZE
  145. /*
  146. * NS16550 Configuration
  147. */
  148. #define UART0_BASE SOCFPGA_UART0_ADDRESS
  149. #define CONFIG_SYS_NS16550
  150. #define CONFIG_SYS_NS16550_SERIAL
  151. #define CONFIG_SYS_NS16550_REG_SIZE -4
  152. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  153. #define CONFIG_CONS_INDEX 1
  154. #define CONFIG_SYS_NS16550_COM1 UART0_BASE
  155. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200}
  156. /*
  157. * FLASH
  158. */
  159. #define CONFIG_SYS_NO_FLASH
  160. /*
  161. * L4 OSC1 Timer 0
  162. */
  163. /* This timer use eosc1 where the clock frequency is fixed
  164. * throughout any condition */
  165. #define CONFIG_SYS_TIMERBASE SOCFPGA_OSC1TIMER0_ADDRESS
  166. /* reload value when timer count to zero */
  167. #define TIMER_LOAD_VAL 0xFFFFFFFF
  168. #define CONFIG_ENV_IS_NOWHERE
  169. /*
  170. * SPL "Second Program Loader" aka Initial Software
  171. */
  172. /* Enable building of SPL globally */
  173. #define CONFIG_SPL
  174. #define CONFIG_SPL_FRAMEWORK
  175. /* TEXT_BASE for linking the SPL binary */
  176. #define CONFIG_SPL_TEXT_BASE 0xFFFF0000
  177. /* Stack size for SPL */
  178. #define CONFIG_SPL_STACK_SIZE (4 * 1024)
  179. /* MALLOC size for SPL */
  180. #define CONFIG_SPL_MALLOC_SIZE (5 * 1024)
  181. #define CONFIG_SPL_SERIAL_SUPPORT
  182. #define CONFIG_SPL_BOARD_INIT
  183. #define CHUNKSZ_CRC32 (1 * 1024)
  184. #define CONFIG_CRC32_VERIFY
  185. /* Linker script for SPL */
  186. #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/socfpga/u-boot-spl.lds"
  187. /* Support for common/libcommon.o in SPL binary */
  188. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  189. /* Support for lib/libgeneric.o in SPL binary */
  190. #define CONFIG_SPL_LIBGENERIC_SUPPORT
  191. #endif /* __CONFIG_H */