]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
77f29293 SS |
2 | /* |
3 | * Copyright (C) 2017 Armadeus Systems | |
4 | * | |
5 | * Configuration settings for the OPOS6ULDev board | |
77f29293 SS |
6 | */ |
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" | |
15 | ||
16 | #ifdef CONFIG_SPL_BUILD | |
30754ef7 | 17 | #undef CONFIG_DM_REGULATOR |
77f29293 SS |
18 | #endif |
19 | #endif | |
20 | ||
77f29293 SS |
21 | /* Miscellaneous configurable options */ |
22 | #define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR | |
23 | ||
24 | /* Physical Memory Map */ | |
77f29293 SS |
25 | #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR |
26 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR | |
27 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE | |
28 | #define CONFIG_SYS_INIT_SP_OFFSET \ | |
29 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
30 | #define CONFIG_SYS_INIT_SP_ADDR \ | |
31 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) | |
32 | ||
77f29293 SS |
33 | /* USB */ |
34 | #ifdef CONFIG_USB_EHCI_MX6 | |
35 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET | |
36 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) | |
37 | #define CONFIG_MXC_USB_FLAGS 0 | |
38 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 | |
77f29293 SS |
39 | #endif |
40 | ||
77f29293 | 41 | /* LCD */ |
30754ef7 | 42 | #ifndef CONFIG_SPL_BUILD |
b1be79b4 | 43 | #ifdef CONFIG_DM_VIDEO |
77f29293 | 44 | #define CONFIG_VIDEO_BMP_LOGO |
77f29293 SS |
45 | #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR |
46 | #endif | |
30754ef7 | 47 | #endif |
77f29293 SS |
48 | |
49 | /* Environment is stored in the eMMC boot partition */ | |
77f29293 SS |
50 | |
51 | #define CONFIG_ENV_VERSION 100 | |
52 | #define CONFIG_BOARD_NAME opos6ul | |
53 | #define ACFG_CONSOLE_DEV ttymxc0 | |
54 | #define CONFIG_SYS_AUTOLOAD "no" | |
55 | #define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root" | |
77f29293 SS |
56 | |
57 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
58 | "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \ | |
59 | "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \ | |
60 | "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \ | |
61 | "fdt_addr=0x88000000\0" \ | |
62 | "fdt_high=0xffffffff\0" \ | |
63 | "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \ | |
64 | "initrd_high=0xffffffff\0" \ | |
65 | "ip_dyn=yes\0" \ | |
66 | "stdin=serial\0" \ | |
67 | "stdout=serial\0" \ | |
68 | "stderr=serial\0" \ | |
69 | "mmcdev=0\0" \ | |
70 | "mmcpart=2\0" \ | |
71 | "mmcroot=/dev/mmcblk0p2 ro\0" \ | |
72 | "mmcrootfstype=ext4 rootwait\0" \ | |
73 | "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \ | |
b1be79b4 | 74 | "splashpos=0,0\0" \ |
0cf207ec | 75 | "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
77f29293 SS |
76 | "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" \ |
77 | "check_env=if test -n ${flash_env_version}; " \ | |
78 | "then env default env_version; " \ | |
79 | "else env set flash_env_version ${env_version}; env save; " \ | |
80 | "fi; " \ | |
81 | "if itest ${flash_env_version} != ${env_version}; then " \ | |
82 | "echo \"*** Warning - Environment version" \ | |
83 | " change suggests: run flash_reset_env; reset\"; " \ | |
84 | "env default flash_reset_env; " \ | |
85 | "else exit; fi; \0" \ | |
86 | "flash_reset_env=env default -f -a && saveenv && " \ | |
87 | "echo Environment variables erased!\0" \ | |
88 | "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \ | |
89 | "flash_uboot_spl=" \ | |
90 | "if mmc dev 0 1; then " \ | |
91 | "setexpr sz ${filesize} / 0x200; " \ | |
92 | "setexpr sz ${sz} + 1; " \ | |
93 | "if mmc write ${loadaddr} 0x2 ${sz}; then " \ | |
94 | "echo Flashing of U-boot SPL succeed; " \ | |
95 | "else echo Flashing of U-boot SPL failed; " \ | |
96 | "fi; " \ | |
97 | "fi;\0" \ | |
98 | "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \ | |
99 | "flash_uboot_img=" \ | |
100 | "if mmc dev 0 1; then " \ | |
101 | "setexpr sz ${filesize} / 0x200; " \ | |
102 | "setexpr sz ${sz} + 1; " \ | |
103 | "if mmc write ${loadaddr} 0x8a ${sz}; then " \ | |
104 | "echo Flashing of U-boot image succeed; " \ | |
105 | "else echo Flashing of U-boot image failed; " \ | |
106 | "fi; " \ | |
107 | "fi;\0" \ | |
108 | "update_uboot=run download_uboot_spl flash_uboot_spl " \ | |
109 | "download_uboot_img flash_uboot_img\0" \ | |
110 | "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \ | |
111 | "flash_kernel=" \ | |
112 | "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \ | |
113 | "echo kernel update succeed; " \ | |
114 | "else echo kernel update failed; " \ | |
115 | "fi;\0" \ | |
116 | "update_kernel=run download_kernel flash_kernel\0" \ | |
117 | "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \ | |
118 | "flash_dtb=" \ | |
119 | "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \ | |
120 | "echo dtb update succeed; " \ | |
121 | "else echo dtb update in failed; " \ | |
122 | "fi;\0" \ | |
123 | "update_dtb=run download_dtb flash_dtb\0" \ | |
124 | "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \ | |
125 | "flash_rootfs=" \ | |
126 | "if mmc dev 0 0; then " \ | |
127 | "setexpr nbblocks ${filesize} / 0x200; " \ | |
128 | "setexpr nbblocks ${nbblocks} + 1; " \ | |
129 | "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \ | |
130 | "echo Flashing of rootfs image succeed; " \ | |
131 | "else echo Flashing of rootfs image failed; " \ | |
132 | "fi; " \ | |
133 | "fi;\0" \ | |
134 | "update_rootfs=run download_rootfs flash_rootfs\0" \ | |
135 | "flash_failsafe=" \ | |
136 | "if mmc dev 0 0; then " \ | |
137 | "setexpr nbblocks ${filesize} / 0x200; " \ | |
138 | "setexpr nbblocks ${nbblocks} + 1; " \ | |
139 | "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \ | |
140 | "echo Flashing of rootfs image in failsafe partition succeed; " \ | |
141 | "else echo Flashing of rootfs image in failsafe partition failed; " \ | |
142 | "fi; " \ | |
143 | "fi;\0" \ | |
144 | "update_failsafe=run download_rootfs flash_failsafe\0" \ | |
145 | "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \ | |
146 | "flash_userdata=" \ | |
147 | "if mmc dev 0 0; then " \ | |
148 | "setexpr nbblocks ${filesize} / 0x200; " \ | |
149 | "setexpr nbblocks ${nbblocks} + 1; " \ | |
150 | "if mmc write ${loadaddr} 0 ${nbblocks}; then " \ | |
151 | "echo Flashing of user_data image succeed; " \ | |
152 | "else echo Flashing of user_data image failed; " \ | |
153 | "fi; " \ | |
154 | "fi;\0" \ | |
155 | "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \ | |
156 | "erase_userdata=" \ | |
157 | "if mmc dev 0 0; then " \ | |
158 | "echo Erasing eMMC User Data partition, no way out...; " \ | |
159 | "mw ${loadaddr} 0 0x200000; " \ | |
160 | "mmc write ${loadaddr} 0 0x1000; " \ | |
161 | "mmc write ${loadaddr} 0x800 0x1000; " \ | |
162 | "mmc write ${loadaddr} 0x40800 0x1000; " \ | |
163 | "mmc write ${loadaddr} 0x440800 0x1000; " \ | |
164 | "fi;" \ | |
165 | "mmc rescan\0" \ | |
166 | "update_all=run update_rootfs update_uboot\0" \ | |
167 | "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \ | |
168 | "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \ | |
169 | "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ | |
170 | "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \ | |
171 | "rootfstype=${mmcrootfstype}\0" \ | |
172 | "emmcboot=run initargs; run addmmcargs; " \ | |
173 | "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \ | |
174 | "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \ | |
175 | "bootz ${loadaddr} - ${fdt_addr};\0" \ | |
176 | "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \ | |
177 | "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \ | |
178 | "nfsroot=${serverip}:${rootpath}\0" \ | |
179 | "nfsboot=run initargs; run addnfsargs addipargs; " \ | |
180 | "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \ | |
181 | "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \ | |
182 | "bootz ${loadaddr} - ${fdt_addr};\0" | |
183 | ||
184 | #endif /* __OPOS6ULDEV_CONFIG_H */ |