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