mv-common.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /*
  2. * (C) Copyright 2010
  3. * Marvell Semiconductor <www.marvell.com>
  4. * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  22. * MA 02110-1301 USA
  23. */
  24. /*
  25. * This file contains Marvell Board Specific common defincations.
  26. * This file should be included in board config header file.
  27. *
  28. * It supports common definations for Kirkwood platform
  29. * TBD: support for Orion5X platforms
  30. */
  31. #ifndef _MV_COMMON_H
  32. #define _MV_COMMON_H
  33. /*
  34. * High Level Configuration Options (easy to change)
  35. */
  36. #define CONFIG_MARVELL 1
  37. #define CONFIG_ARM926EJS 1 /* Basic Architecture */
  38. /* ====> Kirkwood Platform Common Definations */
  39. #if defined(CONFIG_KIRKWOOD)
  40. #define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */
  41. #define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
  42. #define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
  43. #define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */
  44. /*
  45. * By default kwbimage.cfg from board specific folder is used
  46. * If for some board, different configuration file need to be used,
  47. * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
  48. */
  49. #ifndef CONFIG_SYS_KWD_CONFIG
  50. #define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
  51. #endif /* CONFIG_SYS_KWD_CONFIG */
  52. /* Kirkwood has 2k of Security SRAM, use it for SP */
  53. #define CONFIG_SYS_INIT_SP_ADDR 0xC8012000
  54. #define CONFIG_NR_DRAM_BANKS_MAX 2
  55. #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
  56. #define MV_UART_CONSOLE_BASE KW_UART0_BASE
  57. #define MV_SATA_BASE KW_SATA_BASE
  58. #define MV_SATA_PORT0_OFFSET KW_SATA_PORT0_OFFSET
  59. #define MV_SATA_PORT1_OFFSET KW_SATA_PORT1_OFFSET
  60. /* ====> ARMADA100 Platform Common Definations */
  61. #elif defined (CONFIG_ARMADA100)
  62. #define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */
  63. #define CONFIG_SYS_HZ_CLOCK (3250000) /* Timer Freq. 3.25MHZ */
  64. #define CONFIG_MARVELL_MFP /* Enable mvmfp driver */
  65. #define MV_MFPR_BASE ARMD1_MFPR_BASE
  66. #define MV_UART_CONSOLE_BASE ARMD1_UART1_BASE
  67. #define CONFIG_SYS_NS16550_IER (1 << 6) /* Bit 6 in UART_IER register
  68. represents UART Unit Enable */
  69. /*
  70. * There is no internal RAM in ARMADA100, using DRAM
  71. * TBD: dcache to be used for this
  72. */
  73. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - 0x00200000)
  74. #define CONFIG_NR_DRAM_BANKS_MAX 2
  75. #else
  76. #error "Unsupported SoC Platform..."
  77. #endif
  78. /*
  79. * Custom CONFIG_SYS_TEXT_BASE can be done in <board>.h
  80. */
  81. #ifndef CONFIG_SYS_TEXT_BASE
  82. #define CONFIG_SYS_TEXT_BASE 0x00600000
  83. #endif /* CONFIG_SYS_TEXT_BASE */
  84. /* additions for new ARM relocation support */
  85. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  86. /*
  87. * CLKs configurations
  88. */
  89. #define CONFIG_SYS_HZ 1000
  90. /*
  91. * NS16550 Configuration
  92. */
  93. #define CONFIG_SYS_NS16550
  94. #define CONFIG_SYS_NS16550_SERIAL
  95. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  96. #define CONFIG_SYS_NS16550_CLK CONFIG_SYS_TCLK
  97. #define CONFIG_SYS_NS16550_COM1 MV_UART_CONSOLE_BASE
  98. /*
  99. * Serial Port configuration
  100. * The following definitions let you select what serial you want to use
  101. * for your console driver.
  102. */
  103. #define CONFIG_CONS_INDEX 1 /*Console on UART0 */
  104. #define CONFIG_BAUDRATE 115200
  105. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \
  106. 115200,230400, 460800, 921600 }
  107. /* auto boot */
  108. #define CONFIG_BOOTDELAY 3 /* default enable autoboot */
  109. /*
  110. * For booting Linux, the board info and command line data
  111. * have to be in the first 8 MB of memory, since this is
  112. * the maximum mapped by the Linux kernel during initialization.
  113. */
  114. #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
  115. #define CONFIG_INITRD_TAG 1 /* enable INITRD tag */
  116. #define CONFIG_SETUP_MEMORY_TAGS 1 /* enable memory tag */
  117. #define CONFIG_SYS_PROMPT "Marvell>> " /* Command Prompt */
  118. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buff Size */
  119. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
  120. +sizeof(CONFIG_SYS_PROMPT) + 16) /* Print Buff */
  121. /*
  122. * NAND configuration
  123. */
  124. #ifdef CONFIG_CMD_NAND
  125. #define CONFIG_NAND_KIRKWOOD
  126. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  127. #define NAND_MAX_CHIPS 1
  128. #define CONFIG_SYS_NAND_BASE 0xD8000000 /* MV_DEFADR_NANDF */
  129. #define NAND_ALLOW_ERASE_ALL 1
  130. #define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
  131. #endif
  132. /*
  133. * SPI Flash configuration
  134. */
  135. #ifdef CONFIG_CMD_SF
  136. #define CONFIG_SPI_FLASH 1
  137. #define CONFIG_HARD_SPI 1
  138. #define CONFIG_KIRKWOOD_SPI 1
  139. #define CONFIG_SPI_FLASH_MACRONIX 1
  140. #define CONFIG_ENV_SPI_BUS 0
  141. #define CONFIG_ENV_SPI_CS 0
  142. #define CONFIG_ENV_SPI_MAX_HZ 50000000 /*50Mhz */
  143. #endif
  144. /*
  145. * Size of malloc() pool
  146. */
  147. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* 1MiB for malloc() */
  148. /* size in bytes reserved for initial data */
  149. /*
  150. * Other required minimal configurations
  151. */
  152. #define CONFIG_SYS_LONGHELP
  153. #define CONFIG_AUTO_COMPLETE
  154. #define CONFIG_CMDLINE_EDITING
  155. #define CONFIG_CONSOLE_INFO_QUIET /* some code reduction */
  156. #define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */
  157. #ifndef CONFIG_ARMADA100 /* will be removed latter */
  158. #define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */
  159. #endif /* CONFIG_ARMADA100 */
  160. #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */
  161. #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
  162. #define CONFIG_STACKSIZE 0x00100000 /* regular stack- 1M */
  163. #define CONFIG_SYS_LOAD_ADDR 0x00800000 /* default load adr- 8M */
  164. #define CONFIG_SYS_MEMTEST_START 0x00800000 /* 8M */
  165. #define CONFIG_SYS_MEMTEST_END 0x00ffffff /*(_16M -1) */
  166. #define CONFIG_SYS_RESET_ADDRESS 0xffff0000 /* Rst Vector Adr */
  167. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  168. /*
  169. * DRAM Banks configuration, Custom config can be done in <board>.h
  170. */
  171. #ifndef CONFIG_NR_DRAM_BANKS
  172. #define CONFIG_NR_DRAM_BANKS CONFIG_NR_DRAM_BANKS_MAX
  173. #else
  174. #if (CONFIG_NR_DRAM_BANKS > CONFIG_NR_DRAM_BANKS_MAX)
  175. #error CONFIG_NR_DRAM_BANKS Configurated more than available
  176. #endif
  177. #endif /* CONFIG_NR_DRAM_BANKS */
  178. /*
  179. * Ethernet Driver configuration
  180. */
  181. #ifdef CONFIG_CMD_NET
  182. #define CONFIG_CMD_MII
  183. #define CONFIG_NETCONSOLE /* include NetConsole support */
  184. #define CONFIG_NET_MULTI /* specify more that one ports available */
  185. #define CONFIG_MII /* expose smi ove miiphy interface */
  186. #define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */
  187. #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */
  188. #define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */
  189. #define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */
  190. #endif /* CONFIG_CMD_NET */
  191. /*
  192. * USB/EHCI
  193. */
  194. #ifdef CONFIG_CMD_USB
  195. #define CONFIG_USB_EHCI /* Enable EHCI USB support */
  196. #define CONFIG_USB_EHCI_KIRKWOOD
  197. #define CONFIG_EHCI_IS_TDI
  198. #define CONFIG_USB_STORAGE
  199. #define CONFIG_DOS_PARTITION
  200. #define CONFIG_ISO_PARTITION
  201. #define CONFIG_SUPPORT_VFAT
  202. #endif /* CONFIG_CMD_USB */
  203. /*
  204. * IDE Support on SATA ports
  205. */
  206. #ifdef CONFIG_CMD_IDE
  207. #define __io
  208. #define CONFIG_CMD_EXT2
  209. #define CONFIG_MVSATA_IDE
  210. #define CONFIG_IDE_PREINIT
  211. #define CONFIG_MVSATA_IDE_USE_PORT1
  212. /* Needs byte-swapping for ATA data register */
  213. #define CONFIG_IDE_SWAP_IO
  214. /* Data, registers and alternate blocks are at the same offset */
  215. #define CONFIG_SYS_ATA_DATA_OFFSET (0x0100)
  216. #define CONFIG_SYS_ATA_REG_OFFSET (0x0100)
  217. #define CONFIG_SYS_ATA_ALT_OFFSET (0x0100)
  218. /* Each 8-bit ATA register is aligned to a 4-bytes address */
  219. #define CONFIG_SYS_ATA_STRIDE 4
  220. /* Controller supports 48-bits LBA addressing */
  221. #define CONFIG_LBA48
  222. /* CONFIG_CMD_IDE requires some #defines for ATA registers */
  223. #define CONFIG_SYS_IDE_MAXBUS 2
  224. #define CONFIG_SYS_IDE_MAXDEVICE 2
  225. /* ATA registers base is at SATA controller base */
  226. #define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE
  227. #endif /* CONFIG_CMD_IDE */
  228. /*
  229. * I2C related stuff
  230. */
  231. #ifdef CONFIG_CMD_I2C
  232. #define CONFIG_I2C_MVTWSI
  233. #define CONFIG_SYS_I2C_SLAVE 0x0
  234. #define CONFIG_SYS_I2C_SPEED 100000
  235. #endif
  236. /*
  237. * File system
  238. */
  239. #ifndef CONFIG_ARMADA100 /* will be removed latter */
  240. #define CONFIG_CMD_EXT2
  241. #define CONFIG_CMD_JFFS2
  242. #define CONFIG_CMD_FAT
  243. #define CONFIG_CMD_UBI
  244. #define CONFIG_CMD_UBIFS
  245. #define CONFIG_RBTREE
  246. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  247. #define CONFIG_MTD_PARTITIONS
  248. #define CONFIG_CMD_MTDPARTS
  249. #define CONFIG_LZO
  250. #endif /* CONFIG_ARMADA100 */
  251. #endif /* _MV_COMMON_H */