blob: 8f68472f5bad742afb2e63d44360695e8715d6a0 [file] [log] [blame]
Fabio Estevam40496ac2021-05-28 10:26:57 -03001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2016 NXP Semiconductors
4 * Copyright (C) 2021 Fabio Estevam <festevam@denx.de>
5 *
6 * Configuration settings for the smegw01 board.
7 */
8
9#ifndef __SMEGW01_CONFIG_H
10#define __SMEGW01_CONFIG_H
11
12#include "mx7_common.h"
13#include <imximage.h>
14
15#define PHYS_SDRAM_SIZE SZ_512M
16
Fabio Estevam40496ac2021-05-28 10:26:57 -030017/* MMC Config*/
Tom Rini6cc04542022-10-28 20:27:13 -040018#define CFG_SYS_FSL_ESDHC_ADDR 0
Fabio Estevam40496ac2021-05-28 10:26:57 -030019
Eduard Strehlau7f932c62023-04-26 13:04:48 -030020/* default to no extra bootparams, we need an empty define for stringification*/
21#ifndef EXTRA_BOOTPARAMS
22#define EXTRA_BOOTPARAMS
23#endif
24
Tom Rini0613c362022-12-04 10:03:50 -050025#define CFG_EXTRA_ENV_SETTINGS \
Fabio Estevam40496ac2021-05-28 10:26:57 -030026 "image=zImage\0" \
27 "console=ttymxc0\0" \
28 "fdtfile=imx7d-smegw01.dtb\0" \
29 "fdt_addr=0x83000000\0" \
30 "bootm_size=0x10000000\0" \
Eduard Strehlaub1bbdf12023-04-26 13:04:55 -030031 "mmcdev=1\0" \
Fabio Estevam40496ac2021-05-28 10:26:57 -030032 "mmcpart=1\0" \
Eduard Strehlau52726d22023-04-26 13:04:53 -030033 "mmcpart_committed=1\0" \
Fabio Estevam40496ac2021-05-28 10:26:57 -030034 "mmcargs=setenv bootargs console=${console},${baudrate} " \
Eduard Strehlau31c6c792023-04-26 13:04:54 -030035 "root=/dev/mmcblk${mmcdev}p${gpt_partition_entry} rootwait rw " \
36 __stringify(EXTRA_BOOTPARAMS) " SM_ROOT_DEV=${mmcdev} SM_ROOT_PART=${gpt_partition_entry} SM_BOOT_PART=${boot_part}\0" \
Eduard Strehlau52726d22023-04-26 13:04:53 -030037 "commit_mmc=if test \"${ustate}\" = 1 -a \"${mmcpart}\" != \"${mmcpart_committed}\"; then " \
38 "setenv mmcpart_committed ${mmcpart};" \
39 "saveenv;" \
40 "fi;\0" \
Eduard Strehlauac52bb92023-04-26 13:04:51 -030041 "bootlimit=3\0" \
Eduard Strehlau31c6c792023-04-26 13:04:54 -030042 "loadimage=load mmc ${mmcdev}#rootfs-${mmcpart_committed} ${loadaddr} boot/${image}\0" \
43 "loadfdt=load mmc ${mmcdev}#rootfs-${mmcpart_committed} ${fdt_addr} boot/${fdtfile}\0" \
44 "loadpart=gpt setenv mmc ${mmcdev} rootfs-${mmcpart_committed}\0" \
45 "loadbootpart=mmc partconf 1 boot_part\0" \
Fabio Estevam40496ac2021-05-28 10:26:57 -030046 "mmcboot=echo Booting from mmc ...; " \
Eduard Strehlau52726d22023-04-26 13:04:53 -030047 "run commit_mmc; " \
Eduard Strehlau31c6c792023-04-26 13:04:54 -030048 "run loadpart; " \
49 "run loadbootpart; " \
Fabio Estevam40496ac2021-05-28 10:26:57 -030050 "run mmcargs; " \
51 "if run loadfdt; then " \
Eduard Strehlau440dc062023-04-26 13:04:52 -030052 "if bootz ${loadaddr} - ${fdt_addr}; then " \
53 "; " \
54 "else " \
55 "run altbootcmd; " \
56 "fi;" \
57 "else " \
58 "run altbootcmd; " \
Fabio Estevam40496ac2021-05-28 10:26:57 -030059 "fi;\0" \
Eduard Strehlauac52bb92023-04-26 13:04:51 -030060 "altbootcmd=echo Performing rollback...; " \
Eduard Strehlau52726d22023-04-26 13:04:53 -030061 "if test \"${mmcpart_committed}\" = 1; then " \
Eduard Strehlauac52bb92023-04-26 13:04:51 -030062 "setenv mmcpart 2; " \
Eduard Strehlau52726d22023-04-26 13:04:53 -030063 "setenv mmcpart_committed 2;" \
Eduard Strehlauac52bb92023-04-26 13:04:51 -030064 "else " \
65 "setenv mmcpart 1; " \
Eduard Strehlau52726d22023-04-26 13:04:53 -030066 "setenv mmcpart_committed 1;" \
Eduard Strehlauac52bb92023-04-26 13:04:51 -030067 "fi; setenv bootcount 0; setenv upgrade_available; setenv ustate 3; saveenv; " \
68 "run bootcmd;\0"
Fabio Estevam40496ac2021-05-28 10:26:57 -030069
Fabio Estevam40496ac2021-05-28 10:26:57 -030070/* Physical Memory Map */
71#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
72
Tom Riniaa6e94d2022-11-16 13:10:37 -050073#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini65cc0e22022-11-16 13:10:41 -050074#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
75#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Fabio Estevam40496ac2021-05-28 10:26:57 -030076
Fabio Estevam40496ac2021-05-28 10:26:57 -030077#endif