blob: 247d5e1bcc3a5d39de43d687530168a77d6c69bc [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Peng Fan55a42b32016-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 Fan55a42b32016-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 Glass1af3c7f2020-05-10 11:40:09 -060013#include <linux/stringify.h>
Peng Fan55a42b32016-08-11 14:02:57 +080014#include "mx6_common.h"
Stefano Babic552a8482017-06-29 10:16:06 +020015#include <asm/mach-imx/gpio.h>
Peng Fan55a42b32016-08-11 14:02:57 +080016
Peng Fan55a42b32016-08-11 14:02:57 +080017#define PHYS_SDRAM_SIZE SZ_512M
18
Peng Fan55a42b32016-08-11 14:02:57 +080019#define CONFIG_MXC_UART_BASE UART1_BASE
20
21/* MMC Configs */
22#ifdef CONFIG_FSL_USDHC
23#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
24
25/* NAND pin conflicts with usdhc2 */
26#ifdef CONFIG_SYS_USE_NAND
27#define CONFIG_SYS_FSL_USDHC_NUM 1
28#else
29#define CONFIG_SYS_FSL_USDHC_NUM 2
30#endif
31#endif
32
Peng Fan55a42b32016-08-11 14:02:57 +080033#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
34
35#define CONFIG_EXTRA_ENV_SETTINGS \
36 "script=boot.scr\0" \
37 "image=zImage\0" \
38 "console=ttymxc0\0" \
39 "fdt_high=0xffffffff\0" \
40 "initrd_high=0xffffffff\0" \
Peng Fan1d293e62019-08-08 09:55:57 +000041 "fdt_file=undefined\0" \
Peng Fan55a42b32016-08-11 14:02:57 +080042 "fdt_addr=0x83000000\0" \
43 "boot_fdt=try\0" \
44 "ip_dyn=yes\0" \
45 "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" \
46 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
47 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
48 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
49 "mmcautodetect=yes\0" \
50 "mmcargs=setenv bootargs console=${console},${baudrate} " \
51 "root=${mmcroot}\0" \
52 "loadbootscript=" \
53 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
54 "bootscript=echo Running bootscript from mmc ...; " \
55 "source\0" \
56 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
57 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
58 "mmcboot=echo Booting from mmc ...; " \
59 "run mmcargs; " \
60 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
61 "if run loadfdt; then " \
62 "bootz ${loadaddr} - ${fdt_addr}; " \
63 "else " \
64 "if test ${boot_fdt} = try; then " \
65 "bootz; " \
66 "else " \
67 "echo WARN: Cannot load the DT; " \
68 "fi; " \
69 "fi; " \
70 "else " \
71 "bootz; " \
72 "fi;\0" \
Peng Fan1d293e62019-08-08 09:55:57 +000073 "findfdt="\
74 "if test $fdt_file = undefined; then " \
75 "if test $board_name = ULZ-EVK && test $board_rev = 14X14; then " \
76 "setenv fdt_file imx6ulz-14x14-evk.dtb; fi; " \
77 "if test $board_name = EVK && test $board_rev = 14X14; then " \
78 "setenv fdt_file imx6ull-14x14-evk.dtb; fi; " \
79 "if test $fdt_file = undefined; then " \
80 "echo WARNING: Could not determine dtb to use; " \
81 "fi; " \
82 "fi;\0" \
Peng Fan55a42b32016-08-11 14:02:57 +080083 "netargs=setenv bootargs console=${console},${baudrate} " \
84 "root=/dev/nfs " \
85 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
86 "netboot=echo Booting from net ...; " \
87 "run netargs; " \
88 "if test ${ip_dyn} = yes; then " \
89 "setenv get_cmd dhcp; " \
90 "else " \
91 "setenv get_cmd tftp; " \
92 "fi; " \
93 "${get_cmd} ${image}; " \
94 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
95 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
96 "bootz ${loadaddr} - ${fdt_addr}; " \
97 "else " \
98 "if test ${boot_fdt} = try; then " \
99 "bootz; " \
100 "else " \
101 "echo WARN: Cannot load the DT; " \
102 "fi; " \
103 "fi; " \
104 "else " \
105 "bootz; " \
106 "fi;\0" \
107
108#define CONFIG_BOOTCOMMAND \
Peng Fan1d293e62019-08-08 09:55:57 +0000109 "run findfdt;" \
Peng Fan55a42b32016-08-11 14:02:57 +0800110 "mmc dev ${mmcdev};" \
111 "mmc dev ${mmcdev}; if mmc rescan; then " \
112 "if run loadbootscript; then " \
113 "run bootscript; " \
114 "else " \
115 "if run loadimage; then " \
116 "run mmcboot; " \
117 "else run netboot; " \
118 "fi; " \
119 "fi; " \
120 "else run netboot; fi"
121
122/* Miscellaneous configurable options */
Peng Fan55a42b32016-08-11 14:02:57 +0800123
Peng Fan55a42b32016-08-11 14:02:57 +0800124#define CONFIG_SYS_HZ 1000
125
Peng Fan55a42b32016-08-11 14:02:57 +0800126/* Physical Memory Map */
Peng Fan55a42b32016-08-11 14:02:57 +0800127#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
128
129#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
130#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
131#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
132
133#define CONFIG_SYS_INIT_SP_OFFSET \
134 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
135#define CONFIG_SYS_INIT_SP_ADDR \
136 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
137
Masahiro Yamadae856bdc2017-02-11 22:43:54 +0900138/* environment organization */
Peng Fan55a42b32016-08-11 14:02:57 +0800139#define CONFIG_MMCROOT "/dev/mmcblk1p2" /* USDHC2 */
140
Peng Fan55a42b32016-08-11 14:02:57 +0800141#define CONFIG_IOMUX_LPSR
142
143#define CONFIG_SOFT_SPI
144
Fabio Estevam03279b72020-02-03 14:23:58 -0300145#ifdef CONFIG_CMD_NET
146#define CONFIG_FEC_ENET_DEV 1
147#if (CONFIG_FEC_ENET_DEV == 0)
148#define CONFIG_ETHPRIME "eth0"
149#elif (CONFIG_FEC_ENET_DEV == 1)
150#define CONFIG_ETHPRIME "eth1"
151#endif
152#endif
153
Peng Fan55a42b32016-08-11 14:02:57 +0800154#endif