suvd3.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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 2010
  12. * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  13. *
  14. * SPDX-License-Identifier: GPL-2.0+
  15. */
  16. #ifndef __CONFIG_H
  17. #define __CONFIG_H
  18. /*
  19. * High Level Configuration Options
  20. */
  21. /* This needs to be set prior to including km/km83xx-common.h */
  22. #define CONFIG_SYS_TEXT_BASE 0xF0000000
  23. #if defined(CONFIG_SUVD3) /* SUVD3 board specific */
  24. #define CONFIG_HOSTNAME suvd3
  25. #define CONFIG_KM_BOARD_NAME "suvd3"
  26. /* include common defines/options for all 8321 Keymile boards */
  27. #include "km/km8321-common.h"
  28. #elif defined(CONFIG_KMVECT1) /* VECT1 board specific */
  29. #define CONFIG_HOSTNAME kmvect1
  30. #define CONFIG_KM_BOARD_NAME "kmvect1"
  31. /* at end of uboot partition, before env */
  32. #define CONFIG_SYS_QE_FW_ADDR 0xF00B0000
  33. /* include common defines/options for all 8309 Keymile boards */
  34. #include "km/km8309-common.h"
  35. #elif defined(CONFIG_KMTEGR1) /* TEGR1 board specific */
  36. #define CONFIG_HOSTNAME kmtegr1
  37. #define CONFIG_KM_BOARD_NAME "kmtegr1"
  38. #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
  39. #define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
  40. #define MTDIDS_DEFAULT "nor0=boot,nand0=app"
  41. #define MTDPARTS_DEFAULT "mtdparts=" \
  42. "boot:" \
  43. "768k(u-boot)," \
  44. "256k(qe-fw)," \
  45. "128k(env)," \
  46. "128k(envred)," \
  47. "-(" CONFIG_KM_UBI_PARTITION_NAME_BOOT ");" \
  48. "app:" \
  49. "-(" CONFIG_KM_UBI_PARTITION_NAME_APP ");"
  50. #define CONFIG_ENV_ADDR 0xF0100000
  51. #define CONFIG_ENV_OFFSET 0x100000
  52. #define CONFIG_CMD_NAND
  53. #define CONFIG_NAND_ECC_BCH
  54. #define CONFIG_BCH
  55. #define CONFIG_NAND_KMETER1
  56. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  57. #define NAND_MAX_CHIPS 1
  58. /* include common defines/options for all 8309 Keymile boards */
  59. #include "km/km8309-common.h"
  60. /* must be after the include because KMBEC_FPGA is otherwise undefined */
  61. #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
  62. #else
  63. #error Supported boards are: SUVD3, KMVECT1, KMTEGR1
  64. #endif
  65. #define CONFIG_SYS_APP1_BASE 0xA0000000
  66. #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
  67. #define CONFIG_SYS_APP2_BASE 0xB0000000
  68. #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
  69. /* EEprom support */
  70. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  71. /*
  72. * Init Local Bus Memory Controller:
  73. *
  74. * Bank Bus Machine PortSz Size Device
  75. * ---- --- ------- ------ ----- ------
  76. * 2 Local UPMA 16 bit 256MB APP1
  77. * 3 Local GPCM 16 bit 256MB APP2
  78. *
  79. */
  80. #if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
  81. /*
  82. * APP1 on the local bus CS2
  83. */
  84. #define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
  85. #define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
  86. #define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
  87. BR_PS_16 | \
  88. BR_MS_UPMA | \
  89. BR_V)
  90. #define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE))
  91. #define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
  92. BR_PS_16 | \
  93. BR_V)
  94. #define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
  95. OR_GPCM_CSNT | \
  96. OR_GPCM_ACS_DIV4 | \
  97. OR_GPCM_SCY_3 | \
  98. OR_GPCM_TRLX_SET)
  99. #define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
  100. 0x0000c000 | \
  101. MxMR_WLFx_2X)
  102. #elif defined(CONFIG_KMTEGR1)
  103. #define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
  104. BR_PS_16 | \
  105. BR_MS_GPCM | \
  106. BR_V)
  107. #define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
  108. OR_GPCM_SCY_5 | \
  109. OR_GPCM_TRLX_CLEAR | \
  110. OR_GPCM_EHTR_CLEAR)
  111. #endif /* CONFIG_KMTEGR1 */
  112. #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
  113. #define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
  114. /*
  115. * MMU Setup
  116. */
  117. #if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
  118. /* APP1: icache cacheable, but dcache-inhibit and guarded */
  119. #define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
  120. BATL_MEMCOHERENCE)
  121. #define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | BATU_BL_256M | \
  122. BATU_VS | BATU_VP)
  123. #define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
  124. BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  125. #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
  126. #elif defined(CONFIG_KMTEGR1)
  127. #define CONFIG_SYS_IBAT5L (0)
  128. #define CONFIG_SYS_IBAT5U (0)
  129. #define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
  130. #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
  131. #endif /* CONFIG_KMTEGR1 */
  132. #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
  133. BATL_MEMCOHERENCE)
  134. #define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
  135. BATU_VS | BATU_VP)
  136. #define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
  137. BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
  138. #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
  139. /*
  140. * QE UEC ethernet configuration
  141. */
  142. #if defined(CONFIG_KMVECT1)
  143. #define CONFIG_MV88E6352_SWITCH
  144. #define CONFIG_KM_MVEXTSW_ADDR 0x10
  145. /* ethernet port connected to simple switch 88e6122 (UEC0) */
  146. #define CONFIG_UEC_ETH1
  147. #define CONFIG_SYS_UEC1_UCC_NUM 0 /* UCC1 */
  148. #define CONFIG_SYS_UEC1_RX_CLK QE_CLK9
  149. #define CONFIG_SYS_UEC1_TX_CLK QE_CLK10
  150. #define CONFIG_FIXED_PHY 0xFFFFFFFF
  151. #define CONFIG_SYS_FIXED_PHY_ADDR 0x1E /* unused address */
  152. #define CONFIG_SYS_FIXED_PHY_PORT(devnum, speed, duplex) \
  153. {devnum, speed, duplex}
  154. #define CONFIG_SYS_FIXED_PHY_PORTS \
  155. CONFIG_SYS_FIXED_PHY_PORT("UEC0", SPEED_100, DUPLEX_FULL)
  156. #define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
  157. #define CONFIG_SYS_UEC1_PHY_ADDR CONFIG_SYS_FIXED_PHY_ADDR
  158. #define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
  159. #define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
  160. #endif /* CONFIG_KMVECT1 */
  161. #if defined(CONFIG_KMVECT1) || defined(CONFIG_KMTEGR1)
  162. /* ethernet port connected to piggy (UEC2) */
  163. #define CONFIG_HAS_ETH1
  164. #define CONFIG_UEC_ETH2
  165. #define CONFIG_SYS_UEC2_UCC_NUM 2 /* UCC3 */
  166. #define CONFIG_SYS_UEC2_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
  167. #define CONFIG_SYS_UEC2_TX_CLK QE_CLK12
  168. #define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH
  169. #define CONFIG_SYS_UEC2_PHY_ADDR 0
  170. #define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
  171. #define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
  172. #endif /* CONFIG_KMVECT1 || CONFIG_KMTEGR1 */
  173. #endif /* __CONFIG_H */