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
27 #define CONFIG_IPADDR 192.168.10.2
28 #define CONFIG_NETMASK 255.255.255.0
29 #define CONFIG_SERVERIP 192.168.10.1
31 #if defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
32 #define UBOOT_UPDATE \
35 "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
36 "setexpr blkcnt ${blkcnt} / 0x200\0" \
37 "update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
38 "mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0"
39 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
40 #define UBOOT_UPDATE \
41 "update_uboot=nand erase.part u-boot1 && " \
42 "nand write ${loadaddr} u-boot1 ${filesize} && " \
43 "nand erase.part u-boot2 && " \
44 "nand write ${loadaddr} u-boot2 ${filesize}\0"
48 /* Define the default GPT table for eMMC */
49 #define PARTS_DEFAULT \
50 /* Android partitions */ \
51 "partitions_android=" \
52 "uuid_disk=${uuid_gpt_disk};" \
53 "name=boot,start=1M,size=32M,uuid=${uuid_gpt_boot};" \
54 "name=environment,size=4M,uuid=${uuid_gpt_environment};" \
55 "name=recovery,size=16M,uuid=${uuid_gpt_recovery};" \
56 "name=system,size=1536M,uuid=${uuid_gpt_system};" \
57 "name=cache,size=512M,uuid=${uuid_gpt_cache};" \
58 "name=device,size=8M,uuid=${uuid_gpt_device};" \
59 "name=misc,size=4M,uuid=${uuid_gpt_misc};" \
60 "name=datafooter,size=2M,uuid=${uuid_gpt_datafooter};" \
61 "name=metadata,size=2M,uuid=${uuid_gpt_metadata};" \
62 "name=persistdata,size=2M,uuid=${uuid_gpt_persistdata};" \
63 "name=userdata,size=128M,uuid=${uuid_gpt_userdata};" \
64 "name=fbmisc,size=-,uuid=${uuid_gpt_fbmisc}\0"
65 #endif /* PARTS_DEFAULT */
67 #define EMMC_ANDROID_BOOTCMD \
68 "android_args=androidboot.storage_type=emmc\0" \
70 "android_fdt_addr=0x83700000\0" \
71 "android_mmc_dev=0\0" \
72 "m4binary=rpmsg_imu_freertos.elf\0" \
73 "androidboot=ext4load mmc 0:a ${loadaddr} media/0/${m4binary}; "\
74 "bootaux ${loadaddr}; " \
75 "setenv loadaddr 0x88000000; " \
76 "setenv bootm_boot_mode sec;" \
77 "setenv bootargs androidboot.serialno=${serial#} " \
79 "part start mmc ${android_mmc_dev} boot boot_start; " \
80 "part size mmc ${android_mmc_dev} boot boot_size; " \
81 "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
82 "part start mmc ${android_mmc_dev} environment env_start; " \
83 "part size mmc ${android_mmc_dev} environment env_size; " \
84 "mmc read ${android_fdt_addr} ${env_start} ${env_size}; " \
85 "bootm ${loadaddr} ${loadaddr} ${android_fdt_addr}\0 "
87 #define MEM_LAYOUT_ENV_SETTINGS \
88 "bootm_size=0x10000000\0" \
89 "fdt_addr_r=0x82000000\0" \
90 "kernel_addr_r=0x81000000\0" \
91 "pxefile_addr_r=0x87100000\0" \
92 "ramdisk_addr_r=0x82100000\0" \
93 "scriptaddr=0x87000000\0"
96 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
97 "nfsboot=run setup; " \
98 "setenv bootargs ${defargs} ${nfsargs} " \
99 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
100 "dhcp ${kernel_addr_r} && " \
101 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
102 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
104 #define UBI_BOOTCMD \
105 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
106 "ubi.fm_autoconvert=1\0" \
107 "ubiboot=run setup; " \
108 "setenv bootargs ${defargs} ${ubiargs} " \
109 "${setupargs} ${vidargs} ${tdxargs}; echo Booting from NAND...; " \
110 "ubi part ubi && run m4boot && " \
111 "ubi read ${kernel_addr_r} kernel && " \
112 "ubi read ${fdt_addr_r} dtb && " \
113 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
115 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
116 #define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
117 "run distro_bootcmd;"
118 #define MODULE_EXTRA_ENV_SETTINGS \
119 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
121 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
122 #define MODULE_EXTRA_ENV_SETTINGS \
127 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
128 #define BOOT_TARGET_DEVICES(func) \
132 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
133 #define BOOT_TARGET_DEVICES(func) \
139 #include <config_distro_bootcmd.h>
141 #define CONFIG_EXTRA_ENV_SETTINGS \
143 MEM_LAYOUT_ENV_SETTINGS \
145 MODULE_EXTRA_ENV_SETTINGS \
147 "boot_file=zImage\0" \
148 "bootubipart=ubi\0" \
149 "console=ttymxc0\0" \
151 "fdt_board=eval-v3\0" \
155 "kernel_file=zImage\0" \
156 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
157 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
158 "${board}/flash_eth.img && source ${loadaddr}\0" \
159 "setsdupdate=mmc rescan && setenv interface mmc && " \
160 "fatload ${interface} 0:1 ${loadaddr} " \
161 "${board}/flash_blk.img && source ${loadaddr}\0" \
162 "setup=setenv setupargs " \
163 "console=tty1 console=${console}" \
164 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
165 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
166 "setusbupdate=usb start && setenv interface usb && " \
167 "fatload ${interface} 0:1 ${loadaddr} " \
168 "${board}/flash_blk.img && source ${loadaddr}\0" \
170 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
171 "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" \
174 /* Miscellaneous configurable options */
176 #define CONFIG_SYS_HZ 1000
178 /* Physical Memory Map */
179 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
181 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
182 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
183 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
185 #define CONFIG_SYS_INIT_SP_OFFSET \
186 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
187 #define CONFIG_SYS_INIT_SP_ADDR \
188 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
190 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
192 #define CONFIG_SYS_MAX_NAND_DEVICE 1
193 #define CONFIG_SYS_NAND_BASE 0x40000000
194 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
195 #define CONFIG_SYS_NAND_ONFI_DETECTION
196 #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
200 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
202 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
203 #define CONFIG_MXC_USB_FLAGS 0
204 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
206 #define CONFIG_USBD_HS
208 #if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
209 #define CONFIG_VIDEO_MXS
210 #define CONFIG_VIDEO_LOGO
211 #define CONFIG_VIDEO_BMP_LOGO