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
46 #define IMX_FEC_BASE ENET_BASE_ADDR
47 #define CONFIG_FEC_MXC_PHYADDR 0x1
48 #define CONFIG_FEC_XCV_TYPE RMII
49 #define CONFIG_ETHPRIME "FEC"
53 #ifndef CONFIG_SPL_BUILD
55 #define CONFIG_VIDEO_LOGO
56 #define CONFIG_SPLASH_SCREEN
57 #define CONFIG_SPLASH_SCREEN_ALIGN
58 #define CONFIG_SPLASH_SOURCE
59 #define CONFIG_VIDEO_BMP_RLE8
60 #define CONFIG_VIDEO_BMP_LOGO
61 #define CONFIG_BMP_16BPP
62 #define CONFIG_VIDEO_MXS
63 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
67 /* Environment is stored in the eMMC boot partition */
68 #define CONFIG_SYS_MMC_ENV_DEV 0
69 #define CONFIG_SYS_MMC_ENV_PART 1
70 #define CONFIG_ENV_SIZE (10 * 1024)
71 #define CONFIG_ENV_OFFSET (1024 * 1024) /* 1 MB */
72 #define CONFIG_ENV_OFFSET_REDUND (1536 * 1024) /* 512KB from CONFIG_ENV_OFFSET */
74 #define CONFIG_ENV_VERSION 100
75 #define CONFIG_BOARD_NAME opos6ul
76 #define ACFG_CONSOLE_DEV ttymxc0
77 #define CONFIG_SYS_AUTOLOAD "no"
78 #define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
79 #define CONFIG_PREBOOT "run check_env"
80 #define CONFIG_BOOTCOMMAND "run emmcboot"
82 #define CONFIG_EXTRA_ENV_SETTINGS \
83 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
84 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
85 "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
86 "fdt_addr=0x88000000\0" \
87 "fdt_high=0xffffffff\0" \
88 "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \
89 "initrd_high=0xffffffff\0" \
96 "mmcroot=/dev/mmcblk0p2 ro\0" \
97 "mmcrootfstype=ext4 rootwait\0" \
98 "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \
99 "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" \
100 "check_env=if test -n ${flash_env_version}; " \
101 "then env default env_version; " \
102 "else env set flash_env_version ${env_version}; env save; " \
104 "if itest ${flash_env_version} != ${env_version}; then " \
105 "echo \"*** Warning - Environment version" \
106 " change suggests: run flash_reset_env; reset\"; " \
107 "env default flash_reset_env; " \
108 "else exit; fi; \0" \
109 "flash_reset_env=env default -f -a && saveenv && " \
110 "echo Environment variables erased!\0" \
111 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
113 "if mmc dev 0 1; then " \
114 "setexpr sz ${filesize} / 0x200; " \
115 "setexpr sz ${sz} + 1; " \
116 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
117 "echo Flashing of U-boot SPL succeed; " \
118 "else echo Flashing of U-boot SPL failed; " \
121 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
123 "if mmc dev 0 1; then " \
124 "setexpr sz ${filesize} / 0x200; " \
125 "setexpr sz ${sz} + 1; " \
126 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
127 "echo Flashing of U-boot image succeed; " \
128 "else echo Flashing of U-boot image failed; " \
131 "update_uboot=run download_uboot_spl flash_uboot_spl " \
132 "download_uboot_img flash_uboot_img\0" \
133 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
135 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
136 "echo kernel update succeed; " \
137 "else echo kernel update failed; " \
139 "update_kernel=run download_kernel flash_kernel\0" \
140 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
142 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
143 "echo dtb update succeed; " \
144 "else echo dtb update in failed; " \
146 "update_dtb=run download_dtb flash_dtb\0" \
147 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
149 "if mmc dev 0 0; then " \
150 "setexpr nbblocks ${filesize} / 0x200; " \
151 "setexpr nbblocks ${nbblocks} + 1; " \
152 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
153 "echo Flashing of rootfs image succeed; " \
154 "else echo Flashing of rootfs image failed; " \
157 "update_rootfs=run download_rootfs flash_rootfs\0" \
159 "if mmc dev 0 0; then " \
160 "setexpr nbblocks ${filesize} / 0x200; " \
161 "setexpr nbblocks ${nbblocks} + 1; " \
162 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
163 "echo Flashing of rootfs image in failsafe partition succeed; " \
164 "else echo Flashing of rootfs image in failsafe partition failed; " \
167 "update_failsafe=run download_rootfs flash_failsafe\0" \
168 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
170 "if mmc dev 0 0; then " \
171 "setexpr nbblocks ${filesize} / 0x200; " \
172 "setexpr nbblocks ${nbblocks} + 1; " \
173 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
174 "echo Flashing of user_data image succeed; " \
175 "else echo Flashing of user_data image failed; " \
178 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
180 "if mmc dev 0 0; then " \
181 "echo Erasing eMMC User Data partition, no way out...; " \
182 "mw ${loadaddr} 0 0x200000; " \
183 "mmc write ${loadaddr} 0 0x1000; " \
184 "mmc write ${loadaddr} 0x800 0x1000; " \
185 "mmc write ${loadaddr} 0x40800 0x1000; " \
186 "mmc write ${loadaddr} 0x440800 0x1000; " \
189 "update_all=run update_rootfs update_uboot\0" \
190 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
191 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
192 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
193 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
194 "rootfstype=${mmcrootfstype}\0" \
195 "emmcboot=run initargs; run addmmcargs; " \
196 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
197 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
198 "bootz ${loadaddr} - ${fdt_addr};\0" \
199 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
200 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
201 "nfsroot=${serverip}:${rootpath}\0" \
202 "nfsboot=run initargs; run addnfsargs addipargs; " \
203 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
204 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
205 "bootz ${loadaddr} - ${fdt_addr};\0"
207 #endif /* __OPOS6ULDEV_CONFIG_H */