include: configs: ge: simplify default boot command
[platform/kernel/u-boot.git] / include / configs / ge_bx50v3.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2015 Timesys Corporation
4  * Copyright (C) 2015 General Electric Company
5  * Copyright (C) 2014 Advantech
6  * Copyright (C) 2012 Freescale Semiconductor, Inc.
7  *
8  * Configuration settings for the GE MX6Q Bx50v3 boards.
9  */
10
11 #ifndef __GE_BX50V3_CONFIG_H
12 #define __GE_BX50V3_CONFIG_H
13
14 #include <asm/arch/imx-regs.h>
15 #include <asm/mach-imx/gpio.h>
16
17 #define CONFIG_BOARD_NAME       "General Electric Bx50v3"
18
19 #include "mx6_common.h"
20 #include <linux/sizes.h>
21
22 #define CONFIG_CMDLINE_TAG
23 #define CONFIG_SETUP_MEMORY_TAGS
24 #define CONFIG_INITRD_TAG
25 #define CONFIG_REVISION_TAG
26 #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M)
27
28 /* SATA Configs */
29 #ifdef CONFIG_CMD_SATA
30 #define CONFIG_SYS_SATA_MAX_DEVICE      1
31 #define CONFIG_DWC_AHSATA_PORT_ID       0
32 #define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
33 #define CONFIG_LBA48
34 #endif
35
36 /* USB Configs */
37 #ifdef CONFIG_USB
38 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
39 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
40 #define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
41 #define CONFIG_MXC_USB_FLAGS    0
42
43 #define CONFIG_USBD_HS
44 #define CONFIG_USB_GADGET_MASS_STORAGE
45 #endif
46
47 /* Serial Flash */
48
49 #define CONFIG_LOADADDR 0x12000000
50
51 #ifdef CONFIG_CMD_NFS
52 #define NETWORKBOOT \
53         "setnetworkboot=" \
54                 "setenv ipaddr 172.16.2.10; setenv serverip 172.16.2.20; " \
55                 "setenv gatewayip 172.16.2.20; setenv nfsserver 172.16.2.20; " \
56                 "setenv netmask 255.255.255.0; setenv ethaddr ca:fe:de:ca:f0:11; " \
57                 "setenv bootargs root=/dev/nfs nfsroot=${nfsserver}:/srv/nfs/,v3,tcp rw rootwait" \
58                 "setenv bootargs $bootargs ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}::eth0:off " \
59                 "setenv bootargs $bootargs cma=128M bootcause=${bootcause} ${videoargs} " \
60                 "setenv bootargs $bootargs systemd.mask=helix-network-defaults.service " \
61                 "setenv bootargs $bootargs watchdog.handle_boot_enabled=1\0" \
62         "networkboot=" \
63                 "run setnetworkboot; " \
64                 "nfs ${loadaddr} /srv/nfs/fitImage; " \
65                 "bootm ${loadaddr}\0" \
66
67 #define CONFIG_NETWORKBOOTCOMMAND \
68         "run networkboot; " \
69
70 #else
71 #define NETWORKBOOT \
72
73 #endif
74
75 #define CONFIG_EXTRA_ENV_SETTINGS \
76         NETWORKBOOT \
77         "image=/boot/fitImage\0" \
78         "dev=mmc\0" \
79         "devnum=2\0" \
80         "rootdev=mmcblk0p\0" \
81         "quiet=quiet loglevel=0\0" \
82         "setargs=setenv bootargs root=/dev/${rootdev}${partnum} " \
83                 "ro rootwait cma=128M " \
84                 "bootcause=${bootcause} " \
85                 "${quiet} " \
86                 "${videoargs}" "\0" \
87         "doquiet=" \
88                 "if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
89                         "then setenv quiet; fi\0" \
90         "hasfirstboot=" \
91                 "test -e ${dev} ${devnum}:${partnum} /boot/bootcause/firstboot\0" \
92         "swappartitions=" \
93                 "setexpr partnum 3 - ${partnum}\0" \
94         "failbootcmd=" \
95                 "cls; " \
96                 "setcurs 5 4; " \
97                 "lcdputs \"Monitor failed to start. " \
98                 "Try again, or contact GE Service for support.\"; " \
99                 "bootcount reset; \0" \
100         "altbootcmd=" \
101                 "run doquiet; " \
102                 "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
103                 "run hasfirstboot || setenv partnum 0; " \
104                 "if test ${partnum} != 0; then " \
105                         "run swappartitions loadimage doboot; " \
106                 "fi; " \
107                 "run failbootcmd\0" \
108         "loadimage=" \
109                 "ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
110         "doboot=" \
111                 "echo Booting from ${dev}:${devnum}:${partnum} ...; " \
112                 "run setargs; " \
113                 "bootm ${loadaddr}\0" \
114         "tryboot=" \
115                 "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
116                 "run loadimage || run swappartitions && run loadimage || " \
117                         "setenv partnum 0 && echo MISSING IMAGE;" \
118                 "run doboot; " \
119                 "run failbootcmd\0" \
120
121 #define CONFIG_MMCBOOTCOMMAND \
122         "run doquiet; " \
123         "run tryboot; " \
124
125 #ifdef CONFIG_CMD_NFS
126 #define CONFIG_BOOTCOMMAND CONFIG_NETWORKBOOTCOMMAND
127 #else
128 #define CONFIG_BOOTCOMMAND CONFIG_MMCBOOTCOMMAND
129 #endif
130
131
132 /* Miscellaneous configurable options */
133
134 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
135
136 /* Physical Memory Map */
137 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
138
139 #define CONFIG_SYS_BOOTMAPSZ (256 << 20)     /* 256M */
140
141 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
142 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
143 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
144
145 #define CONFIG_SYS_INIT_SP_OFFSET \
146         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
147 #define CONFIG_SYS_INIT_SP_ADDR \
148         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
149
150 /* environment organization */
151
152 #define CONFIG_SYS_FSL_USDHC_NUM        3
153
154 /* Framebuffer */
155 #define CONFIG_HIDE_LOGO_VERSION
156 #define CONFIG_IMX_HDMI
157 #define CONFIG_IMX_VIDEO_SKIP
158
159 #define CONFIG_IMX6_PWM_PER_CLK 66000000
160
161 #define CONFIG_PCI_SCAN_SHOW
162 #define CONFIG_PCIE_IMX
163 #define CONFIG_PCIE_IMX_PERST_GPIO      IMX_GPIO_NR(7, 12)
164 #define CONFIG_PCIE_IMX_POWER_GPIO      IMX_GPIO_NR(1, 5)
165
166 #endif  /* __GE_BX50V3_CONFIG_H */