Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 1 | /* 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 \ |
Dario Binacchi | d8aba36 | 2023-02-08 09:15:39 +0100 | [diff] [blame] | 17 | "nandargs=setenv bootargs " \ |
Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 18 | "${optargs} " \ |
Dario Binacchi | 0c4db62 | 2022-06-26 12:05:18 +0200 | [diff] [blame] | 19 | "mtdparts=${mtdparts} " \ |
Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 20 | "root=${nandroot} " \ |
| 21 | "rootfstype=${nandrootfstype}\0" \ |
| 22 | "nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \ |
Michael Trimarchi | 98303ce | 2022-05-22 15:22:08 +0200 | [diff] [blame] | 23 | "nandrootfstype=ubifs rootwait\0" \ |
Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 24 | "nandboot=echo Booting from nand ...; " \ |
| 25 | "run nandargs; " \ |
| 26 | "nand read ${fdt_addr_r} nanddtb; " \ |
| 27 | "nand read ${loadaddr} nandkernel; " \ |
| 28 | "booti ${loadaddr} - ${fdt_addr_r}\0" |
| 29 | |
| 30 | #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ |
| 31 | "bootcmd_" #devtypel #instance "=" \ |
| 32 | "run nandboot\0" |
| 33 | |
| 34 | #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \ |
| 35 | #devtypel #instance " " |
| 36 | |
| 37 | /* Initial environment variables */ |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 38 | #define CFG_EXTRA_ENV_SETTINGS \ |
Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 39 | MEM_LAYOUT_ENV_SETTINGS \ |
| 40 | NANDARGS \ |
| 41 | BOOTENV |
| 42 | |
| 43 | #define PHYS_SDRAM_SIZE SZ_256M |
| 44 | |
| 45 | /* NAND */ |
Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 46 | |
Tom Rini | 4e59094 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 47 | #define CFG_SYS_NAND_BASE 0x20000000 |
Ariel D'Alessandro | 6c317fe | 2022-04-12 10:31:38 -0300 | [diff] [blame] | 48 | |
| 49 | #endif /* __IMX8MN_BSH_SMM_S2_H */ |