eb_cpux9k2.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. /*
  2. * (C) Copyright 2008-2009
  3. * BuS Elektronik GmbH & Co. KG <www.bus-elektronik.de>
  4. * Jens Scharsig <esw@bus-elektronik.de>
  5. *
  6. * Configuation settings for the EB+CPUx9K2 board.
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #ifndef _CONFIG_EB_CPUx9K2_H_
  27. #define _CONFIG_EB_CPUx9K2_H_
  28. /*--------------------------------------------------------------------------*/
  29. #define CONFIG_ARM920T 1 /* This is an ARM920T Core */
  30. #define CONFIG_AT91RM9200 1 /* It's an Atmel AT91RM9200 SoC */
  31. #define CONFIG_EB_CPUX9K2 1 /* on an EP+CPUX9K2 Board */
  32. #define USE_920T_MMU 1
  33. #define CONFIG_VERSION_VARIABLE 1
  34. #define CONFIG_IDENT_STRING " on EB+CPUx9K2"
  35. #include <asm/arch/hardware.h> /* needed for port definitions */
  36. #define CONFIG_MISC_INIT_R
  37. /*--------------------------------------------------------------------------*/
  38. #define CONFIG_SYS_LOAD_ADDR 0x21000000 /* default load address */
  39. #define CONFIG_SYS_BOOT_SIZE 0x00 /* 0 KBytes */
  40. #define CONFIG_SYS_U_BOOT_BASE PHYS_FLASH_1
  41. #define CONFIG_SYS_U_BOOT_SIZE 0x60000 /* 384 KBytes */
  42. #define CONFIG_BOOT_RETRY_TIME 30
  43. #define CONFIG_CMDLINE_EDITING
  44. #define CONFIG_SYS_PROMPT "U-Boot> " /* Monitor Command Prompt */
  45. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  46. #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
  47. #define CONFIG_SYS_PBSIZE \
  48. (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
  49. #define CONFIG_STACKSIZE (32*1024) /* regular stack */
  50. /*
  51. * ARM asynchronous clock
  52. */
  53. #define AT91C_MAIN_CLOCK 179404800 /* from 12.288 MHz * 73 / 5 */
  54. #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK / 3)
  55. #define CONFIG_SYS_HZ 1000
  56. #define CONFIG_SYS_HZ_CLOCK (AT91C_MASTER_CLOCK / 2)
  57. #define AT91_SLOW_CLOCK 32768 /* slow clock */
  58. #define CONFIG_CMDLINE_TAG 1
  59. #define CONFIG_SETUP_MEMORY_TAGS 1
  60. #define CONFIG_INITRD_TAG 1
  61. #define CONFIG_SYS_USE_MAIN_OSCILLATOR 1
  62. /* flash */
  63. #define CONFIG_SYS_EBI_CFGR_VAL 0x00000000
  64. #define CONFIG_SYS_SMC_CSR0_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */
  65. /* clocks */
  66. #define CONFIG_SYS_PLLAR_VAL 0x20483E05 /* 179.4048 MHz for PCK */
  67. #define CONFIG_SYS_PLLBR_VAL 0x104C3E0A /* 47.3088 MHz (for USB) */
  68. #define CONFIG_SYS_MCKR_VAL 0x00000202 /* PCK/3 = MCK Clock */
  69. /*
  70. * Size of malloc() pool
  71. */
  72. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 520*1024)
  73. #define CONFIG_SYS_GBL_DATA_SIZE 128
  74. /*
  75. * sdram
  76. */
  77. #define CONFIG_NR_DRAM_BANKS 1
  78. #define PHYS_SDRAM 0x20000000
  79. #define PHYS_SDRAM_SIZE 0x04000000 /* 64 megs */
  80. #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
  81. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
  82. PHYS_SDRAM_SIZE - 0x00400000 - \
  83. CONFIG_SYS_MALLOC_LEN)
  84. #define CONFIG_SYS_PIOC_ASR_VAL 0xFFFF0000 /* PIOC as D16/D31 */
  85. #define CONFIG_SYS_PIOC_BSR_VAL 0x00000000
  86. #define CONFIG_SYS_PIOC_PDR_VAL 0xFFFF0000
  87. #define CONFIG_SYS_EBI_CSA_VAL 0x00000002 /* CS1=SDRAM */
  88. #define CONFIG_SYS_SDRC_CR_VAL 0x2188c159 /* set up the SDRAM */
  89. #define CONFIG_SYS_SDRAM 0x20000000 /* address of the SDRAM */
  90. #define CONFIG_SYS_SDRAM1 0x20000080 /* address of the SDRAM */
  91. #define CONFIG_SYS_SDRAM_VAL 0x00000000 /* value written to SDRAM */
  92. #define CONFIG_SYS_SDRC_MR_VAL 0x00000002 /* Precharge All */
  93. #define CONFIG_SYS_SDRC_MR_VAL1 0x00000004 /* refresh */
  94. #define CONFIG_SYS_SDRC_MR_VAL2 0x00000003 /* Load Mode Register */
  95. #define CONFIG_SYS_SDRC_MR_VAL3 0x00000000 /* Normal Mode */
  96. #define CONFIG_SYS_SDRC_TR_VAL 0x000002E0 /* Write refresh rate */
  97. /*
  98. * Command line configuration
  99. */
  100. #include <config_cmd_default.h>
  101. #define CONFIG_CMD_BMP
  102. #define CONFIG_CMD_DATE
  103. #define CONFIG_CMD_DHCP
  104. #define CONFIG_CMD_I2C
  105. #define CONFIG_CMD_JFFS2
  106. #define CONFIG_CMD_MII
  107. #define CONFIG_CMD_NAND
  108. #define CONFIG_CMD_PING
  109. #define CONFIG_I2C_CMD_NO_FLAT
  110. #define CONFIG_I2C_CMD_TREE
  111. #define CONFIG_SYS_LONGHELP
  112. /*
  113. * Filesystems
  114. */
  115. #define CONFIG_JFFS2_NAND 1
  116. #ifndef CONFIG_JFFS2_CMDLINE
  117. #define CONFIG_JFFS2_DEV "nand0"
  118. #define CONFIG_JFFS2_PART_OFFSET 0
  119. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  120. #else
  121. #define MTDIDS_DEFAULT "nor0=0,nand0=1"
  122. #define MTDPARTS_DEFAULT "mtdparts=" \
  123. "0:" \
  124. "384k(U-Boot)," \
  125. "128k(Env)," \
  126. "128k(Splash)," \
  127. "4M(Kernel)," \
  128. "-(FS)" \
  129. ";" \
  130. "1:" \
  131. "-(jffs2)"
  132. #endif /* CONFIG_JFFS2_CMDLINE */
  133. /*
  134. * Hardware drivers
  135. */
  136. /*
  137. * UART/CONSOLE
  138. */
  139. #define CONFIG_SYS_BAUDRATE_TABLE { 115200, 19200, 38400, 57600, 9600 }
  140. #define CONFIG_BAUDRATE 115200
  141. #define CONFIG_AT91RM9200_USART
  142. #define CONFIG_DBGU /* define DBGU as console */
  143. /*
  144. * network
  145. */
  146. #define CONFIG_NET_MULTI 1
  147. #define CONFIG_NET_RETRY_COUNT 10
  148. #define CONFIG_RESET_PHY_R 1
  149. #define CONFIG_DRIVER_AT91EMAC 1
  150. #define CONFIG_DRIVER_AT91EMAC_QUIET 1
  151. #define CONFIG_SYS_RX_ETH_BUFFER 8
  152. #define CONFIG_MII 1
  153. /*
  154. * BOOTP options
  155. */
  156. #define CONFIG_BOOTP_BOOTFILESIZE
  157. #define CONFIG_BOOTP_BOOTPATH
  158. #define CONFIG_BOOTP_GATEWAY
  159. #define CONFIG_BOOTP_HOSTNAME
  160. /*
  161. * I2C-Bus
  162. */
  163. #define CONFIG_SYS_I2C_SPEED 50000
  164. #define CONFIG_SYS_I2C_SLAVE 0 /* not used */
  165. #ifndef CONFIG_HARD_I2C
  166. #define CONFIG_SOFT_I2C
  167. /* Software I2C driver configuration */
  168. #define AT91_PIN_SDA (1<<25) /* AT91C_PIO_PA25 */
  169. #define AT91_PIN_SCL (1<<26) /* AT91C_PIO_PA26 */
  170. #define CONFIG_SYS_I2C_INIT_BOARD
  171. #define I2C_INIT i2c_init_board();
  172. #define I2C_ACTIVE writel(AT91_PMX_AA_TWD, &pio->pioa.mddr);
  173. #define I2C_TRISTATE writel(AT91_PMX_AA_TWD, &pio->pioa.mder);
  174. #define I2C_READ ((readl(&pio->pioa.pdsr) & AT91_PMX_AA_TWD) != 0)
  175. #define I2C_SDA(bit) \
  176. if (bit) \
  177. writel(AT91_PMX_AA_TWD, &pio->pioa.sodr); \
  178. else \
  179. writel(AT91_PMX_AA_TWD, &pio->pioa.codr);
  180. #define I2C_SCL(bit) \
  181. if (bit) \
  182. writel(AT91_PMX_AA_TWCK, &pio->pioa.sodr); \
  183. else \
  184. writel(AT91_PMX_AA_TWCK, &pio->pioa.codr);
  185. #define I2C_DELAY udelay(2500000/CONFIG_SYS_I2C_SPEED)
  186. #endif /* CONFIG_HARD_I2C */
  187. /* I2C-RTC */
  188. #ifdef CONFIG_CMD_DATE
  189. #define CONFIG_RTC_DS1338
  190. #define CONFIG_SYS_I2C_RTC_ADDR 0x68
  191. #endif
  192. /* EEPROM */
  193. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  194. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
  195. /* FLASH organization */
  196. /* NOR-FLASH */
  197. #define CONFIG_FLASH_CFI_DRIVER 1
  198. #define PHYS_FLASH_1 0x10000000
  199. #define PHYS_FLASH_SIZE 0x01000000 /* 16 megs main flash */
  200. #define CONFIG_SYS_FLASH_CFI 1
  201. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
  202. #define CONFIG_SYS_FLASH_PROTECTION 1
  203. #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
  204. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  205. #define CONFIG_SYS_MAX_FLASH_SECT 512
  206. #define CONFIG_SYS_FLASH_ERASE_TOUT 6000
  207. #define CONFIG_SYS_FLASH_WRITE_TOUT 2000
  208. /* NAND */
  209. #define CONFIG_SYS_NAND_MAX_CHIPS 1
  210. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  211. #define CONFIG_SYS_NAND_BASE 0x40000000
  212. #define CONFIG_SYS_NAND_DBW_8 1
  213. #define CONFIG_SYS_64BIT_VSPRINTF 1
  214. /* Status LED's */
  215. #define CONFIG_STATUS_LED 1
  216. #define CONFIG_BOARD_SPECIFIC_LED 1
  217. #define STATUS_LED_BOOT 1
  218. #define STATUS_LED_ACTIVE 0
  219. #define STATUS_LED_BIT 1 /* AT91C_PIO_PD0 green LED */
  220. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  221. #define STATUS_LED_STATE STATUS_LED_OFF /* BLINKING */
  222. #define STATUS_LED_BIT1 2 /* AT91C_PIO_PD1 red LED */
  223. #define STATUS_LED_STATE1 STATUS_LED_ON /* BLINKING */
  224. #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 4)
  225. #define CONFIG_VIDEO 1
  226. /* Options */
  227. #ifdef CONFIG_VIDEO
  228. #define CONFIG_VIDEO_VCXK 1
  229. #define CONFIG_SPLASH_SCREEN 1
  230. #define CONFIG_SYS_VCXK_DEFAULT_LINEALIGN 4
  231. #define CONFIG_SYS_VCXK_BASE 0x30000000
  232. #define CONFIG_SYS_VCXK_ACKNOWLEDGE_PIN (1<<3)
  233. #define CONFIG_SYS_VCXK_ACKNOWLEDGE_PORT piob
  234. #define CONFIG_SYS_VCXK_ACKNOWLEDGE_DDR odr
  235. #define CONFIG_SYS_VCXK_ENABLE_PIN (1<<5)
  236. #define CONFIG_SYS_VCXK_ENABLE_PORT piob
  237. #define CONFIG_SYS_VCXK_ENABLE_DDR oer
  238. #define CONFIG_SYS_VCXK_REQUEST_PIN (1<<2)
  239. #define CONFIG_SYS_VCXK_REQUEST_PORT piob
  240. #define CONFIG_SYS_VCXK_REQUEST_DDR oer
  241. #define CONFIG_SYS_VCXK_INVERT_PIN (1<<4)
  242. #define CONFIG_SYS_VCXK_INVERT_PORT piob
  243. #define CONFIG_SYS_VCXK_INVERT_DDR oer
  244. #define CONFIG_SYS_VCXK_RESET_PIN (1<<6)
  245. #define CONFIG_SYS_VCXK_RESET_PORT piob
  246. #define CONFIG_SYS_VCXK_RESET_DDR oer
  247. #endif /* CONFIG_VIDEO */
  248. /* Environment */
  249. #define CONFIG_BOOTDELAY 5
  250. #define CONFIG_ENV_IS_IN_FLASH 1
  251. #define CONFIG_ENV_ADDR (PHYS_FLASH_1 + 0x60000)
  252. #define CONFIG_ENV_SIZE 0x20000 /* sectors are 128K here */
  253. #define CONFIG_BAUDRATE 115200
  254. #define CONFIG_BOOTCOMMAND "run nfsboot"
  255. #define CONFIG_NFSBOOTCOMMAND \
  256. "dhcp $(copy_addr) uImage_cpux9k2;" \
  257. "run bootargsdefaults;" \
  258. "set bootargs $(bootargs) boot=nfs " \
  259. ";echo $(bootargs)" \
  260. ";bootm"
  261. #define CONFIG_EXTRA_ENV_SETTINGS \
  262. "displaywidth=256\0" \
  263. "displayheight=512\0" \
  264. "displaybsteps=1023\0" \
  265. "ubootaddr=10000000\0" \
  266. "splashimage=10080000\0" \
  267. "kerneladdr=100A0000\0" \
  268. "kernelsize=00400000\0" \
  269. "rootfsaddr=104A0000\0" \
  270. "copy_addr=21200000\0" \
  271. "rootfssize=00B60000\0" \
  272. "bootargsdefaults=set bootargs " \
  273. "console=ttyS0,115200 " \
  274. "video=vcxk_fb:xres:${displaywidth}," \
  275. "yres:${displayheight}," \
  276. "bres:${displaybsteps} " \
  277. "mem=62M " \
  278. "panic=10 " \
  279. "uboot=\\\"${ver}\\\" " \
  280. "\0" \
  281. "update_kernel=protect off $(kerneladdr) +$(kernelsize);" \
  282. "dhcp $(copy_addr) uImage_cpux9k2;" \
  283. "erase $(kerneladdr) +$(kernelsize);" \
  284. "cp.b $(fileaddr) $(kerneladdr) $(filesize);" \
  285. "protect on $(kerneladdr) +$(kernelsize)" \
  286. "\0" \
  287. "update_root=protect off $(rootfsaddr) +$(rootfssize);" \
  288. "dhcp $(copy_addr) rfs;" \
  289. "erase $(rootfsaddr) +$(rootfssize);" \
  290. "cp.b $(fileaddr) $(rootfsaddr) $(filesize);" \
  291. "\0" \
  292. "update_uboot=protect off 10000000 1005FFFF;" \
  293. "dhcp $(copy_addr) u-boot_eb_cpux9k2;" \
  294. "erase 10000000 1005FFFF;" \
  295. "cp.b $(fileaddr) $(ubootaddr) $(filesize);" \
  296. "protect on 10000000 1005FFFF;reset\0" \
  297. "update_splash=protect off $(splashimage) +20000;" \
  298. "dhcp $(copy_addr) splash_eb_cpux9k2.bmp;" \
  299. "erase $(splashimage) +20000;" \
  300. "cp.b $(fileaddr) 10080000 $(filesize);" \
  301. "protect on $(splashimage) +20000;reset\0" \
  302. "emergency=run bootargsdefaults;" \
  303. "set bootargs $(bootargs) root=initramfs boot=emergency " \
  304. ";bootm $(kerneladdr)\0" \
  305. "netemergency=run bootargsdefaults;" \
  306. "dhcp $(copy_addr) uImage_cpux9k2;" \
  307. "set bootargs $(bootargs) root=initramfs boot=emergency " \
  308. ";bootm $(copy_addr)\0" \
  309. "norboot=run bootargsdefaults;" \
  310. "set bootargs $(bootargs) root=initramfs boot=local " \
  311. ";bootm $(kerneladdr)\0" \
  312. "nandboot=run bootargsdefaults;" \
  313. "set bootargs $(bootargs) root=initramfs boot=nand " \
  314. ";bootm $(kerneladdr)\0" \
  315. "uu=run update_uboot\0" \
  316. "ur=run update_root;run nk\0" \
  317. "nk=run bootargsdefaults;set bootargs $(bootargs) root=initramfs " \
  318. "boot=local " \
  319. ";echo $(bootargs)" \
  320. ";dhcp uImage_cpux9k2;bootm\0" \
  321. "nn=run bootargsdefaults;set bootargs $(bootargs) root=initramfs " \
  322. "boot=nand " \
  323. ";echo $(bootargs)" \
  324. ";dhcp uImage_cpux9k2;bootm\0" \
  325. " "
  326. /*--------------------------------------------------------------------------*/
  327. #endif
  328. /* EOF */