blob: 654f8349f4df6df0683efd7d4a4d88ce834f273b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Otavio Salvadorb604d8a2015-02-17 10:42:46 -02002/*
3 * Copyright (C) 2014 O.S. Systems Software LTDA.
4 * Copyright (C) 2014 Kynetics LLC.
5 * Copyright (C) 2014 Revolution Robotics, Inc.
6 *
7 * Author: Otavio Salvador <otavio@ossystems.com.br>
8 *
9 * Configuration settings for the WaRP Board
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020010 */
11
12#ifndef __CONFIG_H
13#define __CONFIG_H
14
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020015#include "mx6_common.h"
16
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020017/* Size of malloc() pool */
Fabio Estevamf0473d62015-03-02 10:17:17 -030018#define CONFIG_SYS_MALLOC_LEN (35 * SZ_1M) /* Increase due to DFU */
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020019
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020020#define CONFIG_MXC_UART
21#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
22
23/* MMC Configs */
Fabio Estevam692182b2015-05-27 01:11:45 -030024#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
Fabio Estevam38e9cd82015-03-11 22:52:15 -030025#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020026
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020027/* Watchdog */
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020028
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020029/* Physical Memory Map */
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020030#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020031
32#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
33#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
34#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
35
36#define CONFIG_SYS_INIT_SP_OFFSET \
37 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
38#define CONFIG_SYS_INIT_SP_ADDR \
39 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
40
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020041#define CONFIG_SYS_MMC_ENV_DEV 0
42
43/* VDD voltage 1.65 - 1.95 */
44#define CONFIG_SYS_SD_VOLTAGE 0x00000080
45
Fabio Estevam019b51c2015-02-28 15:16:42 -030046/* USB Configs */
Fabio Estevam019b51c2015-02-28 15:16:42 -030047#ifdef CONFIG_CMD_USB
Fabio Estevam019b51c2015-02-28 15:16:42 -030048#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
49#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
50#define CONFIG_MXC_USB_FLAGS 0
51#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* Only OTG2 port enabled */
52#endif
53
Fabio Estevam019b51c2015-02-28 15:16:42 -030054#define CONFIG_USBD_HS
Fabio Estevam019b51c2015-02-28 15:16:42 -030055
Fabio Estevamce48d582015-05-27 01:11:44 -030056#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
Fabio Estevamf0473d62015-03-02 10:17:17 -030057#define DFU_DEFAULT_POLL_TIMEOUT 300
58
Fabio Estevam99bfe1d2015-07-21 19:48:41 -030059/* I2C Configs */
Fabio Estevam99bfe1d2015-07-21 19:48:41 -030060#define CONFIG_SYS_I2C
61#define CONFIG_SYS_I2C_MXC
Albert ARIBAUD \\(3ADEV\\)eb943872015-09-21 22:43:38 +020062#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
63#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
Fabio Estevam99bfe1d2015-07-21 19:48:41 -030064#define CONFIG_SYS_I2C_SPEED 100000
65
66/* PMIC */
67#define CONFIG_POWER
68#define CONFIG_POWER_I2C
69#define CONFIG_POWER_MAX77696
Fabio Estevam0abdeb32015-05-27 01:11:47 -030070
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020071#define CONFIG_EXTRA_ENV_SETTINGS \
72 "script=boot.scr\0" \
73 "image=zImage\0" \
74 "console=ttymxc0\0" \
75 "fdt_high=0xffffffff\0" \
76 "initrd_high=0xffffffff\0" \
77 "fdt_file=imx6sl-warp.dtb\0" \
78 "fdt_addr=0x88000000\0" \
79 "initrd_addr=0x83800000\0" \
80 "boot_fdt=try\0" \
81 "ip_dyn=yes\0" \
82 "mmcdev=0\0" \
83 "mmcpart=1\0" \
Fabio Estevamc951fa72017-07-11 14:24:29 -030084 "finduuid=part uuid mmc 0:2 uuid\0" \
Fabio Estevamf0473d62015-03-02 10:17:17 -030085 "dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\0" \
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020086 "mmcargs=setenv bootargs console=${console},${baudrate} " \
Fabio Estevamc951fa72017-07-11 14:24:29 -030087 "root=PARTUUID=${uuid} rootwait rw\0" \
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020088 "loadbootscript=" \
89 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
90 "bootscript=echo Running bootscript from mmc ...; " \
91 "source\0" \
92 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
93 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
94 "mmcboot=echo Booting from mmc ...; " \
Fabio Estevamc951fa72017-07-11 14:24:29 -030095 "run finduuid; " \
Otavio Salvadorb604d8a2015-02-17 10:42:46 -020096 "run mmcargs; " \
97 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
98 "if run loadfdt; 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 "netargs=setenv bootargs console=${console},${baudrate} " \
111 "root=/dev/nfs " \
112 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
113 "netboot=echo Booting from net ...; " \
114 "run netargs; " \
115 "if test ${ip_dyn} = yes; then " \
116 "setenv get_cmd dhcp; " \
117 "else " \
118 "setenv get_cmd tftp; " \
119 "fi; " \
120 "${get_cmd} ${image}; " \
121 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
122 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
123 "bootz ${loadaddr} - ${fdt_addr}; " \
124 "else " \
125 "if test ${boot_fdt} = try; then " \
126 "bootz; " \
127 "else " \
128 "echo WARN: Cannot load the DT; " \
129 "fi; " \
130 "fi; " \
131 "else " \
132 "bootz; " \
133 "fi;\0"
134
135#define CONFIG_BOOTCOMMAND \
136 "mmc dev ${mmcdev};" \
137 "mmc dev ${mmcdev}; if mmc rescan; then " \
138 "if run loadbootscript; then " \
139 "run bootscript; " \
140 "else " \
141 "if run loadimage; then " \
142 "run mmcboot; " \
143 "else run netboot; " \
144 "fi; " \
145 "fi; " \
146 "else run netboot; fi"
147
148#endif /* __CONFIG_H */