ARM: imx: config: Disable support for USB on MCCMON6
[oweals/u-boot.git] / include / configs / mccmon6.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2016-2017
4  * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
5  */
6
7 #ifndef __CONFIG_H
8 #define __CONFIG_H
9
10 #include "mx6_common.h"
11
12 #define CONFIG_SPL_LIBCOMMON_SUPPORT
13 #include "imx6_spl.h"
14
15 #define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
16 #define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + 0x80000)
17 #define CONFIG_SPL_OS_BOOT
18 #define CONFIG_SYS_OS_BASE (CONFIG_SYS_FLASH_BASE + 0x180000)
19 #define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + 0x1980000)
20 #define CONFIG_SYS_FDT_SIZE (48 * SZ_1K)
21 #define CONFIG_SYS_SPL_ARGS_ADDR        0x18000000
22
23 /*
24  * Below defines are set but NOT really used since we by
25  * design force U-Boot run when we boot in development
26  * mode from SD card (SD2)
27  */
28 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (0x800)
29 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (0x80)
30 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR (0x1000)
31 #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
32 #define CONFIG_SPL_FS_LOAD_ARGS_NAME "imx6q-mccmon.dtb"
33
34 /* Size of malloc() pool */
35 #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M)
36
37 #define CONFIG_BOARD_EARLY_INIT_F
38 #define CONFIG_BOARD_LATE_INIT
39
40 #define CONFIG_MXC_UART
41 #define CONFIG_MXC_UART_BASE            UART1_BASE
42
43 #define CONFIG_SYS_MEMTEST_START        0x10000000
44 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
45
46 /* I2C Configs */
47 #define CONFIG_SYS_I2C
48 #define CONFIG_SYS_I2C_MXC
49 #define CONFIG_SYS_I2C_MXC_I2C1         /* enable I2C bus 1 */
50 #define CONFIG_SYS_I2C_MXC_I2C2         /* enable I2C bus 2 */
51 #define CONFIG_SYS_I2C_SPEED            100000
52
53 /* MMC Configuration */
54 #define CONFIG_SYS_FSL_USDHC_NUM        2
55 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
56
57 /* NOR 16-bit mode */
58 #define CONFIG_SYS_FLASH_BASE           WEIM_ARB_BASE_ADDR
59 #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
60 #define CONFIG_SYS_FLASH_EMPTY_INFO
61 #define CONFIG_FLASH_VERIFY
62
63 /* NOR Flash MTD */
64 #define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
65 #define CONFIG_SYS_FLASH_BANKS_LIST     { (CONFIG_SYS_FLASH_BASE) }
66 #define CONFIG_SYS_FLASH_BANKS_SIZES    { (32 * SZ_1M) }
67
68 /* Ethernet Configuration */
69 #define CONFIG_FEC_MXC
70 #define IMX_FEC_BASE                    ENET_BASE_ADDR
71 #define CONFIG_FEC_XCV_TYPE             RGMII
72 #define CONFIG_ETHPRIME                 "FEC"
73 #define CONFIG_FEC_MXC_PHYADDR          1
74
75 #define CONFIG_EXTRA_ENV_SETTINGS \
76         "console=ttymxc0,115200 quiet\0" \
77         "fdtfile=imx6q-mccmon6.dtb\0" \
78         "fdt_high=0xffffffff\0" \
79         "initrd_high=0xffffffff\0" \
80         "boot_os=yes\0" \
81         "download_kernel=" \
82                 "tftpboot ${kernel_addr} ${kernel_file};" \
83                 "tftpboot ${fdt_addr} ${fdtfile};\0" \
84         "get_boot_medium=" \
85                 "setenv boot_medium nor;" \
86                 "setexpr.l _src_sbmr1 *0x020d8004;" \
87                 "setexpr _b_medium ${_src_sbmr1} '&' 0x00000040;" \
88                 "if test ${_b_medium} = 40; then " \
89                         "setenv boot_medium sdcard;" \
90                 "fi\0" \
91         "kernel_file=uImage\0" \
92         "load_kernel=" \
93                 "load mmc ${bootdev}:${bootpart} ${kernel_addr} uImage;" \
94                 "load mmc ${bootdev}:${bootpart} ${fdt_addr} ${fdtfile};\0" \
95         "boot_sd=" \
96                 "echo '#######################';" \
97                 "echo '# Factory SDcard Boot #';" \
98                 "echo '#######################';" \
99                 "setenv mmcdev 1;" \
100                 "setenv mmcfactorydev 0;" \
101                 "setenv mmcfactorypart 1;" \
102                 "run factory_flash_img;\0" \
103         "boot_nor=" \
104                 "setenv kernelnor 0x08180000;" \
105                 "setenv dtbnor 0x09980000;" \
106                 "setenv bootargs console=${console} " \
107                 CONFIG_MTDPARTS_DEFAULT " " \
108                 "root=/dev/mmcblk1 rootfstype=ext4 rw rootwait noinitrd;" \
109                 "cp.l ${dtbnor} ${dtbloadaddr} 0x8000;" \
110                 "bootm ${kernelnor} - ${dtbloadaddr};\0" \
111         "boot_recovery=" \
112                 "echo '#######################';" \
113                 "echo '# RECOVERY SWU Boot   #';" \
114                 "echo '#######################';" \
115                 "setenv rootfsloadaddr 0x13000000;" \
116                 "setenv swukernelnor 0x08980000;" \
117                 "setenv swurootfsnor 0x09180000;" \
118                 "setenv swudtbnor 0x099A0000;" \
119                 "setenv bootargs console=${console} " \
120                 CONFIG_MTDPARTS_DEFAULT " " \
121                 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
122                     ":${hostname}::off root=/dev/ram rw;" \
123                 "cp.l ${swurootfsnor} ${rootfsloadaddr} 0x200000;" \
124                 "cp.l ${swudtbnor} ${dtbloadaddr} 0x8000;" \
125                 "bootm ${swukernelnor} ${rootfsloadaddr} ${dtbloadaddr};\0" \
126         "boot_tftp=" \
127                 "echo '#######################';" \
128                 "echo '# TFTP Boot           #';" \
129                 "echo '#######################';" \
130                 "if run download_kernel; then " \
131                      "setenv bootargs console=${console} " \
132                      "root=/dev/mmcblk0p2 rootwait;" \
133                      "bootm ${kernel_addr} - ${fdt_addr};" \
134                 "fi\0" \
135         "bootcmd=" \
136                 "if test -n ${recovery_status}; then " \
137                      "run boot_recovery;" \
138                 "else " \
139                      "if test ! -n ${boot_medium}; then " \
140                           "run get_boot_medium;" \
141                           "if test ${boot_medium} = sdcard; then " \
142                               "run boot_sd;" \
143                           "else " \
144                               "run boot_nor;" \
145                           "fi;" \
146                      "else " \
147                           "if test ${boot_medium} = tftp; then " \
148                               "run boot_tftp;" \
149                           "fi;" \
150                      "fi;" \
151                 "fi\0" \
152         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
153         "fdt_addr=0x18000000\0" \
154         "bootdev=1\0" \
155         "bootpart=1\0" \
156         "kernel_addr=" __stringify(CONFIG_LOADADDR) "\0" \
157         "netdev=eth0\0" \
158         "load_addr=0x11000000\0" \
159         "dtbloadaddr=0x12000000\0" \
160         "uboot_file=u-boot.img\0" \
161         "SPL_file=SPL\0" \
162         "load_uboot=tftp ${load_addr} ${uboot_file}\0" \
163         "nor_img_addr=0x11000000\0" \
164         "nor_img_file=core-image-lwn-mccmon6.nor\0" \
165         "emmc_img_file=core-image-lwn-mccmon6.ext4\0" \
166         "nor_bank_start=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \
167         "nor_img_size=0x02000000\0" \
168         "factory_script_file=factory.scr\0" \
169         "factory_load_script=" \
170                 "if test -e mmc ${mmcdev}:${mmcfactorypart} " \
171                     "${factory_script_file}; then " \
172                     "load mmc ${mmcdev}:${mmcfactorypart} " \
173                      "${loadaddr} ${factory_script_file};" \
174                 "fi\0" \
175         "factory_script=echo Running factory script from mmc${mmcdev} ...; " \
176                 "source ${loadaddr}\0" \
177         "factory_flash_img="\
178                 "echo 'Flash mccmon6 with factory images'; " \
179                 "if run factory_load_script; then " \
180                         "run factory_script;" \
181                 "else " \
182                     "echo No factory script: ${factory_script_file} found on " \
183                     "device ${mmcdev};" \
184                     "run factory_nor_img;" \
185                     "run factory_eMMC_img;" \
186                 "fi\0" \
187         "factory_eMMC_img="\
188                 "echo 'Update mccmon6 eMMC image'; " \
189                 "if load mmc ${mmcdev}:${mmcfactorypart} " \
190                     "${loadaddr} ${emmc_img_file}; then " \
191                     "setexpr fw_sz ${filesize} / 0x200;" \
192                     "setexpr fw_sz ${fw_sz} + 1;" \
193                     "mmc dev ${mmcfactorydev};" \
194                     "mmc write ${loadaddr} 0x0 ${fw_sz};" \
195                 "fi\0" \
196         "factory_nor_img="\
197                 "echo 'Update mccmon6 NOR image'; " \
198                 "if load mmc ${mmcdev}:${mmcfactorypart} " \
199                     "${nor_img_addr} ${nor_img_file}; then " \
200                         "run nor_update;" \
201                 "fi\0" \
202         "nor_update=" \
203                     "protect off ${nor_bank_start} +${nor_img_size};" \
204                     "erase ${nor_bank_start} +${nor_img_size};" \
205                     "setexpr nor_img_size ${nor_img_size} / 4; " \
206                     "cp.l ${nor_img_addr} ${nor_bank_start} ${nor_img_size}\0" \
207         "tftp_nor_uboot="\
208                 "echo 'Update mccmon6 NOR U-BOOT via TFTP'; " \
209                 "setenv nor_img_file u-boot.img; " \
210                 "setenv nor_img_size 0x80000; " \
211                 "setenv nor_bank_start 0x08080000; " \
212                 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
213                     "run nor_update;" \
214                 "fi\0" \
215         "tftp_nor_uImg="\
216                 "echo 'Update mccmon6 NOR uImage via TFTP'; " \
217                 "setenv nor_img_file uImage; " \
218                 "setenv nor_img_size 0x500000; " \
219                 "setenv nor_bank_start 0x08180000; " \
220                 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
221                     "run nor_update;" \
222                 "fi\0" \
223         "tftp_nor_dtb="\
224                 "echo 'Update mccmon6 NOR DTB via TFTP'; " \
225                 "setenv nor_img_file imx6q-mccmon6.dtb; " \
226                 "setenv nor_img_size 0x20000; " \
227                 "setenv nor_bank_start 0x09980000; " \
228                 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
229                     "run nor_update;" \
230                 "fi\0" \
231         "tftp_nor_img="\
232                 "echo 'Update mccmon6 NOR image via TFTP'; " \
233                 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
234                     "run nor_update;" \
235                 "fi\0" \
236         "tftp_nor_SPL="\
237                 "if tftp ${load_addr} SPL_padded; then " \
238                     "erase 0x08000000 +0x20000;" \
239                     "cp.b ${load_addr} 0x08000000 0x20000;" \
240                 "fi;\0" \
241         "tftp_sd_SPL="\
242             "if mmc dev 1; then "      \
243                 "if tftp ${load_addr} ${SPL_file}; then " \
244                     "setexpr fw_sz ${filesize} / 0x200; " \
245                     "setexpr fw_sz ${fw_sz} + 1; " \
246                     "mmc write ${load_addr} 0x2 ${fw_sz};" \
247                 "fi;" \
248             "fi;\0" \
249         "tftp_sd_uboot="\
250             "if mmc dev 1; then "      \
251                 "if run load_uboot; then " \
252                     "setexpr fw_sz ${filesize} / 0x200; " \
253                     "setexpr fw_sz ${fw_sz} + 1; " \
254                     "mmc write ${load_addr} 0x8A ${fw_sz};" \
255                 "fi;" \
256             "fi;\0"
257
258 /* Physical Memory Map */
259 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
260
261 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
262 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
263 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
264
265 #define CONFIG_SYS_INIT_SP_OFFSET \
266         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
267 #define CONFIG_SYS_INIT_SP_ADDR \
268         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
269
270 /* Environment organization */
271 #define CONFIG_ENV_SIZE                 (SZ_128K)
272
273 /* Envs are stored in NOR flash */
274 #define CONFIG_ENV_SECT_SIZE    (SZ_128K)
275 #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x40000)
276
277 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
278 #define CONFIG_ENV_ADDR_REDUND  (CONFIG_SYS_FLASH_BASE + 0x60000)
279 #define CONFIG_ENV_SIZE_REDUND  CONFIG_ENV_SIZE
280
281 #endif                         /* __CONFIG_H * */