arm: Finish migration of CONFIG_MACH_TYPE
[platform/kernel/u-boot.git] / include / configs / aristainetos2.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2015
4  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5  *
6  * Based on:
7  * Copyright (C) 2012 Freescale Semiconductor, Inc.
8  *
9  * Configuration settings for the Freescale i.MX6DL aristainetos2 board.
10  */
11 #ifndef __ARISTAINETOS2_CONFIG_H
12 #define __ARISTAINETOS2_CONFIG_H
13
14 #define CONFIG_HOSTNAME         "aristainetos2"
15
16 #if (CONFIG_SYS_BOARD_VERSION == 5)
17 #define CONFIG_MXC_UART_BASE    UART2_BASE
18 #define CONSOLE_DEV     "ttymxc1"
19 #elif (CONFIG_SYS_BOARD_VERSION == 6)
20 #define CONFIG_MXC_UART_BASE    UART1_BASE
21 #define CONSOLE_DEV     "ttymxc0"
22 #endif
23
24 #define CONFIG_FEC_XCV_TYPE             RGMII
25
26 /* Framebuffer */
27 #define CONFIG_SYS_LDB_CLOCK    28341000
28
29 #include "mx6_common.h"
30
31 #define CONFIG_MMCROOT          "/dev/mmcblk0p1"
32
33 /* MMC Configs */
34 #define CONFIG_SYS_FSL_ESDHC_ADDR      USDHC1_BASE_ADDR
35
36 #define IMX_FEC_BASE                    ENET_BASE_ADDR
37 #define CONFIG_ETHPRIME                 "FEC"
38 #define CONFIG_FEC_MXC_PHYADDR          0
39
40 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
41
42 #ifdef CONFIG_IMX_HAB
43 #define HAB_EXTRA_SETTINGS \
44         "hab_check_addr=" \
45                 "if hab_auth_img ${check_addr} ${filesize} ; then " \
46                         "true;" \
47                 "else " \
48                         "echo \"HAB checks ${hab_check_filetype} " \
49                         "failed!\"; " \
50                         "false; " \
51                 "fi;\0" \
52         "hab_check_file_fit=" \
53                 "if env exists enable_hab_check && test " \
54                         "${enable_hab_check} -eq 1 ; then " \
55                         "setenv hab_check_filetype \"FIT file on SD card " \
56                         "or eMMC\";" \
57                         "env set check_addr ${fit_addr_r};" \
58                         "run hab_check_addr;" \
59                 "else " \
60                         "true; "\
61                 "fi;\0" \
62         "hab_check_file_bootscript=" \
63                 "if env exists enable_hab_check && test " \
64                         "${enable_hab_check} -eq 1 ; then " \
65                         "setenv hab_check_filetype \"Bootscript file\";" \
66                         "env set check_addr ${loadaddr};" \
67                         "run hab_check_addr;" \
68                 "else " \
69                         "true; "\
70                 "fi;\0" \
71         "hab_check_flash_fit=" \
72                 "if env exists enable_hab_check && test " \
73                         "${enable_hab_check} -eq 1 ; then " \
74                         "setenv hab_check_filetype \"FIT files on flash\";" \
75                         "env set check_addr ${fit_addr_r};" \
76                         "run hab_check_addr;" \
77                 "else " \
78                         "true; "\
79                 "fi;\0" \
80         "enable_hab_check=1\0"
81 #else
82 #define HAB_EXTRA_SETTINGS \
83         "hab_check_addr=echo HAB check addr always returns " \
84                 "true;true\0" \
85         "hab_check_file_fit=echo HAB check FIT file always returns " \
86                 "true;true\0" \
87         "hab_check_flash_fit=echo HAB check flash FIT always returns " \
88                 "true;true\0" \
89         "hab_check_file_bootscript=echo HAB check bootscript always " \
90                 "returns true;true\0" \
91         "enable_hab_check=0\0"
92 #endif
93
94 #if (CONFIG_SYS_BOARD_VERSION == 5)
95 #define EXTRA_ENV_BOARD_SETTINGS \
96         "dead=while true; do; " \
97                 "led led_red on; sleep 1;" \
98                 "led led_red off; sleep 1;" \
99         "done\0"
100 #elif (CONFIG_SYS_BOARD_VERSION == 6)
101 #define EXTRA_ENV_BOARD_SETTINGS \
102         "dead=while true; do; " \
103                 "led led_red on; led led_red2 on; sleep 1;" \
104                 "led led_red off; led led_red2 off;; sleep 1;" \
105         "done\0"
106 #endif
107
108 #define CONFIG_EXTRA_ENV_SETTINGS \
109         "disable_giga=yes\0" \
110         "usb_pgood_delay=2000\0" \
111         "nor_bootdelay=-2\0" \
112         "script=u-boot.scr\0" \
113         "loadaddr=0x12000000\0" \
114         "fit_addr_r=0x14000000\0" \
115         "uboot_sz=d0000\0" \
116         "panel=lb07wv8\0" \
117         "splashpos=m,m\0" \
118         "console=" CONSOLE_DEV "\0" \
119         "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
120         "mtdids=nor0=spi0.0\0" \
121         "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
122                 "-(ubi-nor)\0" \
123         "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
124         "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
125         "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
126         "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
127         "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
128         "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
129                 "bootmode=${bootmode} rng_core.default_quality=1000 " \
130                 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
131         "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
132         "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
133         "get_env=mw ${loadaddr} 0 0x20000;" \
134                 "mmc rescan;" \
135                 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
136                 "env import -t ${loadaddr}\0" \
137         "default_env=gpio set wp_spi_nor.gpio-hog;" \
138                 "sf probe;" \
139                 "sf protect unlock 0 0x1000000;" \
140                 "mw ${loadaddr} 0 0x20000;" \
141                 "env export -t ${loadaddr} serial# ethaddr " \
142                 "board_type panel;" \
143                 "env default -a;" \
144                 "env import -t ${loadaddr}\0" \
145         "loadbootscript=" \
146                 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
147                 "${script};\0" \
148         "loadbootscriptUSB=" \
149                 "ext4load usb 0 ${loadaddr} ${script};\0" \
150         "loadbootscriptUSBf=" \
151                 "fatload usb 0 ${loadaddr} ${script};\0" \
152         "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
153                 "source \0" \
154         "bootscript=echo Running bootscript from mmc ...; " \
155                 "source \0" \
156         "mmcpart=1\0" \
157         "mmcdev=0\0" \
158         "emmcpart=1\0" \
159         "emmcdev=1\0" \
160         "sysnum=1\0" \
161         "rescue_sysnum=0\0" \
162         "rreason=18\0" \
163         "mainboot=echo Booting from eMMC ...; " \
164                 "run mainargs addmtd addmisc;" \
165                 "run boot_board_type;" \
166                 "bootm ${fit_addr_r}\0" \
167         "mainargs=setenv bootargs console=${console},${baudrate} " \
168                 "root=${emmcroot} rootfstype=ext4\0 " \
169         "main_load_fit=run mk_fitfile_path; " \
170                 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
171                 "${fit_file}; " \
172                 "imi ${fit_addr_r}\0 " \
173         "rescue_load_fit=run mk_rescue_fitfile_path; " \
174                 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
175                 "${rescue_fit_file}; " \
176                 "imi ${fit_addr_r}\0" \
177         "main_load_pubkey=run mk_pubkey_path; " \
178                 "setenv hab_check_filetype \"PCR.pem\";" \
179                 "env set check_addr ${loadaddr};" \
180                 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
181                 "${pubkey}\0" \
182         "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
183                 "setenv hab_check_filetype \"PCR.pem\";" \
184                 "env set check_addr ${loadaddr};" \
185                 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
186                 "${pubkey}\0" \
187         "mainRargs=setenv bootargs console=${console},${baudrate} " \
188                 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
189         "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
190         "mmcargs=setenv bootargs console=${console},${baudrate} " \
191                 "root=${mmcroot}\0" \
192         "mmcRargs=setenv bootargs console=${console},${baudrate} " \
193                 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
194         "mmcboot=echo Booting from mmc ...; " \
195                 "run mmcargs addmtd addmisc;" \
196                 "run boot_board_type;" \
197                 "bootm ${fit_addr_r}\0" \
198         "mmc_load_fit=run mk_fitfile_path; " \
199                 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
200                 "${fit_file}\0" \
201                 "imi ${fit_addr_r}\0" \
202         "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
203                 "ext4load mmc ${mmcdev}:${mmcpart} " \
204                 "${fit_addr_r} ${rescue_fit_file}\0" \
205                 "imi ${fit_addr_r}\0" \
206         "mmc_load_uboot=run mk_uboot_path; " \
207                 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
208                 "${uboot}\0" \
209         "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
210                 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
211                 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
212                 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
213                 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
214                 "sf write ${loadaddr} 400 ${filesize};" \
215                 "sf read ${cmp_buf} 400 ${uboot_sz};" \
216                 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
217         "mmc_load_pubkey=run mk_pubkey_path; " \
218                 "setenv hab_check_filetype \"PCR.pem\";" \
219                 "env set check_addr ${loadaddr};" \
220                 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
221                 "${pubkey}\0" \
222         "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
223                 "setenv hab_check_filetype \"PCR.pem\";" \
224                 "env set check_addr ${loadaddr};" \
225                 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
226                 "${pubkey}\0" \
227         "rescueboot=echo Booting rescue system ...; " \
228                 "run addmtd addmisc;" \
229                 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
230                 "run boot_board_type;" \
231                 "if bootm ${fit_addr_r}; then ; " \
232                 "else " \
233                         "run dead; " \
234                 "fi; \0" \
235         "r_reason_syserr=setenv rescue_reason setenv bootargs " \
236                 "\\\\${bootargs} " \
237                 "rescueReason=$rreason\0 " \
238         "usb_load_fit=run mk_fitfile_path; " \
239                 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
240         "usb_load_fitf=run mk_fitfile_path; " \
241                 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
242         "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
243                 "ext4load usb 0 ${fit_addr_r} " \
244                 "${rescue_fit_file}\0" \
245         "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
246                 "fatload usb 0 ${fit_addr_r} " \
247                 "${rescue_fit_file}\0" \
248         "usb_load_pubkey=run mk_pubkey_path; " \
249                 "setenv hab_check_filetype \"PCR.pem\";" \
250                 "env set check_addr ${loadaddr};" \
251                 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
252         "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
253                 "setenv hab_check_filetype \"PCR.pem\";" \
254                 "env set check_addr ${loadaddr};" \
255                 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
256         "usb_load_pubkeyf=run mk_pubkey_path; " \
257                 "setenv hab_check_filetype \"PCR.pem\";" \
258                 "env set check_addr ${loadaddr};" \
259                 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
260         "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
261                 "setenv hab_check_filetype \"PCR.pem\";" \
262                 "env set check_addr ${loadaddr};" \
263                 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
264         "usbroot=/dev/sda1 rootwait rw\0" \
265         "usbboot=echo Booting from usb-stick ...; " \
266                 "run usbargs addmtd addmisc;" \
267                 "run boot_board_type;" \
268                 "bootm ${fit_addr_r}\0" \
269         "usbargs=setenv bootargs console=${console},${baudrate} " \
270                 "root=${usbroot}\0" \
271         "usbRargs=setenv bootargs console=${console},${baudrate} " \
272                 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
273         "mmc_rescue_boot=" \
274                 "run r_reason_syserr;" \
275                 "if run mmc_rescue_load_pubkey hab_check_addr " \
276                 "mmc_rescue_load_fit hab_check_file_fit; then " \
277                         "run mmcRargs; run rescueboot; " \
278                 "else " \
279                         "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
280                         "run dead; " \
281                 "fi;\0" \
282         "main_rescue_boot=" \
283                 "if run main_load_pubkey hab_check_addr " \
284                 "main_load_fit hab_check_flash_fit; then " \
285                         "if run mainboot; then ; " \
286                         "else " \
287                                 "run r_reason_syserr;" \
288                                 "if run rescue_load_pubkey hab_check_addr " \
289                                 "rescue_load_fit hab_check_file_fit; then " \
290                                         "run mainRargs; run rescueboot; " \
291                                 "else " \
292                                         "echo RESCUE SYSTEM BOOT FAILURE;" \
293                                         "run dead; " \
294                                 "fi; " \
295                         "fi; " \
296                 "else " \
297                         "run r_reason_syserr;" \
298                         "if run rescue_load_pubkey hab_check_addr " \
299                         "rescue_load_fit hab_check_file_fit; then " \
300                                 "run mainRargs; run rescueboot; " \
301                         "else " \
302                                 "echo RESCUE SYSTEM BOOT FAILURE;" \
303                                 "run dead; " \
304                         "fi; " \
305                 "fi;\0" \
306         "usb_mmc_rescue_boot=" \
307                 "usb start;" \
308                 "if usb storage; then " \
309                         "if run loadbootscriptUSB " \
310                                 "hab_check_file_bootscript;" \
311                                 "then run bootscriptUSB; " \
312                         "fi; " \
313                         "if run loadbootscriptUSBf " \
314                                 "hab_check_file_bootscript;" \
315                                 "then run bootscriptUSB; " \
316                         "fi; " \
317                         "if run usb_load_pubkey hab_check_addr " \
318                         "usb_load_fit hab_check_file_fit; then " \
319                                 "run usbboot; " \
320                         "fi; " \
321                         "if run usb_load_pubkeyf hab_check_addr " \
322                         "usb_load_fitf hab_check_file_fit; then " \
323                                 "run usbboot; " \
324                         "fi; "\
325                         "if run usb_rescue_load_pubkey hab_check_addr " \
326                         "usb_load_rescuefit hab_check_file_fit; then " \
327                                 "run r_reason_syserr usbRargs; run rescueboot;" \
328                         "fi; " \
329                         "if run usb_rescue_load_pubkeyf hab_check_addr " \
330                         "usb_load_rescuefitf hab_check_file_fit; then " \
331                                 "run r_reason_syserr usbRargs; run rescueboot;" \
332                         "fi; " \
333                         "run mmc_rescue_boot;" \
334                 "fi; "\
335                 "run mmc_rescue_boot;\0" \
336         "rescue_xload_boot=" \
337                 "run r_reason_syserr;" \
338                 "if test ${bootmode} -ne 0 ; then " \
339                         "mmc dev ${mmcdev};" \
340                         "if mmc rescan; then " \
341                                 "if run mmc_rescue_load_pubkey " \
342                                 "hab_check_addr " \
343                                 "mmc_rescue_load_fit " \
344                                 "hab_check_file_fit; then " \
345                                         "run mmcRargs; run rescueboot; " \
346                                 "else " \
347                                         "usb start;" \
348                                         "if usb storage; then " \
349                                                 "if run usb_rescue_load_pubkey " \
350                                                 "hab_check_addr " \
351                                                 "usb_load_rescuefit " \
352                                                 "hab_check_file_fit; then " \
353                                                         "run usbRargs; run rescueboot;" \
354                                                 "fi; " \
355                                                 "if run usb_rescue_load_pubkeyf " \
356                                                 "hab_check_addr " \
357                                                 "usb_load_rescuefitf " \
358                                                 "hab_check_file_fit; then " \
359                                                         "run usbRargs; run rescueboot;" \
360                                                 "fi; " \
361                                         "fi;" \
362                                 "fi;" \
363                                 "echo RESCUE SYSTEM ON SD OR " \
364                                         "USB BOOT FAILURE;" \
365                                 "run dead; " \
366                         "else " \
367                                 "usb start;" \
368                                 "if usb storage; then " \
369                                         "if run usb_rescue_load_pubkey " \
370                                         "hab_check_addr " \
371                                         "usb_load_rescuefit " \
372                                         "hab_check_file_fit; then " \
373                                                 "run usbRargs; run rescueboot;" \
374                                         "fi; " \
375                                         "if run usb_rescue_load_pubkeyf " \
376                                         "hab_check_addr " \
377                                         "usb_load_rescuefitf " \
378                                         "hab_check_file_fit; then " \
379                                                 "run usbRargs; run rescueboot;" \
380                                         "fi; " \
381                                 "fi;" \
382                                 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
383                                 "run dead; " \
384                         "fi; " \
385                 "else "\
386                         "if run rescue_load_pubkey hab_check_addr " \
387                         "rescue_load_fit hab_check_file_fit; then " \
388                                 "run mainRargs; run rescueboot; " \
389                         "else " \
390                                 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
391                                 "run dead; " \
392                         "fi; " \
393                 "fi;\0" \
394         "ari_boot=if test ${bootmode} -ne 0 ; then " \
395                 "mmc dev ${mmcdev};" \
396                 "if mmc rescan; then " \
397                         "if run loadbootscript hab_check_file_bootscript;" \
398                                 "then run bootscript; " \
399                         "fi; " \
400                         "if run mmc_load_pubkey hab_check_addr " \
401                         "mmc_load_fit hab_check_file_fit; then " \
402                                 "if run mmcboot; then ; " \
403                                 "else " \
404                                         "run mmc_rescue_boot;" \
405                                 "fi; " \
406                         "else " \
407                                 "run usb_mmc_rescue_boot;" \
408                         "fi; " \
409                 "else " \
410                         "run usb_mmc_rescue_boot;" \
411                 "fi; " \
412         "else "\
413                 "run main_rescue_boot;" \
414         "fi; \0"\
415         HAB_EXTRA_SETTINGS \
416         EXTRA_ENV_BOARD_SETTINGS
417
418 #define CONFIG_ARP_TIMEOUT              200UL
419
420 /* Physical Memory Map */
421 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
422
423 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
424 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
425 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
426
427 #define CONFIG_SYS_INIT_SP_OFFSET \
428         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
429 #define CONFIG_SYS_INIT_SP_ADDR \
430         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
431
432 #define CONFIG_SYS_FSL_USDHC_NUM        2
433
434 /* DMA stuff, needed for GPMI/MXS NAND support */
435
436 /* USB Configs */
437 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET        /* For OTG port */
438 #define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
439 #define CONFIG_MXC_USB_FLAGS    0
440
441 /* UBI support */
442
443 /* Framebuffer */
444 /* check this console not needed, after test remove it */
445 #define CONFIG_IMX_VIDEO_SKIP
446 #define CONFIG_VIDEO_LOGO
447 #define CONFIG_VIDEO_BMP_LOGO
448
449 #define CONFIG_IMX6_PWM_PER_CLK 66000000
450
451 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
452                 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
453
454 #endif                         /* __ARISTAINETOS2_CONFIG_H */