km8360.h 7.2 KB

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