blob: 049d1d74345d62558e1b56e0f939f7e94292cf92 [file] [log] [blame]
Teresa Remmet82750c22020-08-21 09:55:53 +02001/* SPDX-License-Identifier: GPL-2.0-or-later
2 *
3 * Copyright (C) 2019-2020 PHYTEC Messtechnik GmbH
4 * Author: Teresa Remmet <t.remmet@phytec.de>
5 */
6
7#ifndef __PHYCORE_IMX8MM_H
8#define __PHYCORE_IMX8MM_H
9
10#include <linux/sizes.h>
11#include <linux/stringify.h>
12#include <asm/arch/imx-regs.h>
13
Teresa Remmet82750c22020-08-21 09:55:53 +020014#define CONFIG_SYS_MONITOR_LEN SZ_512K
Teresa Remmet82750c22020-08-21 09:55:53 +020015#define CONFIG_SYS_UBOOT_BASE \
16 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
17
18#ifdef CONFIG_SPL_BUILD
Teresa Remmet82750c22020-08-21 09:55:53 +020019/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
20#define CONFIG_MALLOC_F_ADDR 0x930000
21/* For RAW image gives a error info not panic */
Teresa Remmet82750c22020-08-21 09:55:53 +020022#endif
23
24#define CONFIG_EXTRA_ENV_SETTINGS \
25 "image=Image\0" \
26 "console=ttymxc2,115200\0" \
27 "fdt_addr=0x48000000\0" \
28 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
Teresa Remmet8698e472021-10-06 11:56:47 +020029 "ip_dyn=yes\0" \
Teresa Remmet82750c22020-08-21 09:55:53 +020030 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
Tom Rinib113bca2021-12-11 14:55:52 -050031 "mmcpart=1\0" \
Teresa Remmet82750c22020-08-21 09:55:53 +020032 "mmcroot=2\0" \
33 "mmcautodetect=yes\0" \
34 "mmcargs=setenv bootargs console=${console} " \
35 "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
36 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
37 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
38 "mmcboot=echo Booting from mmc ...; " \
39 "run mmcargs; " \
40 "if run loadfdt; then " \
41 "booti ${loadaddr} - ${fdt_addr}; " \
42 "else " \
43 "echo WARN: Cannot load the DT; " \
44 "fi;\0 " \
45 "nfsroot=/nfs\0" \
46 "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
47 "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
48 "netboot=echo Booting from net ...; " \
49 "run netargs; " \
50 "if test ${ip_dyn} = yes; then " \
51 "setenv get_cmd dhcp; " \
52 "else " \
53 "setenv get_cmd tftp; " \
54 "fi; " \
55 "${get_cmd} ${loadaddr} ${image}; " \
56 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
57 "booti ${loadaddr} - ${fdt_addr}; " \
58 "else " \
59 "echo WARN: Cannot load the DT; " \
60 "fi;\0" \
61
Teresa Remmet82750c22020-08-21 09:55:53 +020062/* Link Definitions */
Teresa Remmet82750c22020-08-21 09:55:53 +020063
64#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
65#define CONFIG_SYS_INIT_RAM_SIZE SZ_512K
Teresa Remmet82750c22020-08-21 09:55:53 +020066
Teresa Remmet82750c22020-08-21 09:55:53 +020067
Teresa Remmet82750c22020-08-21 09:55:53 +020068#define CONFIG_SYS_SDRAM_BASE 0x40000000
69
Teresa Remmetbdba9312021-10-06 11:56:49 +020070#define PHYS_SDRAM 0x40000000
Teresa Remmet82750c22020-08-21 09:55:53 +020071#define PHYS_SDRAM_SIZE SZ_2G /* 2GB DDR */
72
Teresa Remmet82750c22020-08-21 09:55:53 +020073#endif /* __PHYCORE_IMX8MM_H */