config.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * (C) Copyright 2011
  3. * Marvell Semiconductor <www.marvell.com>
  4. * Written-by: Lei Wen <leiwen@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 should be included in board config header file.
  26. *
  27. * It supports common definitions for Kirkwood platform
  28. */
  29. #ifndef _KW_CONFIG_H
  30. #define _KW_CONFIG_H
  31. #if defined (CONFIG_KW88F6281)
  32. #include <asm/arch/kw88f6281.h>
  33. #elif defined (CONFIG_KW88F6192)
  34. #include <asm/arch/kw88f6192.h>
  35. #else
  36. #error "SOC Name not defined"
  37. #endif /* CONFIG_KW88F6281 */
  38. #include <asm/arch/kirkwood.h>
  39. #define CONFIG_ARM926EJS 1 /* Basic Architecture */
  40. #define CONFIG_SYS_CACHELINE_SIZE 32
  41. /* default Dcache Line length for kirkwood */
  42. #define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */
  43. #define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
  44. #define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
  45. #define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */
  46. /*
  47. * By default kwbimage.cfg from board specific folder is used
  48. * If for some board, different configuration file need to be used,
  49. * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
  50. */
  51. #ifndef CONFIG_SYS_KWD_CONFIG
  52. #define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
  53. #endif /* CONFIG_SYS_KWD_CONFIG */
  54. /* Kirkwood has 2k of Security SRAM, use it for SP */
  55. #define CONFIG_SYS_INIT_SP_ADDR 0xC8012000
  56. #define CONFIG_NR_DRAM_BANKS_MAX 2
  57. #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
  58. #define MV_UART_CONSOLE_BASE KW_UART0_BASE
  59. #define MV_SATA_BASE KW_SATA_BASE
  60. #define MV_SATA_PORT0_OFFSET KW_SATA_PORT0_OFFSET
  61. #define MV_SATA_PORT1_OFFSET KW_SATA_PORT1_OFFSET
  62. /*
  63. * NAND configuration
  64. */
  65. #ifdef CONFIG_CMD_NAND
  66. #define CONFIG_NAND_KIRKWOOD
  67. #define CONFIG_SYS_NAND_BASE 0xD8000000 /* MV_DEFADR_NANDF */
  68. #define NAND_ALLOW_ERASE_ALL 1
  69. #endif
  70. /*
  71. * SPI Flash configuration
  72. */
  73. #ifdef CONFIG_CMD_SF
  74. #define CONFIG_HARD_SPI 1
  75. #define CONFIG_KIRKWOOD_SPI 1
  76. #ifndef CONFIG_ENV_SPI_BUS
  77. # define CONFIG_ENV_SPI_BUS 0
  78. #endif
  79. #ifndef CONFIG_ENV_SPI_CS
  80. # define CONFIG_ENV_SPI_CS 0
  81. #endif
  82. #ifndef CONFIG_ENV_SPI_MAX_HZ
  83. # define CONFIG_ENV_SPI_MAX_HZ 50000000
  84. #endif
  85. #endif
  86. /*
  87. * Ethernet Driver configuration
  88. */
  89. #ifdef CONFIG_CMD_NET
  90. #define CONFIG_CMD_MII
  91. #define CONFIG_NETCONSOLE /* include NetConsole support */
  92. #define CONFIG_MII /* expose smi ove miiphy interface */
  93. #define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */
  94. #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */
  95. #define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */
  96. #define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */
  97. #endif /* CONFIG_CMD_NET */
  98. /*
  99. * USB/EHCI
  100. */
  101. #ifdef CONFIG_CMD_USB
  102. #define CONFIG_USB_EHCI_MARVELL
  103. #define CONFIG_EHCI_IS_TDI
  104. #endif /* CONFIG_CMD_USB */
  105. /*
  106. * IDE Support on SATA ports
  107. */
  108. #ifdef CONFIG_CMD_IDE
  109. #define __io
  110. #define CONFIG_CMD_EXT2
  111. #define CONFIG_MVSATA_IDE
  112. #define CONFIG_IDE_PREINIT
  113. #define CONFIG_MVSATA_IDE_USE_PORT1
  114. /* Needs byte-swapping for ATA data register */
  115. #define CONFIG_IDE_SWAP_IO
  116. /* Data, registers and alternate blocks are at the same offset */
  117. #define CONFIG_SYS_ATA_DATA_OFFSET (0x0100)
  118. #define CONFIG_SYS_ATA_REG_OFFSET (0x0100)
  119. #define CONFIG_SYS_ATA_ALT_OFFSET (0x0100)
  120. /* Each 8-bit ATA register is aligned to a 4-bytes address */
  121. #define CONFIG_SYS_ATA_STRIDE 4
  122. /* Controller supports 48-bits LBA addressing */
  123. #define CONFIG_LBA48
  124. /* CONFIG_CMD_IDE requires some #defines for ATA registers */
  125. #define CONFIG_SYS_IDE_MAXBUS 2
  126. #define CONFIG_SYS_IDE_MAXDEVICE 2
  127. /* ATA registers base is at SATA controller base */
  128. #define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE
  129. #endif /* CONFIG_CMD_IDE */
  130. /*
  131. * I2C related stuff
  132. */
  133. #ifdef CONFIG_CMD_I2C
  134. #ifndef CONFIG_SOFT_I2C
  135. #define CONFIG_I2C_MVTWSI
  136. #endif
  137. #define CONFIG_SYS_I2C_SLAVE 0x0
  138. #define CONFIG_SYS_I2C_SPEED 100000
  139. #endif
  140. #endif /* _KW_CONFIG_H */