a320evb.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. * (C) Copyright 2009 Faraday Technology
  3. * Po-Yu Chuang <ratbert@faraday-tech.com>
  4. *
  5. * Configuation settings for the Faraday A320 board.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef __CONFIG_H
  22. #define __CONFIG_H
  23. #include <asm/arch/a320.h>
  24. /*-----------------------------------------------------------------------
  25. * CPU and Board Configuration Options
  26. */
  27. #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
  28. #undef CONFIG_SKIP_LOWLEVEL_INIT
  29. /*-----------------------------------------------------------------------
  30. * Timer
  31. */
  32. #define CONFIG_SYS_HZ 1000 /* timer ticks per second */
  33. /*-----------------------------------------------------------------------
  34. * Real Time Clock
  35. */
  36. #define CONFIG_RTC_FTRTC010
  37. /*-----------------------------------------------------------------------
  38. * Serial console configuration
  39. */
  40. /* FTUART is a high speed NS 16C550A compatible UART */
  41. #define CONFIG_BAUDRATE 38400
  42. #define CONFIG_CONS_INDEX 1
  43. #define CONFIG_SYS_NS16550
  44. #define CONFIG_SYS_NS16550_SERIAL
  45. #define CONFIG_SYS_NS16550_COM1 0x98200000
  46. #define CONFIG_SYS_NS16550_REG_SIZE -4
  47. #define CONFIG_SYS_NS16550_CLK 18432000
  48. /* valid baudrates */
  49. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  50. /*-----------------------------------------------------------------------
  51. * Ethernet
  52. */
  53. #define CONFIG_NET_MULTI
  54. #define CONFIG_FTMAC100
  55. #define CONFIG_BOOTDELAY 3
  56. /*-----------------------------------------------------------------------
  57. * Command line configuration.
  58. */
  59. #include <config_cmd_default.h>
  60. #define CONFIG_CMD_CACHE
  61. #define CONFIG_CMD_DATE
  62. #define CONFIG_CMD_PING
  63. /*-----------------------------------------------------------------------
  64. * Miscellaneous configurable options
  65. */
  66. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  67. #define CONFIG_SYS_PROMPT "A320 # " /* Monitor Command Prompt */
  68. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  69. /* Print Buffer Size */
  70. #define CONFIG_SYS_PBSIZE \
  71. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  72. /* max number of command args */
  73. #define CONFIG_SYS_MAXARGS 16
  74. /* Boot Argument Buffer Size */
  75. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  76. /*-----------------------------------------------------------------------
  77. * Stack sizes
  78. *
  79. * The stack sizes are set up in start.S using the settings below
  80. */
  81. #define CONFIG_STACKSIZE (128 * 1024) /* regular stack */
  82. #ifdef CONFIG_USE_IRQ
  83. #define CONFIG_STACKSIZE_IRQ (4 * 1024) /* IRQ stack */
  84. #define CONFIG_STACKSIZE_FIQ (4 * 1024) /* FIQ stack */
  85. #endif
  86. /*-----------------------------------------------------------------------
  87. * Size of malloc() pool
  88. */
  89. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024)
  90. /*-----------------------------------------------------------------------
  91. * size in bytes reserved for initial data
  92. */
  93. #define CONFIG_SYS_GBL_DATA_SIZE 128
  94. /*-----------------------------------------------------------------------
  95. * SDRAM controller configuration
  96. */
  97. #define CONFIG_SYS_FTSDMC020_TP0 (FTSDMC020_TP0_TRAS(2) | \
  98. FTSDMC020_TP0_TRP(1) | \
  99. FTSDMC020_TP0_TRCD(1) | \
  100. FTSDMC020_TP0_TRF(3) | \
  101. FTSDMC020_TP0_TWR(1) | \
  102. FTSDMC020_TP0_TCL(2))
  103. #define CONFIG_SYS_FTSDMC020_TP1 (FTSDMC020_TP1_INI_PREC(4) | \
  104. FTSDMC020_TP1_INI_REFT(8) | \
  105. FTSDMC020_TP1_REF_INTV(0x180))
  106. #define CONFIG_SYS_FTSDMC020_BANK0_BSR (FTSDMC020_BANK_ENABLE | \
  107. FTSDMC020_BANK_DDW_X16 | \
  108. FTSDMC020_BANK_DSZ_256M | \
  109. FTSDMC020_BANK_MBW_32 | \
  110. FTSDMC020_BANK_SIZE_64M)
  111. /*-----------------------------------------------------------------------
  112. * Physical Memory Map
  113. */
  114. #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
  115. #define PHYS_SDRAM_1 0x10000000 /* SDRAM Bank #1 */
  116. #define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
  117. /*
  118. * Load address and memory test area should agree with
  119. * board/faraday/a320/config.mk. Be careful not to overwrite U-boot itself.
  120. */
  121. #define CONFIG_SYS_LOAD_ADDR 0x12000000
  122. /* memtest works on 63 MB in DRAM */
  123. #define CONFIG_SYS_MEMTEST_START 0x10000000
  124. #define CONFIG_SYS_MEMTEST_END 0x13F00000
  125. /*-----------------------------------------------------------------------
  126. * Static memory controller configuration
  127. */
  128. #include <asm/arch/ftsmc020.h>
  129. #define FTSMC020_BANK0_CONFIG (FTSMC020_BANK_ENABLE | \
  130. FTSMC020_BANK_BASE(PHYS_FLASH_1) | \
  131. FTSMC020_BANK_SIZE_1M | \
  132. FTSMC020_BANK_MBW_8)
  133. #define FTSMC020_BANK0_TIMING (FTSMC020_TPR_RBE | \
  134. FTSMC020_TPR_AST(3) | \
  135. FTSMC020_TPR_CTW(3) | \
  136. FTSMC020_TPR_ATI(0xf) | \
  137. FTSMC020_TPR_AT2(3) | \
  138. FTSMC020_TPR_WTC(3) | \
  139. FTSMC020_TPR_AHT(3) | \
  140. FTSMC020_TPR_TRNA(0xf))
  141. #define FTSMC020_BANK1_CONFIG (FTSMC020_BANK_ENABLE | \
  142. FTSMC020_BANK_BASE(PHYS_FLASH_2) | \
  143. FTSMC020_BANK_SIZE_32M | \
  144. FTSMC020_BANK_MBW_32)
  145. #define FTSMC020_BANK1_TIMING (FTSMC020_TPR_AST(3) | \
  146. FTSMC020_TPR_CTW(3) | \
  147. FTSMC020_TPR_ATI(0xf) | \
  148. FTSMC020_TPR_AT2(3) | \
  149. FTSMC020_TPR_WTC(3) | \
  150. FTSMC020_TPR_AHT(3) | \
  151. FTSMC020_TPR_TRNA(0xf))
  152. #define CONFIG_SYS_FTSMC020_CONFIGS { \
  153. { FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, }, \
  154. { FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, }, \
  155. }
  156. /*-----------------------------------------------------------------------
  157. * FLASH and environment organization
  158. */
  159. /* use CFI framework */
  160. #define CONFIG_SYS_FLASH_CFI
  161. #define CONFIG_FLASH_CFI_DRIVER
  162. /* support JEDEC */
  163. #define CONFIG_FLASH_CFI_LEGACY
  164. #define CONFIG_SYS_FLASH_LEGACY_512Kx8
  165. #define PHYS_FLASH_1 0x00000000
  166. #define PHYS_FLASH_2 0x00400000
  167. #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
  168. #define CONFIG_SYS_FLASH_BANKS_LIST { PHYS_FLASH_1, PHYS_FLASH_2, }
  169. #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
  170. /* max number of memory banks */
  171. #define CONFIG_SYS_MAX_FLASH_BANKS 2
  172. /* max number of sectors on one chip */
  173. #define CONFIG_SYS_MAX_FLASH_SECT 512
  174. #undef CONFIG_SYS_FLASH_EMPTY_INFO
  175. /* environments */
  176. #define CONFIG_ENV_IS_IN_FLASH
  177. #define CONFIG_ENV_ADDR 0x00060000
  178. #define CONFIG_ENV_SIZE 0x20000
  179. #endif /* __CONFIG_H */