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