bluestone.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * bluestone.h - configuration for Bluestone (APM821XX)
  3. *
  4. * Copyright (c) 2010, Applied Micro Circuits Corporation
  5. * Author: Tirumala R Marri <tmarri@apm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __CONFIG_H
  23. #define __CONFIG_H
  24. /*
  25. * High Level Configuration Options
  26. */
  27. #define CONFIG_APM821XX 1 /* APM821XX series */
  28. #define CONFIG_HOSTNAME bluestone
  29. #define CONFIG_4xx 1 /* ... PPC4xx family */
  30. #define CONFIG_440 1
  31. /*
  32. * Include common defines/options for all AMCC eval boards
  33. */
  34. #include "amcc-common.h"
  35. #define CONFIG_SYS_CLK_FREQ 50000000
  36. #define CONFIG_BOARD_TYPES 1 /* support board types */
  37. #define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */
  38. #define CONFIG_MISC_INIT_R 1 /* Call misc_init_r */
  39. /*
  40. * Base addresses -- Note these are effective addresses where the
  41. * actual resources get mapped (not physical addresses)
  42. */
  43. /* EBC stuff */
  44. /* later mapped to this addr */
  45. #define CONFIG_SYS_FLASH_BASE 0xFFF00000
  46. #define CONFIG_SYS_FLASH_SIZE (4 << 20) /* 1MB usable */
  47. /* EBC Boot Space: 0xFF000000 */
  48. #define CONFIG_SYS_BOOT_BASE_ADDR 0xFF000000
  49. #define CONFIG_SYS_OCM_BASE 0xE3000000 /* OCM: 32k */
  50. #define CONFIG_SYS_SRAM_BASE 0xE8000000 /* SRAM: 256k */
  51. #define CONFIG_SYS_AHB_BASE 0xE2000000 /* internal AHB peripherals*/
  52. #define CONFIG_SYS_SRAM_SIZE (256 << 10)
  53. /*
  54. * Initial RAM & stack pointer (placed in OCM)
  55. */
  56. #define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_OCM_BASE /* OCM */
  57. #define CONFIG_SYS_INIT_RAM_END (4 << 10)
  58. #define CONFIG_SYS_GBL_DATA_SIZE 256 /* num bytes initial data */
  59. #define CONFIG_SYS_GBL_DATA_OFFSET \
  60. (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
  61. #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
  62. /*
  63. * Environment
  64. */
  65. /*
  66. * Define here the location of the environment variables (FLASH).
  67. */
  68. #define CONFIG_ENV_IS_IN_FLASH 1 /* use FLASH for environment vars */
  69. /*
  70. * FLASH related
  71. */
  72. #define CONFIG_SYS_FLASH_CFI /* The flash is CFI compatible */
  73. #define CONFIG_FLASH_CFI_DRIVER /* Use common CFI driver */
  74. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
  75. #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE}
  76. /* max number of memory banks */
  77. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  78. /* max number of sectors on one chip */
  79. #define CONFIG_SYS_MAX_FLASH_SECT 80
  80. /* Timeout for Flash Erase (in ms) */
  81. #define CONFIG_SYS_FLASH_ERASE_TOUT 120000
  82. /* Timeout for Flash Write (in ms) */
  83. #define CONFIG_SYS_FLASH_WRITE_TOUT 500
  84. /* use buffered writes (20x faster) */
  85. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
  86. /* print 'E' for empty sector on flinfo */
  87. #define CONFIG_SYS_FLASH_EMPTY_INFO
  88. #ifdef CONFIG_ENV_IS_IN_FLASH
  89. #define CONFIG_ENV_SECT_SIZE 0x10000 /* size of one complete sector */
  90. #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
  91. #define CONFIG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
  92. /* Address and size of Redundant Environment Sector */
  93. #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR - CONFIG_ENV_SECT_SIZE)
  94. #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
  95. #endif /* CONFIG_ENV_IS_IN_FLASH */
  96. /* SDRAM */
  97. #define CONFIG_SPD_EEPROM 1 /* Use SPD EEPROM for setup */
  98. #define SPD_EEPROM_ADDRESS {0x53, 0x51} /* SPD i2c spd addresses */
  99. #define CONFIG_PPC4xx_DDR_AUTOCALIBRATION /* IBM DDR autocalibration */
  100. #define CONFIG_AUTOCALIB "silent\0" /* default is non-verbose */
  101. #define CONFIG_DDR_ECC 1 /* with ECC support */
  102. /*
  103. * Serial Port
  104. */
  105. #define CONFIG_CONS_INDEX 1 /* Use UART0 */
  106. /*
  107. * I2C
  108. */
  109. #define CONFIG_SYS_I2C_SPEED 400000 /* I2C speed */
  110. #define CONFIG_SYS_I2C_MULTI_EEPROMS
  111. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x54
  112. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  113. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
  114. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 /* Data sheet */
  115. /* I2C bootstrap EEPROM */
  116. #define CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR 0x52
  117. #define CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET 0
  118. #define CONFIG_4xx_CONFIG_BLOCKSIZE 16
  119. /*
  120. * Ethernet
  121. */
  122. #define CONFIG_IBM_EMAC4_V4 1
  123. #define CONFIG_EMAC_PHY_MODE EMAC_PHY_MODE_NONE_RGMII
  124. #define CONFIG_HAS_ETH0
  125. /* PHY address, See schematics */
  126. #define CONFIG_PHY_ADDR 0x1f
  127. /* reset phy upon startup */
  128. #define CONFIG_PHY_RESET 1
  129. /* Include GbE speed/duplex detection */
  130. #define CONFIG_PHY_GIGE 1
  131. #define CONFIG_PHY_DYNAMIC_ANEG 1
  132. /*
  133. * External Bus Controller (EBC) Setup
  134. **/
  135. #define CONFIG_SYS_EBC_CFG (EBC_CFG_LE_LOCK | \
  136. EBC_CFG_PTD_ENABLE | \
  137. EBC_CFG_RTC_2048PERCLK | \
  138. EBC_CFG_ATC_HI | \
  139. EBC_CFG_DTC_HI | \
  140. EBC_CFG_CTC_HI | \
  141. EBC_CFG_OEO_PREVIOUS)
  142. /* NOR Flash */
  143. #define CONFIG_SYS_EBC_PB0AP (EBC_BXAP_BME_DISABLED | \
  144. EBC_BXAP_TWT_ENCODE(64) | \
  145. EBC_BXAP_BCE_DISABLE | \
  146. EBC_BXAP_BCT_2TRANS | \
  147. EBC_BXAP_CSN_ENCODE(1) | \
  148. EBC_BXAP_OEN_ENCODE(2) | \
  149. EBC_BXAP_WBN_ENCODE(2) | \
  150. EBC_BXAP_WBF_ENCODE(2) | \
  151. EBC_BXAP_TH_ENCODE(7) | \
  152. EBC_BXAP_SOR_DELAYED | \
  153. EBC_BXAP_BEM_WRITEONLY | \
  154. EBC_BXAP_PEN_DISABLED)
  155. /* Peripheral Bank Configuration Register - EBC_BxCR */
  156. #define CONFIG_SYS_EBC_PB0CR \
  157. (EBC_BXCR_BAS_ENCODE(CONFIG_SYS_FLASH_BASE) | \
  158. EBC_BXCR_BS_1MB | \
  159. EBC_BXCR_BU_RW | \
  160. EBC_BXCR_BW_8BIT)
  161. #endif /* __CONFIG_H */