blob: 03dbdfcb3da65b1e2d65c0fe306a457572e8f7a8 [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_BASE UART1_BASE
23
24/* MMC Configs */
25#ifdef CONFIG_FSL_USDHC
26#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
27
28/* NAND pin conflicts with usdhc2 */
29#ifdef CONFIG_SYS_USE_NAND
30#define CONFIG_SYS_FSL_USDHC_NUM 1
31#else
32#define CONFIG_SYS_FSL_USDHC_NUM 2
33#endif
34#endif
35
Peng Fan81590632016-08-11 14:02:57 +080036#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
37
38#define CONFIG_EXTRA_ENV_SETTINGS \
39 "script=boot.scr\0" \
40 "image=zImage\0" \
41 "console=ttymxc0\0" \
42 "fdt_high=0xffffffff\0" \
43 "initrd_high=0xffffffff\0" \
Peng Fan5098eae2019-08-08 09:55:57 +000044 "fdt_file=undefined\0" \
Peng Fan81590632016-08-11 14:02:57 +080045 "fdt_addr=0x83000000\0" \
46 "boot_fdt=try\0" \
47 "ip_dyn=yes\0" \
48 "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" \
49 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
50 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
51 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
52 "mmcautodetect=yes\0" \
53 "mmcargs=setenv bootargs console=${console},${baudrate} " \
54 "root=${mmcroot}\0" \
55 "loadbootscript=" \
56 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
57 "bootscript=echo Running bootscript from mmc ...; " \
58 "source\0" \
59 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
60 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
61 "mmcboot=echo Booting from mmc ...; " \
62 "run mmcargs; " \
63 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
64 "if run loadfdt; then " \
65 "bootz ${loadaddr} - ${fdt_addr}; " \
66 "else " \
67 "if test ${boot_fdt} = try; then " \
68 "bootz; " \
69 "else " \
70 "echo WARN: Cannot load the DT; " \
71 "fi; " \
72 "fi; " \
73 "else " \
74 "bootz; " \
75 "fi;\0" \
Peng Fan5098eae2019-08-08 09:55:57 +000076 "findfdt="\
77 "if test $fdt_file = undefined; then " \
78 "if test $board_name = ULZ-EVK && test $board_rev = 14X14; then " \
79 "setenv fdt_file imx6ulz-14x14-evk.dtb; fi; " \
80 "if test $board_name = EVK && test $board_rev = 14X14; then " \
81 "setenv fdt_file imx6ull-14x14-evk.dtb; fi; " \
82 "if test $fdt_file = undefined; then " \
83 "echo WARNING: Could not determine dtb to use; " \
84 "fi; " \
85 "fi;\0" \
Peng Fan81590632016-08-11 14:02:57 +080086 "netargs=setenv bootargs console=${console},${baudrate} " \
87 "root=/dev/nfs " \
88 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
89 "netboot=echo Booting from net ...; " \
90 "run netargs; " \
91 "if test ${ip_dyn} = yes; then " \
92 "setenv get_cmd dhcp; " \
93 "else " \
94 "setenv get_cmd tftp; " \
95 "fi; " \
96 "${get_cmd} ${image}; " \
97 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
98 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
99 "bootz ${loadaddr} - ${fdt_addr}; " \
100 "else " \
101 "if test ${boot_fdt} = try; then " \
102 "bootz; " \
103 "else " \
104 "echo WARN: Cannot load the DT; " \
105 "fi; " \
106 "fi; " \
107 "else " \
108 "bootz; " \
109 "fi;\0" \
110
111#define CONFIG_BOOTCOMMAND \
Peng Fan5098eae2019-08-08 09:55:57 +0000112 "run findfdt;" \
Peng Fan81590632016-08-11 14:02:57 +0800113 "mmc dev ${mmcdev};" \
114 "mmc dev ${mmcdev}; if mmc rescan; then " \
115 "if run loadbootscript; then " \
116 "run bootscript; " \
117 "else " \
118 "if run loadimage; then " \
119 "run mmcboot; " \
120 "else run netboot; " \
121 "fi; " \
122 "fi; " \
123 "else run netboot; fi"
124
125/* Miscellaneous configurable options */
Peng Fan81590632016-08-11 14:02:57 +0800126
Peng Fan81590632016-08-11 14:02:57 +0800127#define CONFIG_SYS_HZ 1000
128
Peng Fan81590632016-08-11 14:02:57 +0800129/* Physical Memory Map */
Peng Fan81590632016-08-11 14:02:57 +0800130#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
131
132#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
133#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
134#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
135
136#define CONFIG_SYS_INIT_SP_OFFSET \
137 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
138#define CONFIG_SYS_INIT_SP_ADDR \
139 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
140
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900141/* environment organization */
Peng Fan81590632016-08-11 14:02:57 +0800142#define CONFIG_MMCROOT "/dev/mmcblk1p2" /* USDHC2 */
143
Peng Fan81590632016-08-11 14:02:57 +0800144#define CONFIG_IOMUX_LPSR
145
146#define CONFIG_SOFT_SPI
147
Fabio Estevam4ada4f02020-02-03 14:23:58 -0300148#ifdef CONFIG_CMD_NET
149#define CONFIG_FEC_ENET_DEV 1
150#if (CONFIG_FEC_ENET_DEV == 0)
151#define CONFIG_ETHPRIME "eth0"
152#elif (CONFIG_FEC_ENET_DEV == 1)
153#define CONFIG_ETHPRIME "eth1"
154#endif
155#endif
156
Peng Fan81590632016-08-11 14:02:57 +0800157#endif