blob: a6aabc7add7085f994dfa9f48e08ed8bda1d1e7b [file] [log] [blame]
Peng Fan702c6dc2018-10-18 14:28:37 +02001/* 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>
Simon Glassfb64e362020-05-10 11:40:09 -060010#include <linux/stringify.h>
Peng Fan702c6dc2018-10-18 14:28:37 +020011#include <asm/arch/imx-regs.h>
12
Peng Fan0b2236d2018-12-21 06:21:34 +000013#ifdef CONFIG_SPL_BUILD
Peng Fan0b2236d2018-12-21 06:21:34 +000014#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)
Peng Fan0b2236d2018-12-21 06:21:34 +000015
Peng Fan0b2236d2018-12-21 06:21:34 +000016#define CONFIG_SERIAL_LPUART_BASE 0x5a060000
Peng Fan0b2236d2018-12-21 06:21:34 +000017#define CONFIG_MALLOC_F_ADDR 0x00120000
18
19#define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE
20
21#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
Peng Fan0b2236d2018-12-21 06:21:34 +000022#endif
23
Peng Fan128f1892019-09-25 08:11:19 +000024#ifdef CONFIG_AHAB_BOOT
25#define AHAB_ENV "sec_boot=yes\0"
26#else
27#define AHAB_ENV "sec_boot=no\0"
28#endif
29
Peng Fan702c6dc2018-10-18 14:28:37 +020030/* Initial environment variables */
31#define CONFIG_EXTRA_ENV_SETTINGS \
Peng Fan128f1892019-09-25 08:11:19 +000032 AHAB_ENV \
Peng Fan702c6dc2018-10-18 14:28:37 +020033 "script=boot.scr\0" \
34 "image=Image\0" \
35 "panel=NULL\0" \
Fabio Estevam1f9ce1d2020-02-17 15:17:01 -030036 "console=ttyLP0\0" \
Peng Fan702c6dc2018-10-18 14:28:37 +020037 "fdt_addr=0x83000000\0" \
38 "fdt_high=0xffffffffffffffff\0" \
39 "boot_fdt=try\0" \
Peng Fane95219d2020-05-05 20:28:45 +080040 "fdt_file=undefined\0" \
Peng Fan702c6dc2018-10-18 14:28:37 +020041 "initrd_addr=0x83800000\0" \
42 "initrd_high=0xffffffffffffffff\0" \
43 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
Tom Rinib113bca2021-12-11 14:55:52 -050044 "mmcpart=1\0" \
Peng Fanbb4bb582022-04-15 12:23:41 +080045 "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
Peng Fan702c6dc2018-10-18 14:28:37 +020046 "mmcautodetect=yes\0" \
Fabio Estevam1f9ce1d2020-02-17 15:17:01 -030047 "mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}\0 " \
Peng Fan702c6dc2018-10-18 14:28:37 +020048 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
49 "bootscript=echo Running bootscript from mmc ...; " \
50 "source\0" \
51 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
52 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Peng Fan128f1892019-09-25 08:11:19 +000053 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
54 "auth_os=auth_cntr ${cntr_addr}\0" \
55 "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \
Peng Fan702c6dc2018-10-18 14:28:37 +020056 "mmcboot=echo Booting from mmc ...; " \
57 "run mmcargs; " \
Peng Fan128f1892019-09-25 08:11:19 +000058 "if test ${sec_boot} = yes; then " \
59 "if run auth_os; then " \
60 "run boot_os; " \
Peng Fan702c6dc2018-10-18 14:28:37 +020061 "else " \
Peng Fan128f1892019-09-25 08:11:19 +000062 "echo ERR: failed to authenticate; " \
Peng Fan702c6dc2018-10-18 14:28:37 +020063 "fi; " \
64 "else " \
Peng Fan128f1892019-09-25 08:11:19 +000065 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
66 "if run loadfdt; then " \
67 "run boot_os; " \
68 "else " \
69 "echo WARN: Cannot load the DT; " \
70 "fi; " \
71 "else " \
72 "echo wait for boot; " \
73 "fi;" \
Peng Fan702c6dc2018-10-18 14:28:37 +020074 "fi;\0" \
Fabio Estevam1f9ce1d2020-02-17 15:17:01 -030075 "netargs=setenv bootargs console=${console},${baudrate} " \
Peng Fan702c6dc2018-10-18 14:28:37 +020076 "root=/dev/nfs " \
77 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
78 "netboot=echo Booting from net ...; " \
79 "run netargs; " \
80 "if test ${ip_dyn} = yes; then " \
81 "setenv get_cmd dhcp; " \
82 "else " \
83 "setenv get_cmd tftp; " \
84 "fi; " \
Peng Fan128f1892019-09-25 08:11:19 +000085 "if test ${sec_boot} = yes; then " \
86 "${get_cmd} ${cntr_addr} ${cntr_file}; " \
87 "if run auth_os; then " \
88 "run boot_os; " \
Peng Fan702c6dc2018-10-18 14:28:37 +020089 "else " \
Peng Fan128f1892019-09-25 08:11:19 +000090 "echo ERR: failed to authenticate; " \
Peng Fan702c6dc2018-10-18 14:28:37 +020091 "fi; " \
92 "else " \
Peng Fan128f1892019-09-25 08:11:19 +000093 "${get_cmd} ${loadaddr} ${image}; " \
94 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
95 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
96 "run boot_os; " \
97 "else " \
98 "echo WARN: Cannot load the DT; " \
99 "fi; " \
100 "else " \
101 "booti; " \
102 "fi;" \
Peng Fan702c6dc2018-10-18 14:28:37 +0200103 "fi;\0"
104
Peng Fan702c6dc2018-10-18 14:28:37 +0200105/* Link Definitions */
Peng Fan702c6dc2018-10-18 14:28:37 +0200106
Peng Fan702c6dc2018-10-18 14:28:37 +0200107/* Default environment is in SD */
Peng Fan702c6dc2018-10-18 14:28:37 +0200108
Peng Fan702c6dc2018-10-18 14:28:37 +0200109/* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
Peng Fan702c6dc2018-10-18 14:28:37 +0200110
Peng Fan702c6dc2018-10-18 14:28:37 +0200111#define CONFIG_SYS_SDRAM_BASE 0x80000000
112#define PHYS_SDRAM_1 0x80000000
113#define PHYS_SDRAM_2 0x880000000
114#define PHYS_SDRAM_1_SIZE 0x80000000 /* 2 GB */
115/* LPDDR4 board total DDR is 3GB */
116#define PHYS_SDRAM_2_SIZE 0x40000000 /* 1 GB */
117
Peng Fan702c6dc2018-10-18 14:28:37 +0200118#ifndef CONFIG_DM_PCA953X
119#define CONFIG_PCA953X
Peng Fan702c6dc2018-10-18 14:28:37 +0200120#endif
121
Anatolij Gustschin1bfd6f42019-10-21 17:31:53 +0200122/* Misc configuration */
Anatolij Gustschin1bfd6f42019-10-21 17:31:53 +0200123
Peng Fan702c6dc2018-10-18 14:28:37 +0200124#endif /* __IMX8QXP_MEK_H */