mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
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
This commit is contained in:
commit
8391a0f3d9
6 changed files with 39 additions and 16 deletions
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue