blob: e74a3f184c6c9054d8bd10884375b9073819d8e1 [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
Tom Rini6a5dccc2022-11-16 13:10:41 -050014#define CFG_SYS_UBOOT_BASE \
Teresa Remmet82750c22020-08-21 09:55:53 +020015 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
16
Simon Glass209ae762024-09-29 19:49:49 -060017#ifdef CONFIG_XPL_BUILD
Teresa Remmet82750c22020-08-21 09:55:53 +020018/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
Tom Rinifb52b942022-12-04 10:04:49 -050019#define CFG_MALLOC_F_ADDR 0x930000
Teresa Remmet82750c22020-08-21 09:55:53 +020020/* For RAW image gives a error info not panic */
Teresa Remmet82750c22020-08-21 09:55:53 +020021#endif
22
Tom Rinic9edebe2022-12-04 10:03:50 -050023#define CFG_EXTRA_ENV_SETTINGS \
Teresa Remmet82750c22020-08-21 09:55:53 +020024 "image=Image\0" \
25 "console=ttymxc2,115200\0" \
26 "fdt_addr=0x48000000\0" \
27 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
Teresa Remmet8698e472021-10-06 11:56:47 +020028 "ip_dyn=yes\0" \
Teresa Remmet82750c22020-08-21 09:55:53 +020029 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
Tom Rinib113bca2021-12-11 14:55:52 -050030 "mmcpart=1\0" \
Teresa Remmet82750c22020-08-21 09:55:53 +020031 "mmcroot=2\0" \
Lukasz Majewskia8412292024-08-09 18:53:32 +020032 "update_offset=0x42\0" \
33 "update_filename=flash.bin\0" \
34 "update_bootimg=" \
35 "mmc dev ${mmcdev} ; " \
36 "if dhcp ${loadaddr} ${update_filepath}/${update_filename} ; then " \
37 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
38 "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \
39 "fi\0" \
Teresa Remmet82750c22020-08-21 09:55:53 +020040 "mmcautodetect=yes\0" \
41 "mmcargs=setenv bootargs console=${console} " \
42 "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
43 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
44 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
45 "mmcboot=echo Booting from mmc ...; " \
46 "run mmcargs; " \
47 "if run loadfdt; then " \
48 "booti ${loadaddr} - ${fdt_addr}; " \
49 "else " \
50 "echo WARN: Cannot load the DT; " \
51 "fi;\0 " \
52 "nfsroot=/nfs\0" \
53 "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
54 "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
55 "netboot=echo Booting from net ...; " \
56 "run netargs; " \
57 "if test ${ip_dyn} = yes; then " \
58 "setenv get_cmd dhcp; " \
59 "else " \
60 "setenv get_cmd tftp; " \
61 "fi; " \
62 "${get_cmd} ${loadaddr} ${image}; " \
63 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
64 "booti ${loadaddr} - ${fdt_addr}; " \
65 "else " \
66 "echo WARN: Cannot load the DT; " \
67 "fi;\0" \
68
Teresa Remmet82750c22020-08-21 09:55:53 +020069/* Link Definitions */
Teresa Remmet82750c22020-08-21 09:55:53 +020070
Tom Rini6a5dccc2022-11-16 13:10:41 -050071#define CFG_SYS_INIT_RAM_ADDR 0x40000000
72#define CFG_SYS_INIT_RAM_SIZE SZ_512K
Teresa Remmet82750c22020-08-21 09:55:53 +020073
Tom Rinibb4dd962022-11-16 13:10:37 -050074#define CFG_SYS_SDRAM_BASE 0x40000000
Teresa Remmet82750c22020-08-21 09:55:53 +020075
Teresa Remmetbdba9312021-10-06 11:56:49 +020076#define PHYS_SDRAM 0x40000000
Teresa Remmet82750c22020-08-21 09:55:53 +020077#define PHYS_SDRAM_SIZE SZ_2G /* 2GB DDR */
78
Teresa Remmet82750c22020-08-21 09:55:53 +020079#endif /* __PHYCORE_IMX8MM_H */