]> Git Repo - J-u-boot.git/blame - include/configs/colibri_imx7.h
Convert CONFIG_SYS_MALLOC_LEN to Kconfig
[J-u-boot.git] / include / configs / colibri_imx7.h
CommitLineData
83d290c5 1/* SPDX-License-Identifier: GPL-2.0+ */
ae440ab0 2/*
a62c6061 3 * Copyright 2016-2018 Toradex AG
ae440ab0
SA
4 *
5 * Configuration settings for the Colibri iMX7 module.
6 *
7 * based on mx7dsabresd.h:
8 * Copyright (C) 2015 Freescale Semiconductor, Inc.
ae440ab0
SA
9 */
10
11#ifndef __COLIBRI_IMX7_CONFIG_H
12#define __COLIBRI_IMX7_CONFIG_H
13
14#include "mx7_common.h"
15
ae440ab0
SA
16/* MMC Config*/
17#define CONFIG_SYS_FSL_ESDHC_ADDR 0
a62c6061 18#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
ae440ab0 19#define CONFIG_SYS_FSL_USDHC_NUM 1
a62c6061
SA
20#elif CONFIG_TARGET_COLIBRI_IMX7_EMMC
21#define CONFIG_SYS_FSL_USDHC_NUM 2
a62c6061 22#endif
ae440ab0 23
ae440ab0
SA
24#define CONFIG_IPADDR 192.168.10.2
25#define CONFIG_NETMASK 255.255.255.0
26#define CONFIG_SERVERIP 192.168.10.1
27
9e286cb6
IO
28#if defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
29#define UBOOT_UPDATE \
30 "uboot_hwpart=1\0" \
31 "uboot_blk=2\0" \
32 "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
33 "setexpr blkcnt ${blkcnt} / 0x200\0" \
34 "update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
35 "mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0"
36#elif defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
37#define UBOOT_UPDATE \
38 "update_uboot=nand erase.part u-boot1 && " \
39 "nand write ${loadaddr} u-boot1 ${filesize} && " \
40 "nand erase.part u-boot2 && " \
41 "nand write ${loadaddr} u-boot2 ${filesize}\0"
42#endif
43
9358e5b3
IO
44#ifndef PARTS_DEFAULT
45/* Define the default GPT table for eMMC */
46#define PARTS_DEFAULT \
47 /* Android partitions */ \
48 "partitions_android=" \
49 "uuid_disk=${uuid_gpt_disk};" \
50 "name=boot,start=1M,size=32M,uuid=${uuid_gpt_boot};" \
51 "name=environment,size=4M,uuid=${uuid_gpt_environment};" \
52 "name=recovery,size=16M,uuid=${uuid_gpt_recovery};" \
53 "name=system,size=1536M,uuid=${uuid_gpt_system};" \
54 "name=cache,size=512M,uuid=${uuid_gpt_cache};" \
55 "name=device,size=8M,uuid=${uuid_gpt_device};" \
56 "name=misc,size=4M,uuid=${uuid_gpt_misc};" \
57 "name=datafooter,size=2M,uuid=${uuid_gpt_datafooter};" \
58 "name=metadata,size=2M,uuid=${uuid_gpt_metadata};" \
59 "name=persistdata,size=2M,uuid=${uuid_gpt_persistdata};" \
60 "name=userdata,size=128M,uuid=${uuid_gpt_userdata};" \
61 "name=fbmisc,size=-,uuid=${uuid_gpt_fbmisc}\0"
62#endif /* PARTS_DEFAULT */
63
64#define EMMC_ANDROID_BOOTCMD \
65 "android_args=androidboot.storage_type=emmc\0" \
66 PARTS_DEFAULT \
67 "android_fdt_addr=0x83700000\0" \
68 "android_mmc_dev=0\0" \
69 "m4binary=rpmsg_imu_freertos.elf\0" \
70 "androidboot=ext4load mmc 0:a ${loadaddr} media/0/${m4binary}; "\
71 "bootaux ${loadaddr}; " \
72 "setenv loadaddr 0x88000000; " \
73 "setenv bootm_boot_mode sec;" \
74 "setenv bootargs androidboot.serialno=${serial#} " \
75 "$android_args; " \
76 "part start mmc ${android_mmc_dev} boot boot_start; " \
77 "part size mmc ${android_mmc_dev} boot boot_size; " \
78 "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
79 "part start mmc ${android_mmc_dev} environment env_start; " \
80 "part size mmc ${android_mmc_dev} environment env_size; " \
81 "mmc read ${android_fdt_addr} ${env_start} ${env_size}; " \
82 "bootm ${loadaddr} ${loadaddr} ${android_fdt_addr}\0 "
83
ae440ab0 84#define MEM_LAYOUT_ENV_SETTINGS \
9af131e3 85 "bootm_size=0x10000000\0" \
ae440ab0 86 "fdt_addr_r=0x82000000\0" \
ae440ab0 87 "kernel_addr_r=0x81000000\0" \
d3976cc2 88 "pxefile_addr_r=0x87100000\0" \
848ba639 89 "ramdisk_addr_r=0x82100000\0" \
d3976cc2 90 "scriptaddr=0x87000000\0"
ae440ab0 91
ae440ab0 92#define NFS_BOOTCMD \
a62c6061 93 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
ae440ab0
SA
94 "nfsboot=run setup; " \
95 "setenv bootargs ${defargs} ${nfsargs} " \
96 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
a62c6061
SA
97 "dhcp ${kernel_addr_r} && " \
98 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
ae440ab0
SA
99 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
100
101#define UBI_BOOTCMD \
102 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
103 "ubi.fm_autoconvert=1\0" \
104 "ubiboot=run setup; " \
105 "setenv bootargs ${defargs} ${ubiargs} " \
fdbf0e51 106 "${setupargs} ${vidargs} ${tdxargs}; echo Booting from NAND...; " \
ae440ab0
SA
107 "ubi part ubi && run m4boot && " \
108 "ubi read ${kernel_addr_r} kernel && " \
109 "ubi read ${fdt_addr_r} dtb && " \
110 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
111
a62c6061 112#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
2bc18ce5 113#define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
327381e8 114 "run distro_bootcmd;"
a62c6061
SA
115#define MODULE_EXTRA_ENV_SETTINGS \
116 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
117 UBI_BOOTCMD
118#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
a62c6061
SA
119#define MODULE_EXTRA_ENV_SETTINGS \
120 "variant=-emmc\0" \
9358e5b3 121 EMMC_ANDROID_BOOTCMD
a62c6061
SA
122#endif
123
124#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
125#define BOOT_TARGET_DEVICES(func) \
126 func(MMC, mmc, 0) \
127 func(USB, usb, 0) \
128 func(DHCP, dhcp, na)
129#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
130#define BOOT_TARGET_DEVICES(func) \
a62c6061 131 func(MMC, mmc, 1) \
a17930a3 132 func(MMC, mmc, 0) \
a62c6061
SA
133 func(USB, usb, 0) \
134 func(DHCP, dhcp, na)
135#endif
136#include <config_distro_bootcmd.h>
ae440ab0
SA
137
138#define CONFIG_EXTRA_ENV_SETTINGS \
a62c6061 139 BOOTENV \
ae440ab0
SA
140 MEM_LAYOUT_ENV_SETTINGS \
141 NFS_BOOTCMD \
a62c6061 142 MODULE_EXTRA_ENV_SETTINGS \
9e286cb6 143 UBOOT_UPDATE \
2bc18ce5 144 "boot_file=zImage\0" \
b0a8cefd 145 "bootubipart=ubi\0" \
ae440ab0
SA
146 "console=ttymxc0\0" \
147 "defargs=\0" \
148 "fdt_board=eval-v3\0" \
149 "fdt_fixup=;\0" \
150 "m4boot=;\0" \
151 "ip_dyn=yes\0" \
152 "kernel_file=zImage\0" \
ae440ab0
SA
153 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
154 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
155 "${board}/flash_eth.img && source ${loadaddr}\0" \
156 "setsdupdate=mmc rescan && setenv interface mmc && " \
157 "fatload ${interface} 0:1 ${loadaddr} " \
158 "${board}/flash_blk.img && source ${loadaddr}\0" \
159 "setup=setenv setupargs " \
160 "console=tty1 console=${console}" \
64095704 161 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
ae440ab0
SA
162 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
163 "setusbupdate=usb start && setenv interface usb && " \
164 "fatload ${interface} 0:1 ${loadaddr} " \
165 "${board}/flash_blk.img && source ${loadaddr}\0" \
166 "splashpos=m,m\0" \
72d81360 167 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
ae440ab0 168 "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" \
38045f54 169 "updlevel=2\0"
ae440ab0
SA
170
171/* Miscellaneous configurable options */
ae440ab0 172
ae440ab0
SA
173#define CONFIG_SYS_HZ 1000
174
ae440ab0 175/* Physical Memory Map */
ae440ab0
SA
176#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
177
178#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
179#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
180#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
181
182#define CONFIG_SYS_INIT_SP_OFFSET \
183 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
184#define CONFIG_SYS_INIT_SP_ADDR \
185 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
186
a62c6061 187#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
ae440ab0
SA
188/* NAND stuff */
189#define CONFIG_SYS_MAX_NAND_DEVICE 1
190#define CONFIG_SYS_NAND_BASE 0x40000000
191#define CONFIG_SYS_NAND_5_ADDR_CYCLE
192#define CONFIG_SYS_NAND_ONFI_DETECTION
193#define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
a62c6061 194#endif
ae440ab0
SA
195
196/* USB Configs */
ae440ab0
SA
197#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
198
199#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
200#define CONFIG_MXC_USB_FLAGS 0
201#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
202
ae440ab0
SA
203#define CONFIG_USBD_HS
204
8c1df09f 205#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
ae440ab0
SA
206#define CONFIG_VIDEO_MXS
207#define CONFIG_VIDEO_LOGO
ae440ab0
SA
208#define CONFIG_VIDEO_BMP_LOGO
209#endif
210
211#endif
This page took 0.436474 seconds and 4 git commands to generate.