trats.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. /*
  2. * Copyright (C) 2011 Samsung Electronics
  3. * Heungjun Kim <riverful.kim@samsung.com>
  4. *
  5. * Configuation settings for the SAMSUNG TRATS (EXYNOS4210) board.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __CONFIG_H
  26. #define __CONFIG_H
  27. /*
  28. * High Level Configuration Options
  29. * (easy to change)
  30. */
  31. #define CONFIG_SAMSUNG /* in a SAMSUNG core */
  32. #define CONFIG_S5P /* which is in a S5P Family */
  33. #define CONFIG_EXYNOS4210 /* which is in a EXYNOS4210 */
  34. #define CONFIG_TRATS /* working with TRATS */
  35. #define CONFIG_TIZEN /* TIZEN lib */
  36. #include <asm/arch/cpu.h> /* get chip and board defs */
  37. #define CONFIG_ARCH_CPU_INIT
  38. #define CONFIG_DISPLAY_CPUINFO
  39. #define CONFIG_DISPLAY_BOARDINFO
  40. #ifndef CONFIG_SYS_L2CACHE_OFF
  41. #define CONFIG_SYS_L2_PL310
  42. #define CONFIG_SYS_PL310_BASE 0x10502000
  43. #endif
  44. #define CONFIG_SYS_SDRAM_BASE 0x40000000
  45. #define CONFIG_SYS_TEXT_BASE 0x63300000
  46. /* input clock of PLL: TRATS has 24MHz input clock at EXYNOS4210 */
  47. #define CONFIG_SYS_CLK_FREQ_C210 24000000
  48. #define CONFIG_SYS_CLK_FREQ CONFIG_SYS_CLK_FREQ_C210
  49. #define CONFIG_SETUP_MEMORY_TAGS
  50. #define CONFIG_CMDLINE_TAG
  51. #define CONFIG_REVISION_TAG
  52. #define CONFIG_CMDLINE_EDITING
  53. #define CONFIG_SKIP_LOWLEVEL_INIT
  54. #define CONFIG_BOARD_EARLY_INIT_F
  55. /* MACH_TYPE_TRATS macro will be removed once added to mach-types */
  56. #define MACH_TYPE_TRATS 3928
  57. #define CONFIG_MACH_TYPE MACH_TYPE_TRATS
  58. /* Size of malloc() pool */
  59. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (16 << 20))
  60. /* select serial console configuration */
  61. #define CONFIG_SERIAL2 /* use SERIAL 2 */
  62. #define CONFIG_BAUDRATE 115200
  63. /* MMC */
  64. #define CONFIG_GENERIC_MMC
  65. #define CONFIG_MMC
  66. #define CONFIG_S5P_SDHCI
  67. #define CONFIG_SDHCI
  68. #define CONFIG_MMC_SDMA
  69. /* PWM */
  70. #define CONFIG_PWM
  71. /* It should define before config_cmd_default.h */
  72. #define CONFIG_SYS_NO_FLASH
  73. /* Command definition */
  74. #include <config_cmd_default.h>
  75. #undef CONFIG_CMD_FPGA
  76. #undef CONFIG_CMD_MISC
  77. #undef CONFIG_CMD_NET
  78. #undef CONFIG_CMD_NFS
  79. #undef CONFIG_CMD_XIMG
  80. #undef CONFIG_CMD_CACHE
  81. #undef CONFIG_CMD_ONENAND
  82. #undef CONFIG_CMD_MTDPARTS
  83. #define CONFIG_CMD_MMC
  84. #define CONFIG_CMD_DFU
  85. #define CONFIG_CMD_GPT
  86. #define CONFIG_CMD_SETEXPR
  87. /* FAT */
  88. #define CONFIG_CMD_FAT
  89. #define CONFIG_FAT_WRITE
  90. /* USB Composite download gadget - g_dnl */
  91. #define CONFIG_USBDOWNLOAD_GADGET
  92. #define CONFIG_DFU_FUNCTION
  93. #define CONFIG_DFU_MMC
  94. /* USB Samsung's IDs */
  95. #define CONFIG_G_DNL_VENDOR_NUM 0x04E8
  96. #define CONFIG_G_DNL_PRODUCT_NUM 0x6601
  97. #define CONFIG_G_DNL_MANUFACTURER "Samsung"
  98. #define CONFIG_BOOTDELAY 1
  99. #define CONFIG_ZERO_BOOTDELAY_CHECK
  100. #define CONFIG_BOOTARGS "Please use defined boot"
  101. #define CONFIG_BOOTCOMMAND "run mmcboot"
  102. #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
  103. #define CONFIG_BOOTBLOCK "10"
  104. #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}"
  105. /* Tizen - partitions definitions */
  106. #define PARTS_CSA "csa-mmc"
  107. #define PARTS_BOOTLOADER "u-boot"
  108. #define PARTS_BOOT "boot"
  109. #define PARTS_ROOT "platform"
  110. #define PARTS_DATA "data"
  111. #define PARTS_CSC "csc"
  112. #define PARTS_UMS "ums"
  113. #define PARTS_DEFAULT \
  114. "uuid_disk=${uuid_gpt_disk};" \
  115. "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
  116. "name="PARTS_BOOTLOADER",size=60MiB," \
  117. "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \
  118. "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
  119. "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
  120. "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
  121. "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \
  122. "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
  123. #define CONFIG_DFU_ALT \
  124. "u-boot mmc 80 400;" \
  125. "uImage ext4 0 2;" \
  126. "exynos4210-trats.dtb ext4 0 2\0"
  127. #define CONFIG_ENV_OVERWRITE
  128. #define CONFIG_SYS_CONSOLE_INFO_QUIET
  129. #define CONFIG_SYS_CONSOLE_IS_IN_ENV
  130. #define CONFIG_EXTRA_ENV_SETTINGS \
  131. "bootk=" \
  132. "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \
  133. "updatemmc=" \
  134. "mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200;" \
  135. "mmc boot 0 1 1 0\0" \
  136. "updatebackup=" \
  137. "mmc boot 0 1 1 2; mmc write 0 0x42100000 0 0x200;" \
  138. "mmc boot 0 1 1 0\0" \
  139. "updatebootb=" \
  140. "mmc read 0 0x42100000 0x80 0x200; run updatebackup\0" \
  141. "lpj=lpj=3981312\0" \
  142. "nfsboot=" \
  143. "setenv bootargs root=/dev/nfs rw " \
  144. "nfsroot=${nfsroot},nolock,tcp " \
  145. "ip=${ipaddr}:${serverip}:${gatewayip}:" \
  146. "${netmask}:generic:usb0:off " CONFIG_ENV_COMMON_BOOT \
  147. "; run bootk\0" \
  148. "ramfsboot=" \
  149. "setenv bootargs root=/dev/ram0 rw rootfstype=ext2 " \
  150. "${console} ${meminfo} " \
  151. "initrd=0x43000000,8M ramdisk=8192\0" \
  152. "mmcboot=" \
  153. "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
  154. "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \
  155. "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \
  156. "bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0" \
  157. "boottrace=setenv opts initcall_debug; run bootcmd\0" \
  158. "mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \
  159. "verify=n\0" \
  160. "rootfstype=ext4\0" \
  161. "console=" CONFIG_DEFAULT_CONSOLE \
  162. "meminfo=crashkernel=32M@0x50000000\0" \
  163. "nfsroot=/nfsroot/arm\0" \
  164. "bootblock=" CONFIG_BOOTBLOCK "\0" \
  165. "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 uImage\0" \
  166. "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr}" \
  167. "${fdtfile}\0" \
  168. "mmcdev=0\0" \
  169. "mmcbootpart=2\0" \
  170. "mmcrootpart=5\0" \
  171. "opts=always_resume=1\0" \
  172. "partitions=" PARTS_DEFAULT \
  173. "dfu_alt_info=" CONFIG_DFU_ALT \
  174. "spladdr=0x40000100\0" \
  175. "splsize=0x200\0" \
  176. "splfile=falcon.bin\0" \
  177. "spl_export=" \
  178. "setexpr spl_imgsize ${splsize} + 8 ;" \
  179. "setenv spl_imgsize 0x${spl_imgsize};" \
  180. "setexpr spl_imgaddr ${spladdr} - 8 ;" \
  181. "setexpr spl_addr_tmp ${spladdr} - 4 ;" \
  182. "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run loaduimage;" \
  183. "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
  184. "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};" \
  185. "spl export atags 0x40007FC0;" \
  186. "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \
  187. "mw.l ${spl_addr_tmp} ${splsize};" \
  188. "ext4write mmc ${mmcdev}:${mmcbootpart}" \
  189. " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \
  190. "setenv spl_imgsize;" \
  191. "setenv spl_imgaddr;" \
  192. "setenv spl_addr_tmp;\0" \
  193. "fdtaddr=40800000\0" \
  194. "fdtfile=exynos4210-trats.dtb\0"
  195. /* Miscellaneous configurable options */
  196. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  197. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  198. #define CONFIG_SYS_PROMPT "TRATS # "
  199. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  200. #define CONFIG_SYS_PBSIZE 384 /* Print Buffer Size */
  201. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  202. /* Boot Argument Buffer Size */
  203. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  204. /* memtest works on */
  205. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  206. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5000000)
  207. #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x4800000)
  208. #define CONFIG_SYS_HZ 1000
  209. /* TRATS has 4 banks of DRAM */
  210. #define CONFIG_NR_DRAM_BANKS 4
  211. #define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */
  212. #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE
  213. #define PHYS_SDRAM_1_SIZE SDRAM_BANK_SIZE
  214. #define PHYS_SDRAM_2 (CONFIG_SYS_SDRAM_BASE + SDRAM_BANK_SIZE)
  215. #define PHYS_SDRAM_2_SIZE SDRAM_BANK_SIZE
  216. #define PHYS_SDRAM_3 (CONFIG_SYS_SDRAM_BASE + (2 * SDRAM_BANK_SIZE))
  217. #define PHYS_SDRAM_3_SIZE SDRAM_BANK_SIZE
  218. #define PHYS_SDRAM_4 (CONFIG_SYS_SDRAM_BASE + (3 * SDRAM_BANK_SIZE))
  219. #define PHYS_SDRAM_4_SIZE SDRAM_BANK_SIZE
  220. #define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */
  221. #define CONFIG_SYS_MONITOR_BASE 0x00000000
  222. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  223. #define CONFIG_ENV_IS_IN_MMC
  224. #define CONFIG_SYS_MMC_ENV_DEV 0
  225. #define CONFIG_ENV_SIZE 4096
  226. #define CONFIG_ENV_OFFSET ((32 - 4) << 10) /* 32KiB - 4KiB */
  227. #define CONFIG_DOS_PARTITION
  228. #define CONFIG_EFI_PARTITION
  229. /* EXT4 */
  230. #define CONFIG_CMD_EXT4
  231. #define CONFIG_CMD_EXT4_WRITE
  232. /* Falcon mode definitions */
  233. #define CONFIG_CMD_SPL
  234. #define CONFIG_SYS_SPL_ARGS_ADDR PHYS_SDRAM_1 + 0x100
  235. /* GPT */
  236. #define CONFIG_EFI_PARTITION
  237. #define CONFIG_PARTITION_UUIDS
  238. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE)
  239. #define CONFIG_SYS_CACHELINE_SIZE 32
  240. #define CONFIG_SOFT_I2C
  241. #define CONFIG_SOFT_I2C_READ_REPEATED_START
  242. #define CONFIG_SYS_I2C_INIT_BOARD
  243. #define CONFIG_SYS_I2C_SPEED 50000
  244. #define CONFIG_I2C_MULTI_BUS
  245. #define CONFIG_SOFT_I2C_MULTI_BUS
  246. #define CONFIG_SYS_MAX_I2C_BUS 15
  247. #include <asm/arch/gpio.h>
  248. /* I2C PMIC */
  249. #define CONFIG_SOFT_I2C_I2C5_SCL exynos4_gpio_part1_get_nr(b, 7)
  250. #define CONFIG_SOFT_I2C_I2C5_SDA exynos4_gpio_part1_get_nr(b, 6)
  251. /* I2C FG */
  252. #define CONFIG_SOFT_I2C_I2C9_SCL exynos4_gpio_part2_get_nr(y4, 1)
  253. #define CONFIG_SOFT_I2C_I2C9_SDA exynos4_gpio_part2_get_nr(y4, 0)
  254. #define CONFIG_SOFT_I2C_GPIO_SCL get_multi_scl_pin()
  255. #define CONFIG_SOFT_I2C_GPIO_SDA get_multi_sda_pin()
  256. #define I2C_INIT multi_i2c_init()
  257. #define CONFIG_POWER
  258. #define CONFIG_POWER_I2C
  259. #define CONFIG_POWER_MAX8997
  260. #define CONFIG_POWER_FG
  261. #define CONFIG_POWER_FG_MAX17042
  262. #define CONFIG_POWER_MUIC
  263. #define CONFIG_POWER_MUIC_MAX8997
  264. #define CONFIG_POWER_BATTERY
  265. #define CONFIG_POWER_BATTERY_TRATS
  266. #define CONFIG_USB_GADGET
  267. #define CONFIG_USB_GADGET_S3C_UDC_OTG
  268. #define CONFIG_USB_GADGET_DUALSPEED
  269. #define CONFIG_USB_GADGET_VBUS_DRAW 2
  270. /* LCD */
  271. #define CONFIG_EXYNOS_FB
  272. #define CONFIG_LCD
  273. #define CONFIG_CMD_BMP
  274. #define CONFIG_BMP_32BPP
  275. #define CONFIG_FB_ADDR 0x52504000
  276. #define CONFIG_S6E8AX0
  277. #define CONFIG_EXYNOS_MIPI_DSIM
  278. #define CONFIG_VIDEO_BMP_GZIP
  279. #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 120 * 4) + (1 << 12))
  280. #define CONFIG_CMD_USB_MASS_STORAGE
  281. #if defined(CONFIG_CMD_USB_MASS_STORAGE)
  282. #define CONFIG_USB_GADGET_MASS_STORAGE
  283. #endif
  284. /* Pass open firmware flat tree */
  285. #define CONFIG_OF_LIBFDT 1
  286. #endif /* __CONFIG_H */