Merge branch '2021-11-15-assorted-fixes'

- Rename "tqc" to "tq" and related updates
- Assorted minor ARM updates, build updates and documentation updates
diff --git a/Makefile b/Makefile
index 0220e8d..5064996 100644
--- a/Makefile
+++ b/Makefile
@@ -1246,7 +1246,7 @@
 			echo "u-boot.map shows a binary size of $$map_size" >&2 ; \
 			echo "  but u-boot-nodtb.bin shows $$file_size" >&2 ; \
 			exit 1; \
-		fi \
+		fi; \
 	fi
 
 ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy)
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index f7fb772..eee7a21 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -210,7 +210,7 @@
 		orr	r9, r9, ip, lspush #\push
 		mov	ip, ip, lspull #\pull
 		orr	ip, ip, lr, lspush #\push
-		str8w	r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
+		str8w	r0, r3, r4, r5, r6, r7, r8, r9, ip, abort=19f
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index b4c8511..62de942 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -569,7 +569,7 @@
 	imply CMD_SPL
 
 config TARGET_TQMA6
-	bool "TQ Systems TQMa6 board"
+	bool "TQ-Systems TQMa6 board"
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 	select MXC_SPI
@@ -688,7 +688,7 @@
 source "board/technexion/pico-imx6/Kconfig"
 source "board/technexion/pico-imx6ul/Kconfig"
 source "board/tbs/tbs2910/Kconfig"
-source "board/tqc/tqma6/Kconfig"
+source "board/tq/tqma6/Kconfig"
 source "board/toradex/apalis_imx6/Kconfig"
 source "board/toradex/colibri_imx6/Kconfig"
 source "board/toradex/colibri-imx6ull/Kconfig"
diff --git a/board/tqc/tqma6/Kconfig b/board/tq/tqma6/Kconfig
similarity index 90%
rename from board/tqc/tqma6/Kconfig
rename to board/tq/tqma6/Kconfig
index a2a5905..cb1b874 100644
--- a/board/tqc/tqma6/Kconfig
+++ b/board/tq/tqma6/Kconfig
@@ -4,7 +4,7 @@
 	default "tqma6"
 
 config SYS_VENDOR
-	default "tqc"
+	default "tq"
 
 config SYS_CONFIG_NAME
 	default "tqma6"
@@ -89,8 +89,8 @@
 	default 0x4fc00000 if TQMA6Q || TQMA6DL
 
 config IMX_CONFIG
-	default "board/tqc/tqma6/tqma6q.cfg" if TQMA6Q
-	default "board/tqc/tqma6/tqma6dl.cfg" if TQMA6DL
-	default "board/tqc/tqma6/tqma6s.cfg" if TQMA6S
+	default "board/tq/tqma6/tqma6q.cfg" if TQMA6Q
+	default "board/tq/tqma6/tqma6dl.cfg" if TQMA6DL
+	default "board/tq/tqma6/tqma6s.cfg" if TQMA6S
 
 endif
diff --git a/board/tqc/tqma6/MAINTAINERS b/board/tq/tqma6/MAINTAINERS
similarity index 72%
rename from board/tqc/tqma6/MAINTAINERS
rename to board/tq/tqma6/MAINTAINERS
index 91cd244..c4fb6ec 100644
--- a/board/tqc/tqma6/MAINTAINERS
+++ b/board/tq/tqma6/MAINTAINERS
@@ -1,6 +1,6 @@
-TQ SYSTEMS TQMA6 BOARD
+TQ-SYSTEMS TQMA6 BOARD
 M:	Markus Niebel <Markus.Niebel@tq-group.com>
 S:	Maintained
-F:	board/tqc/tqma6/
+F:	board/tq/tqma6/
 F:	include/configs/tqma6.h
 F:	configs/tqma6*_defconfig
diff --git a/board/tqc/tqma6/Makefile b/board/tq/tqma6/Makefile
similarity index 100%
rename from board/tqc/tqma6/Makefile
rename to board/tq/tqma6/Makefile
diff --git a/board/tqc/tqma6/README b/board/tq/tqma6/README
similarity index 83%
rename from board/tqc/tqma6/README
rename to board/tq/tqma6/README
index c47cb21..bd2466c 100644
--- a/board/tqc/tqma6/README
+++ b/board/tq/tqma6/README
@@ -1,7 +1,7 @@
-U-Boot for the TQ Systems TQMa6 modules
+U-Boot for the TQ-Systems TQMa6 modules
 
 This file contains information for the port of
-U-Boot to the TQ Systems TQMa6 modules.
+U-Boot to the TQ-Systems TQMa6 modules.
 
 1. Boot source
 --------------
