blob: 511f6c8d9bb6c8db2ebab1df7d30af672b571842 [file] [log] [blame]
Peng Fand0dd7392018-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 Glass1af3c7f2020-05-10 11:40:09 -060010#include <linux/stringify.h>
Peng Fand0dd7392018-10-18 14:28:37 +020011#include <asm/arch/imx-regs.h>
12
Peng Fan018e3fd2018-12-21 06:21:34 +000013#ifdef CONFIG_SPL_BUILD
Peng Fan018e3fd2018-12-21 06:21:34 +000014#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)
Peng Fan018e3fd2018-12-21 06:21:34 +000015
Peng Fan018e3fd2018-12-21 06:21:34 +000016#define CONFIG_SERIAL_LPUART_BASE 0x5a060000
Peng Fan018e3fd2018-12-21 06:21:34 +000017#define CONFIG_MALLOC_F_ADDR 0x00120000
18
19#define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE
20
Peng Fan018e3fd2018-12-21 06:21:34 +000021#endif
22
Peng Fan6dcc6ce2019-09-25 08:11:19 +000023#ifdef CONFIG_AHAB_BOOT
24#define AHAB_ENV "sec_boot=yes\0"
25#else
26#define AHAB_ENV "sec_boot=no\0"
27#endif
28
Peng Fand0dd7392018-10-18 14:28:37 +020029/* Initial environment variables */
30#define CONFIG_EXTRA_ENV_SETTINGS \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000031 AHAB_ENV \
Peng Fand0dd7392018-10-18 14:28:37 +020032 "script=boot.scr\0" \
33 "image=Image\0" \
34 "panel=NULL\0" \
Fabio Estevam10a8cc02020-02-17 15:17:01 -030035 "console=ttyLP0\0" \
Peng Fand0dd7392018-10-18 14:28:37 +020036 "fdt_addr=0x83000000\0" \
37 "fdt_high=0xffffffffffffffff\0" \
38 "boot_fdt=try\0" \
Peng Fana6c36f12020-05-05 20:28:45 +080039 "fdt_file=undefined\0" \
Peng Fand0dd7392018-10-18 14:28:37 +020040 "initrd_addr=0x83800000\0" \
41 "initrd_high=0xffffffffffffffff\0" \
42 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
Tom Rinide35b8f2021-12-11 14:55:52 -050043 "mmcpart=1\0" \
Peng Fanadfaa422022-04-15 12:23:41 +080044 "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
Peng Fand0dd7392018-10-18 14:28:37 +020045 "mmcautodetect=yes\0" \
Fabio Estevam10a8cc02020-02-17 15:17:01 -030046 "mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}\0 " \
Peng Fand0dd7392018-10-18 14:28:37 +020047 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
48 "bootscript=echo Running bootscript from mmc ...; " \
49 "source\0" \
50 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
51 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000052 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
53 "auth_os=auth_cntr ${cntr_addr}\0" \
54 "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \
Peng Fand0dd7392018-10-18 14:28:37 +020055 "mmcboot=echo Booting from mmc ...; " \
56 "run mmcargs; " \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000057 "if test ${sec_boot} = yes; then " \
58 "if run auth_os; then " \
59 "run boot_os; " \
Peng Fand0dd7392018-10-18 14:28:37 +020060 "else " \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000061 "echo ERR: failed to authenticate; " \
Peng Fand0dd7392018-10-18 14:28:37 +020062 "fi; " \
63 "else " \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000064 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
65 "if run loadfdt; then " \
66 "run boot_os; " \
67 "else " \
68 "echo WARN: Cannot load the DT; " \
69 "fi; " \
70 "else " \
71 "echo wait for boot; " \
72 "fi;" \
Peng Fand0dd7392018-10-18 14:28:37 +020073 "fi;\0" \
Fabio Estevam10a8cc02020-02-17 15:17:01 -030074 "netargs=setenv bootargs console=${console},${baudrate} " \
Peng Fand0dd7392018-10-18 14:28:37 +020075 "root=/dev/nfs " \
76 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
77 "netboot=echo Booting from net ...; " \
78 "run netargs; " \
79 "if test ${ip_dyn} = yes; then " \
80 "setenv get_cmd dhcp; " \
81 "else " \
82 "setenv get_cmd tftp; " \
83 "fi; " \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000084 "if test ${sec_boot} = yes; then " \
85 "${get_cmd} ${cntr_addr} ${cntr_file}; " \
86 "if run auth_os; then " \
87 "run boot_os; " \
Peng Fand0dd7392018-10-18 14:28:37 +020088 "else " \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000089 "echo ERR: failed to authenticate; " \
Peng Fand0dd7392018-10-18 14:28:37 +020090 "fi; " \
91 "else " \
Peng Fan6dcc6ce2019-09-25 08:11:19 +000092 "${get_cmd} ${loadaddr} ${image}; " \
93 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
94 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
95 "run boot_os; " \
96 "else " \
97 "echo WARN: Cannot load the DT; " \
98 "fi; " \
99 "else " \
100 "booti; " \
101 "fi;" \
Peng Fand0dd7392018-10-18 14:28:37 +0200102 "fi;\0"
103
Peng Fand0dd7392018-10-18 14:28:37 +0200104/* Link Definitions */
Peng Fand0dd7392018-10-18 14:28:37 +0200105
Peng Fand0dd7392018-10-18 14:28:37 +0200106/* Default environment is in SD */
Peng Fand0dd7392018-10-18 14:28:37 +0200107
Peng Fand0dd7392018-10-18 14:28:37 +0200108/* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
Peng Fand0dd7392018-10-18 14:28:37 +0200109
Peng Fand0dd7392018-10-18 14:28:37 +0200110#define CONFIG_SYS_SDRAM_BASE 0x80000000
111#define PHYS_SDRAM_1 0x80000000
112#define PHYS_SDRAM_2 0x880000000
113#define PHYS_SDRAM_1_SIZE 0x80000000 /* 2 GB */
114/* LPDDR4 board total DDR is 3GB */
115#define PHYS_SDRAM_2_SIZE 0x40000000 /* 1 GB */
116
Peng Fand0dd7392018-10-18 14:28:37 +0200117#ifndef CONFIG_DM_PCA953X
118#define CONFIG_PCA953X
Peng Fand0dd7392018-10-18 14:28:37 +0200119#endif
120
Anatolij Gustschin5c1c7c12019-10-21 17:31:53 +0200121/* Misc configuration */
Anatolij Gustschin5c1c7c12019-10-21 17:31:53 +0200122
Peng Fand0dd7392018-10-18 14:28:37 +0200123#endif /* __IMX8QXP_MEK_H */