a320evb.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. * mach-type definition
  26. */
  27. #define MACH_TYPE_FARADAY 758
  28. #define CONFIG_MACH_TYPE MACH_TYPE_FARADAY
  29. /*
  30. * Linux kernel tagged list
  31. */
  32. #define CONFIG_CMDLINE_TAG
  33. #define CONFIG_SETUP_MEMORY_TAGS
  34. /*
  35. * CPU and Board Configuration Options
  36. */
  37. #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
  38. #undef CONFIG_SKIP_LOWLEVEL_INIT
  39. /*
  40. * Power Management Unit
  41. */
  42. #define CONFIG_FTPMU010_POWER
  43. /*
  44. * Timer
  45. */
  46. #define CONFIG_SYS_HZ 1000 /* timer ticks per second */
  47. /*
  48. * Real Time Clock
  49. */
  50. #define CONFIG_RTC_FTRTC010
  51. /*
  52. * Serial console configuration
  53. */
  54. /* FTUART is a high speed NS 16C550A compatible UART */
  55. #define CONFIG_BAUDRATE 38400
  56. #define CONFIG_CONS_INDEX 1
  57. #define CONFIG_SYS_NS16550
  58. #define CONFIG_SYS_NS16550_SERIAL
  59. #define CONFIG_SYS_NS16550_COM1 0x98200000
  60. #define CONFIG_SYS_NS16550_REG_SIZE -4
  61. #define CONFIG_SYS_NS16550_CLK 18432000
  62. /* valid baudrates */
  63. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  64. /*
  65. * Ethernet
  66. */
  67. #define CONFIG_FTMAC100
  68. #define CONFIG_BOOTDELAY 3
  69. /*
  70. * Command line configuration.
  71. */
  72. #include <config_cmd_default.h>
  73. #define CONFIG_CMD_CACHE
  74. #define CONFIG_CMD_DATE
  75. #define CONFIG_CMD_PING
  76. /*
  77. * Miscellaneous configurable options
  78. */
  79. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  80. #define CONFIG_SYS_PROMPT "A320 # " /* Monitor Command Prompt */
  81. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  82. /* Print Buffer Size */
  83. #define CONFIG_SYS_PBSIZE \
  84. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  85. /* max number of command args */
  86. #define CONFIG_SYS_MAXARGS 16
  87. /* Boot Argument Buffer Size */
  88. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  89. /*
  90. * Stack sizes
  91. *
  92. * The stack sizes are set up in start.S using the settings below
  93. */
  94. #define CONFIG_STACKSIZE (128 * 1024) /* regular stack */
  95. #ifdef CONFIG_USE_IRQ
  96. #define CONFIG_STACKSIZE_IRQ (4 * 1024) /* IRQ stack */
  97. #define CONFIG_STACKSIZE_FIQ (4 * 1024) /* FIQ stack */
  98. #endif
  99. /*
  100. * Size of malloc() pool
  101. */
  102. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024)
  103. /*
  104. * SDRAM controller configuration
  105. */
  106. #define CONFIG_SYS_FTSDMC020_TP0 (FTSDMC020_TP0_TRAS(2) | \
  107. FTSDMC020_TP0_TRP(1) | \
  108. FTSDMC020_TP0_TRCD(1) | \
  109. FTSDMC020_TP0_TRF(3) | \
  110. FTSDMC020_TP0_TWR(1) | \
  111. FTSDMC020_TP0_TCL(2))
  112. #define CONFIG_SYS_FTSDMC020_TP1 (FTSDMC020_TP1_INI_PREC(4) | \
  113. FTSDMC020_TP1_INI_REFT(8) | \
  114. FTSDMC020_TP1_REF_INTV(0x180))
  115. #define CONFIG_SYS_FTSDMC020_BANK0_BSR (FTSDMC020_BANK_ENABLE | \
  116. FTSDMC020_BANK_DDW_X16 | \
  117. FTSDMC020_BANK_DSZ_256M | \
  118. FTSDMC020_BANK_MBW_32 | \
  119. FTSDMC020_BANK_SIZE_64M)
  120. /*
  121. * Physical Memory Map
  122. */
  123. #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
  124. #define PHYS_SDRAM_1 0x10000000 /* SDRAM Bank #1 */
  125. #define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
  126. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  127. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - \
  128. GENERATED_GBL_DATA_SIZE)
  129. /*
  130. * Load address and memory test area should agree with
  131. * board/faraday/a320/config.mk. Be careful not to overwrite U-boot itself.
  132. */
  133. #define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x2000000)
  134. /* memtest works on 63 MB in DRAM */
  135. #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1
  136. #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x3F00000)
  137. #define CONFIG_SYS_TEXT_BASE 0
  138. /*
  139. * Static memory controller configuration
  140. */
  141. #define CONFIG_FTSMC020
  142. #include <faraday/ftsmc020.h>
  143. #define FTSMC020_BANK0_CONFIG (FTSMC020_BANK_ENABLE | \
  144. FTSMC020_BANK_BASE(PHYS_FLASH_1) | \
  145. FTSMC020_BANK_SIZE_1M | \
  146. FTSMC020_BANK_MBW_8)
  147. #define FTSMC020_BANK0_TIMING (FTSMC020_TPR_RBE | \
  148. FTSMC020_TPR_AST(3) | \
  149. FTSMC020_TPR_CTW(3) | \
  150. FTSMC020_TPR_ATI(0xf) | \
  151. FTSMC020_TPR_AT2(3) | \
  152. FTSMC020_TPR_WTC(3) | \
  153. FTSMC020_TPR_AHT(3) | \
  154. FTSMC020_TPR_TRNA(0xf))
  155. #define FTSMC020_BANK1_CONFIG (FTSMC020_BANK_ENABLE | \
  156. FTSMC020_BANK_BASE(PHYS_FLASH_2) | \
  157. FTSMC020_BANK_SIZE_32M | \
  158. FTSMC020_BANK_MBW_32)
  159. #define FTSMC020_BANK1_TIMING (FTSMC020_TPR_AST(3) | \
  160. FTSMC020_TPR_CTW(3) | \
  161. FTSMC020_TPR_ATI(0xf) | \
  162. FTSMC020_TPR_AT2(3) | \
  163. FTSMC020_TPR_WTC(3) | \
  164. FTSMC020_TPR_AHT(3) | \
  165. FTSMC020_TPR_TRNA(0xf))
  166. #define CONFIG_SYS_FTSMC020_CONFIGS { \
  167. { FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, }, \
  168. { FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, }, \
  169. }
  170. /*
  171. * FLASH and environment organization
  172. */
  173. /* use CFI framework */
  174. #define CONFIG_SYS_FLASH_CFI
  175. #define CONFIG_FLASH_CFI_DRIVER
  176. /* support JEDEC */
  177. #define CONFIG_FLASH_CFI_LEGACY
  178. #define CONFIG_SYS_FLASH_LEGACY_512Kx8
  179. #define PHYS_FLASH_1 0x00000000
  180. #define PHYS_FLASH_2 0x00400000
  181. #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
  182. #define CONFIG_SYS_FLASH_BANKS_LIST { PHYS_FLASH_1, PHYS_FLASH_2, }
  183. #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
  184. /* max number of memory banks */
  185. #define CONFIG_SYS_MAX_FLASH_BANKS 2
  186. /* max number of sectors on one chip */
  187. #define CONFIG_SYS_MAX_FLASH_SECT 512
  188. #undef CONFIG_SYS_FLASH_EMPTY_INFO
  189. /* environments */
  190. #define CONFIG_ENV_IS_IN_FLASH
  191. #define CONFIG_ENV_ADDR (PHYS_FLASH_1 + 0x60000)
  192. #define CONFIG_ENV_SIZE 0x20000
  193. #endif /* __CONFIG_H */