km8360.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /*
  2. * (C) Copyright 2012
  3. * Holger Brunck, Keymile GmbH Hannover, <holger.brunck@keymile.com>
  4. * Christian Herzig, Keymile AG Switzerland, <christian.herzig@keymile.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. */
  11. #ifndef __CONFIG_H
  12. #define __CONFIG_H
  13. /* KMBEC FPGA (PRIO) */
  14. #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
  15. #define CONFIG_SYS_KMBEC_FPGA_SIZE 64
  16. #if defined CONFIG_KMETER1
  17. #define CONFIG_HOSTNAME kmeter1
  18. #define CONFIG_KM_BOARD_NAME "kmeter1"
  19. #define CONFIG_KM_DEF_NETDEV "netdev=eth2\0"
  20. #elif defined CONFIG_KMCOGE5NE
  21. #define CONFIG_HOSTNAME kmcoge5ne
  22. #define CONFIG_KM_BOARD_NAME "kmcoge5ne"
  23. #define CONFIG_KM_DEF_NETDEV "netdev=eth1\0"
  24. #define CONFIG_CMD_NAND
  25. #define CONFIG_NAND_KMETER1
  26. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  27. #define NAND_MAX_CHIPS 1
  28. #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
  29. #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
  30. #define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
  31. #define MTDIDS_DEFAULT "nor0=boot,nand0=app"
  32. #define MTDPARTS_DEFAULT "mtdparts=" \
  33. "boot:" \
  34. "768k(u-boot)," \
  35. "128k(env)," \
  36. "128k(envred)," \
  37. "-(" CONFIG_KM_UBI_PARTITION_NAME_BOOT ");" \
  38. "app:" \
  39. "-(" CONFIG_KM_UBI_PARTITION_NAME_APP ");"
  40. #else
  41. #error ("Board not supported")
  42. #endif
  43. /*
  44. * High Level Configuration Options
  45. */
  46. #define CONFIG_QE /* Has QE */
  47. #define CONFIG_MPC8360 /* MPC8360 CPU specific */
  48. #define CONFIG_SYS_TEXT_BASE 0xF0000000
  49. /* include common defines/options for all 83xx Keymile boards */
  50. #include "km/km83xx-common.h"
  51. /*
  52. * System IO Setup
  53. */
  54. #define CONFIG_SYS_SICRH (SICRH_UC1EOBI | SICRH_UC2E1OBI)
  55. /*
  56. * Hardware Reset Configuration Word
  57. */
  58. #define CONFIG_SYS_HRCW_LOW (\
  59. HRCWL_CSB_TO_CLKIN_4X1 | \
  60. HRCWL_CORE_TO_CSB_2X1 | \
  61. HRCWL_CE_PLL_VCO_DIV_2 | \
  62. HRCWL_CE_TO_PLL_1X6)
  63. #define CONFIG_SYS_HRCW_HIGH (\
  64. HRCWH_CORE_ENABLE | \
  65. HRCWH_FROM_0X00000100 | \
  66. HRCWH_BOOTSEQ_DISABLE | \
  67. HRCWH_SW_WATCHDOG_DISABLE | \
  68. HRCWH_ROM_LOC_LOCAL_16BIT | \
  69. HRCWH_BIG_ENDIAN | \
  70. HRCWH_LALE_EARLY | \
  71. HRCWH_LDP_CLEAR)
  72. /**
  73. * DDR RAM settings
  74. */
  75. #define CONFIG_SYS_DDR_SDRAM_CFG (\
  76. SDRAM_CFG_SDRAM_TYPE_DDR2 | \
  77. SDRAM_CFG_SREN | \
  78. SDRAM_CFG_HSE)
  79. #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
  80. #ifdef CONFIG_KMCOGE5NE
  81. /**
  82. * KMCOGE5NE has 512 MB RAM
  83. */
  84. #define CONFIG_SYS_DDR_CS0_CONFIG (\
  85. CSCONFIG_EN | \
  86. CSCONFIG_AP | \
  87. CSCONFIG_ODT_RD_ONLY_CURRENT | \
  88. CSCONFIG_BANK_BIT_3 | \
  89. CSCONFIG_ROW_BIT_13 | \
  90. CSCONFIG_COL_BIT_10)
  91. #else
  92. #define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
  93. CSCONFIG_ROW_BIT_13 | \
  94. CSCONFIG_COL_BIT_10 | \
  95. CSCONFIG_ODT_RD_ONLY_CURRENT)
  96. #endif
  97. #define CONFIG_SYS_DDR_CLK_CNTL (\
  98. DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
  99. #define CONFIG_SYS_DDR_INTERVAL (\
  100. (0x080 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
  101. (0x203 << SDRAM_INTERVAL_REFINT_SHIFT))
  102. #define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
  103. #define CONFIG_SYS_DDRCDR (\
  104. DDRCDR_EN | \
  105. DDRCDR_Q_DRN)
  106. #define CONFIG_SYS_DDR_MODE 0x47860452
  107. #define CONFIG_SYS_DDR_MODE2 0x8080c000
  108. #define CONFIG_SYS_DDR_TIMING_0 (\
  109. (2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
  110. (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
  111. (6 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
  112. (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
  113. (0 << TIMING_CFG0_WWT_SHIFT) | \
  114. (0 << TIMING_CFG0_RRT_SHIFT) | \
  115. (0 << TIMING_CFG0_WRT_SHIFT) | \
  116. (0 << TIMING_CFG0_RWT_SHIFT))
  117. #define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_50) | \
  118. (2 << TIMING_CFG1_WRTORD_SHIFT) | \
  119. (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
  120. (3 << TIMING_CFG1_WRREC_SHIFT) | \
  121. (7 << TIMING_CFG1_REFREC_SHIFT) | \
  122. (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
  123. (8 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
  124. (3 << TIMING_CFG1_PRETOACT_SHIFT))
  125. #define CONFIG_SYS_DDR_TIMING_2 (\
  126. (0xa << TIMING_CFG2_FOUR_ACT_SHIFT) | \
  127. (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
  128. (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
  129. (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
  130. (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
  131. (5 << TIMING_CFG2_CPO_SHIFT) | \
  132. (0 << TIMING_CFG2_ADD_LAT_SHIFT))
  133. #define CONFIG_SYS_DDR_TIMING_3 0x00000000
  134. /* EEprom support */
  135. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  136. /*
  137. * Local Bus Configuration & Clock Setup
  138. */
  139. #define CONFIG_SYS_LCRR_DBYP LCRR_DBYP
  140. #define CONFIG_SYS_LCRR_EADC LCRR_EADC_2
  141. #define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
  142. /*
  143. * PAXE on the local bus CS3
  144. */
  145. #define CONFIG_SYS_PAXE_BASE 0xA0000000
  146. #define CONFIG_SYS_PAXE_SIZE 256
  147. #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_PAXE_BASE
  148. #define CONFIG_SYS_LBLAWAR3_PRELIM 0x8000001C /* 512MB window size */
  149. #define CONFIG_SYS_BR3_PRELIM (\
  150. CONFIG_SYS_PAXE_BASE | \
  151. (1 << BR_PS_SHIFT) | \
  152. BR_V)
  153. #define CONFIG_SYS_OR3_PRELIM (\
  154. MEG_TO_AM(CONFIG_SYS_PAXE_SIZE) | \
  155. OR_GPCM_CSNT | \
  156. OR_GPCM_ACS_DIV2 | \
  157. OR_GPCM_SCY_2 | \
  158. OR_GPCM_TRLX | \
  159. OR_GPCM_EAD)
  160. #ifdef CONFIG_KMCOGE5NE
  161. /*
  162. * BFTIC3 on the local bus CS4
  163. */
  164. #define CONFIG_SYS_BFTIC3_BASE 0xB0000000
  165. #define CONFIG_SYS_BFTIC3_SIZE 256
  166. #define CONFIG_SYS_BR4_PRELIM (\
  167. CONFIG_SYS_BFTIC3_BASE |\
  168. (1 << BR_PS_SHIFT) | \
  169. BR_V)
  170. #define CONFIG_SYS_OR4_PRELIM (\
  171. MEG_TO_AM(CONFIG_SYS_BFTIC3_SIZE) |\
  172. OR_GPCM_CSNT | \
  173. OR_GPCM_ACS_DIV2 |\
  174. OR_GPCM_SCY_2 |\
  175. OR_GPCM_TRLX |\
  176. OR_GPCM_EAD)
  177. #endif
  178. /*
  179. * MMU Setup
  180. */
  181. /* PAXE: icache cacheable, but dcache-inhibit and guarded */
  182. #define CONFIG_SYS_IBAT5L (\
  183. CONFIG_SYS_PAXE_BASE | \
  184. BATL_PP_10 | \
  185. BATL_MEMCOHERENCE)
  186. #define CONFIG_SYS_IBAT5U (\
  187. CONFIG_SYS_PAXE_BASE | \
  188. BATU_BL_256M | \
  189. BATU_VS | \
  190. BATU_VP)
  191. #define CONFIG_SYS_DBAT5L (\
  192. CONFIG_SYS_PAXE_BASE | \
  193. BATL_PP_10 | \
  194. BATL_CACHEINHIBIT | \
  195. BATL_GUARDEDSTORAGE)
  196. #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
  197. #ifdef CONFIG_KMCOGE5NE
  198. /* BFTIC3: icache cacheable, but dcache-inhibit and guarded */
  199. #define CONFIG_SYS_IBAT6L (\
  200. CONFIG_SYS_BFTIC3_BASE | \
  201. BATL_PP_10 | \
  202. BATL_MEMCOHERENCE)
  203. #define CONFIG_SYS_IBAT6U (\
  204. CONFIG_SYS_BFTIC3_BASE | \
  205. BATU_BL_256M | \
  206. BATU_VS | \
  207. BATU_VP)
  208. #define CONFIG_SYS_DBAT6L (\
  209. CONFIG_SYS_BFTIC3_BASE | \
  210. BATL_PP_10 | \
  211. BATL_CACHEINHIBIT | \
  212. BATL_GUARDEDSTORAGE)
  213. #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
  214. /* DDR/LBC SDRAM next 256M: cacheable */
  215. #define CONFIG_SYS_IBAT7L (\
  216. CONFIG_SYS_SDRAM_BASE2 |\
  217. BATL_PP_10 |\
  218. BATL_CACHEINHIBIT |\
  219. BATL_GUARDEDSTORAGE)
  220. #define CONFIG_SYS_IBAT7U (\
  221. CONFIG_SYS_SDRAM_BASE2 |\
  222. BATU_BL_256M |\
  223. BATU_VS |\
  224. BATU_VP)
  225. /* enable POST tests */
  226. #define CONFIG_POST (CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS)
  227. #define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
  228. #define CPM_POST_WORD_ADDR CONFIG_SYS_MEMTEST_END
  229. #define CONFIG_TESTPIN_REG gprt3 /* for kmcoge5ne */
  230. #define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */
  231. #define CONFIG_CMD_DIAG /* so that testpin is inquired for POST test */
  232. #else
  233. #define CONFIG_SYS_IBAT6L (0)
  234. #define CONFIG_SYS_IBAT6U (0)
  235. #define CONFIG_SYS_IBAT7L (0)
  236. #define CONFIG_SYS_IBAT7U (0)
  237. #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
  238. #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
  239. #endif
  240. #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
  241. #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
  242. #endif /* CONFIG */