blob: 69f5e9f96ab5e4f7217c25947580299a1898b7cd [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
Sébastien Szymanski77f29292017-03-07 14:33:25 +010044/* LCD */
Sébastien Szymanski30754ef2018-04-17 17:29:31 +020045#ifndef CONFIG_SPL_BUILD
Sébastien Szymanskib1be79b2019-10-21 15:33:03 +020046#ifdef CONFIG_DM_VIDEO
Sébastien Szymanski77f29292017-03-07 14:33:25 +010047#define CONFIG_VIDEO_LOGO
48#define CONFIG_SPLASH_SCREEN
49#define CONFIG_SPLASH_SCREEN_ALIGN
50#define CONFIG_SPLASH_SOURCE
51#define CONFIG_VIDEO_BMP_RLE8
52#define CONFIG_VIDEO_BMP_LOGO
Sébastien Szymanski77f29292017-03-07 14:33:25 +010053#define CONFIG_BMP_16BPP
Sébastien Szymanskib1be79b2019-10-21 15:33:03 +020054#define CONFIG_BMP_24BPP
55#define CONFIG_BMP_32BPP
Sébastien Szymanski77f29292017-03-07 14:33:25 +010056#define CONFIG_VIDEO_MXS
57#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
58#endif
Sébastien Szymanski30754ef2018-04-17 17:29:31 +020059#endif
Sébastien Szymanski77f29292017-03-07 14:33:25 +010060
61/* Environment is stored in the eMMC boot partition */
Sébastien Szymanski77f29292017-03-07 14:33:25 +010062
63#define CONFIG_ENV_VERSION 100
64#define CONFIG_BOARD_NAME opos6ul
65#define ACFG_CONSOLE_DEV ttymxc0
66#define CONFIG_SYS_AUTOLOAD "no"
67#define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
Sébastien Szymanski77f29292017-03-07 14:33:25 +010068#define CONFIG_BOOTCOMMAND "run emmcboot"
69
70#define CONFIG_EXTRA_ENV_SETTINGS \
71 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
72 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
73 "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
74 "fdt_addr=0x88000000\0" \
75 "fdt_high=0xffffffff\0" \
76 "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \
77 "initrd_high=0xffffffff\0" \
78 "ip_dyn=yes\0" \
79 "stdin=serial\0" \
80 "stdout=serial\0" \
81 "stderr=serial\0" \
82 "mmcdev=0\0" \
83 "mmcpart=2\0" \
84 "mmcroot=/dev/mmcblk0p2 ro\0" \
85 "mmcrootfstype=ext4 rootwait\0" \
86 "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \
Sébastien Szymanskib1be79b2019-10-21 15:33:03 +020087 "splashpos=0,0\0" \
88 "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
Sébastien Szymanski77f29292017-03-07 14:33:25 +010089 "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" \
90 "check_env=if test -n ${flash_env_version}; " \
91 "then env default env_version; " \
92 "else env set flash_env_version ${env_version}; env save; " \
93 "fi; " \
94 "if itest ${flash_env_version} != ${env_version}; then " \
95 "echo \"*** Warning - Environment version" \
96 " change suggests: run flash_reset_env; reset\"; " \
97 "env default flash_reset_env; " \
98 "else exit; fi; \0" \
99 "flash_reset_env=env default -f -a && saveenv && " \
100 "echo Environment variables erased!\0" \
101 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
102 "flash_uboot_spl=" \
103 "if mmc dev 0 1; then " \
104 "setexpr sz ${filesize} / 0x200; " \
105 "setexpr sz ${sz} + 1; " \
106 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
107 "echo Flashing of U-boot SPL succeed; " \
108 "else echo Flashing of U-boot SPL failed; " \
109 "fi; " \
110 "fi;\0" \
111 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
112 "flash_uboot_img=" \
113 "if mmc dev 0 1; then " \
114 "setexpr sz ${filesize} / 0x200; " \
115 "setexpr sz ${sz} + 1; " \
116 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
117 "echo Flashing of U-boot image succeed; " \
118 "else echo Flashing of U-boot image failed; " \
119 "fi; " \
120 "fi;\0" \
121 "update_uboot=run download_uboot_spl flash_uboot_spl " \
122 "download_uboot_img flash_uboot_img\0" \
123 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
124 "flash_kernel=" \
125 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
126 "echo kernel update succeed; " \
127 "else echo kernel update failed; " \
128 "fi;\0" \
129 "update_kernel=run download_kernel flash_kernel\0" \
130 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
131 "flash_dtb=" \
132 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
133 "echo dtb update succeed; " \
134 "else echo dtb update in failed; " \
135 "fi;\0" \
136 "update_dtb=run download_dtb flash_dtb\0" \
137 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
138 "flash_rootfs=" \
139 "if mmc dev 0 0; then " \
140 "setexpr nbblocks ${filesize} / 0x200; " \
141 "setexpr nbblocks ${nbblocks} + 1; " \
142 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
143 "echo Flashing of rootfs image succeed; " \
144 "else echo Flashing of rootfs image failed; " \
145 "fi; " \
146 "fi;\0" \
147 "update_rootfs=run download_rootfs flash_rootfs\0" \
148 "flash_failsafe=" \
149 "if mmc dev 0 0; then " \
150 "setexpr nbblocks ${filesize} / 0x200; " \
151 "setexpr nbblocks ${nbblocks} + 1; " \
152 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
153 "echo Flashing of rootfs image in failsafe partition succeed; " \
154 "else echo Flashing of rootfs image in failsafe partition failed; " \
155 "fi; " \
156 "fi;\0" \
157 "update_failsafe=run download_rootfs flash_failsafe\0" \
158 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
159 "flash_userdata=" \
160 "if mmc dev 0 0; then " \
161 "setexpr nbblocks ${filesize} / 0x200; " \
162 "setexpr nbblocks ${nbblocks} + 1; " \
163 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
164 "echo Flashing of user_data image succeed; " \
165 "else echo Flashing of user_data image failed; " \
166 "fi; " \
167 "fi;\0" \
168 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
169 "erase_userdata=" \
170 "if mmc dev 0 0; then " \
171 "echo Erasing eMMC User Data partition, no way out...; " \
172 "mw ${loadaddr} 0 0x200000; " \
173 "mmc write ${loadaddr} 0 0x1000; " \
174 "mmc write ${loadaddr} 0x800 0x1000; " \
175 "mmc write ${loadaddr} 0x40800 0x1000; " \
176 "mmc write ${loadaddr} 0x440800 0x1000; " \
177 "fi;" \
178 "mmc rescan\0" \
179 "update_all=run update_rootfs update_uboot\0" \
180 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
181 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
182 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
183 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
184 "rootfstype=${mmcrootfstype}\0" \
185 "emmcboot=run initargs; run addmmcargs; " \
186 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
187 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
188 "bootz ${loadaddr} - ${fdt_addr};\0" \
189 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
190 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
191 "nfsroot=${serverip}:${rootpath}\0" \
192 "nfsboot=run initargs; run addnfsargs addipargs; " \
193 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
194 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
195 "bootz ${loadaddr} - ${fdt_addr};\0"
196
197#endif /* __OPOS6ULDEV_CONFIG_H */