mx23_olinuxino.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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_EXT2
  51. #define CONFIG_CMD_FAT
  52. #define CONFIG_CMD_GPIO
  53. #define CONFIG_CMD_LED
  54. #define CONFIG_CMD_MMC
  55. /*
  56. * Memory configurations
  57. */
  58. #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
  59. #define PHYS_SDRAM_1 0x40000000 /* Base address */
  60. #define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */
  61. #define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */
  62. #define CONFIG_SYS_GBL_DATA_SIZE 128 /* Initial data */
  63. #define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */
  64. #define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */
  65. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  66. /* Point initial SP in SRAM so SPL can use it too. */
  67. #define CONFIG_SYS_INIT_RAM_ADDR 0x00000000
  68. #define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024)
  69. #define CONFIG_SYS_INIT_SP_OFFSET \
  70. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  71. #define CONFIG_SYS_INIT_SP_ADDR \
  72. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  73. /*
  74. * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
  75. * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
  76. * binary. In case there was more of this mess, 0x100 bytes are skipped.
  77. */
  78. #define CONFIG_SYS_TEXT_BASE 0x40000100
  79. /*
  80. * U-Boot general configurations
  81. */
  82. #define CONFIG_SYS_LONGHELP
  83. #define CONFIG_SYS_PROMPT "=> "
  84. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */
  85. #define CONFIG_SYS_PBSIZE \
  86. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  87. /* Print buffer size */
  88. #define CONFIG_SYS_MAXARGS 32 /* Max number of command args */
  89. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  90. /* Boot argument buffer size */
  91. #define CONFIG_VERSION_VARIABLE /* U-BOOT version */
  92. #define CONFIG_AUTO_COMPLETE /* Command auto complete */
  93. #define CONFIG_CMDLINE_EDITING /* Command history etc */
  94. #define CONFIG_SYS_HUSH_PARSER
  95. /*
  96. * Serial Driver
  97. */
  98. #define CONFIG_PL011_SERIAL
  99. #define CONFIG_PL011_CLOCK 24000000
  100. #define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
  101. #define CONFIG_CONS_INDEX 0
  102. #define CONFIG_BAUDRATE 115200 /* Default baud rate */
  103. /*
  104. * Status LED
  105. */
  106. #define CONFIG_STATUS_LED
  107. #define CONFIG_GPIO_LED
  108. #define CONFIG_BOARD_SPECIFIC_LED
  109. #define STATUS_LED_BOOT 0
  110. #define STATUS_LED_BIT MX23_PAD_SSP1_DETECT__GPIO_2_1
  111. #define STATUS_LED_STATE STATUS_LED_ON
  112. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  113. /*
  114. * MMC Driver
  115. */
  116. #ifdef CONFIG_CMD_MMC
  117. #define CONFIG_MMC
  118. #define CONFIG_BOUNCE_BUFFER
  119. #define CONFIG_GENERIC_MMC
  120. #define CONFIG_MXS_MMC
  121. #endif
  122. /*
  123. * APBH DMA
  124. */
  125. #define CONFIG_APBH_DMA
  126. /*
  127. * Boot Linux
  128. */
  129. #define CONFIG_CMDLINE_TAG
  130. #define CONFIG_SETUP_MEMORY_TAGS
  131. #define CONFIG_BOOTDELAY 3
  132. #define CONFIG_BOOTFILE "uImage"
  133. #define CONFIG_LOADADDR 0x42000000
  134. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  135. #define CONFIG_OF_LIBFDT
  136. /*
  137. * Environment
  138. */
  139. #define CONFIG_ENV_IS_IN_MMC
  140. #define CONFIG_ENV_OVERWRITE
  141. #ifdef CONFIG_ENV_IS_IN_MMC
  142. #define CONFIG_ENV_OFFSET (256 * 1024)
  143. #define CONFIG_ENV_SIZE (16 * 1024)
  144. #define CONFIG_SYS_MMC_ENV_DEV 0
  145. #endif
  146. /*
  147. * Extra Environments
  148. */
  149. #define CONFIG_EXTRA_ENV_SETTINGS \
  150. "update_sd_firmware_filename=u-boot.sd\0" \
  151. "update_sd_firmware=" /* Update the SD firmware partition */ \
  152. "if mmc rescan ; then " \
  153. "if tftp ${update_sd_firmware_filename} ; then " \
  154. "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
  155. "setexpr fw_sz ${fw_sz} + 1 ; " \
  156. "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
  157. "fi ; " \
  158. "fi\0" \
  159. "script=boot.scr\0" \
  160. "uimage=uImage\0" \
  161. "console=ttyAMA0\0" \
  162. "fdt_file=imx23-olinuxino.dtb\0" \
  163. "fdt_addr=0x41000000\0" \
  164. "boot_fdt=try\0" \
  165. "mmcdev=0\0" \
  166. "mmcpart=2\0" \
  167. "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
  168. "mmcargs=setenv bootargs console=${console},${baudrate} " \
  169. "root=${mmcroot}\0" \
  170. "loadbootscript=" \
  171. "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  172. "bootscript=echo Running bootscript from mmc ...; " \
  173. "source\0" \
  174. "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
  175. "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
  176. "mmcboot=echo Booting from mmc ...; " \
  177. "run mmcargs; " \
  178. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  179. "if run loadfdt; then " \
  180. "bootm ${loadaddr} - ${fdt_addr}; " \
  181. "else " \
  182. "if test ${boot_fdt} = try; then " \
  183. "bootm; " \
  184. "else " \
  185. "echo WARN: Cannot load the DT; " \
  186. "fi; " \
  187. "fi; " \
  188. "else " \
  189. "bootm; " \
  190. "fi;\0"
  191. #define CONFIG_BOOTCOMMAND \
  192. "mmc dev ${mmcdev}; if mmc rescan; then " \
  193. "if run loadbootscript; then " \
  194. "run bootscript; " \
  195. "else " \
  196. "if run loaduimage; then " \
  197. "run mmcboot; " \
  198. "else " \
  199. "echo ERR: Fail to boot from MMC; " \
  200. "fi; " \
  201. "fi; " \
  202. "else exit; fi"
  203. #endif /* __MX23_OLINUXINO_CONFIG_H__ */