61ca5f8b34ab3d53a02e5991f5f377f39d846928
[platform/kernel/u-boot.git] / include / configs / ge_b1x5v2.h
1 /*
2  * GE B1x5v2
3  *
4  * Copyright 2018-2020 GE Inc.
5  * Copyright 2018-2020 Collabora Ltd.
6  *
7  * SPDX-License-Identifier:    GPL-2.0+
8  */
9
10 #ifndef __GE_B1X5V2_CONFIG_H
11 #define __GE_B1X5V2_CONFIG_H
12
13 #include "mx6_common.h"
14
15 #include "imx6_spl.h"
16
17 /* PWM */
18 #define CONFIG_IMX6_PWM_PER_CLK         66000000
19
20 /* UART */
21 #define CONFIG_MXC_UART_BASE            UART3_BASE
22
23 #if CONFIG_MXC_UART_BASE == UART2_BASE
24 /* UART2 requires CONFIG_DEBUG_UART_BASE=0x21e8000 */
25 #define CONSOLE_DEVICE "ttymxc1" /* System on Module debug connector */
26 #else
27 /* UART3 requires CONFIG_DEBUG_UART_BASE=0x21ec000 */
28 #define CONSOLE_DEVICE "ttymxc2" /* Base board debug connector */
29 #endif
30
31 /* USB */
32 #define CONFIG_MXC_USB_PORTSC           (PORT_PTS_UTMI | PORT_PTS_PTW)
33 #define CONFIG_MXC_USB_FLAGS            0
34 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
35 #define CONFIG_USBD_HS
36
37 /* Video */
38 #define CONFIG_HIDE_LOGO_VERSION
39 #define CONFIG_IMX_VIDEO_SKIP
40
41 /* Memory */
42 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
43
44 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
45 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
46 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
47
48 /* Command definition */
49 #define CONFIG_EXTRA_ENV_SETTINGS \
50         "image=/boot/fitImage\0" \
51         "fdt_addr_r=0x18000000\0" \
52         "splash_addr_r=0x20000000\0" \
53         "mmcdev=2\0" \
54         "mmcpart=1\0" \
55         "console=console="CONSOLE_DEVICE",115200\0" \
56         "quiet=quiet loglevel=0\0" \
57         "rootdev=/dev/mmcblk1p\0" \
58         "setargs=setenv bootargs ${console} ${quiet} ${fsckforcerepair} " \
59                 "bootcause=${bootcause} vt.global_cursor_default=0 vt.cur_default=1 " \
60                 "root=${rootdev}${mmcpart} video=HDMI-A-1:${resolution} rootwait ro\0" \
61         "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
62         "showsplashscreen=load mmc ${mmcdev}:${mmcpart} ${splash_addr_r} /boot/splashscreen-${resolution}.bmp; " \
63                 "bmp display ${splash_addr_r};\0" \
64         "setconfidx=" \
65                 "if test \"${devicetype}\" = \"B105v2\"; then " \
66                         "setenv confidx 1; " \
67                 "elif test \"${devicetype}\" = \"B125v2\"; then " \
68                         "setenv confidx 2; " \
69                 "elif test \"${devicetype}\" = \"B155v2\"; then " \
70                         "setenv confidx 3; " \
71                 "elif test \"${devicetype}\" = \"B105Pv2\"; then " \
72                         "setenv confidx 4; " \
73                 "elif test \"${devicetype}\" = \"B125Pv2\"; then " \
74                         "setenv confidx 5; " \
75                 "fi;\0" \
76         "set_default_type=setenv devicetype B155v2; setenv resolution 1366x768;" \
77                 "setenv fdtfile imx6dl-b155v2.dtb; run setconfidx;\0" \
78         "checkconfidx=env exists confidx || run set_default_type;\0" \
79         "checkfsckforcerepair=" \
80                 "if test \"${bootcount}\" > \"3\" ; then " \
81                         "setenv fsckforcerepair fsck.repair=1; " \
82                 "fi;\0" \
83         "helix=run setconfidx; run checkconfidx; run checkfsckforcerepair; run setargs; " \
84                 "regulator dev LED_VCC; regulator enable; " \
85                 "regulator dev 5V0_AUDIO; regulator enable; " \
86                 "bootm ${loadaddr}#conf@${confidx};\0" \
87         "failbootcmd=" \
88                 "echo reached failbootcmd;" \
89                 "cls; setcurs 5 4; " \
90                 "lcdputs \"Monitor failed to start. Try again, or contact GE Service for support.\"; " \
91                 "bootcount reset; \0" \
92         "hasfirstboot=" \
93                 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
94                 "/boot/bootcause/firstboot;\0" \
95         "swappartitions=" \
96                 "setexpr mmcpart 3 - ${mmcpart};\0" \
97         "doboot=" \
98                 "echo Booting from mmc:${mmcdev}:${mmcpart} ...; " \
99                 "run helix;\0" \
100         "altbootcmd=" \
101                 "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \
102                 "run hasfirstboot || setenv mmcpart 0; " \
103                 "if test ${mmcpart} != 0; then " \
104                         "setenv bootcause REVERT; " \
105                         "run swappartitions loadimage doboot; " \
106                 "fi; " \
107                 "run failbootcmd\0" \
108         "tryboot=" \
109                 "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \
110                 "run loadimage || run swappartitions && run loadimage || " \
111                 "setenv mmcpart 0 && echo MISSING IMAGE;" \
112                 "run showsplashscreen; sleep 1; " \
113                 "run doboot; run failbootcmd;\0" \
114
115 #endif /* __GE_B1X5V2_CONFIG_H */