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