@@ -14,7 +14,7 @@
 2. Building
 ------------
 
-To build U-Boot for the TQ Systems TQMa6 modules:
+To build U-Boot for the TQ-Systems TQMa6 modules:
 
 	make tqma6<x>_<baseboard>_<boot>_config
 	make
diff --git a/board/tqc/tqma6/clocks.cfg b/board/tq/tqma6/clocks.cfg
similarity index 100%
rename from board/tqc/tqma6/clocks.cfg
rename to board/tq/tqma6/clocks.cfg
diff --git a/board/tqc/tqma6/tqma6.c b/board/tq/tqma6/tqma6.c
similarity index 98%
rename from board/tqc/tqma6/tqma6.c
rename to board/tq/tqma6/tqma6.c
index de9c001..1c2228c 100644
--- a/board/tqc/tqma6/tqma6.c
+++ b/board/tq/tqma6/tqma6.c
@@ -3,7 +3,7 @@
  * Copyright (C) 2012 Freescale Semiconductor, Inc.
  * Author: Fabio Estevam <fabio.estevam@freescale.com>
  *
- * Copyright (C) 2013, 2014 TQ Systems (ported SabreSD to TQMa6x)
+ * Copyright (C) 2013, 2014 TQ-Systems (ported SabreSD to TQMa6x)
  * Author: Markus Niebel <markus.niebel@tq-group.com>
  */
 
diff --git a/board/tqc/tqma6/tqma6_bb.h b/board/tq/tqma6/tqma6_bb.h
similarity index 94%
rename from board/tqc/tqma6/tqma6_bb.h
rename to board/tq/tqma6/tqma6_bb.h
index b0f1f99..ca81bdf 100644
--- a/board/tqc/tqma6/tqma6_bb.h
+++ b/board/tq/tqma6/tqma6_bb.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright (C) 2013, 2014 TQ Systems
+ * Copyright (C) 2013, 2014 TQ-Systems
  * Author: Markus Niebel <markus.niebel@tq-group.com>
  */
 
diff --git a/board/tqc/tqma6/tqma6_mba6.c b/board/tq/tqma6/tqma6_mba6.c
similarity index 98%
rename from board/tqc/tqma6/tqma6_mba6.c
rename to board/tq/tqma6/tqma6_mba6.c
index 801619e..52851dd 100644
--- a/board/tqc/tqma6/tqma6_mba6.c
+++ b/board/tq/tqma6/tqma6_mba6.c
@@ -3,7 +3,7 @@
  * Copyright (C) 2012 Freescale Semiconductor, Inc.
  * Author: Fabio Estevam <fabio.estevam@freescale.com>
  *
- * Copyright (C) 2013, 2014 TQ Systems (ported SabreSD to TQMa6x)
+ * Copyright (C) 2013, 2014 TQ-Systems (ported SabreSD to TQMa6x)
  * Author: Markus Niebel <markus.niebel@tq-group.com>
  */
 
diff --git a/board/tqc/tqma6/tqma6_wru4.c b/board/tq/tqma6/tqma6_wru4.c
similarity index 98%
rename from board/tqc/tqma6/tqma6_wru4.c
rename to board/tq/tqma6/tqma6_wru4.c
index 3b1bc60..5d23991 100644
--- a/board/tqc/tqma6/tqma6_wru4.c
+++ b/board/tq/tqma6/tqma6_wru4.c
@@ -3,7 +3,7 @@
  * Copyright (C) 2012 Freescale Semiconductor, Inc.
  * Author: Fabio Estevam <fabio.estevam@freescale.com>
  *
- * Copyright (C) 2013, 2014 TQ Systems (ported SabreSD to TQMa6x)
+ * Copyright (C) 2013, 2014 TQ-Systems (ported SabreSD to TQMa6x)
  * Author: Markus Niebel <markus.niebel@tq-group.com>
  *
  * Copyright (C) 2015 Stefan Roese <sr@denx.de>
diff --git a/board/tqc/tqma6/tqma6dl.cfg b/board/tq/tqma6/tqma6dl.cfg
similarity index 100%
rename from board/tqc/tqma6/tqma6dl.cfg
rename to board/tq/tqma6/tqma6dl.cfg
diff --git a/board/tqc/tqma6/tqma6q.cfg b/board/tq/tqma6/tqma6q.cfg
similarity index 100%
rename from board/tqc/tqma6/tqma6q.cfg
rename to board/tq/tqma6/tqma6q.cfg
diff --git a/board/tqc/tqma6/tqma6s.cfg b/board/tq/tqma6/tqma6s.cfg
similarity index 100%
rename from board/tqc/tqma6/tqma6s.cfg
rename to board/tq/tqma6/tqma6s.cfg
diff --git a/boot/image-board.c b/boot/image-board.c
index ddf30c6..bf88171 100644
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -14,6 +14,7 @@
 #include <env.h>
 #include <fpga.h>
 #include <image.h>
