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