Merge branch 'master' of git://git.denx.de/u-boot-sh
[oweals/u-boot.git] / include / configs / platinum.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2014, Barco (www.barco.com)
4  */
5
6 #ifndef __PLATINUM_CONFIG_H__
7 #define __PLATINUM_CONFIG_H__
8
9 /* SPL */
10
11 /* Location in NAND to read U-Boot from */
12 #define CONFIG_SYS_NAND_U_BOOT_OFFS     (14 * 1024 * 1024)
13
14 #include "imx6_spl.h"                  /* common IMX6 SPL configuration */
15 #include "mx6_common.h"
16
17 /*
18  * Hardware configuration
19  */
20
21 /* UART config */
22 #define CONFIG_MXC_UART
23 #define CONFIG_MXC_UART_BASE                    UART1_BASE
24
25 /* I2C config */
26 #define CONFIG_SYS_I2C
27 #define CONFIG_SYS_I2C_MXC
28 #define CONFIG_SYS_I2C_MXC_I2C1         /* enable I2C bus 1 */
29 #define CONFIG_SYS_I2C_MXC_I2C2         /* enable I2C bus 2 */
30 #define CONFIG_SYS_I2C_MXC_I2C3         /* enable I2C bus 3 */
31 #define CONFIG_SYS_I2C_SPEED                    100000
32
33 /* MMC config */
34 #define CONFIG_SYS_FSL_ESDHC_ADDR               0
35 #define CONFIG_SYS_FSL_USDHC_NUM                1
36
37 /* Ethernet config */
38 #define CONFIG_FEC_MXC
39 #define CONFIG_MII
40 #define IMX_FEC_BASE                            ENET_BASE_ADDR
41
42 /* USB config */
43 #define CONFIG_MXC_USB_PORT                     1
44 #define CONFIG_MXC_USB_PORTSC                   (PORT_PTS_UTMI | PORT_PTS_PTW)
45 #define CONFIG_MXC_USB_FLAGS                    0
46
47 /* Memory config */
48 #define PHYS_SDRAM                              MMDC0_ARB_BASE_ADDR
49 #ifndef PHYS_SDRAM_SIZE
50 #define PHYS_SDRAM_SIZE                         (1024 << 20)
51 #endif
52
53 #define CONFIG_SYS_SDRAM_BASE                   PHYS_SDRAM
54 #define CONFIG_SYS_INIT_RAM_ADDR                IRAM_BASE_ADDR
55 #define CONFIG_SYS_INIT_RAM_SIZE                IRAM_SIZE
56
57 #define CONFIG_SYS_INIT_SP_OFFSET               (CONFIG_SYS_INIT_RAM_SIZE - \
58                                                  GENERATED_GBL_DATA_SIZE)
59 #define CONFIG_SYS_INIT_SP_ADDR                 (CONFIG_SYS_INIT_RAM_ADDR + \
60                                                  CONFIG_SYS_INIT_SP_OFFSET)
61
62 #define CONFIG_SYS_MALLOC_LEN                   (16 * 1024 * 1024)
63
64 #ifdef CONFIG_CMD_NAND
65
66 /* NAND config */
67 #ifndef CONFIG_SYS_NAND_MAX_CHIPS
68 #define CONFIG_SYS_NAND_MAX_CHIPS               2
69 #endif
70 #define CONFIG_SYS_MAX_NAND_DEVICE              1
71 #define CONFIG_SYS_NAND_BASE                    0x40000000
72 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
73 #define CONFIG_SYS_NAND_ONFI_DETECTION
74
75 /* DMA config, needed for GPMI/MXS NAND support */
76
77 /* Environment in NAND */
78 #define CONFIG_ENV_OFFSET               (16 << 20)
79 #define CONFIG_ENV_SECT_SIZE            (128 << 10)
80 #define CONFIG_ENV_SIZE                 CONFIG_ENV_SECT_SIZE
81 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + (512 << 10))
82 #define CONFIG_ENV_SIZE_REDUND          CONFIG_ENV_SIZE
83
84 #else /* CONFIG_CMD_NAND */
85
86 /* Environment in MMC */
87 #define CONFIG_ENV_SIZE                 (8 << 10)
88 #define CONFIG_ENV_OFFSET               (6 * 64 * 1024)
89 #define CONFIG_SYS_MMC_ENV_DEV          0
90
91 #endif /* CONFIG_CMD_NAND */
92
93 /*
94  * U-Boot configuration
95  */
96
97 /* Board startup config */
98 #define CONFIG_MISC_INIT_R
99
100 #define CONFIG_SYS_MEMTEST_START                PHYS_SDRAM
101 #define CONFIG_SYS_MEMTEST_END                  (CONFIG_SYS_MEMTEST_START + \
102                                                  PHYS_SDRAM_SIZE - (12 << 20))
103
104 #define CONFIG_BOOTCOMMAND                      "run bootubi_scr"
105
106 /* Miscellaneous configurable options */
107 #define CONFIG_PREBOOT
108
109 /* MTD/UBI/UBIFS config */
110
111 /*
112  * Environment configuration
113  */
114
115 #if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
116 #define CONFIG_COMMON_ENV_UBI                                           \
117         "setubipartition=env set ubipartition ubi\0"                    \
118         "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0"
119 #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
120 #define CONFIG_COMMON_ENV_UBI                                           \
121         "setubipartition=env set ubipartition ubi$boot_vol\0"           \
122         "setubirfs=env set ubirfs ubi0:rootfs\0"
123 #endif
124
125 #define CONFIG_COMMON_ENV_MISC                                          \
126         "user=user\0"                                                   \
127         "project="CONFIG_PLATINUM_PROJECT"\0"                           \
128         "uimage=uImage\0"                                               \
129         "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \
130         "serverip=serverip\0"                                           \
131         "memaddrlinux=0x10800000\0"                                     \
132         "memaddrsrc=0x11000000\0"                                       \
133         "memaddrdtb=0x12000000\0"                                       \
134         "console=ttymxc0\0"                                             \
135         "baudrate=115200\0"                                             \
136         "boot_scr=boot.uboot\0"                                         \
137         "boot_vol=0\0"                                                  \
138         "mtdids="CONFIG_MTDIDS_DEFAULT"\0"                                      \
139         "mtdparts="CONFIG_MTDPARTS_DEFAULT"\0"                                  \
140         "mmcfs=ext2\0"                                                  \
141         "mmcrootpart=1\0"                                               \
142         \
143         "setnfspath=env set nfspath /home/nfs/$user/$project/root\0"    \
144         "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \
145         "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0"      \
146         "setubifilelinux=env set ubifilelinux boot/$uimage\0"           \
147         "setubipfiledtb=env set ubifiledtb boot/$dtb\0"                 \
148         "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0"  \
149         "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0"          \
150         "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0"                 \
151         \
152         "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0"            \
153         "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0"                   \
154         "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0"         \
155         "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0"                \
156         "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux "  \
157                 "$mmcfilelinux\0"                                       \
158         "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb "       \
159                 "$mmcfiledtb\0"                                         \
160         \
161         "ubipart=ubi part $ubipartition\0"                              \
162         "ubimount=ubifsmount $ubirfs\0"                                 \
163         \
164         "setbootargscommon=env set bootargs $bootargs "                 \
165                 "console=$console,$baudrate enable_wait_mode=off\0"     \
166         "setbootargsmtd=env set bootargs $bootargs $mtdparts\0"         \
167         "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0"          \
168         "setbootargsubirfs=env set bootargs $bootargs "                 \
169                 "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \
170         "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs "   \
171                 "nfsroot=$serverip:$nfspath,v3,tcp\0"                   \
172         "setbootargsmmcrfs=env set bootargs $bootargs "                 \
173                 "root=$mmcrootdev rootwait rw\0"                        \
174         \
175         "bootnet=run settftpfilelinux settftpfiledtb setnfspath "       \
176                 "setbootargscommon setbootargsmtd setbootargsdhcp "     \
177                         "setbootargsnfsrfs;"                            \
178                         "run loadtftpkernel loadtftpdtb;"               \
179                         "bootm $memaddrlinux - $memaddrdtb\0"           \
180         "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;"           \
181                         "run setubipartition setubirfs;"                \
182                         "run setbootargscommon setbootargsmtd "         \
183                                 "setbootargsubirfs;"                    \
184                         "run loadtftpkernel loadtftpdtb;"               \
185                         "bootm $memaddrlinux - $memaddrdtb\0"           \
186         "bootubi=run setubipartition setubirfs setubifilelinux "        \
187                                 "setubipfiledtb;"                       \
188                         "run setbootargscommon setbootargsmtd "         \
189                                 "setbootargsubirfs;"                    \
190                         "run ubipart ubimount loadubikernel loadubidtb;" \
191                         "bootm $memaddrlinux - $memaddrdtb\0"           \
192         "bootubi_scr=run setubipartition setubirfs;"                    \
193                         "run ubipart ubimount;"                         \
194                         "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \
195                         "then source ${memaddrsrc}; else run bootubi; fi\0" \
196         "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb "      \
197                         "setbootargscommon setbootargsmmcrfs;"          \
198                         "run loadmmckernel loadmmcdtb;"                 \
199                         "bootm $memaddrlinux - $memaddrdtb\0"           \
200         \
201         "bootcmd="CONFIG_BOOTCOMMAND"\0"
202
203 #define CONFIG_COMMON_ENV_SETTINGS                      CONFIG_COMMON_ENV_MISC \
204                                                         CONFIG_COMMON_ENV_UBI
205 #endif /* __PLATINUM_CONFIG_H__ */