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