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