stamp9g20.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /*
  2. * (C) Copyright 2007-2008
  3. * Stelian Pop <stelian@popies.net>
  4. * Lead Tech Design <www.leadtechdesign.com>
  5. *
  6. * (C) Copyright 2010
  7. * Achim Ehrlich <aehrlich@taskit.de>
  8. * taskit GmbH <www.taskit.de>
  9. *
  10. * (C) Copyright 2012
  11. * Markus Hubig <mhubig@imko.de>
  12. * IMKO GmbH <www.imko.de>
  13. *
  14. * Configuation settings for the stamp9g20 CPU module.
  15. *
  16. * See file CREDITS for list of people who contributed to this
  17. * project.
  18. *
  19. * This program is free software; you can redistribute it and/or
  20. * modify it under the terms of the GNU General Public License as
  21. * published by the Free Software Foundation; either version 2 of
  22. * the License, or (at your option) any later version.
  23. *
  24. * This program is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU General Public License for more details.
  28. *
  29. * You should have received a copy of the GNU General Public License
  30. * along with this program; if not, write to the Free Software
  31. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  32. * MA 02111-1307 USA
  33. */
  34. #ifndef __CONFIG_H
  35. #define __CONFIG_H
  36. /*
  37. * SoC must be defined first, before hardware.h is included.
  38. * In this case SoC is defined in boards.cfg.
  39. */
  40. #include <asm/hardware.h>
  41. /*
  42. * Warning: changing CONFIG_SYS_TEXT_BASE requires adapting the initial boot
  43. * program. Since the linker has to swallow that define, we must use a pure
  44. * hex number here!
  45. */
  46. #define CONFIG_SYS_TEXT_BASE 0x23f00000
  47. /* ARM asynchronous clock */
  48. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */
  49. #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 /* 18.432MHz crystal */
  50. #define CONFIG_SYS_HZ 1000 /* 1ms resolution */
  51. /* misc settings */
  52. #define CONFIG_CMDLINE_TAG /* pass commandline to Kernel */
  53. #define CONFIG_SETUP_MEMORY_TAGS /* pass memory defs to kernel */
  54. #define CONFIG_INITRD_TAG /* pass initrd param to kernel */
  55. #define CONFIG_SKIP_LOWLEVEL_INIT /* U-Boot is loaded by a bootloader */
  56. #define CONFIG_BOARD_EARLY_INIT_f /* call board_early_init_f() */
  57. #define CONFIG_BOARD_POSTCLK_INIT /* call board_postclk_init() */
  58. #define CONFIG_DISPLAY_CPUINFO /* display CPU Info at startup */
  59. /* setting board specific options */
  60. #ifdef CONFIG_PORTUXG20
  61. # define CONFIG_MACH_TYPE MACH_TYPE_PORTUXG20
  62. # define CONFIG_MACB
  63. #else
  64. # define CONFIG_MACH_TYPE MACH_TYPE_STAMP9G20
  65. #endif
  66. /*
  67. * SDRAM: 1 bank, 64 MB, base address 0x20000000
  68. * Already initialized before u-boot gets started.
  69. */
  70. #define CONFIG_NR_DRAM_BANKS 1
  71. #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1
  72. #define CONFIG_SYS_SDRAM_SIZE (64 << 20)
  73. /*
  74. * Perform a SDRAM Memtest from the start of SDRAM
  75. * till the beginning of the U-Boot position in RAM.
  76. */
  77. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  78. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_TEXT_BASE - 0x100000)
  79. /* Size of malloc() pool */
  80. #define CONFIG_SYS_MALLOC_LEN \
  81. ROUND(3 * CONFIG_ENV_SIZE + (128 << 10), 0x1000)
  82. /*
  83. * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
  84. * leaving the correct space for initial global data structure above that
  85. * address while providing maximum stack area below.
  86. */
  87. #define CONFIG_SYS_INIT_SP_ADDR \
  88. (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
  89. /* NAND flash settings */
  90. #define CONFIG_NAND_ATMEL
  91. #define CONFIG_SYS_NO_FLASH
  92. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  93. #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
  94. #define CONFIG_SYS_NAND_DBW_8
  95. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  96. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  97. #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14
  98. #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13
  99. /* general purpose I/O */
  100. #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */
  101. #define CONFIG_AT91_GPIO /* enable the GPIO features */
  102. #define CONFIG_AT91_GPIO_PULLUP 1 /* keep pullups on peripheral pins */
  103. /* serial console */
  104. #define CONFIG_ATMEL_USART
  105. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  106. #define CONFIG_USART_ID ATMEL_ID_SYS
  107. #define CONFIG_BAUDRATE 115200
  108. /* LED configuration */
  109. #define CONFIG_STATUS_LED
  110. #define CONFIG_BOARD_SPECIFIC_LED
  111. /* The LED PINs */
  112. #define CONFIG_RED_LED AT91_PIN_PC5
  113. #define CONFIG_GREEN_LED AT91_PIN_PC4
  114. #define CONFIG_YELLOW_LED AT91_PIN_PC10
  115. #define STATUS_LED_RED 0
  116. #define STATUS_LED_GREEN 1
  117. #define STATUS_LED_YELLOW 2
  118. /* Red LED */
  119. #define STATUS_LED_BIT STATUS_LED_RED
  120. #define STATUS_LED_STATE STATUS_LED_OFF
  121. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  122. /* Green LED */
  123. #define STATUS_LED_BIT1 STATUS_LED_GREEN
  124. #define STATUS_LED_STATE1 STATUS_LED_ON
  125. #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2)
  126. /* Yellow LED */
  127. #define STATUS_LED_BIT2 STATUS_LED_YELLOW
  128. #define STATUS_LED_STATE2 STATUS_LED_OFF
  129. #define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 2)
  130. /* Boot status LED */
  131. #define STATUS_LED_BOOT STATUS_LED_GREEN
  132. /*
  133. * Ethernet configuration
  134. *
  135. * PortuxG20 has always ethernet but for Stamp9G20 you
  136. * can enable it here if your baseboard features ethernet.
  137. */
  138. /* #define CONFIG_MACB */
  139. #ifdef CONFIG_MACB
  140. # define CONFIG_RMII /* use reduced MII inteface */
  141. # define CONFIG_NET_RETRY_COUNT 20 /* # of DHCP/BOOTP retries */
  142. /* BOOTP and DHCP options */
  143. # define CONFIG_BOOTP_BOOTFILESIZE
  144. # define CONFIG_BOOTP_BOOTPATH
  145. # define CONFIG_BOOTP_GATEWAY
  146. # define CONFIG_BOOTP_HOSTNAME
  147. # define CONFIG_NFSBOOTCOMMAND \
  148. "setenv autoload yes; setenv autoboot yes; " \
  149. "setenv bootargs ${basicargs} ${mtdparts} " \
  150. "root=/dev/nfs ip=dhcp nfsroot=${serverip}:/srv/nfs/rootfs; " \
  151. "dhcp"
  152. #endif /* CONFIG_MACB */
  153. /* Enable the watchdog */
  154. #define CONFIG_AT91SAM9_WATCHDOG
  155. #define CONFIG_HW_WATCHDOG
  156. /* USB configuration */
  157. #define CONFIG_USB_ATMEL
  158. #define CONFIG_USB_OHCI_NEW
  159. #define CONFIG_USB_STORAGE
  160. #define CONFIG_DOS_PARTITION
  161. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  162. #define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_UHP_BASE
  163. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
  164. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
  165. /* General Boot Parameter */
  166. #define CONFIG_BOOTDELAY 3
  167. #define CONFIG_BOOTCOMMAND "run flashboot"
  168. #define CONFIG_SYS_PROMPT "U-Boot> "
  169. #define CONFIG_SYS_CBSIZE 256
  170. #define CONFIG_SYS_MAXARGS 16
  171. #define CONFIG_SYS_PBSIZE \
  172. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  173. #define CONFIG_SYS_LONGHELP
  174. #define CONFIG_CMDLINE_EDITING
  175. /*
  176. * RAM Memory address where to put the
  177. * Linux Kernel befor starting.
  178. */
  179. #define CONFIG_SYS_LOAD_ADDR 0x22000000
  180. /*
  181. * The NAND Flash partitions:
  182. * ==========================================
  183. * 0x0000000-0x001ffff -> 128k, bootstrap
  184. * 0x0020000-0x005ffff -> 256k, u-boot
  185. * 0x0060000-0x007ffff -> 128k, env1
  186. * 0x0080000-0x009ffff -> 128k, env2 (backup)
  187. * 0x0100000-0x06fffff -> 6M, kernel
  188. * 0x0700000-0x8000000 -> 121M, RootFS
  189. */
  190. #define CONFIG_ENV_IS_IN_NAND
  191. #define CONFIG_ENV_OFFSET ((128 + 256) << 10)
  192. #define CONFIG_ENV_OFFSET_REDUND ((128 + 256 + 128) << 10)
  193. #define CONFIG_ENV_SIZE (128 << 10)
  194. /*
  195. * Predefined environment variables.
  196. * Usefull to define some easy to use boot commands.
  197. */
  198. #define CONFIG_EXTRA_ENV_SETTINGS \
  199. \
  200. "basicargs=console=ttyS0,115200\0" \
  201. \
  202. "mtdparts=mtdparts=atmel_nand:128k(bootstrap)ro," \
  203. "256k(uboot)ro,128k(env1)ro," \
  204. "128k(env2)ro,6M(linux),-(root)rw\0" \
  205. \
  206. "flashboot=setenv bootargs ${basicargs} ${mtdparts} " \
  207. "root=/dev/mtdblock5 rootfstype=jffs2; " \
  208. "nand read 0x22000000 0x100000 0x600000; " \
  209. "bootm 22000000\0" \
  210. \
  211. "sdboot=setenv bootargs ${basicargs} ${mtdparts} " \
  212. "root=/dev/mmcblk0p1 rootwait; " \
  213. "nand read 0x22000000 0x100000 0x600000; " \
  214. "bootm 22000000"
  215. /* Command line & features configuration */
  216. #include <config_cmd_default.h>
  217. #undef CONFIG_CMD_FPGA
  218. #undef CONFIG_CMD_IMI
  219. #undef CONFIG_CMD_IMLS
  220. #undef CONFIG_CMD_LOADS
  221. #define CONFIG_CMD_NAND
  222. #define CONFIG_CMD_USB
  223. #define CONFIG_CMD_FAT
  224. #define CONFIG_CMD_LED
  225. #ifdef CONFIG_MACB
  226. # define CONFIG_CMD_PING
  227. # define CONFIG_CMD_DHCP
  228. #else
  229. # undef CONFIG_CMD_BOOTD
  230. # undef CONFIG_CMD_NET
  231. # undef CONFIG_CMD_NFS
  232. #endif /* CONFIG_MACB */
  233. #endif /* __CONFIG_H */