blob: f3d85c9c11e84af2ff683080064cb52a09ff80d3 [file] [log] [blame]
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +02001/*
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
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020015/* UART */
Tom Rinia17aa192022-12-04 10:04:55 -050016#define CFG_MXC_UART_BASE UART3_BASE
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020017
Tom Rinia17aa192022-12-04 10:04:55 -050018#if CFG_MXC_UART_BASE == UART2_BASE
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020019/* UART2 requires CONFIG_DEBUG_UART_BASE=0x21e8000 */
20#define CONSOLE_DEVICE "ttymxc1" /* System on Module debug connector */
21#else
22/* UART3 requires CONFIG_DEBUG_UART_BASE=0x21ec000 */
23#define CONSOLE_DEVICE "ttymxc2" /* Base board debug connector */
24#endif
25
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020026/* Memory */
27#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
28
Tom Rinibb4dd962022-11-16 13:10:37 -050029#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini6a5dccc2022-11-16 13:10:41 -050030#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
31#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020032
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020033/* Command definition */
Tom Rinic9edebe2022-12-04 10:03:50 -050034#define CFG_EXTRA_ENV_SETTINGS \
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +020035 "image=/boot/fitImage\0" \
36 "fdt_addr_r=0x18000000\0" \
37 "splash_addr_r=0x20000000\0" \
38 "mmcdev=2\0" \
39 "mmcpart=1\0" \
40 "console=console="CONSOLE_DEVICE",115200\0" \
41 "quiet=quiet loglevel=0\0" \
42 "rootdev=/dev/mmcblk1p\0" \
43 "setargs=setenv bootargs ${console} ${quiet} ${fsckforcerepair} " \
44 "bootcause=${bootcause} vt.global_cursor_default=0 vt.cur_default=1 " \
45 "root=${rootdev}${mmcpart} video=HDMI-A-1:${resolution} rootwait ro\0" \
46 "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
47 "showsplashscreen=load mmc ${mmcdev}:${mmcpart} ${splash_addr_r} /boot/splashscreen-${resolution}.bmp; " \
48 "bmp display ${splash_addr_r};\0" \
49 "setconfidx=" \
50 "if test \"${devicetype}\" = \"B105v2\"; then " \
51 "setenv confidx 1; " \
52 "elif test \"${devicetype}\" = \"B125v2\"; then " \
53 "setenv confidx 2; " \
54 "elif test \"${devicetype}\" = \"B155v2\"; then " \
55 "setenv confidx 3; " \
56 "elif test \"${devicetype}\" = \"B105Pv2\"; then " \
57 "setenv confidx 4; " \
58 "elif test \"${devicetype}\" = \"B125Pv2\"; then " \
59 "setenv confidx 5; " \
60 "fi;\0" \
61 "set_default_type=setenv devicetype B155v2; setenv resolution 1366x768;" \
62 "setenv fdtfile imx6dl-b155v2.dtb; run setconfidx;\0" \
63 "checkconfidx=env exists confidx || run set_default_type;\0" \
64 "checkfsckforcerepair=" \
65 "if test \"${bootcount}\" > \"3\" ; then " \
66 "setenv fsckforcerepair fsck.repair=1; " \
67 "fi;\0" \
68 "helix=run setconfidx; run checkconfidx; run checkfsckforcerepair; run setargs; " \
69 "regulator dev LED_VCC; regulator enable; " \
70 "regulator dev 5V0_AUDIO; regulator enable; " \
71 "bootm ${loadaddr}#conf@${confidx};\0" \
72 "failbootcmd=" \
73 "echo reached failbootcmd;" \
74 "cls; setcurs 5 4; " \
75 "lcdputs \"Monitor failed to start. Try again, or contact GE Service for support.\"; " \
76 "bootcount reset; \0" \
77 "hasfirstboot=" \
78 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
79 "/boot/bootcause/firstboot;\0" \
80 "swappartitions=" \
81 "setexpr mmcpart 3 - ${mmcpart};\0" \
82 "doboot=" \
83 "echo Booting from mmc:${mmcdev}:${mmcpart} ...; " \
84 "run helix;\0" \
85 "altbootcmd=" \
86 "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \
87 "run hasfirstboot || setenv mmcpart 0; " \
88 "if test ${mmcpart} != 0; then " \
89 "setenv bootcause REVERT; " \
90 "run swappartitions loadimage doboot; " \
91 "fi; " \
92 "run failbootcmd\0" \
93 "tryboot=" \
94 "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \
95 "run loadimage || run swappartitions && run loadimage || " \
96 "setenv mmcpart 0 && echo MISSING IMAGE;" \
97 "run showsplashscreen; sleep 1; " \
98 "run doboot; run failbootcmd;\0" \
99
Sebastian Reichel7cab6fe2020-09-02 19:31:46 +0200100#endif /* __GE_B1X5V2_CONFIG_H */