mx23_olinuxino.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. /*
  2. * Copyright (C) 2013 Marek Vasut <marex@denx.de>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. */
  19. #ifndef __MX23_OLINUXINO_CONFIG_H__
  20. #define __MX23_OLINUXINO_CONFIG_H__
  21. #include <asm/arch/iomux-mx23.h>
  22. /*
  23. * SoC configurations
  24. */
  25. #define CONFIG_MX23 /* i.MX23 SoC */
  26. #define CONFIG_MXS_GPIO /* GPIO control */
  27. #define CONFIG_SYS_HZ 1000 /* Ticks per second */
  28. #define CONFIG_MACH_TYPE 4105
  29. #include <asm/arch/regs-base.h>
  30. #define CONFIG_SYS_NO_FLASH
  31. #define CONFIG_BOARD_EARLY_INIT_F
  32. #define CONFIG_ARCH_MISC_INIT
  33. /*
  34. * SPL
  35. */
  36. #define CONFIG_SPL
  37. #define CONFIG_SPL_NO_CPU_SUPPORT_CODE
  38. #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
  39. #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
  40. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  41. #define CONFIG_SPL_LIBGENERIC_SUPPORT
  42. #define CONFIG_SPL_GPIO_SUPPORT
  43. /*
  44. * U-Boot Commands
  45. */
  46. #include <config_cmd_default.h>
  47. #define CONFIG_DISPLAY_CPUINFO
  48. #define CONFIG_DOS_PARTITION
  49. #define CONFIG_CMD_CACHE
  50. #define CONFIG_CMD_DHCP
  51. #define CONFIG_CMD_EXT2
  52. #define CONFIG_CMD_FAT
  53. #define CONFIG_CMD_GPIO
  54. #define CONFIG_CMD_LED
  55. #define CONFIG_CMD_MMC
  56. #define CONFIG_CMD_NET
  57. #define CONFIG_CMD_USB
  58. /*
  59. * Memory configurations
  60. */
  61. #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
  62. #define PHYS_SDRAM_1 0x40000000 /* Base address */
  63. #define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */
  64. #define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */
  65. #define CONFIG_SYS_GBL_DATA_SIZE 128 /* Initial data */
  66. #define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */
  67. #define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */
  68. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  69. /* Point initial SP in SRAM so SPL can use it too. */
  70. #define CONFIG_SYS_INIT_RAM_ADDR 0x00000000
  71. #define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024)
  72. #define CONFIG_SYS_INIT_SP_OFFSET \
  73. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  74. #define CONFIG_SYS_INIT_SP_ADDR \
  75. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  76. /*
  77. * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
  78. * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
  79. * binary. In case there was more of this mess, 0x100 bytes are skipped.
  80. */
  81. #define CONFIG_SYS_TEXT_BASE 0x40000100
  82. /*
  83. * U-Boot general configurations
  84. */
  85. #define CONFIG_SYS_LONGHELP
  86. #define CONFIG_SYS_PROMPT "=> "
  87. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */
  88. #define CONFIG_SYS_PBSIZE \
  89. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  90. /* Print buffer size */
  91. #define CONFIG_SYS_MAXARGS 32 /* Max number of command args */
  92. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  93. /* Boot argument buffer size */
  94. #define CONFIG_VERSION_VARIABLE /* U-BOOT version */
  95. #define CONFIG_AUTO_COMPLETE /* Command auto complete */
  96. #define CONFIG_CMDLINE_EDITING /* Command history etc */
  97. #define CONFIG_SYS_HUSH_PARSER
  98. /*
  99. * Serial Driver
  100. */
  101. #define CONFIG_PL011_SERIAL
  102. #define CONFIG_PL011_CLOCK 24000000
  103. #define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
  104. #define CONFIG_CONS_INDEX 0
  105. #define CONFIG_BAUDRATE 115200 /* Default baud rate */
  106. /*
  107. * Status LED
  108. */
  109. #define CONFIG_STATUS_LED
  110. #define CONFIG_GPIO_LED
  111. #define CONFIG_BOARD_SPECIFIC_LED
  112. #define STATUS_LED_BOOT 0
  113. #define STATUS_LED_BIT MX23_PAD_SSP1_DETECT__GPIO_2_1
  114. #define STATUS_LED_STATE STATUS_LED_ON
  115. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  116. /*
  117. * MMC Driver
  118. */
  119. #ifdef CONFIG_CMD_MMC
  120. #define CONFIG_MMC
  121. #define CONFIG_BOUNCE_BUFFER
  122. #define CONFIG_GENERIC_MMC
  123. #define CONFIG_MXS_MMC
  124. #endif
  125. /*
  126. * APBH DMA
  127. */
  128. #define CONFIG_APBH_DMA
  129. /* USB */
  130. #ifdef CONFIG_CMD_USB
  131. #define CONFIG_USB_EHCI
  132. #define CONFIG_USB_EHCI_MXS
  133. #define CONFIG_EHCI_MXS_PORT0
  134. #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
  135. #define CONFIG_EHCI_IS_TDI
  136. #define CONFIG_USB_STORAGE
  137. #endif
  138. /* Ethernet */
  139. #ifdef CONFIG_CMD_NET
  140. #define CONFIG_USB_HOST_ETHER
  141. #define CONFIG_USB_ETHER_SMSC95XX
  142. #endif
  143. /*
  144. * Boot Linux
  145. */
  146. #define CONFIG_CMDLINE_TAG
  147. #define CONFIG_SETUP_MEMORY_TAGS
  148. #define CONFIG_BOOTDELAY 3
  149. #define CONFIG_BOOTFILE "uImage"
  150. #define CONFIG_LOADADDR 0x42000000
  151. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  152. #define CONFIG_OF_LIBFDT
  153. /*
  154. * Environment
  155. */
  156. #define CONFIG_ENV_IS_IN_MMC
  157. #define CONFIG_ENV_OVERWRITE
  158. #ifdef CONFIG_ENV_IS_IN_MMC
  159. #define CONFIG_ENV_OFFSET (256 * 1024)
  160. #define CONFIG_ENV_SIZE (16 * 1024)
  161. #define CONFIG_SYS_MMC_ENV_DEV 0
  162. #endif
  163. /*
  164. * Extra Environments
  165. */
  166. #define CONFIG_EXTRA_ENV_SETTINGS \
  167. "update_sd_firmware_filename=u-boot.sd\0" \
  168. "update_sd_firmware=" /* Update the SD firmware partition */ \
  169. "if mmc rescan ; then " \
  170. "if tftp ${update_sd_firmware_filename} ; then " \
  171. "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
  172. "setexpr fw_sz ${fw_sz} + 1 ; " \
  173. "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
  174. "fi ; " \
  175. "fi\0" \
  176. "script=boot.scr\0" \
  177. "uimage=uImage\0" \
  178. "console=ttyAMA0\0" \
  179. "fdt_file=imx23-olinuxino.dtb\0" \
  180. "fdt_addr=0x41000000\0" \
  181. "boot_fdt=try\0" \
  182. "ip_dyn=yes\0" \
  183. "mmcdev=0\0" \
  184. "mmcpart=2\0" \
  185. "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
  186. "mmcargs=setenv bootargs console=${console},${baudrate} " \
  187. "root=${mmcroot}\0" \
  188. "loadbootscript=" \
  189. "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  190. "bootscript=echo Running bootscript from mmc ...; " \
  191. "source\0" \
  192. "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
  193. "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
  194. "mmcboot=echo Booting from mmc ...; " \
  195. "run mmcargs; " \
  196. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  197. "if run loadfdt; then " \
  198. "bootm ${loadaddr} - ${fdt_addr}; " \
  199. "else " \
  200. "if test ${boot_fdt} = try; then " \
  201. "bootm; " \
  202. "else " \
  203. "echo WARN: Cannot load the DT; " \
  204. "fi; " \
  205. "fi; " \
  206. "else " \
  207. "bootm; " \
  208. "fi;\0" \
  209. "netargs=setenv bootargs console=${console},${baudrate} " \
  210. "root=/dev/nfs " \
  211. "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
  212. "netboot=echo Booting from net ...; " \
  213. "usb start; " \
  214. "run netargs; " \
  215. "if test ${ip_dyn} = yes; then " \
  216. "setenv get_cmd dhcp; " \
  217. "else " \
  218. "setenv get_cmd tftp; " \
  219. "fi; " \
  220. "${get_cmd} ${uimage}; " \
  221. "if test ${boot_fdt} = yes; then " \
  222. "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
  223. "bootm ${loadaddr} - ${fdt_addr}; " \
  224. "else " \
  225. "if test ${boot_fdt} = try; then " \
  226. "bootm; " \
  227. "else " \
  228. "echo WARN: Cannot load the DT; " \
  229. "fi;" \
  230. "fi; " \
  231. "else " \
  232. "bootm; " \
  233. "fi;\0"
  234. #define CONFIG_BOOTCOMMAND \
  235. "mmc dev ${mmcdev}; if mmc rescan; then " \
  236. "if run loadbootscript; then " \
  237. "run bootscript; " \
  238. "else " \
  239. "if run loaduimage; then " \
  240. "run mmcboot; " \
  241. "else run netboot; " \
  242. "fi; " \
  243. "fi; " \
  244. "else run netboot; fi"
  245. #endif /* __MX23_OLINUXINO_CONFIG_H__ */