Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 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. |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __GE_BX50V3_CONFIG_H |
| 12 | #define __GE_BX50V3_CONFIG_H |
| 13 | |
| 14 | #include <asm/arch/imx-regs.h> |
Stefano Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 15 | #include <asm/mach-imx/gpio.h> |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 16 | |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 17 | #include "mx6_common.h" |
| 18 | #include <linux/sizes.h> |
| 19 | |
Ian Ray | 656d8d5 | 2020-11-04 17:18:39 +0100 | [diff] [blame] | 20 | #ifdef CONFIG_CMD_NFS |
Joonas Aijala | 667f25f | 2019-01-31 16:21:20 +0200 | [diff] [blame] | 21 | #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 Ray | a8203cc | 2020-11-04 17:18:43 +0100 | [diff] [blame] | 28 | "setenv bootargs $bootargs cma=128M bootcause=${bootcause} ${videoargs} " \ |
Joonas Aijala | 667f25f | 2019-01-31 16:21:20 +0200 | [diff] [blame] | 29 | "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 Reichel | 9945390 | 2020-12-15 00:41:56 +0100 | [diff] [blame] | 34 | "bootm ${loadaddr}\0" \ |
Joonas Aijala | 667f25f | 2019-01-31 16:21:20 +0200 | [diff] [blame] | 35 | |
Tom Rini | 9aed2af | 2021-08-19 14:29:00 -0400 | [diff] [blame] | 36 | #define NETWORKBOOTCOMMAND \ |
Joonas Aijala | 667f25f | 2019-01-31 16:21:20 +0200 | [diff] [blame] | 37 | "run networkboot; " \ |
| 38 | |
| 39 | #else |
| 40 | #define NETWORKBOOT \ |
| 41 | |
| 42 | #endif |
| 43 | |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 44 | #define CFG_EXTRA_ENV_SETTINGS \ |
Joonas Aijala | 667f25f | 2019-01-31 16:21:20 +0200 | [diff] [blame] | 45 | NETWORKBOOT \ |
Ian Ray | b52e252 | 2018-01-10 20:31:33 +0100 | [diff] [blame] | 46 | "image=/boot/fitImage\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 47 | "dev=mmc\0" \ |
Ian Ray | 3a97ec0 | 2019-01-31 16:21:12 +0200 | [diff] [blame] | 48 | "devnum=2\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 49 | "rootdev=mmcblk0p\0" \ |
| 50 | "quiet=quiet loglevel=0\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 51 | "setargs=setenv bootargs root=/dev/${rootdev}${partnum} " \ |
| 52 | "ro rootwait cma=128M " \ |
| 53 | "bootcause=${bootcause} " \ |
Robert Beckett | 8022cbd | 2020-01-31 15:08:01 +0200 | [diff] [blame] | 54 | "${quiet} " \ |
Ian Ray | d8c6099 | 2018-04-25 16:57:03 +0200 | [diff] [blame] | 55 | "${videoargs}" "\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 56 | "doquiet=" \ |
| 57 | "if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \ |
| 58 | "then setenv quiet; fi\0" \ |
| 59 | "hasfirstboot=" \ |
Robert Beckett | f3270fb | 2020-01-31 15:08:03 +0200 | [diff] [blame] | 60 | "test -e ${dev} ${devnum}:${partnum} /boot/bootcause/firstboot\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 61 | "swappartitions=" \ |
| 62 | "setexpr partnum 3 - ${partnum}\0" \ |
| 63 | "failbootcmd=" \ |
Robert Beckett | b2185d2 | 2020-01-31 15:07:59 +0200 | [diff] [blame] | 64 | "cls; " \ |
Ian Ray | b7f9625 | 2019-11-12 19:15:15 +0000 | [diff] [blame] | 65 | "setcurs 5 4; " \ |
| 66 | "lcdputs \"Monitor failed to start. " \ |
| 67 | "Try again, or contact GE Service for support.\"; " \ |
Ian Ray | 75c38f7 | 2021-04-23 16:15:13 +0200 | [diff] [blame] | 68 | "bootcount reset; " \ |
| 69 | "while true; do sleep 1; done; \0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 70 | "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 Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 75 | "run swappartitions loadimage doboot; " \ |
| 76 | "fi; " \ |
| 77 | "run failbootcmd\0" \ |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 78 | "loadimage=" \ |
| 79 | "ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 80 | "doboot=" \ |
| 81 | "echo Booting from ${dev}:${devnum}:${partnum} ...; " \ |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 82 | "run setargs; " \ |
Sebastian Reichel | 9945390 | 2020-12-15 00:41:56 +0100 | [diff] [blame] | 83 | "bootm ${loadaddr}\0" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 84 | "tryboot=" \ |
| 85 | "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \ |
| 86 | "run loadimage || run swappartitions && run loadimage || " \ |
Ian Ray | 8355e8c | 2021-04-23 16:15:12 +0200 | [diff] [blame] | 87 | "setenv partnum 0 && echo MISSING IMAGE;" \ |
Ian Ray | 7084676 | 2018-01-10 20:31:37 +0100 | [diff] [blame] | 88 | "run doboot; " \ |
| 89 | "run failbootcmd\0" \ |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 90 | |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 91 | /* Physical Memory Map */ |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 92 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 93 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 94 | #define CFG_SYS_BOOTMAPSZ (256 << 20) /* 256M */ |
Ian Ray | e5818ae | 2020-01-31 15:08:04 +0200 | [diff] [blame] | 95 | |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 96 | #define CFG_SYS_SDRAM_BASE PHYS_SDRAM |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 97 | #define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 98 | #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 99 | |
Masahiro Yamada | 8cea9b5 | 2017-02-11 22:43:54 +0900 | [diff] [blame] | 100 | /* environment organization */ |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 101 | |
Tom Rini | 376b88a | 2022-10-28 20:27:13 -0400 | [diff] [blame] | 102 | #define CFG_SYS_FSL_USDHC_NUM 3 |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 103 | |
Akshay Bhat | 197f987 | 2016-01-29 15:16:40 -0500 | [diff] [blame] | 104 | #endif /* __GE_BX50V3_CONFIG_H */ |