blob: 29dcc4a298e641750c1dcc5099a686af84953600 [file] [log] [blame]
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +02001/*
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
12#ifndef __CONFIG_ODROID_U3_H
13#define __CONFIG_ODROID_U3_H
14
15#include <configs/exynos4-dt.h>
16
17#define CONFIG_SYS_PROMPT "Odroid # " /* Monitor Command Prompt */
18
19#undef CONFIG_DEFAULT_DEVICE_TREE
20#define CONFIG_DEFAULT_DEVICE_TREE exynos4412-odroid
21
22#define CONFIG_SYS_L2CACHE_OFF
23#ifndef CONFIG_SYS_L2CACHE_OFF
24#define CONFIG_SYS_L2_PL310
25#define CONFIG_SYS_PL310_BASE 0x10502000
26#endif
27
28#define CONFIG_MACH_TYPE 4289
29
30#define CONFIG_NR_DRAM_BANKS 8
31#define CONFIG_SYS_SDRAM_BASE 0x40000000
32#define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */
33#define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE
34
35/* memtest works on */
36#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
37#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5E00000)
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
45/* select serial console configuration */
46#define CONFIG_SERIAL1
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_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
59
60#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
61 - GENERATED_GBL_DATA_SIZE)
62
63#define CONFIG_SYS_MEM_TOP_HIDE (SZ_1M) /* ram console */
64
65#define CONFIG_SYS_MONITOR_BASE 0x00000000
66
67#define CONFIG_ENV_IS_IN_MMC
68#define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV
69#define CONFIG_ENV_SIZE 4096
70#define CONFIG_ENV_OFFSET (SZ_1K * 1280) /* 1.25 MiB offset */
71#define CONFIG_ENV_OVERWRITE
72
73/* Partitions name */
74#define PARTS_BOOT "boot"
75#define PARTS_ROOT "platform"
76
77#define CONFIG_DFU_ALT \
78 "uImage fat 0 1;" \
79 "zImage fat 0 1;" \
80 "Image.itb fat 0 1;" \
81 "uInitrd fat 0 1;" \
82 "exynos4412-odroidu3.dtb fat 0 1;" \
83 "exynos4412-odroidx2.dtb fat 0 1;" \
84 ""PARTS_BOOT" part 0 1;" \
85 ""PARTS_ROOT" part 0 2\0" \
86
87#define CONFIG_SET_DFU_ALT_INFO
88#define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K)
89
90#define CONFIG_DFU_ALT_BOOT_EMMC \
91 "u-boot raw 0x3e 0x800 mmcpart 1;" \
92 "bl1 raw 0x0 0x1e mmcpart 1;" \
93 "bl2 raw 0x1e 0x1d mmcpart 1;" \
94 "tzsw raw 0x83e 0x138 mmcpart 1\0"
95
96#define CONFIG_DFU_ALT_BOOT_SD \
97 "u-boot raw 0x3f 0x800;" \
98 "bl1 raw 0x1 0x1e;" \
99 "bl2 raw 0x1f 0x1d;" \
100 "tzsw raw 0x83f 0x138\0"
101
102/*
103 * Bootable media layout:
104 * dev: SD eMMC(part boot)
105 * BL1 1 0
106 * BL2 31 30
107 * UBOOT 63 62
108 * TZSW 2111 2110
109 * ENV 2560 2560(part user)
110 *
111 * MBR Primary partiions:
112 * Num Name Size Offset
113 * 1. BOOT: 100MiB 2MiB
114 * 2. ROOT: -
115*/
116#define CONFIG_EXTRA_ENV_SETTINGS \
117 "loadkernel=fatload mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
118 "${kernelname}\0" \
119 "loadinitrd=fatload mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
120 "${initrdname}\0" \
121 "loaddtb=fatload mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \
122 "${fdtfile}\0" \
123 "check_ramdisk=" \
124 "if run loadinitrd; then " \
125 "setenv initrd_addr ${initrdaddr};" \
126 "else " \
127 "setenv initrd_addr -;" \
128 "fi;\0" \
129 "check_dtb=" \
130 "if run loaddtb; then " \
131 "setenv fdt_addr ${fdtaddr};" \
132 "else " \
133 "setenv fdt_addr;" \
134 "fi;\0" \
135 "kernel_args=" \
136 "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
137 " rootwait ${console} ${opts}\0" \
138 "boot_fit=" \
139 "setenv kerneladdr 0x42000000;" \
140 "setenv kernelname Image.itb;" \
141 "run loadkernel;" \
142 "run kernel_args;" \
143 "bootm ${kerneladdr}#${boardname}\0" \
144 "boot_uimg=" \
145 "setenv kerneladdr 0x40007FC0;" \
146 "setenv kernelname uImage;" \
147 "run check_dtb;" \
148 "run check_ramdisk;" \
149 "run loadkernel;" \
150 "run kernel_args;" \
151 "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
152 "boot_zimg=" \
153 "setenv kerneladdr 0x40007FC0;" \
154 "setenv kernelname zImage;" \
155 "run check_dtb;" \
156 "run check_ramdisk;" \
157 "run loadkernel;" \
158 "run kernel_args;" \
159 "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
160 "autoboot=" \
161 "if test -e mmc 0 Image.itb; then; " \
162 "run boot_fit;" \
163 "elif test -e mmc 0 zImage; then; " \
164 "run boot_zimg;" \
165 "elif test -e mmc 0 uImage; then; " \
166 "run boot_uimg;" \
167 "fi;\0" \
168 "console=" CONFIG_DEFAULT_CONSOLE \
169 "mmcbootdev=0\0" \
170 "mmcbootpart=1\0" \
171 "mmcrootdev=0\0" \
172 "mmcrootpart=2\0" \
173 "bootdelay=0\0" \
174 "dfu_alt_system="CONFIG_DFU_ALT \
175 "dfu_alt_info=Please reset the board\0" \
176 "consoleon=set console console=ttySAC1,115200n8; save; reset\0" \
177 "consoleoff=set console console=ram; save; reset\0" \
178 "initrdname=uInitrd\0" \
179 "initrdaddr=42000000\0" \
180 "fdtaddr=40800000\0"
181
182/* I2C */
183#define CONFIG_CMD_I2C
184#define CONFIG_SYS_I2C
185#define CONFIG_SYS_I2C_S3C24X0
186#define CONFIG_SYS_I2C_S3C24X0_SPEED 100000
187#define CONFIG_SYS_I2C_S3C24X0_SLAVE 0
188#define CONFIG_MAX_I2C_NUM 8
189#define CONFIG_SYS_I2C_INIT_BOARD
190
191/* POWER */
192#define CONFIG_POWER
193#define CONFIG_POWER_I2C
194#define CONFIG_POWER_MAX77686
195
196/* GPT */
197#define CONFIG_RANDOM_UUID
198
199/* Security subsystem - enable hw_rand() */
200#define CONFIG_EXYNOS_ACE_SHA
201#define CONFIG_LIB_HW_RAND
202
203#define CONFIG_CMD_GPIO
204
205/*
206 * Supported Odroid boards: X3, U3
207 * TODO: Add Odroid X support
208 */
209#define CONFIG_MISC_COMMON
210#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
211#define CONFIG_BOARD_TYPES
212#define CONFIG_MISC_INIT_R
213
214#undef CONFIG_REVISION_TAG
215
216#endif /* __CONFIG_H */