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