Convert CONFIG_SPL_STACK to Kconfig
[platform/kernel/u-boot.git] / include / configs / imx8qm_mek.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2018 NXP
4  */
5
6 #ifndef __IMX8QM_MEK_H
7 #define __IMX8QM_MEK_H
8
9 #include <linux/sizes.h>
10 #include <linux/stringify.h>
11 #include <asm/arch/imx-regs.h>
12
13 #define CONFIG_SYS_BOOTM_LEN            (64 * SZ_1M)
14
15 #ifdef CONFIG_SPL_BUILD
16 #define CONFIG_SYS_MONITOR_LEN                          (1024 * 1024)
17
18 #define CONFIG_SPL_BSS_START_ADDR       0x00128000
19 #define CONFIG_SYS_SPL_MALLOC_START     0x00120000
20 #define CONFIG_SYS_SPL_MALLOC_SIZE      0x3000  /* 12 KB */
21 #define CONFIG_SERIAL_LPUART_BASE       0x5a060000
22 #define CONFIG_MALLOC_F_ADDR            0x00120000
23
24 #define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE
25
26 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
27 #endif
28
29 #ifdef CONFIG_AHAB_BOOT
30 #define AHAB_ENV "sec_boot=yes\0"
31 #else
32 #define AHAB_ENV "sec_boot=no\0"
33 #endif
34
35 /* Initial environment variables */
36 #define CONFIG_EXTRA_ENV_SETTINGS               \
37         AHAB_ENV \
38         "script=boot.scr\0" \
39         "image=Image\0" \
40         "panel=NULL\0" \
41         "console=ttyLP0,${baudrate} earlycon=lpuart32,0x5a060000,${baudrate}\0" \
42         "fdt_addr=0x83000000\0"                 \
43         "fdt_high=0xffffffffffffffff\0"         \
44         "boot_fdt=try\0" \
45         "fdt_file=undefined\0" \
46         "initrd_addr=0x83800000\0"              \
47         "initrd_high=0xffffffffffffffff\0" \
48         "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
49         "mmcpart=1\0" \
50         "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
51         "mmcautodetect=yes\0" \
52         "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
53         "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
54         "bootscript=echo Running bootscript from mmc ...; " \
55                 "source\0" \
56         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
57         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
58         "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \
59         "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
60         "auth_os=auth_cntr ${cntr_addr}\0" \
61         "mmcboot=echo Booting from mmc ...; " \
62                 "run mmcargs; " \
63                 "if test ${sec_boot} = yes; then " \
64                         "if run auth_os; then " \
65                                 "run boot_os; " \
66                         "else " \
67                                 "echo ERR: failed to authenticate; " \
68                         "fi; " \
69                 "else " \
70                         "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
71                                 "if run loadfdt; then " \
72                                         "run boot_os; " \
73                                 "else " \
74                                         "echo WARN: Cannot load the DT; " \
75                                 "fi; " \
76                         "else " \
77                                 "echo wait for boot; " \
78                         "fi;" \
79                 "fi;\0" \
80         "netargs=setenv bootargs console=${console} " \
81                 "root=/dev/nfs " \
82                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
83         "netboot=echo Booting from net ...; " \
84                 "run netargs;  " \
85                 "if test ${ip_dyn} = yes; then " \
86                         "setenv get_cmd dhcp; " \
87                 "else " \
88                         "setenv get_cmd tftp; " \
89                 "fi; " \
90                 "if test ${sec_boot} = yes; then " \
91                         "${get_cmd} ${cntr_addr} ${cntr_file}; " \
92                         "if run auth_os; then " \
93                                 "run boot_os; " \
94                         "else " \
95                                 "echo ERR: failed to authenticate; " \
96                         "fi; " \
97                 "else " \
98                         "${get_cmd} ${loadaddr} ${image}; " \
99                         "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
100                                 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
101                                         "booti ${loadaddr} - ${fdt_addr}; " \
102                                 "else " \
103                                         "echo WARN: Cannot load the DT; " \
104                                 "fi; " \
105                         "else " \
106                                 "booti; " \
107                         "fi;" \
108                 "fi;\0"
109
110 /* Link Definitions */
111
112 /* Default environment is in SD */
113
114 /* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
115
116 #define CONFIG_SYS_SDRAM_BASE           0x80000000
117 #define PHYS_SDRAM_1                    0x80000000
118 #define PHYS_SDRAM_2                    0x880000000
119 #define PHYS_SDRAM_1_SIZE               0x80000000      /* 2 GB */
120 #define PHYS_SDRAM_2_SIZE               0x100000000     /* 4 GB */
121
122 #endif /* __IMX8QM_MEK_H */