2021-05-28 13:26:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 NXP Semiconductors
|
|
|
|
* Copyright (C) 2021 Fabio Estevam <festevam@denx.de>
|
|
|
|
*
|
|
|
|
* Configuration settings for the smegw01 board.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SMEGW01_CONFIG_H
|
|
|
|
#define __SMEGW01_CONFIG_H
|
|
|
|
|
|
|
|
#include "mx7_common.h"
|
|
|
|
#include <imximage.h>
|
|
|
|
|
|
|
|
#define PHYS_SDRAM_SIZE SZ_512M
|
|
|
|
|
|
|
|
/* MMC Config*/
|
2022-10-29 00:27:13 +00:00
|
|
|
#define CFG_SYS_FSL_ESDHC_ADDR 0
|
2021-05-28 13:26:57 +00:00
|
|
|
|
2023-04-26 16:04:48 +00:00
|
|
|
/* default to no extra bootparams, we need an empty define for stringification*/
|
|
|
|
#ifndef EXTRA_BOOTPARAMS
|
|
|
|
#define EXTRA_BOOTPARAMS
|
|
|
|
#endif
|
|
|
|
|
2022-12-04 15:03:50 +00:00
|
|
|
#define CFG_EXTRA_ENV_SETTINGS \
|
2023-04-26 16:04:56 +00:00
|
|
|
"image=fitImage\0" \
|
2021-05-28 13:26:57 +00:00
|
|
|
"console=ttymxc0\0" \
|
|
|
|
"fdtfile=imx7d-smegw01.dtb\0" \
|
|
|
|
"fdt_addr=0x83000000\0" \
|
|
|
|
"bootm_size=0x10000000\0" \
|
2023-04-26 16:04:55 +00:00
|
|
|
"mmcdev=1\0" \
|
2021-05-28 13:26:57 +00:00
|
|
|
"mmcpart=1\0" \
|
2023-04-26 16:04:53 +00:00
|
|
|
"mmcpart_committed=1\0" \
|
2021-05-28 13:26:57 +00:00
|
|
|
"mmcargs=setenv bootargs console=${console},${baudrate} " \
|
2023-04-26 16:04:54 +00:00
|
|
|
"root=/dev/mmcblk${mmcdev}p${gpt_partition_entry} rootwait rw " \
|
|
|
|
__stringify(EXTRA_BOOTPARAMS) " SM_ROOT_DEV=${mmcdev} SM_ROOT_PART=${gpt_partition_entry} SM_BOOT_PART=${boot_part}\0" \
|
2023-04-26 16:04:53 +00:00
|
|
|
"commit_mmc=if test \"${ustate}\" = 1 -a \"${mmcpart}\" != \"${mmcpart_committed}\"; then " \
|
|
|
|
"setenv mmcpart_committed ${mmcpart};" \
|
|
|
|
"saveenv;" \
|
|
|
|
"fi;\0" \
|
2023-04-26 16:04:51 +00:00
|
|
|
"bootlimit=3\0" \
|
2023-04-26 16:04:56 +00:00
|
|
|
"fit_addr=0x88000000\0" \
|
|
|
|
"loadimage=load mmc ${mmcdev}#rootfs-${mmcpart_committed} ${fit_addr} boot/${image}\0" \
|
2023-04-26 16:04:54 +00:00
|
|
|
"loadpart=gpt setenv mmc ${mmcdev} rootfs-${mmcpart_committed}\0" \
|
|
|
|
"loadbootpart=mmc partconf 1 boot_part\0" \
|
2021-05-28 13:26:57 +00:00
|
|
|
"mmcboot=echo Booting from mmc ...; " \
|
2023-04-26 16:04:53 +00:00
|
|
|
"run commit_mmc; " \
|
2023-04-26 16:04:54 +00:00
|
|
|
"run loadpart; " \
|
|
|
|
"run loadbootpart; " \
|
2021-05-28 13:26:57 +00:00
|
|
|
"run mmcargs; " \
|
2023-04-26 16:04:56 +00:00
|
|
|
"if bootm ${fit_addr}; then " \
|
|
|
|
"; " \
|
2023-04-26 16:04:52 +00:00
|
|
|
"else " \
|
|
|
|
"run altbootcmd; " \
|
2021-05-28 13:26:57 +00:00
|
|
|
"fi;\0" \
|
2023-04-26 16:04:51 +00:00
|
|
|
"altbootcmd=echo Performing rollback...; " \
|
2023-04-26 16:04:53 +00:00
|
|
|
"if test \"${mmcpart_committed}\" = 1; then " \
|
2023-04-26 16:04:51 +00:00
|
|
|
"setenv mmcpart 2; " \
|
2023-04-26 16:04:53 +00:00
|
|
|
"setenv mmcpart_committed 2;" \
|
2023-04-26 16:04:51 +00:00
|
|
|
"else " \
|
|
|
|
"setenv mmcpart 1; " \
|
2023-04-26 16:04:53 +00:00
|
|
|
"setenv mmcpart_committed 1;" \
|
2023-04-26 16:04:51 +00:00
|
|
|
"fi; setenv bootcount 0; setenv upgrade_available; setenv ustate 3; saveenv; " \
|
|
|
|
"run bootcmd;\0"
|
2021-05-28 13:26:57 +00:00
|
|
|
|
|
|
|
/* Physical Memory Map */
|
|
|
|
#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
|
|
|
|
|
2022-11-16 18:10:37 +00:00
|
|
|
#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
|
2022-11-16 18:10:41 +00:00
|
|
|
#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
|
|
|
|
#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
|
2021-05-28 13:26:57 +00:00
|
|
|
|
|
|
|
#endif
|