blob: 57edeee941e7e15fe241fa5d6562d8662f5c6e14 [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
24#define CONFIG_SUPPORT_EMMC_BOOT
25
26#include "mx6_common.h"
27#include <linux/sizes.h>
28
Akshay Bhat9301aea2016-07-29 11:44:46 -040029#define CONFIG_CMDLINE_TAG
30#define CONFIG_SETUP_MEMORY_TAGS
31#define CONFIG_INITRD_TAG
32#define CONFIG_REVISION_TAG
33#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
34
Akshay Bhat9301aea2016-07-29 11:44:46 -040035#define CONFIG_MXC_UART
36
Akshay Bhat9301aea2016-07-29 11:44:46 -040037/* SATA Configs */
Akshay Bhat9301aea2016-07-29 11:44:46 -040038#define CONFIG_SYS_SATA_MAX_DEVICE 1
39#define CONFIG_DWC_AHSATA_PORT_ID 0
40#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
41#define CONFIG_LBA48
Akshay Bhat9301aea2016-07-29 11:44:46 -040042
43/* MMC Configs */
Akshay Bhat9301aea2016-07-29 11:44:46 -040044#define CONFIG_FSL_USDHC
45#define CONFIG_SYS_FSL_ESDHC_ADDR 0
Akshay Bhat9301aea2016-07-29 11:44:46 -040046
47/* USB Configs */
Akshay Bhat9301aea2016-07-29 11:44:46 -040048#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
49#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
50#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
51#define CONFIG_MXC_USB_FLAGS 0
Akshay Bhat9301aea2016-07-29 11:44:46 -040052
53#define CONFIG_USBD_HS
Akshay Bhat9301aea2016-07-29 11:44:46 -040054
55/* Networking Configs */
56#define CONFIG_FEC_MXC
Akshay Bhat9301aea2016-07-29 11:44:46 -040057#define IMX_FEC_BASE ENET_BASE_ADDR
58#define CONFIG_FEC_XCV_TYPE RGMII
59#define CONFIG_ETHPRIME "FEC"
60#define CONFIG_FEC_MXC_PHYADDR 4
Akshay Bhat9301aea2016-07-29 11:44:46 -040061#define CONFIG_PHY_ATHEROS
62
63/* Serial Flash */
Akshay Bhat9301aea2016-07-29 11:44:46 -040064
65/* allow to overwrite serial and ethaddr */
66#define CONFIG_ENV_OVERWRITE
Akshay Bhat9301aea2016-07-29 11:44:46 -040067
Akshay Bhat9301aea2016-07-29 11:44:46 -040068#define CONFIG_LOADADDR 0x12000000
Akshay Bhat9301aea2016-07-29 11:44:46 -040069
70#define CONFIG_EXTRA_ENV_SETTINGS \
71 "script=boot.scr\0" \
72 "image=" CONFIG_BOOT_DIR "/uImage\0" \
73 "uboot=u-boot.imx\0" \
74 "fdt_file=" CONFIG_BOOT_DIR "/" CONFIG_DEFAULT_FDT_FILE "\0" \
75 "fdt_addr=0x18000000\0" \
76 "boot_fdt=yes\0" \
77 "ip_dyn=yes\0" \
Simon Glass4694a742016-10-17 20:12:39 -060078 "console=" CONSOLE_DEV "\0" \
Akshay Bhat9301aea2016-07-29 11:44:46 -040079 "fdt_high=0xffffffff\0" \
80 "initrd_high=0xffffffff\0" \
81 "sddev=0\0" \
82 "emmcdev=1\0" \
83 "partnum=1\0" \
84 "loadcmd=" CONFIG_LOADCMD "\0" \
85 "rfspart=" CONFIG_RFSPART "\0" \
86 "update_sd_firmware=" \
87 "if test ${ip_dyn} = yes; then " \
88 "setenv get_cmd dhcp; " \
89 "else " \
90 "setenv get_cmd tftp; " \
91 "fi; " \
92 "if mmc dev ${mmcdev}; then " \
93 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
94 "setexpr fw_sz ${filesize} / 0x200; " \
95 "setexpr fw_sz ${fw_sz} + 1; " \
96 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
97 "fi; " \
98 "fi\0" \
99 "update_sf_uboot=" \
100 "if tftp $loadaddr $uboot; then " \
101 "sf probe; " \
102 "sf erase 0 0xC0000; " \
103 "sf write $loadaddr 0x400 $filesize; " \
104 "echo 'U-Boot upgraded. Please reset'; " \
105 "fi\0" \
106 "setargs=setenv bootargs console=${console},${baudrate} " \
107 "root=/dev/${rootdev} rw rootwait " CONFIG_EXTRA_BOOTARGS "\0" \
108 "loadbootscript=" \
109 "${loadcmd} ${dev} ${devnum}:${partnum} ${loadaddr} ${script};\0" \
110 "bootscript=echo Running bootscript from ${dev}:${devnum}:${partnum};" \
111 " source\0" \
112 "loadimage=" \
113 "${loadcmd} ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
114 "loadfdt=${loadcmd} ${dev} ${devnum}:${partnum} ${fdt_addr} ${fdt_file}\0" \
115 "tryboot=" \
116 "if run loadbootscript; then " \
117 "run bootscript; " \
118 "else " \
119 "if run loadimage; then " \
120 "run doboot; " \
121 "fi; " \
122 "fi;\0" \
123 "doboot=echo Booting from ${dev}:${devnum}:${partnum} ...; " \
124 "run setargs; " \
125 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
126 "if run loadfdt; then " \
127 "bootm ${loadaddr} - ${fdt_addr}; " \
128 "else " \
129 "if test ${boot_fdt} = try; then " \
130 "bootm; " \
131 "else " \
132 "echo WARN: Cannot load the DT; " \
133 "fi; " \
134 "fi; " \
135 "else " \
136 "bootm; " \
137 "fi;\0" \
138 "netargs=setenv bootargs console=${console},${baudrate} " \
139 "root=/dev/nfs " \
140 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
141 "netboot=echo Booting from net ...; " \
142 "run netargs; " \
143 "if test ${ip_dyn} = yes; then " \
144 "setenv get_cmd dhcp; " \
145 "else " \
146 "setenv get_cmd tftp; " \
147 "fi; " \
148 "${get_cmd} ${image}; " \
149 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
150 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
151 "bootm ${loadaddr} - ${fdt_addr}; " \
152 "else " \
153 "if test ${boot_fdt} = try; then " \
154 "bootm; " \
155 "else " \
156 "echo WARN: Cannot load the DT; " \
157 "fi; " \
158 "fi; " \
159 "else " \
160 "bootm; " \
161 "fi;\0" \
162
163#define CONFIG_BOOTCOMMAND \
164 "usb start; " \
165 "setenv dev usb; " \
166 "setenv devnum 0; " \
167 "setenv rootdev sda${rfspart}; " \
168 "run tryboot; " \
169 \
170 "setenv dev mmc; " \
171 "setenv rootdev mmcblk0p${rfspart}; " \
172 \
173 "setenv devnum ${sddev}; " \
174 "if mmc dev ${devnum}; then " \
175 "run tryboot; " \
176 "fi; " \
177 \
178 "setenv devnum ${emmcdev}; " \
179 "setenv rootdev mmcblk${emmcdev}p${rfspart}; " \
180 "if mmc dev ${devnum}; then " \
181 "run tryboot; " \
182 "fi; " \
183 \
184 "bmode usb; " \
185
186#define CONFIG_ARP_TIMEOUT 200UL
187
188/* Miscellaneous configurable options */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400189
Akshay Bhat9301aea2016-07-29 11:44:46 -0400190#define CONFIG_SYS_MEMTEST_START 0x10000000
191#define CONFIG_SYS_MEMTEST_END 0x10010000
192#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
193
194#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
195
Akshay Bhat9301aea2016-07-29 11:44:46 -0400196/* Physical Memory Map */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400197#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
198
199#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
200#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
201#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
202
203#define CONFIG_SYS_INIT_SP_OFFSET \
204 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
205#define CONFIG_SYS_INIT_SP_ADDR \
206 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
207
208/* FLASH and environment organization */
Akshay Bhat9301aea2016-07-29 11:44:46 -0400209
Akshay Bhat9301aea2016-07-29 11:44:46 -0400210#define CONFIG_ENV_SIZE (8 * 1024)
211#define CONFIG_ENV_OFFSET (768 * 1024)
212#define CONFIG_ENV_SECT_SIZE (64 * 1024)
Akshay Bhat9301aea2016-07-29 11:44:46 -0400213
Akshay Bhat9301aea2016-07-29 11:44:46 -0400214#define CONFIG_SYS_FSL_USDHC_NUM 3
215
216/* Framebuffer */
Yung-Ching LIN7bcb3892017-03-29 01:51:22 +0800217#ifdef CONFIG_VIDEO
Akshay Bhat9301aea2016-07-29 11:44:46 -0400218#define CONFIG_VIDEO_BMP_RLE8
219#define CONFIG_SPLASH_SCREEN
220#define CONFIG_SPLASH_SCREEN_ALIGN
221#define CONFIG_BMP_16BPP
222#define CONFIG_VIDEO_LOGO
223#define CONFIG_VIDEO_BMP_LOGO
Akshay Bhat9301aea2016-07-29 11:44:46 -0400224#define CONFIG_IMX_HDMI
225#define CONFIG_IMX_VIDEO_SKIP
Yung-Ching LIN7bcb3892017-03-29 01:51:22 +0800226#endif
Akshay Bhat9301aea2016-07-29 11:44:46 -0400227
228#define CONFIG_PWM_IMX
229#define CONFIG_IMX6_PWM_PER_CLK 66000000
230
Akshay Bhat9301aea2016-07-29 11:44:46 -0400231#ifdef CONFIG_CMD_PCI
Akshay Bhat9301aea2016-07-29 11:44:46 -0400232#define CONFIG_PCI_SCAN_SHOW
233#define CONFIG_PCIE_IMX
234#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12)
235#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(1, 5)
236#endif
237
238/* I2C Configs */
239#define CONFIG_SYS_I2C
240#define CONFIG_SYS_I2C_MXC
241#define CONFIG_SYS_I2C_SPEED 100000
242#define CONFIG_SYS_I2C_MXC_I2C1
243#define CONFIG_SYS_I2C_MXC_I2C2
244#define CONFIG_SYS_I2C_MXC_I2C3
245
246#endif /* __ADVANTECH_DMSBA16_CONFIG_H */