blob: 098f23b206d12d1f29a7df0b1d56f8dc550970e3 [file] [log] [blame]
Ariel D'Alessandro93add532022-04-12 10:31:38 -03001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright 2021 Collabora Ltd.
4 */
5
6#ifndef __IMX8MN_BSH_SMM_S2_H
7#define __IMX8MN_BSH_SMM_S2_H
8
9#include <configs/imx8mn_bsh_smm_s2_common.h>
10
11#define BOOT_TARGET_DEVICES(func) \
12 func(NAND, nand, 0) \
13
14#include <config_distro_bootcmd.h>
15
16#define NANDARGS \
17 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
18 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
19 "nandargs=setenv bootargs console=${console} " \
20 "${optargs} " \
21 "root=${nandroot} " \
22 "rootfstype=${nandrootfstype}\0" \
23 "nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \
24 "nandrootfstype=ubifs rootwait=1\0" \
25 "nandboot=echo Booting from nand ...; " \
26 "run nandargs; " \
27 "nand read ${fdt_addr_r} nanddtb; " \
28 "nand read ${loadaddr} nandkernel; " \
29 "booti ${loadaddr} - ${fdt_addr_r}\0"
30
31#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
32 "bootcmd_" #devtypel #instance "=" \
33 "run nandboot\0"
34
35#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
36 #devtypel #instance " "
37
38/* Initial environment variables */
39#define CONFIG_EXTRA_ENV_SETTINGS \
40 MEM_LAYOUT_ENV_SETTINGS \
41 NANDARGS \
42 BOOTENV
43
44#define PHYS_SDRAM_SIZE SZ_256M
45
46/* NAND */
47#define CONFIG_SYS_MAX_NAND_DEVICE 1
48
49#define CONFIG_SYS_NAND_BASE 0x20000000
50
51#endif /* __IMX8MN_BSH_SMM_S2_H */