tuda1.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /*
  2. * Copyright (C) 2006 Freescale Semiconductor, Inc.
  3. * Dave Liu <daveliu@freescale.com>
  4. *
  5. * Copyright (C) 2007 Logic Product Development, Inc.
  6. * Peter Barada <peterb@logicpd.com>
  7. *
  8. * Copyright (C) 2007 MontaVista Software, Inc.
  9. * Anton Vorontsov <avorontsov@ru.mvista.com>
  10. *
  11. * (C) Copyright 2008
  12. * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  13. *
  14. * (C) Copyright 2010-2011
  15. * Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. */
  22. #ifndef __CONFIG_H
  23. #define __CONFIG_H
  24. /*
  25. * High Level Configuration Options
  26. */
  27. #define CONFIG_QE /* Has QE */
  28. #define CONFIG_MPC832x /* MPC832x CPU specific */
  29. #define CONFIG_TUDA1 /* TUDA1 board specific */
  30. #define CONFIG_HOSTNAME tuda1
  31. #define CONFIG_KM_BOARD_NAME "tuda1"
  32. #define CONFIG_SYS_TEXT_BASE 0xF0000000
  33. #define CONFIG_KM_DEF_NETDEV \
  34. "netdev=eth0\0"
  35. #define CONFIG_KM_DEF_ROOTPATH \
  36. "rootpath=/opt/eldk/ppc_8xx\0"
  37. /* include common defines/options for all 83xx Keymile boards */
  38. #include "km83xx-common.h"
  39. #define CONFIG_MISC_INIT_R
  40. /*
  41. * System IO Config
  42. */
  43. #define CONFIG_SYS_SICRL SICRL_IRQ_CKS
  44. /*
  45. * Hardware Reset Configuration Word
  46. */
  47. #define CONFIG_SYS_HRCW_LOW (\
  48. HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
  49. HRCWL_DDR_TO_SCB_CLK_2X1 | \
  50. HRCWL_CSB_TO_CLKIN_2X1 | \
  51. HRCWL_CORE_TO_CSB_2_5X1 | \
  52. HRCWL_CE_PLL_VCO_DIV_2 | \
  53. HRCWL_CE_TO_PLL_1X3)
  54. #define CONFIG_SYS_HRCW_HIGH (\
  55. HRCWH_PCI_AGENT | \
  56. HRCWH_PCI_ARBITER_DISABLE | \
  57. HRCWH_CORE_ENABLE | \
  58. HRCWH_FROM_0X00000100 | \
  59. HRCWH_BOOTSEQ_DISABLE | \
  60. HRCWH_SW_WATCHDOG_DISABLE | \
  61. HRCWH_ROM_LOC_LOCAL_16BIT | \
  62. HRCWH_BIG_ENDIAN | \
  63. HRCWH_LALE_NORMAL)
  64. #define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
  65. #define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
  66. SDRAM_CFG_32_BE | \
  67. SDRAM_CFG_2T_EN | \
  68. SDRAM_CFG_SREN)
  69. #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
  70. #define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
  71. #define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
  72. (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
  73. #define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
  74. CSCONFIG_ODT_WR_CFG | \
  75. CSCONFIG_ROW_BIT_13 | \
  76. CSCONFIG_COL_BIT_10)
  77. #define CONFIG_SYS_DDR_MODE 0x47860252
  78. #define CONFIG_SYS_DDR_MODE2 0x8080c000
  79. #define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
  80. (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
  81. (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
  82. (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
  83. (0 << TIMING_CFG0_WWT_SHIFT) | \
  84. (0 << TIMING_CFG0_RRT_SHIFT) | \
  85. (0 << TIMING_CFG0_WRT_SHIFT) | \
  86. (0 << TIMING_CFG0_RWT_SHIFT))
  87. #define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_50) | \
  88. (2 << TIMING_CFG1_WRTORD_SHIFT) | \
  89. (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
  90. (2 << TIMING_CFG1_WRREC_SHIFT) | \
  91. (6 << TIMING_CFG1_REFREC_SHIFT) | \
  92. (2 << TIMING_CFG1_ACTTORW_SHIFT) | \
  93. (6 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
  94. (2 << TIMING_CFG1_PRETOACT_SHIFT))
  95. #define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
  96. (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
  97. (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
  98. (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
  99. (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
  100. (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
  101. (5 << TIMING_CFG2_CPO_SHIFT))
  102. #define CONFIG_SYS_DDR_TIMING_3 0x00000000
  103. #define CONFIG_SYS_PIGGY_BASE 0xE8000000
  104. #define CONFIG_SYS_PIGGY_SIZE 128
  105. #define CONFIG_SYS_APP1_BASE 0xA0000000 /* PAXG */
  106. #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
  107. #define CONFIG_SYS_APP2_BASE 0xB0000000 /* PINC3 */
  108. #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
  109. /* EEprom support */
  110. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  111. /*
  112. * Local Bus Configuration & Clock Setup
  113. */
  114. #define CONFIG_SYS_LCRR (LCRR_DBYP | LCRR_EADC_1 | LCRR_CLKDIV_2)
  115. #define CONFIG_SYS_LBC_LBCR 0x00000000
  116. /*
  117. * Init Local Bus Memory Controller:
  118. *
  119. * Bank Bus Machine PortSz Size Device
  120. * ---- --- ------- ------ ----- ------
  121. * 2 Local GPCM 8 bit 256MB PAXG
  122. * 3 Local GPCM 8 bit 256MB PINC3
  123. *
  124. */
  125. /*
  126. * PAXG on the local bus CS2
  127. */
  128. /* Window base at flash base */
  129. #define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
  130. /* Window size: 256 MB */
  131. #define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
  132. #define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
  133. BR_PS_8 | \
  134. BR_MS_GPCM | \
  135. BR_V)
  136. #define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
  137. OR_GPCM_CSNT | \
  138. OR_GPCM_ACS_DIV4 | \
  139. OR_GPCM_SCY_2 | \
  140. (OR_GPCM_TRLX & \
  141. (~OR_GPCM_EHTR)) | /* EHTR = 0 */ \
  142. OR_GPCM_EAD)
  143. /*
  144. * PINC3 on the local bus CS3
  145. */
  146. /* Access window base at PINC3 base */
  147. #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
  148. /* Window size: 256 MB */
  149. #define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
  150. #define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
  151. BR_PS_8 | \
  152. BR_MS_GPCM | \
  153. BR_V)
  154. #define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
  155. OR_GPCM_CSNT | \
  156. (OR_GPCM_ACS_DIV2 & /* ACS = 11 */\
  157. (~OR_GPCM_XACS)) | /* XACS = 0 */\
  158. (OR_GPCM_SCY_2 & \
  159. (~OR_GPCM_EHTR)) | /* EHTR = 0 */ \
  160. OR_GPCM_TRLX)
  161. #define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
  162. 0x0000c000 | \
  163. MxMR_WLFx_2X)
  164. /*
  165. * MMU Setup
  166. */
  167. /* PAXG: icache cacheable, but dcache-inhibit and guarded */
  168. #define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \
  169. BATL_PP_10 | \
  170. BATL_MEMCOHERENCE)
  171. /* 512M should also include APP2... */
  172. #define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \
  173. BATU_BL_256M | \
  174. BATU_VS | \
  175. BATU_VP)
  176. #define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \
  177. BATL_PP_10 | \
  178. BATL_CACHEINHIBIT | \
  179. BATL_GUARDEDSTORAGE)
  180. #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
  181. #ifdef CONFIG_PCI
  182. /* PCI MEM space: cacheable */
  183. #define CFG_IBAT6L (CFG_PCI1_MEM_PHYS | BATL_PP_10 | BATL_MEMCOHERENCE)
  184. #define CFG_IBAT6U (CFG_PCI1_MEM_PHYS | BATU_BL_256M | BATU_VS | BATU_VP)
  185. #define CFG_DBAT6L CFG_IBAT6L
  186. #define CFG_DBAT6U CFG_IBAT6U
  187. /* PCI MMIO space: cache-inhibit and guarded */
  188. #define CFG_IBAT7L (CFG_PCI1_MMIO_PHYS | \
  189. BATL_PP_10 | \
  190. BATL_CACHEINHIBIT | \
  191. BATL_GUARDEDSTORAGE)
  192. #define CFG_IBAT7U (CFG_PCI1_MMIO_PHYS | BATU_BL_256M | BATU_VS | BATU_VP)
  193. #define CFG_DBAT7L CFG_IBAT7L
  194. #define CFG_DBAT7U CFG_IBAT7U
  195. #else /* CONFIG_PCI */
  196. /* PINC3: icache cacheable, but dcache-inhibit and guarded */
  197. #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
  198. BATL_PP_10 | \
  199. BATL_MEMCOHERENCE)
  200. #define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
  201. BATU_BL_256M | \
  202. BATU_VS | \
  203. BATU_VP)
  204. #define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
  205. BATL_PP_10 | \
  206. BATL_CACHEINHIBIT | \
  207. BATL_GUARDEDSTORAGE)
  208. #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
  209. #define CONFIG_SYS_IBAT7L (0)
  210. #define CONFIG_SYS_IBAT7U (0)
  211. #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
  212. #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
  213. #endif /* CONFIG_PCI */
  214. #endif /* __CONFIG_H */