Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 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" |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 16 | |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 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 */ |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 32 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 33 | #define CONFIG_MXC_USB_FLAGS 0 |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 34 | #define CONFIG_USBD_HS |
| 35 | |
| 36 | /* Video */ |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 37 | #define CONFIG_IMX_VIDEO_SKIP |
| 38 | |
| 39 | /* Memory */ |
| 40 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 41 | |
| 42 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 43 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 44 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 45 | |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 46 | /* Command definition */ |
| 47 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 48 | "image=/boot/fitImage\0" \ |
| 49 | "fdt_addr_r=0x18000000\0" \ |
| 50 | "splash_addr_r=0x20000000\0" \ |
| 51 | "mmcdev=2\0" \ |
| 52 | "mmcpart=1\0" \ |
| 53 | "console=console="CONSOLE_DEVICE",115200\0" \ |
| 54 | "quiet=quiet loglevel=0\0" \ |
| 55 | "rootdev=/dev/mmcblk1p\0" \ |
| 56 | "setargs=setenv bootargs ${console} ${quiet} ${fsckforcerepair} " \ |
| 57 | "bootcause=${bootcause} vt.global_cursor_default=0 vt.cur_default=1 " \ |
| 58 | "root=${rootdev}${mmcpart} video=HDMI-A-1:${resolution} rootwait ro\0" \ |
| 59 | "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
| 60 | "showsplashscreen=load mmc ${mmcdev}:${mmcpart} ${splash_addr_r} /boot/splashscreen-${resolution}.bmp; " \ |
| 61 | "bmp display ${splash_addr_r};\0" \ |
| 62 | "setconfidx=" \ |
| 63 | "if test \"${devicetype}\" = \"B105v2\"; then " \ |
| 64 | "setenv confidx 1; " \ |
| 65 | "elif test \"${devicetype}\" = \"B125v2\"; then " \ |
| 66 | "setenv confidx 2; " \ |
| 67 | "elif test \"${devicetype}\" = \"B155v2\"; then " \ |
| 68 | "setenv confidx 3; " \ |
| 69 | "elif test \"${devicetype}\" = \"B105Pv2\"; then " \ |
| 70 | "setenv confidx 4; " \ |
| 71 | "elif test \"${devicetype}\" = \"B125Pv2\"; then " \ |
| 72 | "setenv confidx 5; " \ |
| 73 | "fi;\0" \ |
| 74 | "set_default_type=setenv devicetype B155v2; setenv resolution 1366x768;" \ |
| 75 | "setenv fdtfile imx6dl-b155v2.dtb; run setconfidx;\0" \ |
| 76 | "checkconfidx=env exists confidx || run set_default_type;\0" \ |
| 77 | "checkfsckforcerepair=" \ |
| 78 | "if test \"${bootcount}\" > \"3\" ; then " \ |
| 79 | "setenv fsckforcerepair fsck.repair=1; " \ |
| 80 | "fi;\0" \ |
| 81 | "helix=run setconfidx; run checkconfidx; run checkfsckforcerepair; run setargs; " \ |
| 82 | "regulator dev LED_VCC; regulator enable; " \ |
| 83 | "regulator dev 5V0_AUDIO; regulator enable; " \ |
| 84 | "bootm ${loadaddr}#conf@${confidx};\0" \ |
| 85 | "failbootcmd=" \ |
| 86 | "echo reached failbootcmd;" \ |
| 87 | "cls; setcurs 5 4; " \ |
| 88 | "lcdputs \"Monitor failed to start. Try again, or contact GE Service for support.\"; " \ |
| 89 | "bootcount reset; \0" \ |
| 90 | "hasfirstboot=" \ |
| 91 | "load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 92 | "/boot/bootcause/firstboot;\0" \ |
| 93 | "swappartitions=" \ |
| 94 | "setexpr mmcpart 3 - ${mmcpart};\0" \ |
| 95 | "doboot=" \ |
| 96 | "echo Booting from mmc:${mmcdev}:${mmcpart} ...; " \ |
| 97 | "run helix;\0" \ |
| 98 | "altbootcmd=" \ |
| 99 | "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \ |
| 100 | "run hasfirstboot || setenv mmcpart 0; " \ |
| 101 | "if test ${mmcpart} != 0; then " \ |
| 102 | "setenv bootcause REVERT; " \ |
| 103 | "run swappartitions loadimage doboot; " \ |
| 104 | "fi; " \ |
| 105 | "run failbootcmd\0" \ |
| 106 | "tryboot=" \ |
| 107 | "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \ |
| 108 | "run loadimage || run swappartitions && run loadimage || " \ |
| 109 | "setenv mmcpart 0 && echo MISSING IMAGE;" \ |
| 110 | "run showsplashscreen; sleep 1; " \ |
| 111 | "run doboot; run failbootcmd;\0" \ |
| 112 | |
Sebastian Reichel | 7cab6fe | 2020-09-02 19:31:46 +0200 | [diff] [blame] | 113 | #endif /* __GE_B1X5V2_CONFIG_H */ |