+#include <init.h>
 #include <mapmem.h>
 #include <rtc.h>
 #include <watchdog.h>
diff --git a/boot/image.c b/boot/image.c
index 992e729..f792f2a 100644
--- a/boot/image.c
+++ b/boot/image.c
@@ -9,6 +9,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <env.h>
+#include <init.h>
 #include <lmb.h>
 #include <log.h>
 #include <malloc.h>
@@ -29,11 +30,6 @@
 #include <linux/errno.h>
 #include <asm/io.h>
 
-#ifdef CONFIG_CMD_BDI
-extern int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc,
-		     char *const argv[]);
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /* Set this if we have less than 4 MB of malloc() space */
diff --git a/doc/README.usb b/doc/README.usb
index 05c62c3..650a6da 100644
--- a/doc/README.usb
+++ b/doc/README.usb
@@ -18,8 +18,8 @@
 -------------
 
 The USB (at least the USB UHCI) needs a frame list (4k), transfer
-descripor and queue headers which are all located in the main memory.
-The UHCI allocates every milisecond the PCI bus and reads the current
+descriptor and queue headers which are all located in the main memory.
+The UHCI allocates every millisecond the PCI bus and reads the current
 frame pointer. This may cause to crash the OS during boot. So the USB
 _MUST_ be stopped during OS boot. This is the reason, why the USB is
 NOT automatically started during start-up. If someone needs the USB
@@ -27,10 +27,10 @@
 it before booting the OS.
 
 For USB keyboards this can be done by a script which is automatically
-started after the U-Boot is up and running. To boot an OS with a an
+started after the U-Boot is up and running. To boot an OS with a
 USB keyboard another script is necessary, which first disables the
 USB and then executes the boot command. If the boot command fails,
-the script can reenable the USB kbd.
+the script can re-enable the USB keyboard.
 
 Common USB Commands:
 - usb start:
@@ -40,10 +40,10 @@
 - usb info [dev]:   shows all USB infos of the device dev, or of all
 		    the devices
 - usb stop [f]:	    stops the USB. If f==1 the USB will also stop if
-		    an USB keyboard is assigned as stdin. The stdin
+		    a USB keyboard is assigned as stdin. The stdin
 		    is then switched to serial input.
 Storage USB Commands:
-- usb scan:	    scans the USB for storage devices.The USB must be
+- usb scan:	    scans the USB for storage devices. The USB must be
 		    running for this command (usb start)
 - usb device [dev]: show or set current USB storage device
 - usb part [dev]:   print partition table of one or all USB storage
@@ -57,7 +57,7 @@
 Config Switches:
 ----------------
 CONFIG_CMD_USB	    enables basic USB support and the usb command
-CONFIG_USB_UHCI	    defines the lowlevel part.A lowlevel part must be defined
+CONFIG_USB_UHCI	    defines the lowlevel part. A lowlevel part must be defined
 		    if using CONFIG_CMD_USB
 CONFIG_USB_KEYBOARD enables the USB Keyboard
 CONFIG_USB_STORAGE  enables the USB storage devices
@@ -124,7 +124,7 @@
 
 To enable USB Host Ethernet in U-Boot, your platform must of course
 support USB with CONFIG_CMD_USB enabled and working. You will need to
-add some config settings to your board config:
+add some settings to your board configuration:
 
 CONFIG_CMD_USB=y		/* the 'usb' interactive command */
 CONFIG_USB_HOST_ETHER=y		/* Enable USB Ethernet adapters */
@@ -158,7 +158,7 @@
 You can also set the default IP address of your board and the server
 as well as the default file to load when a 'bootp' command is issued.
 However note that encoding these individual network settings into a
-common exectuable is discouraged, as it leads to potential conflicts,
+common executable is discouraged, as it leads to potential conflicts,
 and all the parameters can either get stored in the board's external
 environment, or get obtained from the bootp server if not set.
 
@@ -166,7 +166,6 @@
 #define CONFIG_SERVERIP		10.0.0.1  (replace with your value)
 #define CONFIG_BOOTFILE		"uImage"
 
-
 The 'usb start' command should identify the adapter something like this:
 
 CrOS> usb start
