1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2016 NXP Semiconductors
5 * Configuration settings for the i.MX7S Warp board.
8 #ifndef __WARP7_CONFIG_H
9 #define __WARP7_CONFIG_H
11 #include "mx7_common.h"
14 #define PHYS_SDRAM_SIZE SZ_512M
17 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC3_BASE_ADDR
18 #define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
19 #define CONFIG_SYS_MMC_IMG_LOAD_PART 1
21 #define CONFIG_DFU_ENV_SETTINGS \
22 "dfu_alt_info=boot raw 0x2 0x1000 mmcpart 1\0" \
24 /* When booting with FIT specify the node entry containing boot.scr */
25 #if defined(CONFIG_FIT)
26 #define BOOT_SCR_STRING "source ${bootscriptaddr}:${bootscr_fitimage_name}\0"
28 #define BOOT_SCR_STRING "source ${bootscriptaddr}\0"
31 #ifndef CONFIG_OPTEE_LOAD_ADDR
32 #define CONFIG_OPTEE_LOAD_ADDR 0
35 #define CONFIG_EXTRA_ENV_SETTINGS \
36 CONFIG_DFU_ENV_SETTINGS \
38 "bootscr_fitimage_name=bootscr\0" \
39 "script_signed=boot.scr.imx-signed\0" \
40 "bootscriptaddr=0x83200000\0" \
43 "ethact=usb_ether\0" \
44 "fdt_high=0xffffffff\0" \
45 "initrd_high=0xffffffff\0" \
46 "fdt_file=imx7s-warp.dtb\0" \
47 "fdt_addr=" __stringify(CONFIG_SYS_FDT_ADDR)"\0" \
48 "fdtovaddr=0x83100000\0" \
49 "optee_addr=" __stringify(CONFIG_OPTEE_LOAD_ADDR)"\0" \
52 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
53 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
54 "rootpart=" __stringify(CONFIG_WARP7_ROOT_PART) "\0" \
55 "finduuid=part uuid mmc 0:${rootpart} uuid\0" \
56 "mmcargs=setenv bootargs console=${console},${baudrate} " \
57 "root=PARTUUID=${uuid} rootwait rw\0" \
58 "ivt_offset=" __stringify(BOOTROM_IVT_HDR_OFFSET)"\0"\
59 "warp7_auth_or_fail=hab_auth_img_or_fail ${hab_ivt_addr} ${filesize} 0;\0" \
60 "do_bootscript_hab=" \
61 "if test ${hab_enabled} -eq 1; then " \
62 "setexpr hab_ivt_addr ${bootscriptaddr} - ${ivt_offset}; " \
63 "setenv script ${script_signed}; " \
64 "load mmc ${mmcdev}:${mmcpart} ${hab_ivt_addr} ${script}; " \
65 "run warp7_auth_or_fail; " \
69 "load mmc ${mmcdev}:${mmcpart} ${bootscriptaddr} ${script};\0" \
70 "bootscript=echo Running bootscript from mmc ...; " \
72 "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
73 "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
74 "mmcboot=echo Booting from mmc ...; " \
77 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
78 "if run loadfdt; then " \
79 "bootz ${loadaddr} - ${fdt_addr}; " \
81 "if test ${boot_fdt} = try; then " \
84 "echo WARN: Cannot load the DT; " \
91 #define CONFIG_BOOTCOMMAND \
92 "mmc dev ${mmcdev};" \
93 "mmc dev ${mmcdev}; if mmc rescan; then " \
94 "run do_bootscript_hab;" \
95 "if run loadbootscript; then " \
98 "if run loadimage; then " \
104 #define CONFIG_SYS_HZ 1000
106 /* Physical Memory Map */
107 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
109 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
110 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
111 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
113 #define CONFIG_SYS_INIT_SP_OFFSET \
114 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
115 #define CONFIG_SYS_INIT_SP_ADDR \
116 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
119 * Environment starts at CONFIG_ENV_OFFSET= 0xC0000 = 768k = 768*1024 = 786432
121 * Detect overlap between U-Boot image and environment area in build-time
123 * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.imx offset
124 * CONFIG_BOARD_SIZE_LIMIT = 768k - 1k = 767k = 785408
126 * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
127 * write the direct value here
129 #define CONFIG_BOARD_SIZE_LIMIT 785408
131 /* environment organization */
133 #define CONFIG_SYS_FSL_USDHC_NUM 1
136 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
138 #define CONFIG_USBD_HS
140 /* USB Device Firmware Update support */
141 #define DFU_DEFAULT_POLL_TIMEOUT 300
143 #define CONFIG_USBNET_DEV_ADDR "de:ad:be:af:00:01"
145 /* Environment variable name to represent HAB enable state */
146 #define HAB_ENABLED_ENVNAME "hab_enabled"