blob: 4bbb8d01488a911ded05bd63a1461ae46014f6d7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Akshay Bhat9301aea2016-07-29 11:44:46 -04002/*
3 * Copyright (C) 2016 Timesys Corporation
4 * Copyright (C) 2016 Advantech Corporation
5 * Copyright (C) 2012 Freescale Semiconductor, Inc.
Akshay Bhat9301aea2016-07-29 11:44:46 -04006 */
7
8#ifndef __ADVANTECH_DMSBA16_CONFIG_H
9#define __ADVANTECH_DMSBA16_CONFIG_H
10
11#include <asm/arch/imx-regs.h>
Stefano Babic33731bc2017-06-29 10:16:06 +020012#include <asm/mach-imx/gpio.h>
Akshay Bhat9301aea2016-07-29 11:44:46 -040013
14#define CONFIG_BOARD_NAME "Advantech DMS-BA16"
Akshay Bhat9301aea2016-07-29 11:44:46 -040015
16#define CONFIG_MXC_UART_BASE UART4_BASE
Simon Glass4694a742016-10-17 20:12:39 -060017#define CONSOLE_DEV "ttymxc3"
Akshay Bhat9301aea2016-07-29 11:44:46 -040018#define CONFIG_EXTRA_BOOTARGS "panic=10"
19
20#define CONFIG_BOOT_DIR ""
21#define CONFIG_LOADCMD "fatload"
22#define CONFIG_RFSPART "2"
23
Akshay Bhat9301aea2016-07-29 11:44:46 -040024#include "mx6_common.h"
25#include <linux/sizes.h>
26
Akshay Bhat9301aea2016-07-29 11:44:46 -040027#define CONFIG_CMDLINE_TAG
28#define CONFIG_SETUP_MEMORY_TAGS
29#define CONFIG_INITRD_TAG
30#define CONFIG_REVISION_TAG
31#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
32
Akshay Bhat9301aea2016-07-29 11:44:46 -040033/* SATA Configs */
Akshay Bhat9301aea2016-07-29 11:44:46 -040034#define CONFIG_SYS_SATA_MAX_DEVICE 1
35#define CONFIG_DWC_AHSATA_PORT_ID 0
36#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
37#define CONFIG_LBA48
Akshay Bhat9301aea2016-07-29 11:44:46 -040038
39/* MMC Configs */
Akshay Bhat9301aea2016-07-29 11:44:46 -040040#define CONFIG_SYS_FSL_ESDHC_ADDR 0
Akshay Bhat9301aea2016-07-29 11:44:46 -040041
42/* USB Configs */
Akshay Bhat9301aea2016-07-29 11:44:46 -040043#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
44#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
45#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
46#define CONFIG_MXC_USB_FLAGS 0
Akshay Bhat9301aea2016-07-29 11:44:46 -040047
48#define CONFIG_USBD_HS
Akshay Bhat9301aea2016-07-29 11:44:46 -040049
50/* Networking Configs */
51#define CONFIG_FEC_MXC
Akshay Bhat9301aea2016-07-29 11:44:46 -040052#define IMX_FEC_BASE ENET_BASE_ADDR
53#define CONFIG_FEC_XCV_TYPE RGMII
54#define CONFIG_ETHPRIME "FEC"
55#define CONFIG_FEC_MXC_PHYADDR 4
Akshay Bhat9301aea2016-07-29 11:44:46 -040056
57/* Serial Flash */
Akshay Bhat9301aea2016-07-29 11:44:46 -040058
59/* allow to overwrite serial and ethaddr */
60#define CONFIG_ENV_OVERWRITE
Akshay Bhat9301aea2016-07-29 11:44:46 -040061
Akshay Bhat9301aea2016-07-29 11:44:46 -040062#define CONFIG_LOADADDR 0x12000000
Akshay Bhat9301aea2016-07-29 11:44:46 -040063
64#define CONFIG_EXTRA_ENV_SETTINGS \
65 "script=boot.scr\0" \
66 "image=" CONFIG_BOOT_DIR "/uImage\0" \
67 "uboot=u-boot.imx\0" \
68 "fdt_file=" CONFIG_BOOT_DIR "/" CONFIG_DEFAULT_FDT_FILE "\0" \
69 "fdt_addr=0x18000000\0" \
70 "boot_fdt=yes\0" \
71 "ip_dyn=yes\0" \
Simon Glass4694a742016-10-17 20:12:39 -060072 "console=" CONSOLE_DEV "\0" \
Akshay Bhat9301aea2016-07-29 11:44:46 -040073 "fdt_high=0xffffffff\0" \
74 "initrd_high=0xffffffff\0" \
75 "sddev=0\0" \
76 "emmcdev=1\0" \
77 "partnum=1\0" \
78 "loadcmd=" CONFIG_LOADCMD "\0" \
79 "rfspart=" CONFIG_RFSPART "\0" \
80 "update_sd_firmware=" \
81 "if test ${ip_dyn} = yes; then " \
82 "setenv get_cmd dhcp; " \
83 "else " \
84 "setenv get_cmd tftp; " \
85 "fi; " \
86 "if mmc dev ${mmcdev}; then " \
87 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
88 "setexpr fw_sz ${filesize} / 0x200; " \
89 "setexpr fw_sz ${fw_sz} + 1; " \
90 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
91 "fi; " \
92 "fi\0" \
93 "update_sf_uboot=" \
94 "if tftp $loadaddr $uboot; then " \
95 "sf probe; " \
96 "sf erase 0 0xC0000; " \
97 "sf write $loadaddr 0x400 $filesize; " \
98 "echo 'U-Boot upgraded. Please reset'; " \
99 "fi\0" \
100 "setargs=setenv bootargs console=${console},${baudrate} " \
101 "root=/dev/${rootdev} rw rootwait " CONFIG_EXTRA_BOOTARGS "\0" \
102 "loadbootscript=" \
103 "${loadcmd} ${dev} ${devnum}:${partnum} ${loadaddr} ${script};\0" \
104 "bootscript=echo Running bootscript from ${dev}:${devnum}:${partnum};" \
105 " source\0" \
106 "loadimage=" \
107 "${loadcmd} ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
108 "loadfdt=${loadcmd} ${dev} ${devnum}:${partnum} ${fdt_addr} ${fdt_file}\0" \
109 "tryboot=" \
110 "if run loadbootscript; then " \
111 "run bootscript; " \
112 "else " \
113 "if run loadimage; then " \
114 "run doboot; " \
115 "fi; " \
116 "fi;\0" \
117 "doboot=echo Booting from ${dev}:${devnum}:${partnum} ...; " \
118 "run setargs; " \
119 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
120 "if run loadfdt; then " \
121 "bootm ${loadaddr} - ${fdt_addr}; " \
122 "else " \
123 "if test ${boot_fdt} = try; then " \
124 "bootm; " \
125 "else " \
126 "echo WARN: Cannot load the DT; " \
127 "fi; " \
128 "fi; " \
129 "else " \
130 "bootm; " \
131 "fi;\0" \
132 "netargs=setenv bootargs console=${console},${baudrate} " \
133 "root=/dev/nfs " \
134 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
135 "netboot=echo Booting from net ...; " \
136 "run netargs; " \
137 "if test ${ip_dyn} = yes; then " \
138 "setenv get_cmd dhcp; " \
139 "else " \
140 "setenv get_cmd tftp; " \
141 "fi; " \
142 "${get_cmd} ${image}; " \
143 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
144 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
145 "bootm ${loadaddr} - ${fdt_addr}; " \
146 "else " \
147 "if test ${boot_fdt} = try; then " \
148 "bootm; " \
149 "else " \
150 "echo WARN: Cannot load the DT; " \
151 "fi; " \
152 "fi; " \
153 "else " \
154 "bootm; " \
155 "fi;\0" \
156
157#define CONFIG_BOOTCOMMAND \
158 "usb start; " \
159 "setenv dev usb; " \
160 "setenv devnum 0; " \
161 "setenv rootdev sda${rfspart}; " \
162 "run tryboot; " \
163 \
164 "setenv dev mmc; " \
165 "setenv rootdev mmcblk0p${rfspart}; " \
166 \
167 "setenv devnum ${sddev}; " \
168 "if mmc dev ${devnum}; then " \
169 "run tryboot; " \
170 "fi; " \
171 \
172 "setenv devnum ${emmcdev}; " \
173 "setenv rootdev mmcblk${emmcdev}p${rfspart}; " \
174 "if mmc dev ${devnum}; then " \
175 "run tryboot; " \
176 "fi; " \
177 \
178 "bmode usb; " \
179
180#define CONFIG_ARP_TIMEOUT 200UL
181
182/* Miscellaneous configurable options */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400183
Akshay Bhat9301aea2016-07-29 11:44:46 -0400184#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
185
Akshay Bhat9301aea2016-07-29 11:44:46 -0400186/* Physical Memory Map */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400187#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
188
189#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
190#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
191#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
192
193#define CONFIG_SYS_INIT_SP_OFFSET \
194 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
195#define CONFIG_SYS_INIT_SP_ADDR \
196 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
197
198/* FLASH and environment organization */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400199
Akshay Bhat9301aea2016-07-29 11:44:46 -0400200#define CONFIG_SYS_FSL_USDHC_NUM 3
201
202/* Framebuffer */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400203#define CONFIG_VIDEO_BMP_RLE8
204#define CONFIG_SPLASH_SCREEN
205#define CONFIG_SPLASH_SCREEN_ALIGN
206#define CONFIG_BMP_16BPP
207#define CONFIG_VIDEO_LOGO
208#define CONFIG_VIDEO_BMP_LOGO
Akshay Bhat9301aea2016-07-29 11:44:46 -0400209#define CONFIG_IMX_HDMI
210#define CONFIG_IMX_VIDEO_SKIP
211
Akshay Bhat9301aea2016-07-29 11:44:46 -0400212#define CONFIG_IMX6_PWM_PER_CLK 66000000
213
Akshay Bhat9301aea2016-07-29 11:44:46 -0400214#ifdef CONFIG_CMD_PCI
Akshay Bhat9301aea2016-07-29 11:44:46 -0400215#define CONFIG_PCI_SCAN_SHOW
216#define CONFIG_PCIE_IMX
217#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12)
218#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(1, 5)
219#endif
220
221/* I2C Configs */
222#define CONFIG_SYS_I2C
223#define CONFIG_SYS_I2C_MXC
224#define CONFIG_SYS_I2C_SPEED 100000
225#define CONFIG_SYS_I2C_MXC_I2C1
226#define CONFIG_SYS_I2C_MXC_I2C2
227#define CONFIG_SYS_I2C_MXC_I2C3
228
229#endif /* __ADVANTECH_DMSBA16_CONFIG_H */