microblaze-generic.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2007-2010 Michal Simek
  4. *
  5. * Michal SIMEK <monstr@monstr.eu>
  6. */
  7. #ifndef __CONFIG_H
  8. #define __CONFIG_H
  9. #include "../board/xilinx/microblaze-generic/xparameters.h"
  10. /* MicroBlaze CPU */
  11. #define MICROBLAZE_V5 1
  12. #define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024)
  13. /* linear and spi flash memory */
  14. #ifdef XILINX_FLASH_START
  15. #define FLASH
  16. #undef SPIFLASH
  17. #undef RAMENV /* hold environment in flash */
  18. #else
  19. #undef FLASH
  20. #undef SPIFLASH
  21. #define RAMENV /* hold environment in RAM */
  22. #endif
  23. /* uart */
  24. /* The following table includes the supported baudrates */
  25. # define CONFIG_SYS_BAUDRATE_TABLE \
  26. {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
  27. /* setting reset address */
  28. /*#define CONFIG_SYS_RESET_ADDRESS CONFIG_SYS_TEXT_BASE*/
  29. #define CONFIG_SYS_MALLOC_LEN 0xC0000
  30. /* Stack location before relocation */
  31. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \
  32. CONFIG_SYS_MALLOC_F_LEN)
  33. /*
  34. * CFI flash memory layout - Example
  35. * CONFIG_SYS_FLASH_BASE = 0x2200_0000;
  36. * CONFIG_SYS_FLASH_SIZE = 0x0080_0000; 8MB
  37. *
  38. * SECT_SIZE = 0x20000; 128kB is one sector
  39. * CONFIG_ENV_SIZE = SECT_SIZE; 128kB environment store
  40. *
  41. * 0x2200_0000 CONFIG_SYS_FLASH_BASE
  42. * FREE 256kB
  43. * 0x2204_0000 CONFIG_ENV_ADDR
  44. * ENV_AREA 128kB
  45. * 0x2206_0000
  46. * FREE
  47. * 0x2280_0000 CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE
  48. *
  49. */
  50. #ifdef FLASH
  51. # define CONFIG_SYS_FLASH_BASE XILINX_FLASH_START
  52. # define CONFIG_SYS_FLASH_SIZE XILINX_FLASH_SIZE
  53. /* ?empty sector */
  54. # define CONFIG_SYS_FLASH_EMPTY_INFO 1
  55. /* max number of memory banks */
  56. # define CONFIG_SYS_MAX_FLASH_BANKS 1
  57. /* max number of sectors on one chip */
  58. # define CONFIG_SYS_MAX_FLASH_SECT 512
  59. /* hardware flash protection */
  60. /* use buffered writes (20x faster) */
  61. # ifdef RAMENV
  62. # else /* FLASH && !RAMENV */
  63. /* 128K(one sector) for env */
  64. # endif /* FLASH && !RAMBOOT */
  65. #else /* !FLASH */
  66. #ifdef SPIFLASH
  67. # ifdef RAMENV
  68. # else /* SPIFLASH && !RAMENV */
  69. /* 128K(two sectors) for env */
  70. /* Warning: adjust the offset in respect of other flash content and size */
  71. # endif /* SPIFLASH && !RAMBOOT */
  72. #else /* !SPIFLASH */
  73. /* ENV in RAM */
  74. #endif /* !SPIFLASH */
  75. #endif /* !FLASH */
  76. #define XILINX_USE_ICACHE 1
  77. #define XILINX_USE_DCACHE 1
  78. #if defined(XILINX_USE_ICACHE)
  79. # define CONFIG_ICACHE
  80. #else
  81. # undef CONFIG_ICACHE
  82. #endif
  83. #if defined(XILINX_USE_DCACHE)
  84. # define CONFIG_DCACHE
  85. #else
  86. # undef CONFIG_DCACHE
  87. #endif
  88. #ifndef XILINX_DCACHE_BYTE_SIZE
  89. #define XILINX_DCACHE_BYTE_SIZE 32768
  90. #endif
  91. /*
  92. * BOOTP options
  93. */
  94. #define CONFIG_BOOTP_BOOTFILESIZE
  95. #if defined(CONFIG_MTD_PARTITIONS)
  96. /* MTD partitions */
  97. /* default mtd partition table */
  98. #endif
  99. /* size of console buffer */
  100. #define CONFIG_SYS_CBSIZE 512
  101. /* max number of command args */
  102. #define CONFIG_SYS_MAXARGS 15
  103. /* default load address */
  104. #define CONFIG_SYS_LOAD_ADDR 0
  105. #define CONFIG_HOSTNAME "microblaze-generic"
  106. #define CONFIG_BOOTCOMMAND "base 0;tftp 11000000 image.img;bootm"
  107. /* architecture dependent code */
  108. #define CONFIG_SYS_USR_EXCEP /* user exception */
  109. #ifndef CONFIG_EXTRA_ENV_SETTINGS
  110. #define CONFIG_EXTRA_ENV_SETTINGS "unlock=yes\0" \
  111. "nor0=flash-0\0"\
  112. "mtdparts=mtdparts=flash-0:"\
  113. "256k(u-boot),256k(env),3m(kernel),"\
  114. "1m(romfs),1m(cramfs),-(jffs2)\0"\
  115. "nc=setenv stdout nc;"\
  116. "setenv stdin nc\0" \
  117. "serial=setenv stdout serial;"\
  118. "setenv stdin serial\0"
  119. #endif
  120. #if defined(CONFIG_XILINX_AXIEMAC)
  121. # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1
  122. #endif
  123. /* SPL part */
  124. #ifdef CONFIG_SYS_FLASH_BASE
  125. # define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_FLASH_BASE
  126. #endif
  127. /* for booting directly linux */
  128. #define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \
  129. 0x40000)
  130. #define CONFIG_SYS_FDT_SIZE (16 << 10)
  131. #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \
  132. 0x1000000)
  133. /* SP location before relocation, must use scratch RAM */
  134. /* BRAM start */
  135. #define CONFIG_SYS_INIT_RAM_ADDR 0x0
  136. /* BRAM size - will be generated */
  137. #define CONFIG_SYS_INIT_RAM_SIZE 0x100000
  138. # define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  139. CONFIG_SYS_INIT_RAM_SIZE - \
  140. CONFIG_SYS_MALLOC_F_LEN)
  141. /* Just for sure that there is a space for stack */
  142. #define CONFIG_SPL_STACK_SIZE 0x100
  143. #define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
  144. #define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
  145. CONFIG_SYS_INIT_RAM_ADDR - \
  146. CONFIG_SYS_MALLOC_F_LEN - \
  147. CONFIG_SPL_STACK_SIZE)
  148. #endif /* __CONFIG_H */