Merge patch series "Allow showing the memory map"

Simon Glass <sjg@chromium.org> says:

This little series adds a new 'memmap' command, intended to show the
layout of memory within U-Boot and how much memory is available for
loading images.

Link: https://lore.kernel.org/r/20241021081934.289473-1-sjg@chromium.org
This commit is contained in:
Tom Rini
2024-10-25 14:22:36 -06:00
17 changed files with 347 additions and 42 deletions

View File

@@ -543,6 +543,36 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
#define gd_set_upl(val)
#endif
#if CONFIG_IS_ENABLED(BLOBLIST)
#define gd_bloblist() gd->bloblist
#else
#define gd_bloblist() NULL
#endif
#if CONFIG_IS_ENABLED(BOOTSTAGE)
#define gd_bootstage() gd->bootstage
#else
#define gd_bootstage() NULL
#endif
#if CONFIG_IS_ENABLED(TRACE)
#define gd_trace_buff() gd->trace_buff
#define gd_trace_size() CONFIG_TRACE_BUFFER_SIZE
#else
#define gd_trace_buff() NULL
#define gd_trace_size() 0
#endif
#if CONFIG_IS_ENABLED(VIDEO)
#define gd_video_top() gd->video_top
#define gd_video_bottom() gd->video_bottom
#define gd_video_size() (gd->video_top - gd->video_bottom)
#else
#define gd_video_top() 0
#define gd_video_bottom() 0
#define gd_video_size() 0
#endif
/**
* enum gd_flags - global data flags
*

View File

@@ -371,9 +371,10 @@ int bootstage_unstash(const void *base, int size);
/**
* bootstage_get_size() - Get the size of the bootstage data
*
* @add_strings: true to add the size of attached strings (for stashing)
* Return: size of boostage data in bytes
*/
int bootstage_get_size(void);
int bootstage_get_size(bool add_strings);
/**
* bootstage_init() - Prepare bootstage for use
@@ -444,7 +445,7 @@ static inline int bootstage_unstash(const void *base, int size)
return 0; /* Pretend to succeed */
}
static inline int bootstage_get_size(void)
static inline int bootstage_get_size(bool add_strings)
{
return 0;
}

View File

@@ -981,6 +981,14 @@ extern ulong mem_malloc_start;
extern ulong mem_malloc_end;
extern ulong mem_malloc_brk;
/**
* mem_malloc_init() - Set up the malloc() pool
*
* Sets the region of memory to be used for all future calls to malloc(), etc.
*
* @start: Start address
* @size: Size in bytes
*/
void mem_malloc_init(ulong start, ulong size);
#ifdef __cplusplus