cpuat91.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. /*
  2. * CPUAT91 by (C) Copyright 2006-2010 Eric Benard
  3. * eric@eukrea.com
  4. *
  5. * Configuration settings for the CPUAT91 board.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef _CONFIG_CPUAT91_H
  26. #define _CONFIG_CPUAT91_H
  27. #include <asm/sizes.h>
  28. #ifdef CONFIG_RAMBOOT
  29. #define CONFIG_SKIP_LOWLEVEL_INIT
  30. #define CONFIG_SYS_TEXT_BASE 0x21F00000
  31. #else
  32. #define CONFIG_BOOTDELAY 1
  33. #define CONFIG_SYS_TEXT_BASE 0
  34. #endif
  35. #define AT91C_XTAL_CLOCK 18432000
  36. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  37. #define AT91C_MAIN_CLOCK ((AT91C_XTAL_CLOCK / 4) * 39)
  38. #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK / 3)
  39. #define CONFIG_SYS_HZ_CLOCK (AT91C_MASTER_CLOCK / 2)
  40. #define CONFIG_SYS_HZ 1000
  41. #define CONFIG_ARM920T
  42. #define CONFIG_AT91RM9200
  43. #define CONFIG_CPUAT91
  44. #undef CONFIG_USE_IRQ
  45. #define USE_920T_MMU
  46. #include <asm/hardware.h> /* needed for port definitions */
  47. #define CONFIG_CMDLINE_TAG
  48. #define CONFIG_SETUP_MEMORY_TAGS
  49. #define CONFIG_INITRD_TAG
  50. #define CONFIG_BOARD_EARLY_INIT_F
  51. #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  52. #define CONFIG_SYS_USE_MAIN_OSCILLATOR
  53. /* flash */
  54. #define CONFIG_SYS_MC_PUIA_VAL 0x00000000
  55. #define CONFIG_SYS_MC_PUP_VAL 0x00000000
  56. #define CONFIG_SYS_MC_PUER_VAL 0x00000000
  57. #define CONFIG_SYS_MC_ASR_VAL 0x00000000
  58. #define CONFIG_SYS_MC_AASR_VAL 0x00000000
  59. #define CONFIG_SYS_EBI_CFGR_VAL 0x00000000
  60. #define CONFIG_SYS_SMC_CSR0_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */
  61. /* clocks */
  62. #define CONFIG_SYS_PLLAR_VAL 0x20263E04 /* 179.712000 MHz for PCK */
  63. #define CONFIG_SYS_PLLBR_VAL 0x10483E0E /* 48.054857 MHz for USB */
  64. #define CONFIG_SYS_MCKR_VAL 0x00000202 /* PCK/3 = MCK Master Clock */
  65. /* sdram */
  66. #define CONFIG_SYS_PIOC_ASR_VAL 0xFFFF0000 /* Configure PIOC as D16/D31 */
  67. #define CONFIG_SYS_PIOC_BSR_VAL 0x00000000
  68. #define CONFIG_SYS_PIOC_PDR_VAL 0xFFFF0000
  69. #define CONFIG_SYS_EBI_CSA_VAL 0x00000002 /* CS1=SDRAM */
  70. #define CONFIG_SYS_SDRC_CR_VAL 0x2188C155 /* set up the SDRAM */
  71. #define CONFIG_SYS_SDRAM 0x20000000 /* address of the SDRAM */
  72. #define CONFIG_SYS_SDRAM1 0x20000080 /* address of the SDRAM */
  73. #define CONFIG_SYS_SDRAM_VAL 0x00000000 /* value written to SDRAM */
  74. #define CONFIG_SYS_SDRC_MR_VAL 0x00000002 /* Precharge All */
  75. #define CONFIG_SYS_SDRC_MR_VAL1 0x00000004 /* refresh */
  76. #define CONFIG_SYS_SDRC_MR_VAL2 0x00000003 /* Load Mode Register */
  77. #define CONFIG_SYS_SDRC_MR_VAL3 0x00000000 /* Normal Mode */
  78. #define CONFIG_SYS_SDRC_TR_VAL 0x000002E0 /* Write refresh rate */
  79. #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
  80. #define CONFIG_ATMEL_USART
  81. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  82. #define CONFIG_USART_ID 0/* ignored in arm */
  83. #undef CONFIG_HARD_I2C
  84. #undef CONFIG_SOFT_I2C
  85. #define AT91_PIN_SDA (1<<25)
  86. #define AT91_PIN_SCL (1<<26)
  87. #define CONFIG_SYS_I2C_INIT_BOARD
  88. #define CONFIG_SYS_I2C_SPEED 50000
  89. #define CONFIG_SYS_I2C_SLAVE 0
  90. #define I2C_INIT i2c_init_board();
  91. #define I2C_ACTIVE writel(AT91_PMX_AA_TWD, &pio->pioa.mddr);
  92. #define I2C_TRISTATE writel(AT91_PMX_AA_TWD, &pio->pioa.mder);
  93. #define I2C_READ ((readl(&pio->pioa.pdsr) & AT91_PMX_AA_TWD) != 0)
  94. #define I2C_SDA(bit) \
  95. if (bit) \
  96. writel(AT91_PMX_AA_TWD, &pio->pioa.sodr); \
  97. else \
  98. writel(AT91_PMX_AA_TWD, &pio->pioa.codr);
  99. #define I2C_SCL(bit) \
  100. if (bit) \
  101. writel(AT91_PMX_AA_TWCK, &pio->pioa.sodr); \
  102. else \
  103. writel(AT91_PMX_AA_TWCK, &pio->pioa.codr);
  104. #define I2C_DELAY udelay(2500000/CONFIG_SYS_I2C_SPEED)
  105. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x54
  106. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  107. #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 1
  108. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
  109. #define CONFIG_BOOTP_BOOTFILESIZE
  110. #define CONFIG_BOOTP_BOOTPATH
  111. #define CONFIG_BOOTP_GATEWAY
  112. #define CONFIG_BOOTP_HOSTNAME
  113. #include <config_cmd_default.h>
  114. #define CONFIG_CMD_PING
  115. #define CONFIG_CMD_MII
  116. #define CONFIG_CMD_CACHE
  117. #undef CONFIG_CMD_USB
  118. #undef CONFIG_CMD_FPGA
  119. #undef CONFIG_CMD_IMI
  120. #undef CONFIG_CMD_LOADS
  121. #undef CONFIG_CMD_NFS
  122. #undef CONFIG_CMD_DHCP
  123. #ifdef CONFIG_SOFT_I2C
  124. #define CONFIG_CMD_EEPROM
  125. #define CONFIG_CMD_I2C
  126. #endif
  127. #define CONFIG_NR_DRAM_BANKS 1
  128. #define CONFIG_SYS_SDRAM_BASE 0x20000000
  129. #define CONFIG_SYS_SDRAM_SIZE (32 * 1024 * 1024)
  130. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  131. #define CONFIG_SYS_MEMTEST_END \
  132. (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - 512 * 1024)
  133. #define CONFIG_DRIVER_AT91EMAC
  134. #define CONFIG_SYS_RX_ETH_BUFFER 16
  135. #define CONFIG_RMII
  136. #define CONFIG_MII
  137. #define CONFIG_DRIVER_AT91EMAC_PHYADDR 1
  138. #define CONFIG_NET_RETRY_COUNT 20
  139. #define CONFIG_KS8721_PHY
  140. #define CONFIG_SYS_FLASH_CFI
  141. #define CONFIG_FLASH_CFI_DRIVER
  142. #define CONFIG_SYS_FLASH_EMPTY_INFO
  143. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  144. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  145. #define CONFIG_SYS_FLASH_PROTECTION
  146. #define PHYS_FLASH_1 0x10000000
  147. #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
  148. #define CONFIG_SYS_MAX_FLASH_SECT 128
  149. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
  150. #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
  151. #define PHYS_FLASH_SIZE (16 * 1024 * 1024)
  152. #define CONFIG_SYS_FLASH_BANKS_LIST \
  153. { PHYS_FLASH_1 }
  154. #if defined(CONFIG_CMD_USB)
  155. #define CONFIG_USB_ATMEL
  156. #define CONFIG_USB_OHCI_NEW
  157. #define CONFIG_USB_STORAGE
  158. #define CONFIG_DOS_PARTITION
  159. #define CONFIG_AT91C_PQFP_UHPBU
  160. #undef CONFIG_SYS_USB_OHCI_BOARD_INIT
  161. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  162. #define CONFIG_SYS_USB_OHCI_REGS_BASE AT91_USB_HOST_BASE
  163. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91rm9200"
  164. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
  165. #endif
  166. #define CONFIG_ENV_IS_IN_FLASH
  167. #define CONFIG_ENV_ADDR (PHYS_FLASH_1 + 128 * 1024)
  168. #define CONFIG_ENV_SIZE (128 * 1024)
  169. #define CONFIG_ENV_SECT_SIZE (128 * 1024)
  170. #define CONFIG_SYS_LOAD_ADDR 0x21000000
  171. #define CONFIG_BAUDRATE 115200
  172. #define CONFIG_SYS_BAUDRATE_TABLE { 115200, 57600, 38400, 19200, 9600 }
  173. #define CONFIG_SYS_PROMPT "CPUAT91=> "
  174. #define CONFIG_SYS_CBSIZE 256
  175. #define CONFIG_SYS_MAXARGS 32
  176. #define CONFIG_SYS_PBSIZE \
  177. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  178. #define CONFIG_CMDLINE_EDITING
  179. #define CONFIG_SYS_MALLOC_LEN \
  180. ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 4 * 1024)
  181. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - \
  182. GENERATED_GBL_DATA_SIZE)
  183. #define CONFIG_STACKSIZE (32 * 1024)
  184. #define CONFIG_STACKSIZE_IRQ (4 * 1024)
  185. #define CONFIG_STACKSIZE_FIQ (4 * 1024)
  186. #if defined(CONFIG_USE_IRQ)
  187. #error CONFIG_USE_IRQ not supported
  188. #endif
  189. #define CONFIG_DEVICE_NULLDEV
  190. #define CONFIG_SILENT_CONSOLE
  191. #define CONFIG_AUTOBOOT_KEYED
  192. #define CONFIG_AUTOBOOT_PROMPT \
  193. "Press SPACE to abort autoboot\n"
  194. #define CONFIG_AUTOBOOT_STOP_STR " "
  195. #define CONFIG_AUTOBOOT_DELAY_STR "d"
  196. #define CONFIG_VERSION_VARIABLE
  197. #define MTDIDS_DEFAULT "nor0=physmap-flash.0"
  198. #define MTDPARTS_DEFAULT \
  199. "mtdparts=physmap-flash.0:" \
  200. "128k(u-boot)ro," \
  201. "128k(u-boot-env)," \
  202. "1792k(kernel)," \
  203. "-(rootfs)"
  204. #define CONFIG_BOOTARGS \
  205. "root=/dev/mtdblock3 rootfstype=jffs2 console=ttyS0,115200"
  206. #define CONFIG_BOOTCOMMAND "run flashboot"
  207. #define CONFIG_EXTRA_ENV_SETTINGS \
  208. "mtdid=" MTDIDS_DEFAULT "\0" \
  209. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  210. "flub=tftp 21000000 cpuat91/u-boot.bin; protect off 10000000 " \
  211. "1001FFFF; erase 10000000 1001FFFF; cp.b 21000000 " \
  212. "10000000 ${filesize}\0" \
  213. "flui=tftp 21000000 cpuat91/uImage; protect off 10040000 " \
  214. "1019ffff; erase 10040000 101fffff; cp.b 21000000 " \
  215. "10040000 ${filesize}\0" \
  216. "flrfs=tftp 21000000 cpuat91/rootfs.jffs2; protect off " \
  217. "10200000 10ffffff; erase 10200000 10ffffff; cp.b " \
  218. "21000000 10200000 ${filesize}\0" \
  219. "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0" \
  220. "flashboot=run ramargs;bootm 10040000\0" \
  221. "netboot=run ramargs;tftpboot 21000000 cpuat91/uImage;" \
  222. "bootm 21000000\0"
  223. #endif /* _CONFIG_CPUAT91_H */