cpu9260.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. /*
  2. * (C) Copyright 2007-2008
  3. * Stelian Pop <stelian@popies.net>
  4. * Lead Tech Design <www.leadtechdesign.com>
  5. * Ilko Iliev <www.ronetix.at>
  6. *
  7. * (C) Copyright 2009
  8. * Eric Benard <eric@eukrea.com>
  9. *
  10. * Configuration settings for the Eukrea CPU9260 board.
  11. *
  12. * See file CREDITS for list of people who contributed to this
  13. * project.
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License as
  17. * published by the Free Software Foundation; either version 2 of
  18. * the License, or (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, write to the Free Software
  27. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  28. * MA 02111-1307 USA
  29. */
  30. #ifndef __CONFIG_H
  31. #define __CONFIG_H
  32. /* to be removed once maemory-map.h is fixed */
  33. #define AT91_BASE_SYS 0xffffe800
  34. #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS)
  35. #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000
  36. #define CONFIG_SYS_HZ 1000
  37. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  38. #if defined(CONFIG_CPU9G20)
  39. #define CONFIG_AT91SAM9G20
  40. #elif defined(CONFIG_CPU9260)
  41. #define CONFIG_AT91SAM9260
  42. #else
  43. #error "Unknown board"
  44. #endif
  45. #include <asm/arch/hardware.h>
  46. #define CONFIG_AT91FAMILY
  47. #define CONFIG_ARCH_CPU_INIT
  48. #undef CONFIG_USE_IRQ
  49. #define CONFIG_DISPLAY_CPUINFO
  50. #define CONFIG_BOARD_EARLY_INIT_F
  51. #define CONFIG_CMDLINE_TAG
  52. #define CONFIG_SETUP_MEMORY_TAGS
  53. #define CONFIG_INITRD_TAG
  54. #if defined(CONFIG_NANDBOOT)
  55. #define CONFIG_SKIP_LOWLEVEL_INIT
  56. #define CONFIG_SYS_TEXT_BASE 0x23f00000
  57. #else
  58. #define CONFIG_SYS_TEXT_BASE 0x00000000
  59. #endif
  60. /* clocks */
  61. #if defined(CONFIG_CPU9G20)
  62. #define MASTER_PLL_DIV 0x01
  63. #define MASTER_PLL_MUL 0x2B
  64. #elif defined(CONFIG_CPU9260)
  65. #define MASTER_PLL_DIV 0x09
  66. #define MASTER_PLL_MUL 0x61
  67. #endif
  68. /* CKGR_MOR - enable main osc. */
  69. #define CONFIG_SYS_MOR_VAL \
  70. (AT91_PMC_MOSCEN | \
  71. (255 << 8)) /* Main Oscillator Start-up Time */
  72. #if defined(CONFIG_CPU9G20)
  73. #define CONFIG_SYS_PLLAR_VAL \
  74. (AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */ \
  75. ((MASTER_PLL_MUL - 1) << 16) | (MASTER_PLL_DIV))
  76. #elif defined(CONFIG_CPU9260)
  77. #define CONFIG_SYS_PLLAR_VAL \
  78. (AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */ \
  79. AT91_PMC_OUT | \
  80. ((MASTER_PLL_MUL - 1) << 16) | (MASTER_PLL_DIV))
  81. #endif
  82. #if defined(CONFIG_CPU9G20)
  83. #define CONFIG_SYS_MCKR1_VAL \
  84. (AT91_PMC_CSS_PLLA | \
  85. AT91_PMC_PRES_1 | \
  86. AT91SAM9_PMC_MDIV_6 | \
  87. AT91_PMC_PDIV_2)
  88. #define CONFIG_SYS_MCKR2_VAL \
  89. CONFIG_SYS_MCKR1_VAL
  90. #elif defined(CONFIG_CPU9260)
  91. #define CONFIG_SYS_MCKR1_VAL \
  92. (AT91_PMC_CSS_SLOW | \
  93. AT91_PMC_PRES_1 | \
  94. AT91SAM9_PMC_MDIV_2 | \
  95. AT91_PMC_PDIV_1)
  96. #define CONFIG_SYS_MCKR2_VAL \
  97. (AT91_PMC_CSS_PLLA | \
  98. AT91_PMC_PRES_1 | \
  99. AT91SAM9_PMC_MDIV_2 | \
  100. AT91_PMC_PDIV_1)
  101. #endif
  102. /* define PDC[31:16] as DATA[31:16] */
  103. #define CONFIG_SYS_PIOC_PDR_VAL1 0xFFFF0000
  104. /* no pull-up for D[31:16] */
  105. #define CONFIG_SYS_PIOC_PPUDR_VAL 0xFFFF0000
  106. /* EBI_CSA, 3.3V, no pull-ups for D[15:0], CS1 SDRAM, CS3 NAND Flash */
  107. #define CONFIG_SYS_MATRIX_EBICSA_VAL \
  108. (AT91_MATRIX_CSA_DBPUC | AT91_MATRIX_CSA_EBI_CS1A | \
  109. AT91_MATRIX_CSA_EBI_CS3A | AT91_MATRIX_CSA_VDDIOMSEL_3_3V)
  110. /* SDRAM */
  111. /* SDRAMC_MR Mode register */
  112. #define CONFIG_SYS_SDRC_MR_VAL1 AT91_SDRAMC_MODE_NORMAL
  113. /* SDRAMC_TR - Refresh Timer register */
  114. #define CONFIG_SYS_SDRC_TR_VAL1 0x287
  115. /* SDRAMC_CR - Configuration register*/
  116. #if defined(CONFIG_CPU9G20)
  117. #define CONFIG_SYS_SDRC_CR_VAL_64MB \
  118. (AT91_SDRAMC_NC_9 | \
  119. AT91_SDRAMC_NR_13 | \
  120. AT91_SDRAMC_NB_4 | \
  121. AT91_SDRAMC_CAS_2 | \
  122. AT91_SDRAMC_DBW_32 | \
  123. (2 << 8) | /* Write Recovery Delay */ \
  124. (9 << 12) | /* Row Cycle Delay */ \
  125. (3 << 16) | /* Row Precharge Delay */ \
  126. (3 << 20) | /* Row to Column Delay */ \
  127. (6 << 24) | /* Active to Precharge Delay */ \
  128. (10 << 28)) /* Exit Self Refresh to Active Delay */
  129. #define CONFIG_SYS_SDRC_CR_VAL_128MB \
  130. (AT91_SDRAMC_NC_10 | \
  131. AT91_SDRAMC_NR_13 | \
  132. AT91_SDRAMC_NB_4 | \
  133. AT91_SDRAMC_CAS_2 | \
  134. AT91_SDRAMC_DBW_32 | \
  135. (2 << 8) | /* Write Recovery Delay */ \
  136. (9 << 12) | /* Row Cycle Delay */ \
  137. (3 << 16) | /* Row Precharge Delay */ \
  138. (3 << 20) | /* Row to Column Delay */ \
  139. (6 << 24) | /* Active to Precharge Delay */ \
  140. (10 << 28)) /* Exit Self Refresh to Active Delay */
  141. #elif defined(CONFIG_CPU9260)
  142. #define CONFIG_SYS_SDRC_CR_VAL_64MB \
  143. (AT91_SDRAMC_NC_9 | \
  144. AT91_SDRAMC_NR_13 | \
  145. AT91_SDRAMC_NB_4 | \
  146. AT91_SDRAMC_CAS_2 | \
  147. AT91_SDRAMC_DBW_32 | \
  148. (2 << 8) | /* Write Recovery Delay */ \
  149. (7 << 12) | /* Row Cycle Delay */ \
  150. (2 << 16) | /* Row Precharge Delay */ \
  151. (2 << 20) | /* Row to Column Delay */ \
  152. (5 << 24) | /* Active to Precharge Delay */ \
  153. (8 << 28)) /* Exit Self Refresh to Active Delay */
  154. #define CONFIG_SYS_SDRC_CR_VAL_128MB \
  155. (AT91_SDRAMC_NC_10 | \
  156. AT91_SDRAMC_NR_13 | \
  157. AT91_SDRAMC_NB_4 | \
  158. AT91_SDRAMC_CAS_2 | \
  159. AT91_SDRAMC_DBW_32 | \
  160. (2 << 8) | /* Write Recovery Delay */ \
  161. (7 << 12) | /* Row Cycle Delay */ \
  162. (2 << 16) | /* Row Precharge Delay */ \
  163. (2 << 20) | /* Row to Column Delay */ \
  164. (5 << 24) | /* Active to Precharge Delay */ \
  165. (8 << 28)) /* Exit Self Refresh to Active Delay */
  166. #endif
  167. /* Memory Device Register -> SDRAM */
  168. #define CONFIG_SYS_SDRC_MDR_VAL AT91_SDRAMC_MD_SDRAM
  169. #define CONFIG_SYS_SDRC_MR_VAL2 AT91_SDRAMC_MODE_PRECHARGE
  170. #define CONFIG_SYS_SDRAM_VAL1 0 /* SDRAM_BASE */
  171. #define CONFIG_SYS_SDRC_MR_VAL3 AT91_SDRAMC_MODE_REFRESH
  172. #define CONFIG_SYS_SDRAM_VAL2 0 /* SDRAM_BASE */
  173. #define CONFIG_SYS_SDRAM_VAL3 0 /* SDRAM_BASE */
  174. #define CONFIG_SYS_SDRAM_VAL4 0 /* SDRAM_BASE */
  175. #define CONFIG_SYS_SDRAM_VAL5 0 /* SDRAM_BASE */
  176. #define CONFIG_SYS_SDRAM_VAL6 0 /* SDRAM_BASE */
  177. #define CONFIG_SYS_SDRAM_VAL7 0 /* SDRAM_BASE */
  178. #define CONFIG_SYS_SDRAM_VAL8 0 /* SDRAM_BASE */
  179. #define CONFIG_SYS_SDRAM_VAL9 0 /* SDRAM_BASE */
  180. #define CONFIG_SYS_SDRC_MR_VAL4 AT91_SDRAMC_MODE_LMR
  181. #define CONFIG_SYS_SDRAM_VAL10 0 /* SDRAM_BASE */
  182. #define CONFIG_SYS_SDRC_MR_VAL5 AT91_SDRAMC_MODE_NORMAL
  183. #define CONFIG_SYS_SDRAM_VAL11 0 /* SDRAM_BASE */
  184. #define CONFIG_SYS_SDRC_TR_VAL2 1200 /* SDRAM_TR */
  185. #define CONFIG_SYS_SDRAM_VAL12 0 /* SDRAM_BASE */
  186. /* setup SMC0, CS0 (NOR Flash) - 16-bit */
  187. #if defined(CONFIG_CPU9G20)
  188. #define CONFIG_SYS_SMC0_SETUP0_VAL \
  189. (AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) | \
  190. AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0))
  191. #define CONFIG_SYS_SMC0_PULSE0_VAL \
  192. (AT91_SMC_PULSE_NWE(8) | AT91_SMC_PULSE_NCS_WR(8) | \
  193. AT91_SMC_PULSE_NRD(14) | AT91_SMC_PULSE_NCS_RD(14))
  194. #define CONFIG_SYS_SMC0_CYCLE0_VAL \
  195. (AT91_SMC_CYCLE_NWE(8) | AT91_SMC_CYCLE_NRD(14))
  196. #define CONFIG_SYS_SMC0_MODE0_VAL \
  197. (AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | \
  198. AT91_SMC_MODE_DBW_16 | \
  199. AT91_SMC_MODE_TDF | \
  200. AT91_SMC_MODE_TDF_CYCLE(3))
  201. #elif defined(CONFIG_CPU9260)
  202. #define CONFIG_SYS_SMC0_SETUP0_VAL \
  203. (AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) | \
  204. AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0))
  205. #define CONFIG_SYS_SMC0_PULSE0_VAL \
  206. (AT91_SMC_PULSE_NWE(6) | AT91_SMC_PULSE_NCS_WR(6) | \
  207. AT91_SMC_PULSE_NRD(10) | AT91_SMC_PULSE_NCS_RD(10))
  208. #define CONFIG_SYS_SMC0_CYCLE0_VAL \
  209. (AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(10))
  210. #define CONFIG_SYS_SMC0_MODE0_VAL \
  211. (AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | \
  212. AT91_SMC_MODE_DBW_16 | \
  213. AT91_SMC_MODE_TDF | \
  214. AT91_SMC_MODE_TDF_CYCLE(2))
  215. #endif
  216. /* user reset enable */
  217. #define CONFIG_SYS_RSTC_RMR_VAL \
  218. (AT91_RSTC_KEY | \
  219. AT91_RSTC_CR_PROCRST | \
  220. AT91_RSTC_MR_ERSTL(1) | \
  221. AT91_RSTC_MR_ERSTL(2))
  222. /* Disable Watchdog */
  223. #define CONFIG_SYS_WDTC_WDMR_VAL \
  224. (AT91_WDT_MR_WDIDLEHLT | AT91_WDT_MR_WDDBGHLT | \
  225. AT91_WDT_MR_WDV(0xfff) | \
  226. AT91_WDT_MR_WDDIS | \
  227. AT91_WDT_MR_WDD(0xfff))
  228. /*
  229. * Hardware drivers
  230. */
  231. #define CONFIG_AT91SAM9_WATCHDOG
  232. #define CONFIG_AT91_GPIO
  233. #define CONFIG_ATMEL_USART
  234. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  235. #define CONFIG_USART_ID ATMEL_ID_SYS
  236. #define CONFIG_BOOTDELAY 3
  237. /*
  238. * BOOTP options
  239. */
  240. #define CONFIG_BOOTP_BOOTFILESIZE
  241. #define CONFIG_BOOTP_BOOTPATH
  242. #define CONFIG_BOOTP_GATEWAY
  243. #define CONFIG_BOOTP_HOSTNAME
  244. /*
  245. * Command line configuration.
  246. */
  247. #include <config_cmd_default.h>
  248. #undef CONFIG_CMD_BDI
  249. #undef CONFIG_CMD_IMI
  250. #undef CONFIG_CMD_FPGA
  251. #undef CONFIG_CMD_LOADS
  252. #undef CONFIG_CMD_IMLS
  253. #define CONFIG_CMD_PING
  254. #define CONFIG_CMD_DHCP
  255. #define CONFIG_CMD_NAND
  256. #define CONFIG_CMD_USB
  257. #define CONFIG_CMD_FAT
  258. #define CONFIG_CMD_MII
  259. /* SDRAM */
  260. #define CONFIG_NR_DRAM_BANKS 1
  261. #define CONFIG_SYS_SDRAM_BASE 0x20000000
  262. #if defined(CONFIG_CPU9260_128M) || defined(CONFIG_CPU9G20_128M)
  263. #define CONFIG_SYS_SDRAM_SIZE (128 * 1024 * 1024)
  264. #define CONFIG_SYS_SDRC_CR_VAL CONFIG_SYS_SDRC_CR_VAL_128MB
  265. #else
  266. #define CONFIG_SYS_SDRAM_SIZE (64 * 1024 * 1024)
  267. #define CONFIG_SYS_SDRC_CR_VAL CONFIG_SYS_SDRC_CR_VAL_64MB
  268. #endif
  269. /* NAND flash */
  270. #define CONFIG_NAND_ATMEL
  271. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  272. #define CONFIG_SYS_NAND_BASE 0x40000000
  273. #define CONFIG_SYS_NAND_DBW_8 1
  274. #define CONFIG_SYS_NAND_READY_PIN AT91_PIO_PORTC, 13
  275. #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIO_PORTC, 14
  276. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  277. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  278. /* NOR flash */
  279. #if defined(CONFIG_NANDBOOT)
  280. #define CONFIG_SYS_NO_FLASH
  281. #else
  282. #define CONFIG_SYS_FLASH_CFI
  283. #define CONFIG_FLASH_CFI_DRIVER
  284. #define PHYS_FLASH_1 0x10000000
  285. #define PHYS_FLASH_2 0x12000000
  286. #define CONFIG_SYS_FLASH_BANKS_LIST \
  287. { PHYS_FLASH_1, PHYS_FLASH_2 }
  288. #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
  289. #define CONFIG_SYS_MAX_FLASH_SECT (255+4)
  290. #define CONFIG_SYS_MAX_FLASH_BANKS 2
  291. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
  292. #define CONFIG_SYS_FLASH_EMPTY_INFO
  293. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  294. #define CONFIG_SYS_FLASH_PROTECTION
  295. #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
  296. #endif
  297. /* Ethernet */
  298. #define CONFIG_MACB
  299. #define CONFIG_RMII
  300. #define CONFIG_NET_RETRY_COUNT 20
  301. #define CONFIG_MACB_SEARCH_PHY
  302. /* LEDS */
  303. /* Status LED */
  304. #define CONFIG_STATUS_LED
  305. #define CONFIG_BOARD_SPECIFIC_LED
  306. #define STATUS_LED_RED 0
  307. #define STATUS_LED_GREEN 1
  308. #define STATUS_LED_YELLOW 2
  309. #define STATUS_LED_BLUE 3
  310. /* Red */
  311. #define STATUS_LED_BIT STATUS_LED_RED
  312. #define STATUS_LED_STATE STATUS_LED_OFF
  313. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  314. /* Green */
  315. #define STATUS_LED_BIT1 STATUS_LED_GREEN
  316. #define STATUS_LED_STATE1 STATUS_LED_OFF
  317. #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2)
  318. /* Yellow */
  319. #define STATUS_LED_BIT2 STATUS_LED_YELLOW
  320. #define STATUS_LED_STATE2 STATUS_LED_OFF
  321. #define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 2)
  322. /* Blue */
  323. #define STATUS_LED_BIT3 STATUS_LED_BLUE
  324. #define STATUS_LED_STATE3 STATUS_LED_ON
  325. #define STATUS_LED_PERIOD3 (CONFIG_SYS_HZ / 2)
  326. /* Optional value */
  327. #define STATUS_LED_BOOT STATUS_LED_BIT
  328. #define CONFIG_RED_LED AT91_PIO_PORTC, 11
  329. #define CONFIG_GREEN_LED AT91_PIO_PORTC, 12
  330. #define CONFIG_YELLOW_LED AT91_PIO_PORTC, 7
  331. #define CONFIG_BLUE_LED AT91_PIO_PORTC, 9
  332. /* USB */
  333. #define CONFIG_USB_ATMEL
  334. #define CONFIG_USB_OHCI_NEW
  335. #define CONFIG_DOS_PARTITION
  336. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  337. #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000
  338. #if defined(CONFIG_CPU9G20)
  339. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9g20"
  340. #elif defined(CONFIG_CPU9260)
  341. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
  342. #endif
  343. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
  344. #define CONFIG_USB_STORAGE
  345. #define CONFIG_SYS_LOAD_ADDR 0x21000000
  346. #define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
  347. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  348. #define CONFIG_SYS_MEMTEST_END \
  349. (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - 512 * 1024)
  350. #if defined(CONFIG_NANDBOOT)
  351. #define CONFIG_SYS_USE_NANDFLASH
  352. #undef CONFIG_SYS_USE_FLASH
  353. #else
  354. #define CONFIG_SYS_USE_FLASH
  355. #undef CONFIG_SYS_USE_NANDFLASH
  356. #endif
  357. #if defined(CONFIG_CPU9G20)
  358. #define CONFIG_SYS_BASEDIR "cpu9G20"
  359. #elif defined(CONFIG_CPU9260)
  360. #define CONFIG_SYS_BASEDIR "cpu9260"
  361. #endif
  362. #if defined(CONFIG_SYS_USE_FLASH)
  363. #define CONFIG_ENV_IS_IN_FLASH
  364. #define CONFIG_ENV_OFFSET 0x40000
  365. #define CONFIG_ENV_SECT_SIZE 0x20000
  366. #define CONFIG_ENV_SIZE 0x20000
  367. #define CONFIG_ENV_OVERWRITE
  368. #define CONFIG_BOOTCOMMAND "run flashboot"
  369. #define MTDIDS_DEFAULT "nor0=physmap-flash.0,nand0=atmel_nand"
  370. #define MTDPARTS_DEFAULT \
  371. "mtdparts=physmap-flash.0:" \
  372. "256k(u-boot)ro," \
  373. "128k(u-boot-env)ro," \
  374. "1792k(kernel)," \
  375. "-(rootfs);" \
  376. "atmel_nand:-(nand)"
  377. #define CONFIG_BOOTARGS "root=/dev/mtdblock3 rootfstype=jffs2 "
  378. #define CONFIG_EXTRA_ENV_SETTINGS \
  379. "mtdids=" MTDIDS_DEFAULT "\0" \
  380. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  381. "partition=nand0,0\0" \
  382. "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0" \
  383. "ramboot=tftpboot 0x22000000 $(basedir)/uImage;" \
  384. "run ramargs;bootm 22000000\0" \
  385. "flashboot=run ramargs;bootm 0x10060000\0" \
  386. "basedir=" CONFIG_SYS_BASEDIR "\0" \
  387. "updtub=tftp 0x24000000 $(basedir)/u-boot.bin;protect " \
  388. "off 0x10000000 0x1003ffff;erase 0x10000000 " \
  389. "0x1003ffff;cp.b 0x24000000 0x10000000 " \
  390. "$(filesize)\0" \
  391. "updtui=tftp 0x24000000 $(basedir)/uImage;protect off" \
  392. " 0x10060000 0x1021ffff;erase 0x10060000 " \
  393. "0x1021ffff;cp.b 0x24000000 0x10060000 " \
  394. "$(filesize)\0" \
  395. "updtrfs=tftp 0x24000000 $(basedir)/rootfs.jffs2; " \
  396. "protect off 0x10220000 0x13ffffff;erase " \
  397. "0x10220000 0x13ffffff;cp.b 0x24000000 " \
  398. "0x10220000 $(filesize)\0" \
  399. ""
  400. #elif defined(CONFIG_NANDBOOT)
  401. #define CONFIG_ENV_IS_IN_NAND
  402. #define CONFIG_ENV_OFFSET 0x60000
  403. #define CONFIG_ENV_OFFSET_REDUND 0x80000
  404. #define CONFIG_ENV_SECT_SIZE 0x20000
  405. #define CONFIG_ENV_SIZE 0x20000
  406. #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
  407. #define CONFIG_ENV_OVERWRITE
  408. #define CONFIG_BOOTCOMMAND "run flashboot"
  409. #define MTDIDS_DEFAULT "nand0=atmel_nand"
  410. #define MTDPARTS_DEFAULT \
  411. "mtdparts=atmel_nand:" \
  412. "128k(bootstrap)ro," \
  413. "256k(u-boot)ro," \
  414. "128k(u-boot-env)ro," \
  415. "128k(u-boot-env2)ro," \
  416. "2M(kernel)," \
  417. "-(rootfs)"
  418. #define CONFIG_BOOTARGS "root=ubi0:eukrea-cpu9260-rootfs " \
  419. "ubi.mtd=5 rootfstype=ubifs at91sam9_wdt.heartbeat=60"
  420. #define CONFIG_EXTRA_ENV_SETTINGS \
  421. "mtdids=" MTDIDS_DEFAULT "\0" \
  422. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  423. "partition=nand0,5\0" \
  424. "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0" \
  425. "ramboot=tftpboot 0x22000000 $(basedir)/uImage;" \
  426. "run ramargs;bootm 22000000\0" \
  427. "flashboot=run ramargs; nand read 0x22000000 0xA0000 " \
  428. "0x200000; bootm 0x22000000\0" \
  429. "basedir=" CONFIG_SYS_BASEDIR "\0" \
  430. "u-boot=u-boot-eukrea-cpu9260.bin\0" \
  431. "kernel=uImage-eukrea-cpu9260.bin\0" \
  432. "rootfs=image-eukrea-cpu9260.ubi\0" \
  433. "updtub=tftp ${loadaddr} $(basedir)/${u-boot}; " \
  434. "nand erase 20000 40000; " \
  435. "nand write ${loadaddr} 20000 40000\0" \
  436. "updtui=tftp ${loadaddr} $(basedir)/${kernel}; " \
  437. "nand erase a0000 200000; " \
  438. "nand write ${loadaddr} a0000 200000\0" \
  439. "updtrfs=tftp ${loadaddr} $(basedir)/${rootfs}; " \
  440. "nand erase 2a0000 fd60000; " \
  441. "nand write ${loadaddr} 2a0000 ${filesize}\0"
  442. #endif
  443. #define CONFIG_BAUDRATE 115200
  444. #define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 }
  445. #if defined(CONFIG_CPU9G20)
  446. #define CONFIG_SYS_PROMPT "CPU9G20=> "
  447. #elif defined(CONFIG_CPU9260)
  448. #define CONFIG_SYS_PROMPT "CPU9260=> "
  449. #endif
  450. #define CONFIG_SYS_CBSIZE 256
  451. #define CONFIG_SYS_MAXARGS 16
  452. #define CONFIG_SYS_PBSIZE \
  453. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  454. #define CONFIG_SYS_LONGHELP
  455. #define CONFIG_CMDLINE_EDITING
  456. #define CONFIG_SILENT_CONSOLE
  457. #define CONFIG_NETCONSOLE
  458. /*
  459. * Size of malloc() pool
  460. */
  461. #define CONFIG_SYS_MALLOC_LEN \
  462. ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 0x1000)
  463. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - \
  464. GENERATED_GBL_DATA_SIZE)
  465. #define CONFIG_STACKSIZE (32 * 1024)
  466. #if defined(CONFIG_USE_IRQ)
  467. #error CONFIG_USE_IRQ not supported
  468. #endif
  469. #endif