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