blob: f9750da58055ef61a4fc893d187679a6431b71d3 [file] [log] [blame]
Peng Fanb72606c2022-07-26 16:41:10 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright 2022 NXP
4 */
5
6#ifndef __IMX93_EVK_H
7#define __IMX93_EVK_H
8
9#include <linux/sizes.h>
10#include <linux/stringify.h>
11#include <asm/arch/imx-regs.h>
12
13#define CONFIG_SYS_MONITOR_LEN SZ_512K
14#define CONFIG_SYS_UBOOT_BASE \
15 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
16
17#ifdef CONFIG_SPL_BUILD
18#define CONFIG_MALLOC_F_ADDR 0x204D0000
19#endif
20
21#ifdef CONFIG_DISTRO_DEFAULTS
22#define BOOT_TARGET_DEVICES(func) \
23 func(MMC, mmc, 0) \
24 func(MMC, mmc, 1) \
25
26#include <config_distro_bootcmd.h>
27#else
28#define BOOTENV
29#endif
30
31/* Initial environment variables */
32#define CONFIG_EXTRA_ENV_SETTINGS \
33 BOOTENV \
34 "scriptaddr=0x83500000\0" \
35 "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
36 "image=Image\0" \
37 "splashimage=0x90000000\0" \
38 "console=ttyLP0,115200 earlycon\0" \
39 "fdt_addr_r=0x83000000\0" \
40 "fdt_addr=0x83000000\0" \
41 "cntr_addr=0x98000000\0" \
42 "cntr_file=os_cntr_signed.bin\0" \
43 "boot_fit=no\0" \
44 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
45 "bootm_size=0x10000000\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 ${jh_clk} console=${console} 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_r} ${fdtfile}\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_r};\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_fit} = yes || test ${boot_fit} = try; then " \
69 "bootm ${loadaddr}; " \
70 "else " \
71 "if run loadfdt; then " \
72 "run boot_os; " \
73 "else " \
74 "echo WARN: Cannot load the DT; " \
75 "fi; " \
76 "fi;" \
77 "fi;\0" \
78 "netargs=setenv bootargs ${jh_clk} console=${console} " \
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_fit} = yes || test ${boot_fit} = try; then " \
98 "bootm ${loadaddr}; " \
99 "else " \
100 "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \
101 "run boot_os; " \
102 "else " \
103 "echo WARN: Cannot load the DT; " \
104 "fi; " \
105 "fi;" \
106 "fi;\0" \
107 "bsp_bootcmd=echo Running BSP bootcmd ...; " \
108 "mmc dev ${mmcdev}; if mmc rescan; then " \
109 "if run loadbootscript; then " \
110 "run bootscript; " \
111 "else " \
112 "if test ${sec_boot} = yes; then " \
113 "if run loadcntr; then " \
114 "run mmcboot; " \
115 "else run netboot; " \
116 "fi; " \
117 "else " \
118 "if run loadimage; then " \
119 "run mmcboot; " \
120 "else run netboot; " \
121 "fi; " \
122 "fi; " \
123 "fi; " \
124 "fi;"
125
126/* Link Definitions */
127
128#define CONFIG_SYS_INIT_RAM_ADDR 0x80000000
129#define CONFIG_SYS_INIT_RAM_SIZE 0x200000
130
131#define CONFIG_SYS_SDRAM_BASE 0x80000000
132#define PHYS_SDRAM 0x80000000
133#define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */
134
135#define CONFIG_SYS_FSL_USDHC_NUM 2
136
137/* Using ULP WDOG for reset */
138#define WDOG_BASE_ADDR WDG3_BASE_ADDR
139
140#if defined(CONFIG_CMD_NET)
Peng Fanb72606c2022-07-26 16:41:10 +0800141#define PHY_ANEG_TIMEOUT 20000
142#endif
143
144#endif