blob: d9311a493508a3c1e372c7e1426cbf12e7b5610e [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
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010021/* Miscellaneous configurable options */
22#define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR
23
24/* Physical Memory Map */
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010025#define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
26#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
27#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
28#define CONFIG_SYS_INIT_SP_OFFSET \
29 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
30#define CONFIG_SYS_INIT_SP_ADDR \
31 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
32
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010033/* USB */
34#ifdef CONFIG_USB_EHCI_MX6
35#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
36#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
37#define CONFIG_MXC_USB_FLAGS 0
38#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010039#endif
40
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010041/* LCD */
Sébastien Szymanski1f29ce52018-04-17 17:29:31 +020042#ifndef CONFIG_SPL_BUILD
Sébastien Szymanskid5c96132019-10-21 15:33:03 +020043#ifdef CONFIG_DM_VIDEO
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010044#define CONFIG_VIDEO_LOGO
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010045#define CONFIG_VIDEO_BMP_LOGO
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010046#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
47#endif
Sébastien Szymanski1f29ce52018-04-17 17:29:31 +020048#endif
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010049
50/* Environment is stored in the eMMC boot partition */
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010051
52#define CONFIG_ENV_VERSION 100
53#define CONFIG_BOARD_NAME opos6ul
54#define ACFG_CONSOLE_DEV ttymxc0
55#define CONFIG_SYS_AUTOLOAD "no"
56#define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010057#define CONFIG_BOOTCOMMAND "run emmcboot"
58
59#define CONFIG_EXTRA_ENV_SETTINGS \
60 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
61 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
62 "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
63 "fdt_addr=0x88000000\0" \
64 "fdt_high=0xffffffff\0" \
65 "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \
66 "initrd_high=0xffffffff\0" \
67 "ip_dyn=yes\0" \
68 "stdin=serial\0" \
69 "stdout=serial\0" \
70 "stderr=serial\0" \
71 "mmcdev=0\0" \
72 "mmcpart=2\0" \
73 "mmcroot=/dev/mmcblk0p2 ro\0" \
74 "mmcrootfstype=ext4 rootwait\0" \
75 "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \
Sébastien Szymanskid5c96132019-10-21 15:33:03 +020076 "splashpos=0,0\0" \
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020077 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010078 "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" \
79 "check_env=if test -n ${flash_env_version}; " \
80 "then env default env_version; " \
81 "else env set flash_env_version ${env_version}; env save; " \
82 "fi; " \
83 "if itest ${flash_env_version} != ${env_version}; then " \
84 "echo \"*** Warning - Environment version" \
85 " change suggests: run flash_reset_env; reset\"; " \
86 "env default flash_reset_env; " \
87 "else exit; fi; \0" \
88 "flash_reset_env=env default -f -a && saveenv && " \
89 "echo Environment variables erased!\0" \
90 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
91 "flash_uboot_spl=" \
92 "if mmc dev 0 1; then " \
93 "setexpr sz ${filesize} / 0x200; " \
94 "setexpr sz ${sz} + 1; " \
95 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
96 "echo Flashing of U-boot SPL succeed; " \
97 "else echo Flashing of U-boot SPL failed; " \
98 "fi; " \
99 "fi;\0" \
100 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
101 "flash_uboot_img=" \
102 "if mmc dev 0 1; then " \
103 "setexpr sz ${filesize} / 0x200; " \
104 "setexpr sz ${sz} + 1; " \
105 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
106 "echo Flashing of U-boot image succeed; " \
107 "else echo Flashing of U-boot image failed; " \
108 "fi; " \
109 "fi;\0" \
110 "update_uboot=run download_uboot_spl flash_uboot_spl " \
111 "download_uboot_img flash_uboot_img\0" \
112 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
113 "flash_kernel=" \
114 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
115 "echo kernel update succeed; " \
116 "else echo kernel update failed; " \
117 "fi;\0" \
118 "update_kernel=run download_kernel flash_kernel\0" \
119 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
120 "flash_dtb=" \
121 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
122 "echo dtb update succeed; " \
123 "else echo dtb update in failed; " \
124 "fi;\0" \
125 "update_dtb=run download_dtb flash_dtb\0" \
126 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
127 "flash_rootfs=" \
128 "if mmc dev 0 0; then " \
129 "setexpr nbblocks ${filesize} / 0x200; " \
130 "setexpr nbblocks ${nbblocks} + 1; " \
131 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
132 "echo Flashing of rootfs image succeed; " \
133 "else echo Flashing of rootfs image failed; " \
134 "fi; " \
135 "fi;\0" \
136 "update_rootfs=run download_rootfs flash_rootfs\0" \
137 "flash_failsafe=" \
138 "if mmc dev 0 0; then " \
139 "setexpr nbblocks ${filesize} / 0x200; " \
140 "setexpr nbblocks ${nbblocks} + 1; " \
141 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
142 "echo Flashing of rootfs image in failsafe partition succeed; " \
143 "else echo Flashing of rootfs image in failsafe partition failed; " \
144 "fi; " \
145 "fi;\0" \
146 "update_failsafe=run download_rootfs flash_failsafe\0" \
147 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
148 "flash_userdata=" \
149 "if mmc dev 0 0; then " \
150 "setexpr nbblocks ${filesize} / 0x200; " \
151 "setexpr nbblocks ${nbblocks} + 1; " \
152 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
153 "echo Flashing of user_data image succeed; " \
154 "else echo Flashing of user_data image failed; " \
155 "fi; " \
156 "fi;\0" \
157 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
158 "erase_userdata=" \
159 "if mmc dev 0 0; then " \
160 "echo Erasing eMMC User Data partition, no way out...; " \
161 "mw ${loadaddr} 0 0x200000; " \
162 "mmc write ${loadaddr} 0 0x1000; " \
163 "mmc write ${loadaddr} 0x800 0x1000; " \
164 "mmc write ${loadaddr} 0x40800 0x1000; " \
165 "mmc write ${loadaddr} 0x440800 0x1000; " \
166 "fi;" \
167 "mmc rescan\0" \
168 "update_all=run update_rootfs update_uboot\0" \
169 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
170 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
171 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
172 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
173 "rootfstype=${mmcrootfstype}\0" \
174 "emmcboot=run initargs; run addmmcargs; " \
175 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
176 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
177 "bootz ${loadaddr} - ${fdt_addr};\0" \
178 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
179 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
180 "nfsroot=${serverip}:${rootpath}\0" \
181 "nfsboot=run initargs; run addnfsargs addipargs; " \
182 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
183 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
184 "bootz ${loadaddr} - ${fdt_addr};\0"
185
186#endif /* __OPOS6ULDEV_CONFIG_H */