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