mp2usb.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /*
  2. * 2004-2005 Gary Jennejohn <garyj@denx.de>
  3. *
  4. * Modified for the MP2USB by (C) Copyright 2005 Eric Benard
  5. * ebenard@eukrea.com
  6. *
  7. * Configuration settings for the MP2USB board.
  8. *
  9. * See file CREDITS for list of people who contributed to this
  10. * project.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25. * MA 02111-1307 USA
  26. */
  27. #ifndef __CONFIG_H
  28. #define __CONFIG_H
  29. /* ARM asynchronous clock */
  30. #define AT91C_MAIN_CLOCK 179712000 /* from 18.432 MHz crystal (18432000 / 4 * 45) */
  31. #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK/3) /* peripheral clock */
  32. #define AT91_SLOW_CLOCK 32768 /* slow clock */
  33. #define CONFIG_ARM920T 1 /* This is an ARM920T Core */
  34. #define CONFIG_AT91RM9200 1 /* It's an Atmel AT91RM9200 SoC */
  35. #define CONFIG_AT91RM9200DK 1 /* on an AT91RM9200DK Board */
  36. #define CONFIG_MP2USB 1 /* on an MP2USB Board */
  37. #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
  38. #define USE_920T_MMU 1
  39. #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
  40. #define CONFIG_SETUP_MEMORY_TAGS 1
  41. #define CONFIG_INITRD_TAG 1
  42. #define CFG_ATMEL_PLL_INIT_BUG 1
  43. #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  44. #define CFG_USE_MAIN_OSCILLATOR 1
  45. /* flash */
  46. #define MC_PUIA_VAL 0x00000000
  47. #define MC_PUP_VAL 0x00000000
  48. #define MC_PUER_VAL 0x00000000
  49. #define MC_ASR_VAL 0x00000000
  50. #define MC_AASR_VAL 0x00000000
  51. #define EBI_CFGR_VAL 0x00000000
  52. #define SMC2_CSR_VAL 0x00003084 /* 16bit, 2 TDF, 4 WS */
  53. /* clocks */
  54. #define PLLAR_VAL 0x20263E04 /* 180 MHz for PCK */
  55. #define PLLBR_VAL 0x1048bE0E /* 48 MHz (divider by 2 for USB) */
  56. #define MCKR_VAL 0x00000202 /* PCK/3 = MCK Master Clock = 60MHz from PLLA */
  57. /* sdram */
  58. #define PIOC_ASR_VAL 0xFFFF0000 /* Configure PIOC as peripheral (D16/D31) */
  59. #define PIOC_BSR_VAL 0x00000000
  60. #define PIOC_PDR_VAL 0xFFFF0000
  61. #define EBI_CSA_VAL 0x00000002 /* CS1=SDRAM */
  62. #define SDRC_CR_VAL 0x3211295A /* set up the SDRAM */
  63. #define SDRAM 0x20000000 /* address of the SDRAM */
  64. #define SDRAM1 0x20000020 /* address of the SDRAM */
  65. #define SDRAM_VAL 0x00000000 /* value written to SDRAM */
  66. #define SDRC_MR_VAL 0x00000002 /* Precharge All */
  67. #define SDRC_MR_VAL1 0x00000004 /* refresh */
  68. #define SDRC_MR_VAL2 0x00000003 /* Load Mode Register */
  69. #define SDRC_MR_VAL3 0x00000000 /* Normal Mode */
  70. #define SDRC_TR_VAL 0x000002E0 /* Write refresh rate */
  71. #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
  72. /*
  73. * Size of malloc() pool
  74. */
  75. #define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
  76. #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
  77. #define CONFIG_BAUDRATE 115200
  78. #define CFG_AT91C_BRGR_DIVISOR 33 /* hardcode so no __divsi3 : AT91C_MASTER_CLOCK /(baudrate * 16) */
  79. /*
  80. * Hardware drivers
  81. */
  82. /* define one of these to choose the DBGU, USART0 or USART1 as console */
  83. #define CONFIG_DBGU
  84. #undef CONFIG_USART0
  85. #undef CONFIG_USART1
  86. #undef CONFIG_HWFLOW /* don't include RTS/CTS flow control support */
  87. #undef CONFIG_MODEM_SUPPORT /* disable modem initialization stuff */
  88. #define CONFIG_USB_OHCI 1
  89. #define CONFIG_USB_KEYBOARD 1
  90. #define CONFIG_USB_STORAGE 1
  91. #define CONFIG_DOS_PARTITION 1
  92. #define CONFIG_AT91C_PQFP_UHPBUG 1
  93. #undef CFG_USB_OHCI_BOARD_INIT
  94. #define CFG_USB_OHCI_CPU_INIT 1
  95. #define CFG_USB_OHCI_REGS_BASE AT91_USB_HOST_BASE
  96. #define CFG_USB_OHCI_SLOT_NAME "at91rm9200"
  97. #undef CONFIG_HARD_I2C
  98. #ifdef CONFIG_HARD_I2C
  99. #define CFG_I2C_SPEED 0 /* not used */
  100. #define CFG_I2C_SLAVE 0 /* not used */
  101. #define CONFIG_RTC_RS5C372A /* RICOH I2C RTC */
  102. #define CFG_I2C_RTC_ADDR 0x32
  103. #define CFG_I2C_EEPROM_ADDR 0x50
  104. #define CFG_I2C_EEPROM_ADDR_LEN 1
  105. #define CFG_I2C_EEPROM_ADDR_OVERFLOW
  106. #endif
  107. /* still about 20 kB free with this defined */
  108. #define CFG_LONGHELP
  109. #define CONFIG_BOOTDELAY 3
  110. #ifdef CONFIG_HARD_I2C
  111. #define CONFIG_COMMANDS \
  112. ((CONFIG_CMD_DFL | \
  113. CFG_CMD_DATE | \
  114. CFG_CMD_DHCP | \
  115. CFG_CMD_EEPROM | \
  116. CFG_CMD_I2C | \
  117. CFG_CMD_NFS | \
  118. CFG_CMD_SNTP | \
  119. CFG_CMD_MISC))
  120. #else
  121. #define CONFIG_COMMANDS \
  122. ((CONFIG_CMD_DFL | \
  123. CFG_CMD_DHCP | \
  124. CFG_CMD_NFS | \
  125. CFG_CMD_SNTP | \
  126. CFG_CMD_USB | \
  127. CFG_CMD_CACHE) & \
  128. ~(CFG_CMD_BDI | \
  129. CFG_CMD_IMI | \
  130. CFG_CMD_AUTOSCRIPT | \
  131. CFG_CMD_FPGA | \
  132. CFG_CMD_MISC | \
  133. CFG_CMD_LOADS ))
  134. #define CONFIG_TIMESTAMP
  135. #endif
  136. #define CFG_LONGHELP
  137. /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
  138. #include <cmd_confdefs.h>
  139. #define CONFIG_NR_DRAM_BANKS 1
  140. #define PHYS_SDRAM 0x20000000
  141. #define PHYS_SDRAM_SIZE 0x08000000 /* 128 megs */
  142. #define CFG_MEMTEST_START PHYS_SDRAM
  143. #define CFG_MEMTEST_END CFG_MEMTEST_START + PHYS_SDRAM_SIZE - 262144
  144. #define CONFIG_DRIVER_ETHER
  145. #define CONFIG_NET_RETRY_COUNT 20
  146. #undef CONFIG_AT91C_USE_RMII
  147. #define PHYS_FLASH_1 0x10000000
  148. #define PHYS_FLASH_SIZE 0x1000000 /* 16 megs main flash */
  149. #define CFG_FLASH_BASE PHYS_FLASH_1
  150. #define CFG_MONITOR_BASE CFG_FLASH_BASE
  151. #define CFG_MAX_FLASH_BANKS 1
  152. #define CFG_MAX_FLASH_SECT 256
  153. #define CFG_FLASH_ERASE_TOUT (2 * CFG_HZ) /* Timeout for Flash Erase */
  154. #define CFG_FLASH_WRITE_TOUT (2 * CFG_HZ) /* Timeout for Flash Write */
  155. #define CFG_FLASH_LOCK_TOUT (10*CFG_HZ) /* Timeout for Flash Set Lock Bit */
  156. #define CFG_FLASH_UNLOCK_TOUT (10*CFG_HZ) /* Timeout for Flash Clear Lock Bits */
  157. #define CFG_FLASH_PROTECTION /* "Real" (hardware) sectors protection */
  158. #define CFG_ENV_IS_IN_FLASH 1
  159. #define CFG_ENV_OFFSET 0x20000 /* after u-boot.bin */
  160. #define CFG_ENV_ADDR (CFG_FLASH_BASE+CFG_ENV_OFFSET)
  161. #define CFG_ENV_SIZE 0x20000
  162. #define CFG_LOAD_ADDR 0x21000000 /* default load address */
  163. #define CFG_BAUDRATE_TABLE { 115200, 57600, 38400, 19200, 9600 }
  164. #define CFG_PROMPT "=> " /* Monitor Command Prompt */
  165. #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
  166. #define CFG_MAXARGS 32 /* max number of command args */
  167. #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
  168. #define CFG_DEVICE_DEREGISTER /* needs device_deregister */
  169. #define LITTLEENDIAN 1 /* used by usb_ohci.c */
  170. #ifndef __ASSEMBLY__
  171. /*-----------------------------------------------------------------------
  172. * Board specific extension for bd_info
  173. *
  174. * This structure is embedded in the global bd_info (bd_t) structure
  175. * and can be used by the board specific code (eg board/...)
  176. */
  177. struct bd_info_ext {
  178. /* helper variable for board environment handling
  179. *
  180. * env_crc_valid == 0 => uninitialised
  181. * env_crc_valid > 0 => environment crc in flash is valid
  182. * env_crc_valid < 0 => environment crc in flash is invalid
  183. */
  184. int env_crc_valid;
  185. };
  186. #endif /* __ASSEMBLY__ */
  187. #define CFG_HZ 1000
  188. #define CFG_HZ_CLOCK (AT91C_MASTER_CLOCK/2) /* AT91C_TC0_CMR is implicitly set to */
  189. /* AT91C_TC_TIMER_DIV1_CLOCK */
  190. #define CONFIG_STACKSIZE (32*1024) /* regular stack */
  191. #ifdef CONFIG_USE_IRQ
  192. #error CONFIG_USE_IRQ not supported
  193. #endif
  194. #define CFG_DEVICE_NULLDEV 1 /* enble null device */
  195. #undef CONFIG_SILENT_CONSOLE /* enable silent startup */
  196. #define CONFIG_AUTOBOOT_KEYED
  197. #define CONFIG_AUTOBOOT_PROMPT "Press SPACE to abort autoboot in %d seconds\n"
  198. #define CONFIG_AUTOBOOT_STOP_STR " "
  199. #define CONFIG_AUTOBOOT_DELAY_STR "d"
  200. #define CONFIG_VERSION_VARIABLE 1 /* include version env variable */
  201. #endif /* __CONFIG_H */