tizen.h: env: checkboard: get partition numbers from variables
[platform/kernel/u-boot.git] / include / configs / tizen.h
1 /*
2  * Copyright (C) 2014 Samsung Electronics
3  *
4  * Configuration settings for the SAMSUNG EXYNOS5 board.
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #ifndef __CONFIG_TIZEN_H
10 #define __CONFIG_TIZEN_H
11
12 #include <configs/exynos4-dt.h>
13 #include <configs/tizen-environment.h>
14
15 #define CONFIG_SYS_PROMPT       "Exynos4412 # " /* Monitor Command Prompt */
16
17 #undef CONFIG_DEFAULT_DEVICE_TREE
18 #define CONFIG_DEFAULT_DEVICE_TREE      exynos4412-odroid
19
20 #define CONFIG_OF_MULTI
21 #define CONFIG_FDTDEC_MEMORY
22
23 /* Arch number for Trats2 */
24 #define MACH_TYPE_SMDK4412      3765
25 /* Arch number for Odroid */
26 #define MACH_TYPE_ODROIDX       4289
27
28 #define CONFIG_SYS_L2CACHE_OFF
29 #ifndef CONFIG_SYS_L2CACHE_OFF
30 #define CONFIG_SYS_L2_PL310
31 #define CONFIG_SYS_PL310_BASE   0x10502000
32 #endif
33
34 #define CONFIG_NR_DRAM_BANKS    8
35 #define CONFIG_SYS_SDRAM_BASE   0x40000000
36 #define SDRAM_BANK_SIZE         (256 << 20)     /* 256 MB */
37
38 #define CONFIG_SYS_LOAD_ADDR            (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
39 #define CONFIG_SYS_TEXT_BASE            0x43e00000
40
41 #include <linux/sizes.h>
42 /* Size of malloc() pool */
43 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + (80 * SZ_1M))
44 #define CONFIG_SYS_MALLOC_F_LEN         (256)
45
46 /* set serial baudrate */
47 #define CONFIG_BAUDRATE                 115200
48
49 /* Console configuration */
50 #define CONFIG_SYS_CONSOLE_INFO_QUIET
51 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
52
53 #define CONFIG_CMD_BOOTZ
54 #define CONFIG_FIT
55 #define CONFIG_FIT_VERBOSE
56 #define CONFIG_BOOTARGS                 "Please use defined boot"
57 #define CONFIG_BOOTCOMMAND              "run autoboot"
58 #define CONFIG_CONSOLE_TTY1             " console=ttySAC1,115200n8"
59 #define CONFIG_CONSOLE_TTY2             " console=ttySAC2,115200n8"
60
61 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
62                                         - GENERATED_GBL_DATA_SIZE)
63
64 #define CONFIG_SYS_MEM_TOP_HIDE (SZ_1M) /* ram console */
65
66 #define CONFIG_SYS_MONITOR_BASE 0x00000000
67
68 #define CONFIG_ENV_IS_IN_MMC
69 #define CONFIG_SYS_MMC_ENV_DEV          CONFIG_MMC_DEFAULT_DEV
70 #define CONFIG_ENV_SIZE                 4096
71 #define CONFIG_ENV_OFFSET               (SZ_1K * 1280) /* 1.25 MiB offset */
72 #define CONFIG_ENV_OVERWRITE
73
74 #define CONFIG_SET_DFU_ALT_INFO
75 #define CONFIG_SET_DFU_ALT_BUF_LEN              SZ_1K
76
77 #define CONFIG_EXTRA_ENV_SETTINGS \
78         "loadkernel=load mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
79                 "${kernelname}\0" \
80         "loadinitrd=load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
81                 "${initrdname}\0" \
82         "loaddtb=load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
83                 "${fdtfile}\0" \
84         "check_ramdisk=" \
85                 "if run loadinitrd; then " \
86                         "setenv initrd_addr ${initrdaddr};" \
87                 "else " \
88                         "setenv initrd_addr -;" \
89                 "fi;\0" \
90         "check_dtb=" \
91                 "if run loaddtb; then " \
92                         "setenv fdt_addr ${fdtaddr};" \
93                 "else " \
94                         "setenv fdt_addr;" \
95                 "fi;\0" \
96         "kernel_args=" \
97                 "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
98                 " rootwait ${console} ${opts}\0" \
99         "checkboard=" \
100                 "if test ${boardname} = trats2; then " \
101                         "setenv mmcbootpart $bootpart_trats2;" \
102                         "setenv mmcrootpart $rootpart_trats2;" \
103                         "setenv console" CONFIG_CONSOLE_TTY2";" \
104                 "else " \
105                         "setenv mmcbootpart $bootpart_odroid;" \
106                         "setenv mmcrootpart $rootpart_odroid;" \
107                         "setenv console" CONFIG_CONSOLE_TTY1";" \
108                 "fi;\0" \
109         "boot_fit=" \
110                 "setenv kerneladdr 0x42000000;" \
111                 "setenv kernelname Image.itb;" \
112                 "run loadkernel;" \
113                 "run kernel_args;" \
114                 "bootm ${kerneladdr}#${boardname}\0" \
115         "boot_uimg=" \
116                 "setenv kerneladdr 0x40007FC0;" \
117                 "setenv kernelname uImage;" \
118                 "run check_dtb;" \
119                 "run check_ramdisk;" \
120                 "run loadkernel;" \
121                 "run kernel_args;" \
122                 "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
123         "boot_zimg=" \
124                 "setenv kerneladdr 0x40007FC0;" \
125                 "setenv kernelname zImage;" \
126                 "run check_dtb;" \
127                 "run check_ramdisk;" \
128                 "run loadkernel;" \
129                 "run kernel_args;" \
130                 "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
131         "autoboot=" \
132                 "run checkboard;" \
133                 "if test -e mmc 0:${mmcbootpart} Image.itb; then; " \
134                         "run boot_fit;" \
135                 "elif test -e mmc 0:${mmcbootpart} zImage; then; " \
136                         "run boot_zimg;" \
137                 "elif test -e mmc 0:${mmcbootpart} uImage; then; " \
138                         "run boot_uimg;" \
139                 "fi;\0" \
140         "mmcbootdev=0\0" \
141         "mmcrootdev=0\0" \
142         "bootpart_trats2=2\0" \
143         "bootpart_odroid=1\0" \
144         "rootpart_trats2=5\0" \
145         "rootpart_odroid=2\0" \
146         "bootdelay=0\0" \
147         "dfu_alt_info=Please reset the board.\0" \
148         "dfu_alt_system_trats2="DFU_ALT_SYSTEM_TRATS2 \
149         "dfu_alt_system_odroid="DFU_ALT_SYSTEM_ODROID \
150         "dfu_usb_con=0\0" \
151         "dfu_interface=mmc\0" \
152         "dfu_device=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\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         "fdtaddr=40800000\0"
158
159 /* I2C */
160 #include <asm/arch/gpio.h>
161
162 #define CONFIG_CMD_I2C
163
164 #define CONFIG_SYS_I2C
165 #define CONFIG_SYS_I2C_S3C24X0
166 #define CONFIG_SYS_I2C_S3C24X0_SPEED    100000
167 #define CONFIG_SYS_I2C_S3C24X0_SLAVE    0
168 #define CONFIG_MAX_I2C_NUM              8
169 #define CONFIG_SYS_I2C_SOFT
170 #define CONFIG_SYS_I2C_SOFT_SPEED       50000
171 #define CONFIG_SYS_I2C_SOFT_SLAVE       0x00
172 #define I2C_SOFT_DECLARATIONS2
173 #define CONFIG_SYS_I2C_SOFT_SPEED_2     50000
174 #define CONFIG_SYS_I2C_SOFT_SLAVE_2     0x00
175 #define CONFIG_SOFT_I2C_READ_REPEATED_START
176 #define CONFIG_SYS_I2C_INIT_BOARD
177
178 #ifndef __ASSEMBLY__
179 int get_soft_i2c_scl_pin(void);
180 int get_soft_i2c_sda_pin(void);
181 #endif
182 #define CONFIG_SOFT_I2C_GPIO_SCL        get_soft_i2c_scl_pin()
183 #define CONFIG_SOFT_I2C_GPIO_SDA        get_soft_i2c_sda_pin()
184
185 /* POWER */
186 #define CONFIG_POWER
187 #define CONFIG_POWER_I2C
188 #define CONFIG_POWER_MAX77686
189 #define CONFIG_POWER_PMIC_MAX77693
190 #define CONFIG_POWER_MUIC_MAX77693
191 #define CONFIG_POWER_FG_MAX77693
192 #define CONFIG_POWER_BATTERY_TRATS2
193 #define CONFIG_CMD_POWEROFF
194
195 /* GPT */
196 #define CONFIG_RANDOM_UUID
197
198 /* Security subsystem - enable hw_rand() */
199 #define CONFIG_EXYNOS_ACE_SHA
200 #define CONFIG_LIB_HW_RAND
201
202 #define CONFIG_CMD_GPIO
203
204 /*
205  * Supported Odroid boards: X3, U3
206  * TODO: Add Odroid X support
207  */
208 #define CONFIG_MISC_COMMON
209 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
210 #define CONFIG_BOARD_TYPES
211 #define CONFIG_MISC_INIT_R
212 #undef CONFIG_REVISION_TAG
213
214 #define CONFIG_TIZEN
215 #define CONFIG_SIG
216
217 /* Charge battery with interactive LCD animation */
218 #define CONFIG_INTERACTIVE_CHARGER
219 #define CONFIG_CMD_BATTERY
220
221 /* Download menu - Samsung common */
222 #define CONFIG_LCD_MENU
223 #define CONFIG_LCD_MENU_BOARD
224
225 /*
226  * Download menu - definitions for check keys
227  * This is valid only for Trats2 and will be reworked
228  */
229 #ifndef __ASSEMBLY__
230 #include <power/max77686_pmic.h>
231
232 #define KEY_PWR_PMIC_NAME               "MAX77686_PMIC"
233 #define KEY_PWR_STATUS_REG              MAX77686_REG_PMIC_STATUS1
234 #define KEY_PWR_STATUS_MASK             (1 << 0)
235 #define KEY_PWR_INTERRUPT_REG           MAX77686_REG_PMIC_INT1
236 #define KEY_PWR_INTERRUPT_MASK          (1 << 1)
237
238 #define KEY_VOL_UP_GPIO                 EXYNOS4X12_GPIO_X22
239 #define KEY_VOL_DOWN_GPIO               EXYNOS4X12_GPIO_X33
240 #endif /* __ASSEMBLY__ */
241
242 /* LCD console */
243 #define LCD_BPP                         LCD_COLOR16
244 #define CONFIG_SYS_WHITE_ON_BLACK
245
246 /* LCD */
247 #define CONFIG_EXYNOS_FB
248 #define CONFIG_LCD
249 #define CONFIG_CMD_BMP
250 #define CONFIG_BMP_16BPP
251 #define CONFIG_FB_ADDR          0x52504000
252 #define CONFIG_S6E8AX0
253 #define CONFIG_EXYNOS_MIPI_DSIM
254 #define CONFIG_VIDEO_BMP_GZIP
255 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
256
257 #define LCD_XRES        720
258 #define LCD_YRES        1280
259
260 #endif  /* __CONFIG_H */