1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2016-2018 Toradex AG
5 * Configuration settings for the Colibri iMX7 module.
7 * based on mx7dsabresd.h:
8 * Copyright (C) 2015 Freescale Semiconductor, Inc.
11 #ifndef __COLIBRI_IMX7_CONFIG_H
12 #define __COLIBRI_IMX7_CONFIG_H
14 #include "mx7_common.h"
16 /* Size of malloc() pool */
17 #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
20 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
21 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
22 #define CONFIG_SYS_FSL_USDHC_NUM 1
23 #elif CONFIG_TARGET_COLIBRI_IMX7_EMMC
24 #define CONFIG_SYS_FSL_USDHC_NUM 2
28 #define CONFIG_SYS_I2C_MXC
29 #define CONFIG_SYS_I2C_SPEED 100000
31 #define CONFIG_IPADDR 192.168.10.2
32 #define CONFIG_NETMASK 255.255.255.0
33 #define CONFIG_SERVERIP 192.168.10.1
35 #if defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
36 #define UBOOT_UPDATE \
39 "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
40 "setexpr blkcnt ${blkcnt} / 0x200\0" \
41 "update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
42 "mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0"
43 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
44 #define UBOOT_UPDATE \
45 "update_uboot=nand erase.part u-boot1 && " \
46 "nand write ${loadaddr} u-boot1 ${filesize} && " \
47 "nand erase.part u-boot2 && " \
48 "nand write ${loadaddr} u-boot2 ${filesize}\0"
52 /* Define the default GPT table for eMMC */
53 #define PARTS_DEFAULT \
54 /* Android partitions */ \
55 "partitions_android=" \
56 "uuid_disk=${uuid_gpt_disk};" \
57 "name=boot,start=1M,size=32M,uuid=${uuid_gpt_boot};" \
58 "name=environment,size=4M,uuid=${uuid_gpt_environment};" \
59 "name=recovery,size=16M,uuid=${uuid_gpt_recovery};" \
60 "name=system,size=1536M,uuid=${uuid_gpt_system};" \
61 "name=cache,size=512M,uuid=${uuid_gpt_cache};" \
62 "name=device,size=8M,uuid=${uuid_gpt_device};" \
63 "name=misc,size=4M,uuid=${uuid_gpt_misc};" \
64 "name=datafooter,size=2M,uuid=${uuid_gpt_datafooter};" \
65 "name=metadata,size=2M,uuid=${uuid_gpt_metadata};" \
66 "name=persistdata,size=2M,uuid=${uuid_gpt_persistdata};" \
67 "name=userdata,size=128M,uuid=${uuid_gpt_userdata};" \
68 "name=fbmisc,size=-,uuid=${uuid_gpt_fbmisc}\0"
69 #endif /* PARTS_DEFAULT */
71 #define EMMC_ANDROID_BOOTCMD \
72 "android_args=androidboot.storage_type=emmc\0" \
74 "android_fdt_addr=0x83700000\0" \
75 "android_mmc_dev=0\0" \
76 "m4binary=rpmsg_imu_freertos.elf\0" \
77 "androidboot=ext4load mmc 0:a ${loadaddr} media/0/${m4binary}; "\
78 "bootaux ${loadaddr}; " \
79 "setenv loadaddr 0x88000000; " \
80 "setenv bootm_boot_mode sec;" \
81 "setenv bootargs androidboot.serialno=${serial#} " \
83 "part start mmc ${android_mmc_dev} boot boot_start; " \
84 "part size mmc ${android_mmc_dev} boot boot_size; " \
85 "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
86 "part start mmc ${android_mmc_dev} environment env_start; " \
87 "part size mmc ${android_mmc_dev} environment env_size; " \
88 "mmc read ${android_fdt_addr} ${env_start} ${env_size}; " \
89 "bootm ${loadaddr} ${loadaddr} ${android_fdt_addr}\0 "
91 #define EMMC_BOOTCMD \
92 "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \
93 "rootfstype=ext4 rootwait\0" \
94 "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
95 "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
96 "${vidargs}; echo Booting from internal eMMC chip...; " \
98 "load mmc ${emmcdev}:${emmcbootpart} ${fdt_addr_r} " \
99 "${soc}-colibri-emmc-${fdt_board}.dtb && " \
100 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
101 "${boot_file} && run fdt_fixup && " \
102 "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
105 "emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \
108 #define MEM_LAYOUT_ENV_SETTINGS \
109 "bootm_size=0x10000000\0" \
110 "fdt_addr_r=0x82000000\0" \
111 "fdt_high=0xffffffff\0" \
112 "initrd_high=0xffffffff\0" \
113 "kernel_addr_r=0x81000000\0" \
114 "ramdisk_addr_r=0x82100000\0" \
115 "scriptaddr=0x82500000\0"
117 #define NFS_BOOTCMD \
118 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
119 "nfsboot=run setup; " \
120 "setenv bootargs ${defargs} ${nfsargs} " \
121 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
122 "dhcp ${kernel_addr_r} && " \
123 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
124 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
126 #define UBI_BOOTCMD \
127 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
128 "ubi.fm_autoconvert=1\0" \
129 "ubiboot=run setup; " \
130 "setenv bootargs ${defargs} ${ubiargs} " \
131 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
132 "ubi part ubi && run m4boot && " \
133 "ubi read ${kernel_addr_r} kernel && " \
134 "ubi read ${fdt_addr_r} dtb && " \
135 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
137 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
138 #define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
139 "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
140 #define MODULE_EXTRA_ENV_SETTINGS \
141 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
143 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
144 #define CONFIG_BOOTCOMMAND \
145 "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
146 #define MODULE_EXTRA_ENV_SETTINGS \
152 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
153 #define BOOT_TARGET_DEVICES(func) \
157 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
158 #define BOOT_TARGET_DEVICES(func) \
164 #include <config_distro_bootcmd.h>
166 #define CONFIG_EXTRA_ENV_SETTINGS \
168 MEM_LAYOUT_ENV_SETTINGS \
170 MODULE_EXTRA_ENV_SETTINGS \
172 "boot_file=zImage\0" \
173 "console=ttymxc0\0" \
175 "fdt_board=eval-v3\0" \
179 "kernel_file=zImage\0" \
180 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
181 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
182 "${board}/flash_eth.img && source ${loadaddr}\0" \
183 "setsdupdate=mmc rescan && setenv interface mmc && " \
184 "fatload ${interface} 0:1 ${loadaddr} " \
185 "${board}/flash_blk.img && source ${loadaddr}\0" \
186 "setup=setenv setupargs " \
187 "console=tty1 console=${console}" \
188 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
189 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
190 "setusbupdate=usb start && setenv interface usb && " \
191 "fatload ${interface} 0:1 ${loadaddr} " \
192 "${board}/flash_blk.img && source ${loadaddr}\0" \
194 "videomode=video=ctfb:x:640,y:480,depth:18,pclk:39722,le:48,ri:16,up:33,lo:10,hs:96,vs:2,sync:0,vmode:0\0" \
197 /* Miscellaneous configurable options */
199 #define CONFIG_SYS_MEMTEST_START 0x80000000
200 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000)
202 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
203 #define CONFIG_SYS_HZ 1000
205 /* Physical Memory Map */
206 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
208 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
209 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
210 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
212 #define CONFIG_SYS_INIT_SP_OFFSET \
213 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
214 #define CONFIG_SYS_INIT_SP_ADDR \
215 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
217 /* environment organization */
219 #if defined(CONFIG_ENV_IS_IN_MMC)
220 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
221 #define CONFIG_SYS_MMC_ENV_DEV 0
222 #define CONFIG_SYS_MMC_ENV_PART 1
225 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
227 #define CONFIG_SYS_MAX_NAND_DEVICE 1
228 #define CONFIG_SYS_NAND_BASE 0x40000000
229 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
230 #define CONFIG_SYS_NAND_ONFI_DETECTION
231 #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
235 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
237 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
238 #define CONFIG_MXC_USB_FLAGS 0
239 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
241 #define CONFIG_IMX_THERMAL
243 #define CONFIG_USBD_HS
245 /* USB Device Firmware Update support */
246 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
247 #define DFU_DEFAULT_POLL_TIMEOUT 300
249 #if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
250 #define CONFIG_VIDEO_MXS
251 #define CONFIG_VIDEO_LOGO
252 #define CONFIG_SPLASH_SCREEN
253 #define CONFIG_SPLASH_SCREEN_ALIGN
254 #define CONFIG_BMP_16BPP
255 #define CONFIG_VIDEO_BMP_RLE8
256 #define CONFIG_VIDEO_BMP_LOGO