blob: 8624d24b6eaadb36f73a979be7911431c90c3556 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Sébastien Szymanskia7762e42017-03-07 14:33:25 +01002/*
3 * Copyright (C) 2017 Armadeus Systems
4 *
5 * Configuration settings for the OPOS6ULDev board
Sébastien Szymanskia7762e42017-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 Szymanskia7762e42017-03-07 14:33:25 +010015#endif
16
Sébastien Szymanskia7762e42017-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 Szymanskia7762e42017-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
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010024
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010025/* USB */
26#ifdef CONFIG_USB_EHCI_MX6
27#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
28#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
29#define CONFIG_MXC_USB_FLAGS 0
30#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010031#endif
32
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010033/* LCD */
Sébastien Szymanski1f29ce52018-04-17 17:29:31 +020034#ifndef CONFIG_SPL_BUILD
Sébastien Szymanskid5c96132019-10-21 15:33:03 +020035#ifdef CONFIG_DM_VIDEO
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010036#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
37#endif
Sébastien Szymanski1f29ce52018-04-17 17:29:31 +020038#endif
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010039
40/* Environment is stored in the eMMC boot partition */
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010041
42#define CONFIG_ENV_VERSION 100
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010043#define ACFG_CONSOLE_DEV ttymxc0
44#define CONFIG_SYS_AUTOLOAD "no"
Tom Rini272eb5b2022-03-21 21:33:32 -040045#define CONFIG_ROOTPATH "/tftpboot/opos6ul-root"
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010046
47#define CONFIG_EXTRA_ENV_SETTINGS \
48 "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
49 "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
Tom Rini272eb5b2022-03-21 21:33:32 -040050 "board_name=opos6ul\0" \
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010051 "fdt_addr=0x88000000\0" \
52 "fdt_high=0xffffffff\0" \
Tom Rini272eb5b2022-03-21 21:33:32 -040053 "fdt_name=opos6uldev\0" \
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010054 "initrd_high=0xffffffff\0" \
55 "ip_dyn=yes\0" \
56 "stdin=serial\0" \
57 "stdout=serial\0" \
58 "stderr=serial\0" \
59 "mmcdev=0\0" \
60 "mmcpart=2\0" \
61 "mmcroot=/dev/mmcblk0p2 ro\0" \
62 "mmcrootfstype=ext4 rootwait\0" \
Tom Rini272eb5b2022-03-21 21:33:32 -040063 "kernelimg=opos6ul-linux.bin\0" \
Sébastien Szymanskid5c96132019-10-21 15:33:03 +020064 "splashpos=0,0\0" \
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020065 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010066 "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" \
67 "check_env=if test -n ${flash_env_version}; " \
68 "then env default env_version; " \
69 "else env set flash_env_version ${env_version}; env save; " \
70 "fi; " \
71 "if itest ${flash_env_version} != ${env_version}; then " \
72 "echo \"*** Warning - Environment version" \
73 " change suggests: run flash_reset_env; reset\"; " \
74 "env default flash_reset_env; " \
75 "else exit; fi; \0" \
76 "flash_reset_env=env default -f -a && saveenv && " \
77 "echo Environment variables erased!\0" \
78 "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \
79 "flash_uboot_spl=" \
80 "if mmc dev 0 1; then " \
81 "setexpr sz ${filesize} / 0x200; " \
82 "setexpr sz ${sz} + 1; " \
83 "if mmc write ${loadaddr} 0x2 ${sz}; then " \
84 "echo Flashing of U-boot SPL succeed; " \
85 "else echo Flashing of U-boot SPL failed; " \
86 "fi; " \
87 "fi;\0" \
88 "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \
89 "flash_uboot_img=" \
90 "if mmc dev 0 1; then " \
91 "setexpr sz ${filesize} / 0x200; " \
92 "setexpr sz ${sz} + 1; " \
93 "if mmc write ${loadaddr} 0x8a ${sz}; then " \
94 "echo Flashing of U-boot image succeed; " \
95 "else echo Flashing of U-boot image failed; " \
96 "fi; " \
97 "fi;\0" \
98 "update_uboot=run download_uboot_spl flash_uboot_spl " \
99 "download_uboot_img flash_uboot_img\0" \
100 "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \
101 "flash_kernel=" \
102 "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \
103 "echo kernel update succeed; " \
104 "else echo kernel update failed; " \
105 "fi;\0" \
106 "update_kernel=run download_kernel flash_kernel\0" \
107 "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \
108 "flash_dtb=" \
109 "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
110 "echo dtb update succeed; " \
111 "else echo dtb update in failed; " \
112 "fi;\0" \
113 "update_dtb=run download_dtb flash_dtb\0" \
114 "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \
115 "flash_rootfs=" \
116 "if mmc dev 0 0; then " \
117 "setexpr nbblocks ${filesize} / 0x200; " \
118 "setexpr nbblocks ${nbblocks} + 1; " \
119 "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \
120 "echo Flashing of rootfs image succeed; " \
121 "else echo Flashing of rootfs image failed; " \
122 "fi; " \
123 "fi;\0" \
124 "update_rootfs=run download_rootfs flash_rootfs\0" \
125 "flash_failsafe=" \
126 "if mmc dev 0 0; then " \
127 "setexpr nbblocks ${filesize} / 0x200; " \
128 "setexpr nbblocks ${nbblocks} + 1; " \
129 "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \
130 "echo Flashing of rootfs image in failsafe partition succeed; " \
131 "else echo Flashing of rootfs image in failsafe partition failed; " \
132 "fi; " \
133 "fi;\0" \
134 "update_failsafe=run download_rootfs flash_failsafe\0" \
135 "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \
136 "flash_userdata=" \
137 "if mmc dev 0 0; then " \
138 "setexpr nbblocks ${filesize} / 0x200; " \
139 "setexpr nbblocks ${nbblocks} + 1; " \
140 "if mmc write ${loadaddr} 0 ${nbblocks}; then " \
141 "echo Flashing of user_data image succeed; " \
142 "else echo Flashing of user_data image failed; " \
143 "fi; " \
144 "fi;\0" \
145 "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \
146 "erase_userdata=" \
147 "if mmc dev 0 0; then " \
148 "echo Erasing eMMC User Data partition, no way out...; " \
149 "mw ${loadaddr} 0 0x200000; " \
150 "mmc write ${loadaddr} 0 0x1000; " \
151 "mmc write ${loadaddr} 0x800 0x1000; " \
152 "mmc write ${loadaddr} 0x40800 0x1000; " \
153 "mmc write ${loadaddr} 0x440800 0x1000; " \
154 "fi;" \
155 "mmc rescan\0" \
156 "update_all=run update_rootfs update_uboot\0" \
157 "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \
158 "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
159 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
160 "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \
161 "rootfstype=${mmcrootfstype}\0" \
162 "emmcboot=run initargs; run addmmcargs; " \
163 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \
164 "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \
165 "bootz ${loadaddr} - ${fdt_addr};\0" \
166 "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \
167 "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
168 "nfsroot=${serverip}:${rootpath}\0" \
169 "nfsboot=run initargs; run addnfsargs addipargs; " \
170 "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \
171 "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \
172 "bootz ${loadaddr} - ${fdt_addr};\0"
173
174#endif /* __OPOS6ULDEV_CONFIG_H */