1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2017 Armadeus Systems
5 * Configuration settings for the OPOS6ULDev board
8 #ifndef __OPOS6ULDEV_CONFIG_H
9 #define __OPOS6ULDEV_CONFIG_H
11 #include "mx6_common.h"
16 #ifdef CONFIG_SPL_BUILD
17 #undef CONFIG_DM_REGULATOR
21 /* Size of malloc() pool */
22 #define CONFIG_SYS_MALLOC_LEN (16 << 20)
24 /* Miscellaneous configurable options */
25 #define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR
27 /* Physical Memory Map */
28 #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)
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
45 #ifndef CONFIG_SPL_BUILD
46 #ifdef CONFIG_DM_VIDEO
47 #define CONFIG_VIDEO_LOGO
48 #define CONFIG_SPLASH_SCREEN
49 #define CONFIG_SPLASH_SCREEN_ALIGN
50 #define CONFIG_SPLASH_SOURCE
51 #define CONFIG_VIDEO_BMP_RLE8
52 #define CONFIG_VIDEO_BMP_LOGO
53 #define CONFIG_BMP_16BPP
54 #define CONFIG_BMP_24BPP
55 #define CONFIG_BMP_32BPP
56 #define CONFIG_VIDEO_MXS
57 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
61 /* Environment is stored in the eMMC boot partition */
62 #define CONFIG_SYS_MMC_ENV_DEV 0
63 #define CONFIG_SYS_MMC_ENV_PART 1
65 #define CONFIG_ENV_VERSION 100
66 #define CONFIG_BOARD_NAME opos6ul
67 #define ACFG_CONSOLE_DEV ttymxc0
68 #define CONFIG_SYS_AUTOLOAD "no"
69 #define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
70 #define CONFIG_BOOTCOMMAND "run emmcboot"
72 #define CONFIG_EXTRA_ENV_SETTINGS \
73 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
74 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
75 "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
76 "fdt_addr=0x88000000\0" \
77 "fdt_high=0xffffffff\0" \
78 "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \
79 "initrd_high=0xffffffff\0" \
86 "mmcroot=/dev/mmcblk0p2 ro\0" \
87 "mmcrootfstype=ext4 rootwait\0" \
88 "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \
90 "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
91 "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" \
92 "check_env=if test -n ${flash_env_version}; " \
93 "then env default env_version; " \
94 "else env set flash_env_version ${env_version}; env save; " \
96 "if itest ${flash_env_version} != ${env_version}; then " \
97 "echo \"*** Warning - Environment version" \
98 " change suggests: run flash_reset_env; reset\"; " \
99 "env default flash_reset_env; " \
100 "else exit; fi; \0" \
101 "flash_reset_env=env default -f -a && saveenv && " \
102 "echo Environment variables erased!\0" \
103 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
105 "if mmc dev 0 1; then " \
106 "setexpr sz ${filesize} / 0x200; " \
107 "setexpr sz ${sz} + 1; " \
108 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
109 "echo Flashing of U-boot SPL succeed; " \
110 "else echo Flashing of U-boot SPL failed; " \
113 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
115 "if mmc dev 0 1; then " \
116 "setexpr sz ${filesize} / 0x200; " \
117 "setexpr sz ${sz} + 1; " \
118 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
119 "echo Flashing of U-boot image succeed; " \
120 "else echo Flashing of U-boot image failed; " \
123 "update_uboot=run download_uboot_spl flash_uboot_spl " \
124 "download_uboot_img flash_uboot_img\0" \
125 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
127 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
128 "echo kernel update succeed; " \
129 "else echo kernel update failed; " \
131 "update_kernel=run download_kernel flash_kernel\0" \
132 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
134 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
135 "echo dtb update succeed; " \
136 "else echo dtb update in failed; " \
138 "update_dtb=run download_dtb flash_dtb\0" \
139 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
141 "if mmc dev 0 0; then " \
142 "setexpr nbblocks ${filesize} / 0x200; " \
143 "setexpr nbblocks ${nbblocks} + 1; " \
144 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
145 "echo Flashing of rootfs image succeed; " \
146 "else echo Flashing of rootfs image failed; " \
149 "update_rootfs=run download_rootfs flash_rootfs\0" \
151 "if mmc dev 0 0; then " \
152 "setexpr nbblocks ${filesize} / 0x200; " \
153 "setexpr nbblocks ${nbblocks} + 1; " \
154 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
155 "echo Flashing of rootfs image in failsafe partition succeed; " \
156 "else echo Flashing of rootfs image in failsafe partition failed; " \
159 "update_failsafe=run download_rootfs flash_failsafe\0" \
160 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
162 "if mmc dev 0 0; then " \
163 "setexpr nbblocks ${filesize} / 0x200; " \
164 "setexpr nbblocks ${nbblocks} + 1; " \
165 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
166 "echo Flashing of user_data image succeed; " \
167 "else echo Flashing of user_data image failed; " \
170 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
172 "if mmc dev 0 0; then " \
173 "echo Erasing eMMC User Data partition, no way out...; " \
174 "mw ${loadaddr} 0 0x200000; " \
175 "mmc write ${loadaddr} 0 0x1000; " \
176 "mmc write ${loadaddr} 0x800 0x1000; " \
177 "mmc write ${loadaddr} 0x40800 0x1000; " \
178 "mmc write ${loadaddr} 0x440800 0x1000; " \
181 "update_all=run update_rootfs update_uboot\0" \
182 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
183 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
184 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
185 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
186 "rootfstype=${mmcrootfstype}\0" \
187 "emmcboot=run initargs; run addmmcargs; " \
188 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
189 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
190 "bootz ${loadaddr} - ${fdt_addr};\0" \
191 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
192 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
193 "nfsroot=${serverip}:${rootpath}\0" \
194 "nfsboot=run initargs; run addnfsargs addipargs; " \
195 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
196 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
197 "bootz ${loadaddr} - ${fdt_addr};\0"
199 #endif /* __OPOS6ULDEV_CONFIG_H */