Merge tag 'tpm-19112021' of https://source.denx.de/u-boot/custodians/u-boot-tpm

TPM1.2 and Atmel fixes

# gpg verification failed.
diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
index 680e674..28c8356 100644
--- a/arch/arm/lib/crt0_64.S
+++ b/arch/arm/lib/crt0_64.S
@@ -104,6 +104,10 @@
 	bic	sp, x0, #0xf	/* 16-byte alignment for ABI compliance */
 	ldr	x18, [x18, #GD_NEW_GD]		/* x18 <- gd->new_gd */
 
+	/* Skip relocation in case gd->gd_flags & GD_FLG_SKIP_RELOC */
+	ldr	x0, [x18, #GD_FLAGS]		/* x0 <- gd->flags */
+	tbnz	x0, 11, relocation_return	/* GD_FLG_SKIP_RELOC is bit 11 */
+
 	adr	lr, relocation_return
 #if CONFIG_POSITION_INDEPENDENT
 	/* Add in link-vs-runtime offset */
diff --git a/board/socionext/developerbox/developerbox.c b/board/socionext/developerbox/developerbox.c
index 31b1349..9552bfc 100644
--- a/board/socionext/developerbox/developerbox.c
+++ b/board/socionext/developerbox/developerbox.c
@@ -82,6 +82,8 @@
 {
 	gd->bd->bi_boot_params = CONFIG_SYS_LOAD_ADDR + LOAD_OFFSET;
 
+	gd->env_addr = (ulong)&default_environment[0];
+
 	synquacer_setup_scbm_smmu();
 
 	return 0;
diff --git a/common/board_f.c b/common/board_f.c
index 3dc0eaa..f7ea7c7 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -673,30 +673,32 @@
 
 static int setup_reloc(void)
 {
-	if (gd->flags & GD_FLG_SKIP_RELOC) {
-		debug("Skipping relocation due to flag\n");
-		return 0;
-	}
-
+	if (!(gd->flags & GD_FLG_SKIP_RELOC)) {
 #ifdef CONFIG_SYS_TEXT_BASE
 #ifdef ARM
-	gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
+		gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
 #elif defined(CONFIG_M68K)
-	/*
-	 * On all ColdFire arch cpu, monitor code starts always
-	 * just after the default vector table location, so at 0x400
-	 */
-	gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
+		/*
+		 * On all ColdFire arch cpu, monitor code starts always
+		 * just after the default vector table location, so at 0x400
+		 */
+		gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
 #elif !defined(CONFIG_SANDBOX)
-	gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
+		gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
 #endif
 #endif
+	}
+
 	memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
 
-	debug("Relocation Offset is: %08lx\n", gd->reloc_off);
-	debug("Relocating to %08lx, new gd at %08lx, sp at %08lx\n",
-	      gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd),
-	      gd->start_addr_sp);
+	if (gd->flags & GD_FLG_SKIP_RELOC) {
+		debug("Skipping relocation due to flag\n");
+	} else {
+		debug("Relocation Offset is: %08lx\n", gd->reloc_off);
+		debug("Relocating to %08lx, new gd at %08lx, sp at %08lx\n",
+		      gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd),
+		      gd->start_addr_sp);
+	}
 
 	return 0;
 }
diff --git a/disk/part.c b/disk/part.c
index a6a8f70..fe1ebd4 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -668,6 +668,13 @@
 	part_drv = part_driver_lookup_type(dev_desc);
 	if (!part_drv)
 		return -1;
+
+	if (!part_drv->get_info) {
+		log_debug("## Driver %s does not have the get_info() method\n",
+			  part_drv->name);
+		return -ENOSYS;
+	}
+
 	for (i = 1; i < part_drv->max_entries; i++) {
 		ret = part_drv->get_info(dev_desc, i, info);
 		if (ret != 0) {
diff --git a/lib/asm-offsets.c b/lib/asm-offsets.c
index c691066..0808cd4 100644
--- a/lib/asm-offsets.c
+++ b/lib/asm-offsets.c
@@ -29,6 +29,9 @@
 	DEFINE(GD_SIZE, sizeof(struct global_data));
 
 	DEFINE(GD_BD, offsetof(struct global_data, bd));
+
+	DEFINE(GD_FLAGS, offsetof(struct global_data, flags));
+
 #if CONFIG_VAL(SYS_MALLOC_F_LEN)
 	DEFINE(GD_MALLOC_BASE, offsetof(struct global_data, malloc_base));
 #endif
diff --git a/lib/lmb.c b/lib/lmb.c
index 676b3a0..f72996a 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -13,6 +13,7 @@
 #include <malloc.h>
 
 #include <asm/global_data.h>
+#include <asm/sections.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -144,6 +145,10 @@
 			bank_end = end - 1;
 
 		lmb_reserve(lmb, sp, bank_end - sp + 1);
+
+		if (gd->flags & GD_FLG_SKIP_RELOC)
+			lmb_reserve(lmb, (phys_addr_t)(uintptr_t)_start, gd->mon_len);
+
 		break;
 	}
 }