blob: 2705587a0156ab1b01418dc490060cace8975bf0 [file] [log] [blame]
Peng Fan86a17972022-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
Tom Rini65cc0e22022-11-16 13:10:41 -050013#define CFG_SYS_UBOOT_BASE \
Peng Fan86a17972022-07-26 16:41:10 +080014 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
15
16#ifdef CONFIG_SPL_BUILD
Tom Rinidd5b58c2022-12-04 10:04:49 -050017#define CFG_MALLOC_F_ADDR 0x204D0000
Peng Fan86a17972022-07-26 16:41:10 +080018#endif
19
20#ifdef CONFIG_DISTRO_DEFAULTS
21#define BOOT_TARGET_DEVICES(func) \
22 func(MMC, mmc, 0) \
23 func(MMC, mmc, 1) \
24
25#include <config_distro_bootcmd.h>
26#else
27#define BOOTENV
28#endif
29
30/* Initial environment variables */
Tom Rini0613c362022-12-04 10:03:50 -050031#define CFG_EXTRA_ENV_SETTINGS \
Peng Fan86a17972022-07-26 16:41:10 +080032 BOOTENV \
33 "scriptaddr=0x83500000\0" \
34 "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
35 "image=Image\0" \
36 "splashimage=0x90000000\0" \
37 "console=ttyLP0,115200 earlycon\0" \
38 "fdt_addr_r=0x83000000\0" \
39 "fdt_addr=0x83000000\0" \
40 "cntr_addr=0x98000000\0" \
41 "cntr_file=os_cntr_signed.bin\0" \
42 "boot_fit=no\0" \
43 "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
44 "bootm_size=0x10000000\0" \
45 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
46 "mmcpart=1\0" \
47 "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
48 "mmcautodetect=yes\0" \
49 "mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}\0 " \
50 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
51 "bootscript=echo Running bootscript from mmc ...; " \
52 "source\0" \
53 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
54 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
55 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
56 "auth_os=auth_cntr ${cntr_addr}\0" \
57 "boot_os=booti ${loadaddr} - ${fdt_addr_r};\0" \
58 "mmcboot=echo Booting from mmc ...; " \
59 "run mmcargs; " \
60 "if test ${sec_boot} = yes; then " \
61 "if run auth_os; then " \
62 "run boot_os; " \
63 "else " \
64 "echo ERR: failed to authenticate; " \
65 "fi; " \
66 "else " \
67 "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
68 "bootm ${loadaddr}; " \
69 "else " \
70 "if run loadfdt; then " \
71 "run boot_os; " \
72 "else " \
73 "echo WARN: Cannot load the DT; " \
74 "fi; " \
75 "fi;" \
76 "fi;\0" \
77 "netargs=setenv bootargs ${jh_clk} console=${console} " \
78 "root=/dev/nfs " \
79 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
80 "netboot=echo Booting from net ...; " \
81 "run netargs; " \
82 "if test ${ip_dyn} = yes; then " \
83 "setenv get_cmd dhcp; " \
84 "else " \
85 "setenv get_cmd tftp; " \
86 "fi; " \
87 "if test ${sec_boot} = yes; then " \
88 "${get_cmd} ${cntr_addr} ${cntr_file}; " \
89 "if run auth_os; then " \
90 "run boot_os; " \
91 "else " \
92 "echo ERR: failed to authenticate; " \
93 "fi; " \
94 "else " \
95 "${get_cmd} ${loadaddr} ${image}; " \
96 "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
97 "bootm ${loadaddr}; " \
98 "else " \
99 "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \
100 "run boot_os; " \
101 "else " \
102 "echo WARN: Cannot load the DT; " \
103 "fi; " \
104 "fi;" \
105 "fi;\0" \
106 "bsp_bootcmd=echo Running BSP bootcmd ...; " \
107 "mmc dev ${mmcdev}; if mmc rescan; then " \
108 "if run loadbootscript; then " \
109 "run bootscript; " \
110 "else " \
111 "if test ${sec_boot} = yes; then " \
112 "if run loadcntr; then " \
113 "run mmcboot; " \
114 "else run netboot; " \
115 "fi; " \
116 "else " \
117 "if run loadimage; then " \
118 "run mmcboot; " \
119 "else run netboot; " \
120 "fi; " \
121 "fi; " \
122 "fi; " \
123 "fi;"
124
125/* Link Definitions */
126
Tom Rini65cc0e22022-11-16 13:10:41 -0500127#define CFG_SYS_INIT_RAM_ADDR 0x80000000
128#define CFG_SYS_INIT_RAM_SIZE 0x200000
Peng Fan86a17972022-07-26 16:41:10 +0800129
Tom Riniaa6e94d2022-11-16 13:10:37 -0500130#define CFG_SYS_SDRAM_BASE 0x80000000
Peng Fan86a17972022-07-26 16:41:10 +0800131#define PHYS_SDRAM 0x80000000
132#define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */
133
Peng Fan86a17972022-07-26 16:41:10 +0800134/* Using ULP WDOG for reset */
135#define WDOG_BASE_ADDR WDG3_BASE_ADDR
136
137#if defined(CONFIG_CMD_NET)
Peng Fan86a17972022-07-26 16:41:10 +0800138#define PHY_ANEG_TIMEOUT 20000
139#endif
140
141#endif