Michael Trimarchi | 273ab5a | 2022-09-18 17:09:53 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (C) 2021 Amarula Solutions B.V. |
| 4 | * |
| 5 | */ |
| 6 | #ifndef __IMX6ULZ_SMM_M2_CONFIG_H |
| 7 | #define __IMX6ULZ_SMM_M2_CONFIG_H |
| 8 | |
| 9 | #include "mx6_common.h" |
| 10 | |
| 11 | #include <asm/arch/imx-regs.h> |
| 12 | #include <linux/sizes.h> |
| 13 | #include <linux/stringify.h> |
| 14 | |
| 15 | /* SPL options */ |
| 16 | #include "imx6_spl.h" |
| 17 | |
| 18 | #define CONFIG_MXC_UART_BASE UART4_BASE |
| 19 | |
| 20 | #ifndef CONFIG_SPL_BUILD |
| 21 | |
| 22 | #define BOOT_TARGET_DEVICES(func) \ |
| 23 | func(NAND, nand, 0) \ |
| 24 | |
| 25 | #include <config_distro_bootcmd.h> |
| 26 | |
| 27 | #endif /* !CONFIG_SPL_BUILD */ |
| 28 | |
| 29 | #define MEM_LAYOUT_ENV_SETTINGS \ |
| 30 | "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 31 | "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 32 | "fdt_addr_r=0x81000000\0" \ |
| 33 | "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
| 34 | "bootcmd_mfg=echo Running fastboot mode; fastboot usb 0\0" \ |
| 35 | |
| 36 | #define NANDARGS \ |
| 37 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 38 | CONFIG_MTDPARTS_DEFAULT "\0" \ |
| 39 | "nandargs=setenv bootargs " \ |
| 40 | "${optargs} " \ |
| 41 | "mtdparts=${mtdparts} " \ |
| 42 | "root=${nandroot} " \ |
| 43 | "rootfstype=${nandrootfstype}\0" \ |
| 44 | "nandroot=ubi0:root rw ubi.mtd=rootfs\0" \ |
| 45 | "nandrootfstype=ubifs rootwait=1\0" \ |
| 46 | "nandboot=echo Booting from nand ...; " \ |
| 47 | "run nandargs; " \ |
| 48 | "nand read ${fdt_addr_r} nanddtb; " \ |
| 49 | "nand read ${loadaddr} kernel; " \ |
| 50 | "bootz ${loadaddr} - ${fdt_addr_r}\0" |
| 51 | |
| 52 | #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ |
| 53 | "bootcmd_" #devtypel #instance "=" \ |
| 54 | "run nandboot\0" |
| 55 | |
| 56 | #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \ |
| 57 | #devtypel #instance " " |
| 58 | |
| 59 | /* Initial environment variables */ |
| 60 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 61 | MEM_LAYOUT_ENV_SETTINGS \ |
| 62 | NANDARGS \ |
| 63 | BOOTENV |
| 64 | |
| 65 | /* Physical Memory Map */ |
| 66 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 67 | #define PHYS_SDRAM_SIZE SZ_128M |
| 68 | |
| 69 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 70 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 71 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 72 | |
| 73 | /* NAND */ |
| 74 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 75 | |
| 76 | #define CONFIG_SYS_NAND_BASE 0x20000000 |
| 77 | |
| 78 | #endif |