sunxi: Tune H3 DRAM PLL to improve lock time
[platform/kernel/u-boot.git] / include / configs / s5p_goni.h
1 /*
2  * Copyright (C) 2009 Samsung Electronics
3  * Minkyu Kang <mk7.kang@samsung.com>
4  * Kyungmin Park <kyungmin.park@samsung.com>
5  *
6  * Configuation settings for the SAMSUNG Universal (s5pc100) board.
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
10
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13
14 /* High Level Configuration Options */
15 #define CONFIG_SAMSUNG          1       /* in a SAMSUNG core */
16 #define CONFIG_S5P              1       /* which is in a S5P Family */
17 #define CONFIG_S5PC110          1       /* which is in a S5PC110 */
18 #define CONFIG_MACH_GONI        1       /* working with Goni */
19
20 #define CONFIG_SYS_CACHELINE_SIZE       64
21
22 #include <linux/sizes.h>
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 /* input clock of PLL: has 24MHz input clock at S5PC110 */
30 #define CONFIG_SYS_CLK_FREQ_C110        24000000
31
32 /* DRAM Base */
33 #define CONFIG_SYS_SDRAM_BASE           0x30000000
34
35 /* Text Base */
36 #define CONFIG_SYS_TEXT_BASE            0x34800000
37
38 #define CONFIG_SETUP_MEMORY_TAGS
39 #define CONFIG_CMDLINE_TAG
40 #define CONFIG_REVISION_TAG
41 #define CONFIG_INITRD_TAG
42 #define CONFIG_CMDLINE_EDITING
43
44 /* Size of malloc() pool before and after relocation */
45 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + (80 << 20))
46
47 /*
48  * select serial console configuration
49  */
50 #define CONFIG_SERIAL2                  1       /* use SERIAL2 */
51 #define CONFIG_BAUDRATE                 115200
52
53 /* MMC */
54 #define CONFIG_GENERIC_MMC
55 #define CONFIG_MMC
56 #define CONFIG_SDHCI
57 #define CONFIG_S5P_SDHCI
58 #define SDHCI_MAX_HOSTS         4
59
60 /* PWM */
61 #define CONFIG_PWM                      1
62
63 #define CONFIG_SYS_NO_FLASH             1
64
65 #define CONFIG_CMD_REGINFO
66 #define CONFIG_CMD_ONENAND
67 #define CONFIG_CMD_GPT
68
69 /* USB Composite download gadget - g_dnl */
70 #define CONFIG_USB_FUNCTION_DFU
71 #define CONFIG_DFU_MMC
72 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
73 #define DFU_DEFAULT_POLL_TIMEOUT 300
74
75 /* TIZEN THOR downloader support */
76 #define CONFIG_CMD_THOR_DOWNLOAD
77 #define CONFIG_USB_FUNCTION_THOR
78
79 /* USB Samsung's IDs */
80
81 #define CONFIG_G_DNL_THOR_VENDOR_NUM 0x04E8
82 #define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D
83 #define CONFIG_G_DNL_UMS_VENDOR_NUM 0x0525
84 #define CONFIG_G_DNL_UMS_PRODUCT_NUM 0xA4A5
85
86 /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
87 #define MTDIDS_DEFAULT          "onenand0=samsung-onenand"
88 #define MTDPARTS_DEFAULT        "mtdparts=samsung-onenand:1m(bootloader)"\
89                                 ",256k(params)"\
90                                 ",2816k(config)"\
91                                 ",8m(csa)"\
92                                 ",7m(kernel)"\
93                                 ",1m(log)"\
94                                 ",12m(modem)"\
95                                 ",60m(qboot)\0"
96
97 /* partitions definitions */
98 #define PARTS_CSA                       "csa-mmc"
99 #define PARTS_BOOTLOADER        "u-boot"
100 #define PARTS_BOOT                      "boot"
101 #define PARTS_ROOT                      "platform"
102 #define PARTS_DATA                      "data"
103 #define PARTS_CSC                       "csc"
104 #define PARTS_UMS                       "ums"
105
106 #define CONFIG_DFU_ALT \
107         "u-boot raw 0x80 0x400;" \
108         "uImage ext4 0 2;" \
109         "exynos3-goni.dtb ext4 0 2;" \
110         ""PARTS_ROOT" part 0 5\0"
111
112 #define PARTS_DEFAULT \
113         "uuid_disk=${uuid_gpt_disk};" \
114         "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
115         "name="PARTS_BOOTLOADER",size=60MiB," \
116         "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \
117         "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
118         "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
119         "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
120         "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \
121         "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
122
123 #define CONFIG_BOOTCOMMAND      "run mmcboot"
124
125 #define CONFIG_DEFAULT_CONSOLE  "console=ttySAC2,115200n8\0"
126
127 #define CONFIG_RAMDISK_BOOT     "root=/dev/ram0 rw rootfstype=ext4" \
128                 " ${console} ${meminfo}"
129
130 #define CONFIG_COMMON_BOOT      "${console} ${meminfo} ${mtdparts}"
131
132 #define CONFIG_BOOTARGS "root=/dev/mtdblock8 rootfstype=ext4 " \
133                         CONFIG_COMMON_BOOT
134
135 #define CONFIG_UPDATEB  "updateb=onenand erase 0x0 0x100000;" \
136                         " onenand write 0x32008000 0x0 0x100000\0"
137
138 #define CONFIG_MISC_COMMON
139 #define CONFIG_MISC_INIT_R
140
141 #define CONFIG_ENV_OVERWRITE
142 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
143 #define CONFIG_ENV_VARS_UBOOT_CONFIG
144 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
145 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
146         CONFIG_UPDATEB \
147         "updatek=" \
148                 "onenand erase 0xc00000 0x600000;" \
149                 "onenand write 0x31008000 0xc00000 0x600000\0" \
150         "updateu=" \
151                 "onenand erase 0x01560000 0x1eaa0000;" \
152                 "onenand write 0x32000000 0x1260000 0x8C0000\0" \
153         "bootk=" \
154                 "run loaduimage;" \
155                 "bootm 0x30007FC0\0" \
156         "flashboot=" \
157                 "set bootargs root=/dev/mtdblock${bootblock} " \
158                 "rootfstype=${rootfstype} ${opts} " \
159                 "${lcdinfo} " CONFIG_COMMON_BOOT "; run bootk\0" \
160         "ubifsboot=" \
161                 "set bootargs root=ubi0!rootfs rootfstype=ubifs " \
162                 "${opts} ${lcdinfo} " \
163                 CONFIG_COMMON_BOOT "; run bootk\0" \
164         "tftpboot=" \
165                 "set bootargs root=ubi0!rootfs rootfstype=ubifs " \
166                 "${opts} ${lcdinfo} " CONFIG_COMMON_BOOT \
167                 "; tftp 0x30007FC0 uImage; bootm 0x30007FC0\0" \
168         "ramboot=" \
169                 "set bootargs " CONFIG_RAMDISK_BOOT \
170                 "initrd=0x33000000,8M ramdisk=8192\0" \
171         "mmcboot=" \
172                 "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
173                 "rootfstype=${rootfstype} ${opts} ${lcdinfo} " \
174                 CONFIG_COMMON_BOOT "; run bootk\0" \
175         "boottrace=setenv opts initcall_debug; run bootcmd\0" \
176         "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
177         "verify=n\0" \
178         "rootfstype=ext4\0" \
179         "console=" CONFIG_DEFAULT_CONSOLE \
180         "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \
181         "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
182         "mmcdev=0\0" \
183         "mmcbootpart=2\0" \
184         "mmcrootpart=5\0" \
185         "partitions=" PARTS_DEFAULT \
186         "bootblock=9\0" \
187         "ubiblock=8\0" \
188         "ubi=enabled\0" \
189         "opts=always_resume=1\0" \
190         "dfu_alt_info=" CONFIG_DFU_ALT "\0"
191
192 #define CONFIG_SYS_LONGHELP             /* undef to save memory */
193 #define CONFIG_SYS_CBSIZE       256     /* Console I/O Buffer Size */
194 #define CONFIG_SYS_PBSIZE       384     /* Print Buffer Size */
195 #define CONFIG_SYS_MAXARGS      16      /* max number of command args */
196 /* Boot Argument Buffer Size */
197 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
198 /* memtest works on */
199 #define CONFIG_SYS_MEMTEST_START        CONFIG_SYS_SDRAM_BASE
200 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_SDRAM_BASE + 0x5000000)
201 #define CONFIG_SYS_LOAD_ADDR            (CONFIG_SYS_SDRAM_BASE + 0x4000000)
202
203 /* Goni has 3 banks of DRAM, but swap the bank */
204 #define CONFIG_NR_DRAM_BANKS    3
205 #define PHYS_SDRAM_1            CONFIG_SYS_SDRAM_BASE   /* OneDRAM Bank #0 */
206 #define PHYS_SDRAM_1_SIZE       (80 << 20)              /* 80 MB in Bank #0 */
207 #define PHYS_SDRAM_2            0x40000000              /* mDDR DMC1 Bank #1 */
208 #define PHYS_SDRAM_2_SIZE       (256 << 20)             /* 256 MB in Bank #1 */
209 #define PHYS_SDRAM_3            0x50000000              /* mDDR DMC2 Bank #2 */
210 #define PHYS_SDRAM_3_SIZE       (128 << 20)             /* 128 MB in Bank #2 */
211
212 #define CONFIG_SYS_MONITOR_BASE         0x00000000
213 #define CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* 256 KiB */
214
215 /* FLASH and environment organization */
216 #define CONFIG_MMC_DEFAULT_DEV  0
217 #define CONFIG_ENV_IS_IN_MMC
218 #define CONFIG_SYS_MMC_ENV_DEV          CONFIG_MMC_DEFAULT_DEV
219 #define CONFIG_ENV_SIZE                 4096
220 #define CONFIG_ENV_OFFSET               ((32 - 4) << 10) /* 32KiB - 4KiB */
221 #define CONFIG_ENV_OVERWRITE
222
223 #define CONFIG_USE_ONENAND_BOARD_INIT
224 #define CONFIG_SAMSUNG_ONENAND          1
225 #define CONFIG_SYS_ONENAND_BASE         0xB0000000
226
227 #define CONFIG_DOS_PARTITION            1
228
229 /* write support for filesystems */
230 #define CONFIG_FAT_WRITE
231 #define CONFIG_EXT4_WRITE
232
233 /* GPT */
234 #define CONFIG_EFI_PARTITION
235 #define CONFIG_PARTITION_UUIDS
236
237 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
238
239 #define CONFIG_SYS_CACHELINE_SIZE       64
240
241 #define CONFIG_POWER
242 #define CONFIG_POWER_I2C
243 #define CONFIG_POWER_MAX8998
244
245 #include <asm/arch/gpio.h>
246 /*
247  * I2C Settings
248  */
249 #define CONFIG_SOFT_I2C_GPIO_SCL S5PC110_GPIO_J43
250 #define CONFIG_SOFT_I2C_GPIO_SDA S5PC110_GPIO_J40
251
252 #define CONFIG_SYS_I2C
253 #define CONFIG_SYS_I2C_SOFT             /* I2C bit-banged */
254 #define CONFIG_SYS_I2C_SOFT_SPEED       50000
255 #define CONFIG_SYS_I2C_SOFT_SLAVE       0x7F
256 #define CONFIG_I2C_MULTI_BUS
257 #define CONFIG_SYS_I2C_INIT_BOARD
258
259 #define CONFIG_SYS_MAX_I2C_BUS  7
260 #define CONFIG_USB_GADGET_DWC2_OTG_PHY
261 #define CONFIG_USB_FUNCTION_MASS_STORAGE
262
263 #endif  /* __CONFIG_H */