blob: 309b4717c483b523d7f3f383c6c8d7cae73553ab [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Sébastien Szymanski77f29292017-03-07 14:33:25 +01002/*
3 * Copyright (C) 2017 Armadeus Systems
4 *
5 * Configuration settings for the OPOS6ULDev board
Sébastien Szymanski77f29292017-03-07 14:33:25 +01006 */
7
8#ifndef __OPOS6ULDEV_CONFIG_H
9#define __OPOS6ULDEV_CONFIG_H
10
11#include "mx6_common.h"
12
13#ifdef CONFIG_SPL
14#include "imx6_spl.h"
15
16#ifdef CONFIG_SPL_BUILD
Sébastien Szymanski30754ef2018-04-17 17:29:31 +020017#undef CONFIG_DM_REGULATOR
Sébastien Szymanski77f29292017-03-07 14:33:25 +010018#endif
19#endif
20
21/* Size of malloc() pool */
22#define CONFIG_SYS_MALLOC_LEN (16 << 20)
23
24/* Miscellaneous configurable options */
25#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR
26
27/* Physical Memory Map */
Sébastien Szymanski77f29292017-03-07 14:33:25 +010028#define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
29#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
30#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
31#define CONFIG_SYS_INIT_SP_OFFSET \
32 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
33#define CONFIG_SYS_INIT_SP_ADDR \
34 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
35
Sébastien Szymanski77f29292017-03-07 14:33:25 +010036/* USB */
37#ifdef CONFIG_USB_EHCI_MX6
38#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
39#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
40#define CONFIG_MXC_USB_FLAGS 0
41#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Sébastien Szymanski77f29292017-03-07 14:33:25 +010042#endif
43
44/* Ethernet */
45#ifdef CONFIG_FEC_MXC
46#define IMX_FEC_BASE ENET_BASE_ADDR
47#define CONFIG_FEC_MXC_PHYADDR 0x1
48#define CONFIG_FEC_XCV_TYPE RMII
49#define CONFIG_ETHPRIME "FEC"
Sébastien Szymanski77f29292017-03-07 14:33:25 +010050#endif
51
52/* LCD */
Sébastien Szymanski30754ef2018-04-17 17:29:31 +020053#ifndef CONFIG_SPL_BUILD
Sébastien Szymanski77f29292017-03-07 14:33:25 +010054#ifdef CONFIG_VIDEO
55#define CONFIG_VIDEO_LOGO
56#define CONFIG_SPLASH_SCREEN
57#define CONFIG_SPLASH_SCREEN_ALIGN
58#define CONFIG_SPLASH_SOURCE
59#define CONFIG_VIDEO_BMP_RLE8
60#define CONFIG_VIDEO_BMP_LOGO
Sébastien Szymanski77f29292017-03-07 14:33:25 +010061#define CONFIG_BMP_16BPP
62#define CONFIG_VIDEO_MXS
63#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
64#endif
Sébastien Szymanski30754ef2018-04-17 17:29:31 +020065#endif
Sébastien Szymanski77f29292017-03-07 14:33:25 +010066
67/* Environment is stored in the eMMC boot partition */
Sébastien Szymanski77f29292017-03-07 14:33:25 +010068#define CONFIG_SYS_MMC_ENV_DEV 0
69#define CONFIG_SYS_MMC_ENV_PART 1
70#define CONFIG_ENV_SIZE (10 * 1024)
71#define CONFIG_ENV_OFFSET (1024 * 1024) /* 1 MB */
72#define CONFIG_ENV_OFFSET_REDUND (1536 * 1024) /* 512KB from CONFIG_ENV_OFFSET */
73
74#define CONFIG_ENV_VERSION 100
75#define CONFIG_BOARD_NAME opos6ul
76#define ACFG_CONSOLE_DEV ttymxc0
77#define CONFIG_SYS_AUTOLOAD "no"
78#define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
Sébastien Szymanski77f29292017-03-07 14:33:25 +010079#define CONFIG_BOOTCOMMAND "run emmcboot"
80
81#define CONFIG_EXTRA_ENV_SETTINGS \
82 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
83 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
84 "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
85 "fdt_addr=0x88000000\0" \
86 "fdt_high=0xffffffff\0" \
87 "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \
88 "initrd_high=0xffffffff\0" \
89 "ip_dyn=yes\0" \
90 "stdin=serial\0" \
91 "stdout=serial\0" \
92 "stderr=serial\0" \
93 "mmcdev=0\0" \
94 "mmcpart=2\0" \
95 "mmcroot=/dev/mmcblk0p2 ro\0" \
96 "mmcrootfstype=ext4 rootwait\0" \
97 "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \
98 "videomode=video=ctfb:x:800,y:480,depth:18,pclk:33033,le:96,ri:96,up:20,lo:21,hs:64,vs:4,sync:0,vmode:0\0" \
99 "check_env=if test -n ${flash_env_version}; " \
100 "then env default env_version; " \
101 "else env set flash_env_version ${env_version}; env save; " \
102 "fi; " \
103 "if itest ${flash_env_version} != ${env_version}; then " \
104 "echo \"*** Warning - Environment version" \
105 " change suggests: run flash_reset_env; reset\"; " \
106 "env default flash_reset_env; " \
107 "else exit; fi; \0" \
108 "flash_reset_env=env default -f -a && saveenv && " \
109 "echo Environment variables erased!\0" \
110 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
111 "flash_uboot_spl=" \
112 "if mmc dev 0 1; then " \
113 "setexpr sz ${filesize} / 0x200; " \
114 "setexpr sz ${sz} + 1; " \
115 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
116 "echo Flashing of U-boot SPL succeed; " \
117 "else echo Flashing of U-boot SPL failed; " \
118 "fi; " \
119 "fi;\0" \
120 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
121 "flash_uboot_img=" \
122 "if mmc dev 0 1; then " \
123 "setexpr sz ${filesize} / 0x200; " \
124 "setexpr sz ${sz} + 1; " \
125 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
126 "echo Flashing of U-boot image succeed; " \
127 "else echo Flashing of U-boot image failed; " \
128 "fi; " \
129 "fi;\0" \
130 "update_uboot=run download_uboot_spl flash_uboot_spl " \
131 "download_uboot_img flash_uboot_img\0" \
132 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
133 "flash_kernel=" \
134 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
135 "echo kernel update succeed; " \
136 "else echo kernel update failed; " \
137 "fi;\0" \
138 "update_kernel=run download_kernel flash_kernel\0" \
139 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
140 "flash_dtb=" \
141 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
142 "echo dtb update succeed; " \
143 "else echo dtb update in failed; " \
144 "fi;\0" \
145 "update_dtb=run download_dtb flash_dtb\0" \
146 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
147 "flash_rootfs=" \
148 "if mmc dev 0 0; then " \
149 "setexpr nbblocks ${filesize} / 0x200; " \
150 "setexpr nbblocks ${nbblocks} + 1; " \
151 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
152 "echo Flashing of rootfs image succeed; " \
153 "else echo Flashing of rootfs image failed; " \
154 "fi; " \
155 "fi;\0" \
156 "update_rootfs=run download_rootfs flash_rootfs\0" \
157 "flash_failsafe=" \
158 "if mmc dev 0 0; then " \
159 "setexpr nbblocks ${filesize} / 0x200; " \
160 "setexpr nbblocks ${nbblocks} + 1; " \
161 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
162 "echo Flashing of rootfs image in failsafe partition succeed; " \
163 "else echo Flashing of rootfs image in failsafe partition failed; " \
164 "fi; " \
165 "fi;\0" \
166 "update_failsafe=run download_rootfs flash_failsafe\0" \
167 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
168 "flash_userdata=" \
169 "if mmc dev 0 0; then " \
170 "setexpr nbblocks ${filesize} / 0x200; " \
171 "setexpr nbblocks ${nbblocks} + 1; " \
172 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
173 "echo Flashing of user_data image succeed; " \
174 "else echo Flashing of user_data image failed; " \
175 "fi; " \
176 "fi;\0" \
177 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
178 "erase_userdata=" \
179 "if mmc dev 0 0; then " \
180 "echo Erasing eMMC User Data partition, no way out...; " \
181 "mw ${loadaddr} 0 0x200000; " \
182 "mmc write ${loadaddr} 0 0x1000; " \
183 "mmc write ${loadaddr} 0x800 0x1000; " \
184 "mmc write ${loadaddr} 0x40800 0x1000; " \
185 "mmc write ${loadaddr} 0x440800 0x1000; " \
186 "fi;" \
187 "mmc rescan\0" \
188 "update_all=run update_rootfs update_uboot\0" \
189 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
190 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
191 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
192 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
193 "rootfstype=${mmcrootfstype}\0" \
194 "emmcboot=run initargs; run addmmcargs; " \
195 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
196 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
197 "bootz ${loadaddr} - ${fdt_addr};\0" \
198 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
199 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
200 "nfsroot=${serverip}:${rootpath}\0" \
201 "nfsboot=run initargs; run addnfsargs addipargs; " \
202 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
203 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
204 "bootz ${loadaddr} - ${fdt_addr};\0"
205
206#endif /* __OPOS6ULDEV_CONFIG_H */