1 /* 2 * Copyright (C) 2013 Samsung Electronics 3 * Sanghee Kim <sh0130.kim@samsung.com> 4 * Piotr Wilczek <p.wilczek@samsung.com> 5 * 6 * Configuation settings for the SAMSUNG TRATS2 (EXYNOS4412) board. 7 * 8 * SPDX-License-Identifier: GPL-2.0+ 9 */ 10 11 #ifndef __CONFIG_H 12 #define __CONFIG_H 13 14 /* 15 * High Level Configuration Options 16 * (easy to change) 17 */ 18 #define CONFIG_SAMSUNG /* in a SAMSUNG core */ 19 #define CONFIG_S5P /* which is in a S5P Family */ 20 #define CONFIG_EXYNOS4 /* which is in a EXYNOS4XXX */ 21 #define CONFIG_TIZEN /* TIZEN lib */ 22 23 #include <asm/arch/cpu.h> /* get chip and board defs */ 24 25 #define CONFIG_ARCH_CPU_INIT 26 #define CONFIG_DISPLAY_CPUINFO 27 #define CONFIG_DISPLAY_BOARDINFO 28 29 #define CONFIG_SKIP_LOWLEVEL_INIT 30 31 #define CONFIG_SYS_CACHELINE_SIZE 32 32 33 #define CONFIG_SYS_L2CACHE_OFF 34 #ifndef CONFIG_SYS_L2CACHE_OFF 35 #define CONFIG_SYS_L2_PL310 36 #define CONFIG_SYS_PL310_BASE 0x10502000 37 #endif 38 39 #define CONFIG_NR_DRAM_BANKS 4 40 #define PHYS_SDRAM_1 0x40000000 /* LDDDR2 DMC 0 */ 41 #define PHYS_SDRAM_1_SIZE (256 << 20) /* 256 MB in CS 0 */ 42 #define PHYS_SDRAM_2 0x50000000 /* LPDDR2 DMC 1 */ 43 #define PHYS_SDRAM_2_SIZE (256 << 20) /* 256 MB in CS 0 */ 44 #define PHYS_SDRAM_3 0x60000000 /* LPDDR2 DMC 1 */ 45 #define PHYS_SDRAM_3_SIZE (256 << 20) /* 256 MB in CS 0 */ 46 #define PHYS_SDRAM_4 0x70000000 /* LPDDR2 DMC 1 */ 47 #define PHYS_SDRAM_4_SIZE (256 << 20) /* 256 MB in CS 0 */ 48 #define PHYS_SDRAM_END 0x80000000 49 50 #define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */ 51 52 #define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1) 53 #define CONFIG_SYS_TEXT_BASE 0x78100000 54 55 #define CONFIG_SYS_CLK_FREQ 24000000 56 57 #define CONFIG_SETUP_MEMORY_TAGS 58 #define CONFIG_CMDLINE_TAG 59 #define CONFIG_REVISION_TAG 60 61 /* MACH_TYPE_TRATS2 */ 62 #define MACH_TYPE_TRATS2 3765 63 #define CONFIG_MACH_TYPE MACH_TYPE_TRATS2 64 65 #define CONFIG_DISPLAY_CPUINFO 66 67 #include <asm/sizes.h> 68 /* Size of malloc() pool */ 69 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (80 * SZ_1M)) 70 71 /* select serial console configuration */ 72 #define CONFIG_SERIAL2 73 74 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ 75 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " 76 77 #define CONFIG_CMDLINE_EDITING 78 79 #define CONFIG_BAUDRATE 115200 80 81 /* It should define before config_cmd_default.h */ 82 #define CONFIG_SYS_NO_FLASH 83 84 /*********************************************************** 85 * Command definition 86 ***********************************************************/ 87 #include <config_cmd_default.h> 88 89 #undef CONFIG_CMD_ECHO 90 #undef CONFIG_CMD_FPGA 91 #undef CONFIG_CMD_FLASH 92 #undef CONFIG_CMD_IMLS 93 #undef CONFIG_CMD_NAND 94 #undef CONFIG_CMD_MISC 95 #undef CONFIG_CMD_NFS 96 #undef CONFIG_CMD_SOURCE 97 #undef CONFIG_CMD_XIMG 98 #define CONFIG_CMD_CACHE 99 #define CONFIG_CMD_I2C 100 #define CONFIG_CMD_MMC 101 #define CONFIG_CMD_DFU 102 #define CONFIG_CMD_GPT 103 #define CONFIG_CMD_PMIC 104 105 #define CONFIG_BOOTDELAY 3 106 #define CONFIG_ZERO_BOOTDELAY_CHECK 107 108 #define CONFIG_CMD_FAT 109 #define CONFIG_FAT_WRITE 110 111 /* EXT4 */ 112 #define CONFIG_CMD_EXT4 113 #define CONFIG_CMD_EXT4_WRITE 114 115 /* USB Composite download gadget - g_dnl */ 116 #define CONFIG_USBDOWNLOAD_GADGET 117 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M 118 #define CONFIG_DFU_FUNCTION 119 #define CONFIG_DFU_MMC 120 121 /* TIZEN THOR downloader support */ 122 #define CONFIG_CMD_THOR_DOWNLOAD 123 #define CONFIG_THOR_FUNCTION 124 125 /* USB Samsung's IDs */ 126 #define CONFIG_G_DNL_VENDOR_NUM 0x04E8 127 #define CONFIG_G_DNL_PRODUCT_NUM 0x6601 128 #define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_VENDOR_NUM 129 #define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D 130 #define CONFIG_G_DNL_MANUFACTURER "Samsung" 131 132 /* To use the TFTPBOOT over USB, Please enable the CONFIG_CMD_NET */ 133 #undef CONFIG_CMD_NET 134 135 /* MMC */ 136 #define CONFIG_GENERIC_MMC 137 #define CONFIG_MMC 138 #define CONFIG_S5P_SDHCI 139 #define CONFIG_SDHCI 140 #define CONFIG_MMC_SDMA 141 #define CONFIG_MMC_DEFAULT_DEV 0 142 143 /* PWM */ 144 #define CONFIG_PWM 145 146 #define CONFIG_BOOTARGS "Please use defined boot" 147 #define CONFIG_BOOTCOMMAND "run mmcboot" 148 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0" 149 150 #define CONFIG_ENV_OVERWRITE 151 #define CONFIG_SYS_CONSOLE_INFO_QUIET 152 #define CONFIG_SYS_CONSOLE_IS_IN_ENV 153 154 /* Tizen - partitions definitions */ 155 #define PARTS_CSA "csa" 156 #define PARTS_BOOT "boot" 157 #define PARTS_MODEM "modem" 158 #define PARTS_CSC "csc" 159 #define PARTS_ROOT "platform" 160 #define PARTS_DATA "data" 161 #define PARTS_UMS "ums" 162 163 #define PARTS_DEFAULT \ 164 "uuid_disk=${uuid_gpt_disk};" \ 165 "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ 166 "name="PARTS_BOOT",size=64MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ 167 "name="PARTS_MODEM",size=100MiB,uuid=${uuid_gpt_"PARTS_MODEM"};" \ 168 "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ 169 "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ 170 "name="PARTS_DATA",size=512MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ 171 "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ 172 173 #define CONFIG_DFU_ALT \ 174 "u-boot mmc 80 800;" \ 175 "uImage ext4 0 2;" \ 176 "exynos4412-trats2.dtb ext4 0 2;" \ 177 ""PARTS_BOOT" part 0 2;" \ 178 ""PARTS_ROOT" part 0 5;" \ 179 ""PARTS_DATA" part 0 6;" \ 180 ""PARTS_UMS" part 0 7\0" 181 182 #define CONFIG_EXTRA_ENV_SETTINGS \ 183 "bootk=" \ 184 "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ 185 "updatemmc=" \ 186 "mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200;" \ 187 "mmc boot 0 1 1 0\0" \ 188 "updatebackup=" \ 189 "mmc boot 0 1 1 2; mmc write 0x42100000 0 0x200;" \ 190 " mmc boot 0 1 1 0\0" \ 191 "updatebootb=" \ 192 "mmc read 0x51000000 0x80 0x200; run updatebackup\0" \ 193 "updateuboot=" \ 194 "mmc write 0x50000000 0x80 0x400\0" \ 195 "mmcboot=" \ 196 "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ 197 "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ 198 "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ 199 "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ 200 "boottrace=setenv opts initcall_debug; run bootcmd\0" \ 201 "verify=n\0" \ 202 "rootfstype=ext4\0" \ 203 "console=" CONFIG_DEFAULT_CONSOLE \ 204 "kernelname=uImage\0" \ 205 "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 " \ 206 "${kernelname}\0" \ 207 "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \ 208 "${fdtfile}\0" \ 209 "mmcdev=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\0" \ 210 "mmcbootpart=2\0" \ 211 "mmcrootpart=5\0" \ 212 "opts=always_resume=1\0" \ 213 "partitions=" PARTS_DEFAULT \ 214 "dfu_alt_info=" CONFIG_DFU_ALT \ 215 "uartpath=ap\0" \ 216 "usbpath=ap\0" \ 217 "consoleon=set console console=ttySAC2,115200n8; save; reset\0" \ 218 "consoleoff=set console console=ram; save; reset\0" \ 219 "spladdr=0x40000100\0" \ 220 "splsize=0x200\0" \ 221 "splfile=falcon.bin\0" \ 222 "spl_export=" \ 223 "setexpr spl_imgsize ${splsize} + 8 ;" \ 224 "setenv spl_imgsize 0x${spl_imgsize};" \ 225 "setexpr spl_imgaddr ${spladdr} - 8 ;" \ 226 "setexpr spl_addr_tmp ${spladdr} - 4 ;" \ 227 "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run loaduimage;" \ 228 "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ 229 "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};" \ 230 "spl export atags 0x40007FC0;" \ 231 "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \ 232 "mw.l ${spl_addr_tmp} ${splsize};" \ 233 "ext4write mmc ${mmcdev}:${mmcbootpart}" \ 234 " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \ 235 "setenv spl_imgsize;" \ 236 "setenv spl_imgaddr;" \ 237 "setenv spl_addr_tmp;\0" \ 238 "fdtaddr=40800000\0" \ 239 "fdtfile=exynos4412-trats2.dtb\0" 240 241 /* 242 * Miscellaneous configurable options 243 */ 244 #define CONFIG_SYS_LONGHELP /* undef to save memory */ 245 #define CONFIG_SYS_PROMPT "Trats2 # " /* Monitor Command Prompt */ 246 #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ 247 #define CONFIG_SYS_PBSIZE 384 /* Print Buffer Size */ 248 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */ 249 250 /* Boot Argument Buffer Size */ 251 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 252 253 /* memtest works on */ 254 #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 255 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5000000) 256 #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x4800000) 257 258 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \ 259 - GENERATED_GBL_DATA_SIZE) 260 261 /* valid baudrates */ 262 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } 263 264 #define CONFIG_SYS_MONITOR_BASE 0x00000000 265 266 /*----------------------------------------------------------------------- 267 * FLASH and environment organization 268 */ 269 270 #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */ 271 272 #define CONFIG_ENV_IS_IN_MMC 273 #define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV 274 #define CONFIG_ENV_SIZE 4096 275 #define CONFIG_ENV_OFFSET ((32 - 4) << 10) /* 32KiB - 4KiB */ 276 #define CONFIG_EFI_PARTITION 277 #define CONFIG_PARTITION_UUIDS 278 279 #define CONFIG_MISC_INIT_R 280 #define CONFIG_BOARD_EARLY_INIT_F 281 282 /* I2C */ 283 #include <asm/arch/gpio.h> 284 285 #define CONFIG_SYS_I2C 286 #define CONFIG_SYS_I2C_S3C24X0 287 #define CONFIG_SYS_I2C_S3C24X0_SPEED 100000 288 #define CONFIG_SYS_I2C_S3C24X0_SLAVE 0 289 #define CONFIG_MAX_I2C_NUM 8 290 #define CONFIG_SYS_I2C_SOFT 291 #define CONFIG_SYS_I2C_SOFT_SPEED 50000 292 #define CONFIG_SYS_I2C_SOFT_SLAVE 0x00 293 #define I2C_SOFT_DECLARATIONS2 294 #define CONFIG_SYS_I2C_SOFT_SPEED_2 50000 295 #define CONFIG_SYS_I2C_SOFT_SLAVE_2 0x00 296 #define CONFIG_SOFT_I2C_READ_REPEATED_START 297 #define CONFIG_SYS_I2C_INIT_BOARD 298 299 #ifndef __ASSEMBLY__ 300 int get_soft_i2c_scl_pin(void); 301 int get_soft_i2c_sda_pin(void); 302 #endif 303 #define CONFIG_SOFT_I2C_GPIO_SCL get_soft_i2c_scl_pin() 304 #define CONFIG_SOFT_I2C_GPIO_SDA get_soft_i2c_sda_pin() 305 306 /* POWER */ 307 #define CONFIG_POWER 308 #define CONFIG_POWER_I2C 309 #define CONFIG_POWER_MAX77686 310 #define CONFIG_POWER_PMIC_MAX77693 311 #define CONFIG_POWER_MUIC_MAX77693 312 #define CONFIG_POWER_FG_MAX77693 313 #define CONFIG_POWER_BATTERY_TRATS2 314 #define CONFIG_USB_GADGET 315 #define CONFIG_USB_GADGET_S3C_UDC_OTG 316 #define CONFIG_USB_GADGET_DUALSPEED 317 #define CONFIG_USB_GADGET_VBUS_DRAW 2 318 #define CONFIG_USB_CABLE_CHECK 319 320 /* LCD */ 321 #define CONFIG_EXYNOS_FB 322 #define CONFIG_LCD 323 #define CONFIG_CMD_BMP 324 #define CONFIG_BMP_32BPP 325 #define CONFIG_FB_ADDR 0x52504000 326 #define CONFIG_S6E8AX0 327 #define CONFIG_EXYNOS_MIPI_DSIM 328 #define CONFIG_VIDEO_BMP_GZIP 329 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 250 * 4) + (1 << 12)) 330 331 #define CONFIG_CMD_USB_MASS_STORAGE 332 #define CONFIG_USB_GADGET_MASS_STORAGE 333 334 /* Pass open firmware flat tree */ 335 #define CONFIG_OF_LIBFDT 1 336 337 #endif /* __CONFIG_H */ 338