mx23_olinuxino.h 6.0 KB

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