blob: 9cedb96a6b4f31a18fa6f82584e2e85356267345 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Peng Fan81590632016-08-11 14:02:57 +08002/*
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
4 *
5 * Configuration settings for the Freescale i.MX6UL 14x14 EVK board.
Peng Fan81590632016-08-11 14:02:57 +08006 */
7#ifndef __MX6ULLEVK_CONFIG_H
8#define __MX6ULLEVK_CONFIG_H
9
10
11#include <asm/arch/imx-regs.h>
12#include <linux/sizes.h>
Simon Glassfb64e362020-05-10 11:40:09 -060013#include <linux/stringify.h>
Peng Fan81590632016-08-11 14:02:57 +080014#include "mx6_common.h"
Stefano Babic33731bc2017-06-29 10:16:06 +020015#include <asm/mach-imx/gpio.h>
Peng Fan81590632016-08-11 14:02:57 +080016
Peng Fan81590632016-08-11 14:02:57 +080017#define PHYS_SDRAM_SIZE SZ_512M
18
Peng Fan81590632016-08-11 14:02:57 +080019/* Size of malloc() pool */
20#define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M)
21
Peng Fan81590632016-08-11 14:02:57 +080022#define CONFIG_MXC_UART
23#define CONFIG_MXC_UART_BASE UART1_BASE
24
25/* MMC Configs */
26#ifdef CONFIG_FSL_USDHC
27#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
28
29/* NAND pin conflicts with usdhc2 */
30#ifdef CONFIG_SYS_USE_NAND
31#define CONFIG_SYS_FSL_USDHC_NUM 1
32#else
33#define CONFIG_SYS_FSL_USDHC_NUM 2
34#endif
35#endif
36
37/* I2C configs */
38#ifdef CONFIG_CMD_I2C
39#define CONFIG_SYS_I2C_MXC
40#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
41#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
42#define CONFIG_SYS_I2C_SPEED 100000
43#endif
44
45#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
46
47#define CONFIG_EXTRA_ENV_SETTINGS \
48 "script=boot.scr\0" \
49 "image=zImage\0" \
50 "console=ttymxc0\0" \
51 "fdt_high=0xffffffff\0" \
52 "initrd_high=0xffffffff\0" \
Peng Fan5098eae2019-08-08 09:55:57 +000053 "fdt_file=undefined\0" \
Peng Fan81590632016-08-11 14:02:57 +080054 "fdt_addr=0x83000000\0" \
55 "boot_fdt=try\0" \
56 "ip_dyn=yes\0" \
57 "videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \
58 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
59 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
60 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
61 "mmcautodetect=yes\0" \
62 "mmcargs=setenv bootargs console=${console},${baudrate} " \
63 "root=${mmcroot}\0" \
64 "loadbootscript=" \
65 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
66 "bootscript=echo Running bootscript from mmc ...; " \
67 "source\0" \
68 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
69 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
70 "mmcboot=echo Booting from mmc ...; " \
71 "run mmcargs; " \
72 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
73 "if run loadfdt; then " \
74 "bootz ${loadaddr} - ${fdt_addr}; " \
75 "else " \
76 "if test ${boot_fdt} = try; then " \
77 "bootz; " \
78 "else " \
79 "echo WARN: Cannot load the DT; " \
80 "fi; " \
81 "fi; " \
82 "else " \
83 "bootz; " \
84 "fi;\0" \
Peng Fan5098eae2019-08-08 09:55:57 +000085 "findfdt="\
86 "if test $fdt_file = undefined; then " \
87 "if test $board_name = ULZ-EVK && test $board_rev = 14X14; then " \
88 "setenv fdt_file imx6ulz-14x14-evk.dtb; fi; " \
89 "if test $board_name = EVK && test $board_rev = 14X14; then " \
90 "setenv fdt_file imx6ull-14x14-evk.dtb; fi; " \
91 "if test $fdt_file = undefined; then " \
92 "echo WARNING: Could not determine dtb to use; " \
93 "fi; " \
94 "fi;\0" \
Peng Fan81590632016-08-11 14:02:57 +080095 "netargs=setenv bootargs console=${console},${baudrate} " \
96 "root=/dev/nfs " \
97 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
98 "netboot=echo Booting from net ...; " \
99 "run netargs; " \
100 "if test ${ip_dyn} = yes; then " \
101 "setenv get_cmd dhcp; " \
102 "else " \
103 "setenv get_cmd tftp; " \
104 "fi; " \
105 "${get_cmd} ${image}; " \
106 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
107 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
108 "bootz ${loadaddr} - ${fdt_addr}; " \
109 "else " \
110 "if test ${boot_fdt} = try; then " \
111 "bootz; " \
112 "else " \
113 "echo WARN: Cannot load the DT; " \
114 "fi; " \
115 "fi; " \
116 "else " \
117 "bootz; " \
118 "fi;\0" \
119
120#define CONFIG_BOOTCOMMAND \
Peng Fan5098eae2019-08-08 09:55:57 +0000121 "run findfdt;" \
Peng Fan81590632016-08-11 14:02:57 +0800122 "mmc dev ${mmcdev};" \
123 "mmc dev ${mmcdev}; if mmc rescan; then " \
124 "if run loadbootscript; then " \
125 "run bootscript; " \
126 "else " \
127 "if run loadimage; then " \
128 "run mmcboot; " \
129 "else run netboot; " \
130 "fi; " \
131 "fi; " \
132 "else run netboot; fi"
133
134/* Miscellaneous configurable options */
Peng Fan81590632016-08-11 14:02:57 +0800135
136#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
137#define CONFIG_SYS_HZ 1000
138
Peng Fan81590632016-08-11 14:02:57 +0800139/* Physical Memory Map */
Peng Fan81590632016-08-11 14:02:57 +0800140#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
141
142#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
143#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
144#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
145
146#define CONFIG_SYS_INIT_SP_OFFSET \
147 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
148#define CONFIG_SYS_INIT_SP_ADDR \
149 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
150
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900151/* environment organization */
Peng Fan81590632016-08-11 14:02:57 +0800152#define CONFIG_SYS_MMC_ENV_DEV 1 /* USDHC2 */
153#define CONFIG_SYS_MMC_ENV_PART 0 /* user area */
154#define CONFIG_MMCROOT "/dev/mmcblk1p2" /* USDHC2 */
155
Peng Fan81590632016-08-11 14:02:57 +0800156#define CONFIG_IMX_THERMAL
157
158#define CONFIG_IOMUX_LPSR
159
160#define CONFIG_SOFT_SPI
161
Fabio Estevam4ada4f02020-02-03 14:23:58 -0300162#ifdef CONFIG_CMD_NET
163#define CONFIG_FEC_ENET_DEV 1
164#if (CONFIG_FEC_ENET_DEV == 0)
165#define CONFIG_ETHPRIME "eth0"
166#elif (CONFIG_FEC_ENET_DEV == 1)
167#define CONFIG_ETHPRIME "eth1"
168#endif
169#endif
170
Peng Fan81590632016-08-11 14:02:57 +0800171#endif