2 * Copyright (C) 2017 Armadeus Systems
4 * Configuration settings for the OPOS6ULDev board
6 * SPDX-License-Identifier: GPL-2.0+
9 #ifndef __OPOS6ULDEV_CONFIG_H
10 #define __OPOS6ULDEV_CONFIG_H
12 #include "mx6_common.h"
17 #ifdef CONFIG_SPL_BUILD
22 #define CONFIG_MXC_UART_BASE UART1_BASE
26 /* Size of malloc() pool */
27 #define CONFIG_SYS_MALLOC_LEN (16 << 20)
29 /* Miscellaneous configurable options */
30 #define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR
32 /* Physical Memory Map */
33 #define CONFIG_NR_DRAM_BANKS 1
34 #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
35 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
36 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
37 #define CONFIG_SYS_INIT_SP_OFFSET \
38 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
39 #define CONFIG_SYS_INIT_SP_ADDR \
40 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
43 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
44 #define CONFIG_SUPPORT_EMMC_BOOT
47 #ifdef CONFIG_USB_EHCI_MX6
48 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
49 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
50 #define CONFIG_MXC_USB_FLAGS 0
51 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
56 #define IMX_FEC_BASE ENET_BASE_ADDR
57 #define CONFIG_FEC_MXC_PHYADDR 0x1
58 #define CONFIG_FEC_XCV_TYPE RMII
59 #define CONFIG_ETHPRIME "FEC"
65 #define CONFIG_VIDEO_LOGO
66 #define CONFIG_SPLASH_SCREEN
67 #define CONFIG_SPLASH_SCREEN_ALIGN
68 #define CONFIG_SPLASH_SOURCE
69 #define CONFIG_VIDEO_BMP_RLE8
70 #define CONFIG_VIDEO_BMP_LOGO
71 #define CONFIG_BMP_16BPP
72 #define CONFIG_VIDEO_MXS
73 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
76 /* Environment is stored in the eMMC boot partition */
77 #define CONFIG_SYS_MMC_ENV_DEV 0
78 #define CONFIG_SYS_MMC_ENV_PART 1
79 #define CONFIG_ENV_SIZE (10 * 1024)
80 #define CONFIG_ENV_OFFSET (1024 * 1024) /* 1 MB */
81 #define CONFIG_ENV_OFFSET_REDUND (1536 * 1024) /* 512KB from CONFIG_ENV_OFFSET */
83 #define CONFIG_ENV_VERSION 100
84 #define CONFIG_BOARD_NAME opos6ul
85 #define ACFG_CONSOLE_DEV ttymxc0
86 #define CONFIG_SYS_AUTOLOAD "no"
87 #define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
88 #define CONFIG_PREBOOT "run check_env"
89 #define CONFIG_BOOTCOMMAND "run emmcboot"
91 #define CONFIG_EXTRA_ENV_SETTINGS \
92 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
93 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
94 "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
95 "fdt_addr=0x88000000\0" \
96 "fdt_high=0xffffffff\0" \
97 "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \
98 "initrd_high=0xffffffff\0" \
105 "mmcroot=/dev/mmcblk0p2 ro\0" \
106 "mmcrootfstype=ext4 rootwait\0" \
107 "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \
108 "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" \
109 "check_env=if test -n ${flash_env_version}; " \
110 "then env default env_version; " \
111 "else env set flash_env_version ${env_version}; env save; " \
113 "if itest ${flash_env_version} != ${env_version}; then " \
114 "echo \"*** Warning - Environment version" \
115 " change suggests: run flash_reset_env; reset\"; " \
116 "env default flash_reset_env; " \
117 "else exit; fi; \0" \
118 "flash_reset_env=env default -f -a && saveenv && " \
119 "echo Environment variables erased!\0" \
120 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
122 "if mmc dev 0 1; then " \
123 "setexpr sz ${filesize} / 0x200; " \
124 "setexpr sz ${sz} + 1; " \
125 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
126 "echo Flashing of U-boot SPL succeed; " \
127 "else echo Flashing of U-boot SPL failed; " \
130 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
132 "if mmc dev 0 1; then " \
133 "setexpr sz ${filesize} / 0x200; " \
134 "setexpr sz ${sz} + 1; " \
135 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
136 "echo Flashing of U-boot image succeed; " \
137 "else echo Flashing of U-boot image failed; " \
140 "update_uboot=run download_uboot_spl flash_uboot_spl " \
141 "download_uboot_img flash_uboot_img\0" \
142 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
144 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
145 "echo kernel update succeed; " \
146 "else echo kernel update failed; " \
148 "update_kernel=run download_kernel flash_kernel\0" \
149 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
151 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
152 "echo dtb update succeed; " \
153 "else echo dtb update in failed; " \
155 "update_dtb=run download_dtb flash_dtb\0" \
156 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
158 "if mmc dev 0 0; then " \
159 "setexpr nbblocks ${filesize} / 0x200; " \
160 "setexpr nbblocks ${nbblocks} + 1; " \
161 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
162 "echo Flashing of rootfs image succeed; " \
163 "else echo Flashing of rootfs image failed; " \
166 "update_rootfs=run download_rootfs flash_rootfs\0" \
168 "if mmc dev 0 0; then " \
169 "setexpr nbblocks ${filesize} / 0x200; " \
170 "setexpr nbblocks ${nbblocks} + 1; " \
171 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
172 "echo Flashing of rootfs image in failsafe partition succeed; " \
173 "else echo Flashing of rootfs image in failsafe partition failed; " \
176 "update_failsafe=run download_rootfs flash_failsafe\0" \
177 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
179 "if mmc dev 0 0; then " \
180 "setexpr nbblocks ${filesize} / 0x200; " \
181 "setexpr nbblocks ${nbblocks} + 1; " \
182 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
183 "echo Flashing of user_data image succeed; " \
184 "else echo Flashing of user_data image failed; " \
187 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
189 "if mmc dev 0 0; then " \
190 "echo Erasing eMMC User Data partition, no way out...; " \
191 "mw ${loadaddr} 0 0x200000; " \
192 "mmc write ${loadaddr} 0 0x1000; " \
193 "mmc write ${loadaddr} 0x800 0x1000; " \
194 "mmc write ${loadaddr} 0x40800 0x1000; " \
195 "mmc write ${loadaddr} 0x440800 0x1000; " \
198 "update_all=run update_rootfs update_uboot\0" \
199 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
200 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
201 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
202 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
203 "rootfstype=${mmcrootfstype}\0" \
204 "emmcboot=run initargs; run addmmcargs; " \
205 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
206 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
207 "bootz ${loadaddr} - ${fdt_addr};\0" \
208 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
209 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
210 "nfsroot=${serverip}:${rootpath}\0" \
211 "nfsboot=run initargs; run addnfsargs addipargs; " \
212 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
213 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
214 "bootz ${loadaddr} - ${fdt_addr};\0"
216 #endif /* __OPOS6ULDEV_CONFIG_H */