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"
17 /* Miscellaneous configurable options */
18 #define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR
20 /* Physical Memory Map */
21 #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
26 #ifdef CONFIG_USB_EHCI_MX6
27 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
28 #define CONFIG_MXC_USB_FLAGS 0
29 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
33 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
35 /* Environment is stored in the eMMC boot partition */
37 #define CONFIG_ENV_VERSION 100
38 #define ACFG_CONSOLE_DEV ttymxc0
39 #define CONFIG_SYS_AUTOLOAD "no"
40 #define CONFIG_ROOTPATH "/tftpboot/opos6ul-root"
42 #define CONFIG_EXTRA_ENV_SETTINGS \
43 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
44 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
45 "board_name=opos6ul\0" \
46 "fdt_addr=0x88000000\0" \
47 "fdt_high=0xffffffff\0" \
48 "fdt_name=opos6uldev\0" \
49 "initrd_high=0xffffffff\0" \
56 "mmcroot=/dev/mmcblk0p2 ro\0" \
57 "mmcrootfstype=ext4 rootwait\0" \
58 "kernelimg=opos6ul-linux.bin\0" \
60 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
61 "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" \
62 "check_env=if test -n ${flash_env_version}; " \
63 "then env default env_version; " \
64 "else env set flash_env_version ${env_version}; env save; " \
66 "if itest ${flash_env_version} != ${env_version}; then " \
67 "echo \"*** Warning - Environment version" \
68 " change suggests: run flash_reset_env; reset\"; " \
69 "env default flash_reset_env; " \
71 "flash_reset_env=env default -f -a && saveenv && " \
72 "echo Environment variables erased!\0" \
73 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
75 "if mmc dev 0 1; then " \
76 "setexpr sz ${filesize} / 0x200; " \
77 "setexpr sz ${sz} + 1; " \
78 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
79 "echo Flashing of U-boot SPL succeed; " \
80 "else echo Flashing of U-boot SPL failed; " \
83 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
85 "if mmc dev 0 1; then " \
86 "setexpr sz ${filesize} / 0x200; " \
87 "setexpr sz ${sz} + 1; " \
88 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
89 "echo Flashing of U-boot image succeed; " \
90 "else echo Flashing of U-boot image failed; " \
93 "update_uboot=run download_uboot_spl flash_uboot_spl " \
94 "download_uboot_img flash_uboot_img\0" \
95 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
97 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
98 "echo kernel update succeed; " \
99 "else echo kernel update failed; " \
101 "update_kernel=run download_kernel flash_kernel\0" \
102 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
104 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
105 "echo dtb update succeed; " \
106 "else echo dtb update in failed; " \
108 "update_dtb=run download_dtb flash_dtb\0" \
109 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
111 "if mmc dev 0 0; then " \
112 "setexpr nbblocks ${filesize} / 0x200; " \
113 "setexpr nbblocks ${nbblocks} + 1; " \
114 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
115 "echo Flashing of rootfs image succeed; " \
116 "else echo Flashing of rootfs image failed; " \
119 "update_rootfs=run download_rootfs flash_rootfs\0" \
121 "if mmc dev 0 0; then " \
122 "setexpr nbblocks ${filesize} / 0x200; " \
123 "setexpr nbblocks ${nbblocks} + 1; " \
124 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
125 "echo Flashing of rootfs image in failsafe partition succeed; " \
126 "else echo Flashing of rootfs image in failsafe partition failed; " \
129 "update_failsafe=run download_rootfs flash_failsafe\0" \
130 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
132 "if mmc dev 0 0; then " \
133 "setexpr nbblocks ${filesize} / 0x200; " \
134 "setexpr nbblocks ${nbblocks} + 1; " \
135 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
136 "echo Flashing of user_data image succeed; " \
137 "else echo Flashing of user_data image failed; " \
140 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
142 "if mmc dev 0 0; then " \
143 "echo Erasing eMMC User Data partition, no way out...; " \
144 "mw ${loadaddr} 0 0x200000; " \
145 "mmc write ${loadaddr} 0 0x1000; " \
146 "mmc write ${loadaddr} 0x800 0x1000; " \
147 "mmc write ${loadaddr} 0x40800 0x1000; " \
148 "mmc write ${loadaddr} 0x440800 0x1000; " \
151 "update_all=run update_rootfs update_uboot\0" \
152 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
153 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
154 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
155 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
156 "rootfstype=${mmcrootfstype}\0" \
157 "emmcboot=run initargs; run addmmcargs; " \
158 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
159 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
160 "bootz ${loadaddr} - ${fdt_addr};\0" \
161 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
162 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
163 "nfsroot=${serverip}:${rootpath}\0" \
164 "nfsboot=run initargs; run addnfsargs addipargs; " \
165 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
166 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
167 "bootz ${loadaddr} - ${fdt_addr};\0"
169 #endif /* __OPOS6ULDEV_CONFIG_H */