@@ -211,8 +210,8 @@
 
 Most Ethernet dongles have a built-in MAC address which is unique in the
 world. This is important so that devices on the network can be
-distinguised from each other. MAC address conflicts are evil and
-generally result in strange and eratic behaviour.
+distinguished from each other. MAC address conflicts are evil and
+generally result in strange and erratic behaviour.
 
 Some boards have USB Ethernet chips on-board, and these sometimes do not
 have an assigned MAC address. In this case it is up to you to assign
diff --git a/include/configs/synquacer.h b/include/configs/synquacer.h
index 28f5463..3d099b4 100644
--- a/include/configs/synquacer.h
+++ b/include/configs/synquacer.h
@@ -52,7 +52,7 @@
 /* #define CONFIG_SYS_PCI_64BIT		1 */
 
 #define DEFAULT_DFU_ALT_INFO "dfu_alt_info="				\
-			"mtd mx66u51235f=u-boot.bin raw 200000 100000;"	\
+			"mtd nor1=u-boot.bin raw 200000 100000;"	\
 			"fip.bin raw 180000 78000;"			\
 			"optee.bin raw 500000 100000\0"
 
diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h
index 374a65a..233031b 100644
--- a/include/configs/tqma6.h
+++ b/include/configs/tqma6.h
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2013, 2014, 2017 Markus Niebel <Markus.Niebel@tq-group.com>
  *
- * Configuration settings for the TQ Systems TQMa6<Q,D,DL,S> module.
+ * Configuration settings for the TQ-Systems TQMa6<Q,D,DL,S> module.
  */
 
 #ifndef __CONFIG_H
diff --git a/include/configs/tqma6_mba6.h b/include/configs/tqma6_mba6.h
index bee6d2f..a19ea35 100644
--- a/include/configs/tqma6_mba6.h
+++ b/include/configs/tqma6_mba6.h
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2013 - 2017 Markus Niebel <Markus.Niebel@tq-group.com>
  *
- * Configuration settings for the TQ Systems TQMa6<Q,D,DL,S> module on
+ * Configuration settings for the TQ-Systems TQMa6<Q,D,DL,S> module on
  * MBa6 starter kit
  */
 
diff --git a/include/init.h b/include/init.h
index c781789..f2cd46d 100644
--- a/include/init.h
+++ b/include/init.h
@@ -332,6 +332,8 @@
 /* Show arch-specific information for the 'bd' command */
 void arch_print_bdinfo(void);
 
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
+
 #endif	/* __ASSEMBLY__ */
 /* Put only stuff here that the assembler can digest */
 
diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index 0bfc1b2..8a3efdb 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -61,7 +61,7 @@
 			if [ -n "${KCONFIG_IGNORE_DUPLICATES}" ] ||			\
 			   ! grep -q "$${line%=*}=" include/config/auto.conf; then	\
 				echo "$$line";						\
-			fi								\
+			fi;								\
 		done > $@
 
 quiet_cmd_u_boot_cfg = CFG     $@
diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c
index 6a52401..f0bc548 100644
--- a/tools/relocate-rela.c
+++ b/tools/relocate-rela.c
@@ -63,7 +63,7 @@
 {
 	FILE *f;
 	int i, num;
-	uint64_t rela_start, rela_end, text_base;
+	uint64_t rela_start, rela_end, text_base, file_size;
 
 	if (argc != 5) {
 		fprintf(stderr, "Statically apply ELF rela relocations\n");
@@ -87,8 +87,7 @@
 		return 3;
 	}
 
-	if (rela_start > rela_end || rela_start < text_base ||
-	    (rela_end - rela_start) % sizeof(Elf64_Rela)) {
+	if (rela_start > rela_end || rela_start < text_base) {
 		fprintf(stderr, "%s: bad rela bounds\n", argv[0]);
 		return 3;
 	}
@@ -96,6 +95,21 @@
 	rela_start -= text_base;
 	rela_end -= text_base;
 
+	fseek(f, 0, SEEK_END);
+	file_size = ftell(f);
+	rewind(f);
+
+	if (rela_end > file_size) {
+		// Most likely compiler inserted some section that didn't get
+		// objcopy-ed into the final binary
+		rela_end = file_size;
+	}
+
+	if ((rela_end - rela_start) % sizeof(Elf64_Rela)) {
+		fprintf(stderr, "%s: rela size isn't a multiple of Elf64_Rela\n", argv[0]);
+		return 3;
+	}
+
 	num = (rela_end - rela_start) / sizeof(Elf64_Rela);
 
 	for (i = 0; i < num; i++) {