odroid.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * Copyright (C) 2014 Samsung Electronics
  3. * Sanghee Kim <sh0130.kim@samsung.com>
  4. * Piotr Wilczek <p.wilczek@samsung.com>
  5. * Przemyslaw Marczak <p.marczak@samsung.com>
  6. *
  7. * Configuation settings for the Odroid-U3 (EXYNOS4412) board.
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #ifndef __CONFIG_ODROID_U3_H
  12. #define __CONFIG_ODROID_U3_H
  13. #include <configs/exynos4-common.h>
  14. #define CONFIG_SYS_L2CACHE_OFF
  15. #ifndef CONFIG_SYS_L2CACHE_OFF
  16. #define CONFIG_SYS_L2_PL310
  17. #define CONFIG_SYS_PL310_BASE 0x10502000
  18. #endif
  19. #define CONFIG_MACH_TYPE 4289
  20. #define CONFIG_NR_DRAM_BANKS 8
  21. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  22. #define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */
  23. #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE
  24. /* Reserve the last 1 MiB for the secure firmware */
  25. #define CONFIG_SYS_MEM_TOP_HIDE (1UL << 20UL)
  26. #define CONFIG_TZSW_RESERVED_DRAM_SIZE CONFIG_SYS_MEM_TOP_HIDE
  27. /* memtest works on */
  28. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  29. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5E00000)
  30. #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
  31. #define CONFIG_SYS_TEXT_BASE 0x43e00000
  32. #include <linux/sizes.h>
  33. /* select serial console configuration */
  34. #define CONFIG_SERIAL1
  35. #define CONFIG_BAUDRATE 115200
  36. /* Console configuration */
  37. #define CONFIG_BOOTARGS "Please use defined boot"
  38. #define CONFIG_BOOTCOMMAND "run autoboot"
  39. #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
  40. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
  41. - GENERATED_GBL_DATA_SIZE)
  42. #define CONFIG_SYS_MONITOR_BASE 0x00000000
  43. #define CONFIG_ENV_IS_IN_MMC
  44. #define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV
  45. #define CONFIG_ENV_SIZE 4096
  46. #define CONFIG_ENV_OFFSET (SZ_1K * 1280) /* 1.25 MiB offset */
  47. #define CONFIG_ENV_OVERWRITE
  48. /* Partitions name */
  49. #define PARTS_BOOT "boot"
  50. #define PARTS_ROOT "platform"
  51. #define CONFIG_DFU_ALT \
  52. "uImage fat 0 1;" \
  53. "zImage fat 0 1;" \
  54. "Image.itb fat 0 1;" \
  55. "uInitrd fat 0 1;" \
  56. "exynos4412-odroidu3.dtb fat 0 1;" \
  57. "exynos4412-odroidx2.dtb fat 0 1;" \
  58. ""PARTS_BOOT" part 0 1;" \
  59. ""PARTS_ROOT" part 0 2\0" \
  60. #define CONFIG_SET_DFU_ALT_INFO
  61. #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K)
  62. #define CONFIG_DFU_ALT_BOOT_EMMC \
  63. "u-boot raw 0x3e 0x800 mmcpart 1;" \
  64. "bl1 raw 0x0 0x1e mmcpart 1;" \
  65. "bl2 raw 0x1e 0x1d mmcpart 1;" \
  66. "tzsw raw 0x83e 0x138 mmcpart 1\0"
  67. #define CONFIG_DFU_ALT_BOOT_SD \
  68. "u-boot raw 0x3f 0x800;" \
  69. "bl1 raw 0x1 0x1e;" \
  70. "bl2 raw 0x1f 0x1d;" \
  71. "tzsw raw 0x83f 0x138\0"
  72. /*
  73. * Bootable media layout:
  74. * dev: SD eMMC(part boot)
  75. * BL1 1 0
  76. * BL2 31 30
  77. * UBOOT 63 62
  78. * TZSW 2111 2110
  79. * ENV 2560 2560(part user)
  80. *
  81. * MBR Primary partiions:
  82. * Num Name Size Offset
  83. * 1. BOOT: 100MiB 2MiB
  84. * 2. ROOT: -
  85. */
  86. #define CONFIG_EXTRA_ENV_SETTINGS \
  87. "loadbootscript=load mmc ${mmcbootdev}:${mmcbootpart} ${scriptaddr} " \
  88. "boot.scr\0" \
  89. "loadkernel=load mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
  90. "${kernelname}\0" \
  91. "loadinitrd=load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
  92. "${initrdname}\0" \
  93. "loaddtb=load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
  94. "${fdtfile}\0" \
  95. "check_ramdisk=" \
  96. "if run loadinitrd; then " \
  97. "setenv initrd_addr ${initrdaddr};" \
  98. "else " \
  99. "setenv initrd_addr -;" \
  100. "fi;\0" \
  101. "check_dtb=" \
  102. "if run loaddtb; then " \
  103. "setenv fdt_addr ${fdtaddr};" \
  104. "else " \
  105. "setenv fdt_addr;" \
  106. "fi;\0" \
  107. "kernel_args=" \
  108. "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
  109. " rootwait ${console} ${opts}\0" \
  110. "boot_script=" \
  111. "run loadbootscript;" \
  112. "source ${scriptaddr}\0" \
  113. "boot_fit=" \
  114. "setenv kerneladdr 0x42000000;" \
  115. "setenv kernelname Image.itb;" \
  116. "run loadkernel;" \
  117. "run kernel_args;" \
  118. "bootm ${kerneladdr}#${boardname}\0" \
  119. "boot_uimg=" \
  120. "setenv kerneladdr 0x40007FC0;" \
  121. "setenv kernelname uImage;" \
  122. "run check_dtb;" \
  123. "run check_ramdisk;" \
  124. "run loadkernel;" \
  125. "run kernel_args;" \
  126. "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
  127. "boot_zimg=" \
  128. "setenv kerneladdr 0x40007FC0;" \
  129. "setenv kernelname zImage;" \
  130. "run check_dtb;" \
  131. "run check_ramdisk;" \
  132. "run loadkernel;" \
  133. "run kernel_args;" \
  134. "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
  135. "autoboot=" \
  136. "if test -e mmc 0 boot.scr; then; " \
  137. "run boot_script; " \
  138. "elif test -e mmc 0 Image.itb; then; " \
  139. "run boot_fit;" \
  140. "elif test -e mmc 0 zImage; then; " \
  141. "run boot_zimg;" \
  142. "elif test -e mmc 0 uImage; then; " \
  143. "run boot_uimg;" \
  144. "fi;\0" \
  145. "console=" CONFIG_DEFAULT_CONSOLE \
  146. "mmcbootdev=0\0" \
  147. "mmcbootpart=1\0" \
  148. "mmcrootdev=0\0" \
  149. "mmcrootpart=2\0" \
  150. "bootdelay=0\0" \
  151. "dfu_alt_system="CONFIG_DFU_ALT \
  152. "dfu_alt_info=Please reset the board\0" \
  153. "consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
  154. "consoleoff=set console console=ram; save; reset\0" \
  155. "initrdname=uInitrd\0" \
  156. "initrdaddr=42000000\0" \
  157. "scriptaddr=0x42000000\0" \
  158. "fdtaddr=40800000\0"
  159. /* I2C */
  160. #define CONFIG_SYS_I2C_S3C24X0
  161. #define CONFIG_SYS_I2C_S3C24X0_SPEED 100000
  162. #define CONFIG_SYS_I2C_S3C24X0_SLAVE 0
  163. /* GPT */
  164. #define CONFIG_RANDOM_UUID
  165. /* Security subsystem - enable hw_rand() */
  166. #define CONFIG_EXYNOS_ACE_SHA
  167. #define CONFIG_LIB_HW_RAND
  168. /* USB */
  169. #define CONFIG_USB_EHCI
  170. #define CONFIG_USB_EHCI_EXYNOS
  171. #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
  172. #define CONFIG_USB_HOST_ETHER
  173. #define CONFIG_USB_ETHER_SMSC95XX
  174. /*
  175. * Supported Odroid boards: X3, U3
  176. * TODO: Add Odroid X support
  177. */
  178. #define CONFIG_MISC_COMMON
  179. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  180. #define CONFIG_BOARD_TYPES
  181. #define CONFIG_MISC_INIT_R
  182. #undef CONFIG_REVISION_TAG
  183. #endif /* __CONFIG_H */