blob: 07b36706e56d4490ec45dca8298de7b1b69be97e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Akshay Bhat197f9872016-01-29 15:16:40 -05002/*
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.
Akshay Bhat197f9872016-01-29 15:16:40 -05009 */
10
11#ifndef __GE_BX50V3_CONFIG_H
12#define __GE_BX50V3_CONFIG_H
13
14#include <asm/arch/imx-regs.h>
Stefano Babic33731bc2017-06-29 10:16:06 +020015#include <asm/mach-imx/gpio.h>
Akshay Bhat197f9872016-01-29 15:16:40 -050016
Akshay Bhat197f9872016-01-29 15:16:40 -050017#include "mx6_common.h"
18#include <linux/sizes.h>
19
Ian Ray656d8d52020-11-04 17:18:39 +010020#ifdef CONFIG_CMD_NFS
Joonas Aijala667f25f2019-01-31 16:21:20 +020021#define NETWORKBOOT \
22 "setnetworkboot=" \
23 "setenv ipaddr 172.16.2.10; setenv serverip 172.16.2.20; " \
24 "setenv gatewayip 172.16.2.20; setenv nfsserver 172.16.2.20; " \
25 "setenv netmask 255.255.255.0; setenv ethaddr ca:fe:de:ca:f0:11; " \
26 "setenv bootargs root=/dev/nfs nfsroot=${nfsserver}:/srv/nfs/,v3,tcp rw rootwait" \
27 "setenv bootargs $bootargs ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}::eth0:off " \
Ian Raya8203cc2020-11-04 17:18:43 +010028 "setenv bootargs $bootargs cma=128M bootcause=${bootcause} ${videoargs} " \
Joonas Aijala667f25f2019-01-31 16:21:20 +020029 "setenv bootargs $bootargs systemd.mask=helix-network-defaults.service " \
30 "setenv bootargs $bootargs watchdog.handle_boot_enabled=1\0" \
31 "networkboot=" \
32 "run setnetworkboot; " \
33 "nfs ${loadaddr} /srv/nfs/fitImage; " \
Sebastian Reichel99453902020-12-15 00:41:56 +010034 "bootm ${loadaddr}\0" \
Joonas Aijala667f25f2019-01-31 16:21:20 +020035
Tom Rini9aed2af2021-08-19 14:29:00 -040036#define NETWORKBOOTCOMMAND \
Joonas Aijala667f25f2019-01-31 16:21:20 +020037 "run networkboot; " \
38
39#else
40#define NETWORKBOOT \
41
42#endif
43
Tom Rinic9edebe2022-12-04 10:03:50 -050044#define CFG_EXTRA_ENV_SETTINGS \
Joonas Aijala667f25f2019-01-31 16:21:20 +020045 NETWORKBOOT \
Ian Rayb52e2522018-01-10 20:31:33 +010046 "image=/boot/fitImage\0" \
Ian Ray70846762018-01-10 20:31:37 +010047 "dev=mmc\0" \
Ian Ray3a97ec02019-01-31 16:21:12 +020048 "devnum=2\0" \
Ian Ray70846762018-01-10 20:31:37 +010049 "rootdev=mmcblk0p\0" \
50 "quiet=quiet loglevel=0\0" \
Ian Ray70846762018-01-10 20:31:37 +010051 "setargs=setenv bootargs root=/dev/${rootdev}${partnum} " \
52 "ro rootwait cma=128M " \
53 "bootcause=${bootcause} " \
Robert Beckett8022cbd2020-01-31 15:08:01 +020054 "${quiet} " \
Ian Rayd8c60992018-04-25 16:57:03 +020055 "${videoargs}" "\0" \
Ian Ray70846762018-01-10 20:31:37 +010056 "doquiet=" \
57 "if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
58 "then setenv quiet; fi\0" \
59 "hasfirstboot=" \
Robert Beckettf3270fb2020-01-31 15:08:03 +020060 "test -e ${dev} ${devnum}:${partnum} /boot/bootcause/firstboot\0" \
Ian Ray70846762018-01-10 20:31:37 +010061 "swappartitions=" \
62 "setexpr partnum 3 - ${partnum}\0" \
63 "failbootcmd=" \
Robert Beckettb2185d22020-01-31 15:07:59 +020064 "cls; " \
Ian Rayb7f96252019-11-12 19:15:15 +000065 "setcurs 5 4; " \
66 "lcdputs \"Monitor failed to start. " \
67 "Try again, or contact GE Service for support.\"; " \
Ian Ray75c38f72021-04-23 16:15:13 +020068 "bootcount reset; " \
69 "while true; do sleep 1; done; \0" \
Ian Ray70846762018-01-10 20:31:37 +010070 "altbootcmd=" \
71 "run doquiet; " \
72 "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
73 "run hasfirstboot || setenv partnum 0; " \
74 "if test ${partnum} != 0; then " \
Ian Ray70846762018-01-10 20:31:37 +010075 "run swappartitions loadimage doboot; " \
76 "fi; " \
77 "run failbootcmd\0" \
Akshay Bhat197f9872016-01-29 15:16:40 -050078 "loadimage=" \
79 "ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
Ian Ray70846762018-01-10 20:31:37 +010080 "doboot=" \
81 "echo Booting from ${dev}:${devnum}:${partnum} ...; " \
Akshay Bhat197f9872016-01-29 15:16:40 -050082 "run setargs; " \
Sebastian Reichel99453902020-12-15 00:41:56 +010083 "bootm ${loadaddr}\0" \
Ian Ray70846762018-01-10 20:31:37 +010084 "tryboot=" \
85 "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
86 "run loadimage || run swappartitions && run loadimage || " \
Ian Ray8355e8c2021-04-23 16:15:12 +020087 "setenv partnum 0 && echo MISSING IMAGE;" \
Ian Ray70846762018-01-10 20:31:37 +010088 "run doboot; " \
89 "run failbootcmd\0" \
Akshay Bhat197f9872016-01-29 15:16:40 -050090
Akshay Bhat197f9872016-01-29 15:16:40 -050091/* Physical Memory Map */
Akshay Bhat197f9872016-01-29 15:16:40 -050092#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
93
Tom Rini6a5dccc2022-11-16 13:10:41 -050094#define CFG_SYS_BOOTMAPSZ (256 << 20) /* 256M */
Ian Raye5818ae2020-01-31 15:08:04 +020095
Tom Rinibb4dd962022-11-16 13:10:37 -050096#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini6a5dccc2022-11-16 13:10:41 -050097#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
98#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Akshay Bhat197f9872016-01-29 15:16:40 -050099
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900100/* environment organization */
Akshay Bhat197f9872016-01-29 15:16:40 -0500101
Tom Rini376b88a2022-10-28 20:27:13 -0400102#define CFG_SYS_FSL_USDHC_NUM 3
Akshay Bhat197f9872016-01-29 15:16:40 -0500103
Akshay Bhat197f9872016-01-29 15:16:40 -0500104#endif /* __GE_BX50V3_CONFIG_H */