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