aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-11-18 18:25:19 -0500
committerTom Rini <trini@konsulko.com>2021-11-18 18:25:19 -0500
commit8391a0f3d97c0300d7eafe7581b6712afb18f283 (patch)
tree750049c4c588dc1da71a290a4cdd5b0d44209a5f
parent3144ba23bf4649f699078259fdf2e5cb4eab8f53 (diff)
parentb1f3f982fa1cdcf08717a37e00adcb6fc3d89bf4 (diff)
downloadu-boot-8391a0f3d97c0300d7eafe7581b6712afb18f283.zip
u-boot-8391a0f3d97c0300d7eafe7581b6712afb18f283.tar.gz
u-boot-8391a0f3d97c0300d7eafe7581b6712afb18f283.tar.bz2
Merge branch '2021-11-18-regression-fixes'
- An assortment of fixes related to GD, GD_FLG_SKIP_RELOC, and the lmb - Environment fix on synquacer developmentbox - Fix for get_info is not valid in partition code
-rw-r--r--arch/arm/lib/crt0_64.S4
-rw-r--r--board/socionext/developerbox/developerbox.c2
-rw-r--r--common/board_f.c34
-rw-r--r--disk/part.c7
-rw-r--r--lib/asm-offsets.c3
-rw-r--r--lib/lmb.c5
6 files changed, 39 insertions, 16 deletions
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 @@ ENTRY(_main)
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 @@ int board_init(void)
{
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 reloc_bloblist(void)
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 @@ int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
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 @@ int main(void)
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 @@ void arch_lmb_reserve_generic(struct lmb *lmb, ulong sp, ulong end, ulong align)
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;
}
}