vbe: Show the margin when using SPL_RELOC
Collect information about the memory-margin in each phase which uses this feature. Update the 'vbe state' command to show it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -92,9 +92,13 @@ static int do_vbe_state(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
|
||||
printf("Phases:");
|
||||
for (i = PHASE_NONE; i < PHASE_COUNT; i++) {
|
||||
if (handoff->phases & (1 << i))
|
||||
printf(" %s", xpl_name(i));
|
||||
if (handoff->phases & (1 << i)) {
|
||||
int margin = handoff->reloc_margin[i];
|
||||
|
||||
printf(" %s", xpl_name(i));
|
||||
if (margin)
|
||||
printf(" (margin %x) ", margin);
|
||||
}
|
||||
}
|
||||
if (!handoff->phases)
|
||||
printf(" (none)");
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*/
|
||||
|
||||
#include <bloblist.h>
|
||||
#include <gzip.h>
|
||||
#include <image.h>
|
||||
#include <log.h>
|
||||
#include <mapmem.h>
|
||||
#include <spl.h>
|
||||
#include <vbe.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/sections.h>
|
||||
@@ -58,6 +60,16 @@ static int setup_layout(struct spl_image_info *image, ulong *addrp)
|
||||
buf_size = rcode_base - base;
|
||||
uint need_size = image->size + image->fdt_size;
|
||||
margin = buf_size - need_size;
|
||||
|
||||
if (CONFIG_IS_ENABLED(BLOBLIST)) {
|
||||
struct vbe_handoff *handoff;
|
||||
|
||||
handoff = bloblist_find(BLOBLISTT_VBE,
|
||||
sizeof(struct vbe_handoff));
|
||||
if (handoff)
|
||||
handoff->reloc_margin[xpl_phase()] = margin;
|
||||
}
|
||||
|
||||
log_debug("spl_reloc %s->%s: margin%s%lx limit %lx fdt_size %lx base %lx avail %x image %x fdt %lx need %x\n",
|
||||
xpl_name(xpl_phase()), xpl_name(xpl_phase() + 1),
|
||||
margin >= 0 ? " " : " -", abs(margin), limit, fdt_size, base,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define __VBE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <spl.h>
|
||||
|
||||
/**
|
||||
* enum vbe_phase_t - current phase of VBE
|
||||
@@ -47,12 +48,14 @@ enum vbe_pick_t {
|
||||
* @size: Size of the area containing the FIT
|
||||
* @phases: Indicates which phases used the VBE bootmeth (1 << PHASE_...)
|
||||
* @pick: Indicates which firmware pick was used (enum vbe_pick_t)
|
||||
* @reloc_margin: Indicates the number of bytes of margin coming into this phase
|
||||
*/
|
||||
struct vbe_handoff {
|
||||
ulong offset;
|
||||
ulong size;
|
||||
u8 phases;
|
||||
u8 pick;
|
||||
int reloc_margin[PHASE_COUNT];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user