mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 08:07:59 +00:00
zynqmp: Run board_get_usable_ram_top() only on main U-Boot
With commit ce39ee28ec
("zynqmp: Do not place u-boot to reserved memory
location"), the function board_get_usable_ram_top() is allocating
MMU_SECTION_SIZE of about 2MB using lmb_alloc(). But we dont have this
much memory in case of mini U-Boot.
Keep these functions which use lmb under CONFIG_LMB so that they are
compiled and used only when LMB is enabled.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/75e52def75f573e554a6b177a78504c128cb0c4a.1657183534.git.michal.simek@amd.com
This commit is contained in:
parent
7c1860fce4
commit
65168910ad
9 changed files with 27 additions and 15 deletions
|
@ -29,9 +29,11 @@ static int boot_prep_linux(bootm_headers_t *images)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = image_setup_linux(images);
|
if (CONFIG_IS_ENABLED(LMB)) {
|
||||||
if (ret)
|
ret = image_setup_linux(images);
|
||||||
return ret;
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return board_prep_linux(images);
|
return board_prep_linux(images);
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,7 @@ static void boot_prep_linux(bootm_headers_t *images)
|
||||||
{
|
{
|
||||||
char *commandline = env_get("bootargs");
|
char *commandline = env_get("bootargs");
|
||||||
|
|
||||||
if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
|
if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
|
||||||
debug("using: FDT\n");
|
debug("using: FDT\n");
|
||||||
if (image_setup_linux(images)) {
|
if (image_setup_linux(images)) {
|
||||||
panic("FDT creation failed!");
|
panic("FDT creation failed!");
|
||||||
|
|
|
@ -60,9 +60,11 @@ int do_bootm_linux(int flag, int argc, char *const argv[],
|
||||||
}
|
}
|
||||||
set_clocks_in_mhz(kbd);
|
set_clocks_in_mhz(kbd);
|
||||||
|
|
||||||
ret = image_setup_linux(images);
|
if (CONFIG_IS_ENABLED(LMB)) {
|
||||||
if (ret)
|
ret = image_setup_linux(images);
|
||||||
goto error;
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
kernel = (void (*)(struct bd_info *, ulong, ulong, ulong, ulong))images->ep;
|
kernel = (void (*)(struct bd_info *, ulong, ulong, ulong, ulong))images->ep;
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
|
||||||
|
|
||||||
static void boot_prep_linux(bootm_headers_t *images)
|
static void boot_prep_linux(bootm_headers_t *images)
|
||||||
{
|
{
|
||||||
if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
|
if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
|
||||||
debug("using: FDT\n");
|
debug("using: FDT\n");
|
||||||
if (image_setup_linux(images)) {
|
if (image_setup_linux(images)) {
|
||||||
printf("FDT creation failed! hanging...");
|
printf("FDT creation failed! hanging...");
|
||||||
|
|
|
@ -214,9 +214,11 @@ static int boot_body_linux(bootm_headers_t *images)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = image_setup_linux(images);
|
if (CONFIG_IS_ENABLED(LMB)) {
|
||||||
if (ret)
|
ret = image_setup_linux(images);
|
||||||
return ret;
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ static void announce_and_cleanup(int fake)
|
||||||
|
|
||||||
static void boot_prep_linux(bootm_headers_t *images)
|
static void boot_prep_linux(bootm_headers_t *images)
|
||||||
{
|
{
|
||||||
if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
|
if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
|
||||||
debug("using: FDT\n");
|
debug("using: FDT\n");
|
||||||
if (image_setup_linux(images)) {
|
if (image_setup_linux(images)) {
|
||||||
printf("FDT creation failed! hanging...");
|
printf("FDT creation failed! hanging...");
|
||||||
|
|
|
@ -78,15 +78,14 @@ static int boot_prep_linux(bootm_headers_t *images)
|
||||||
size_t len;
|
size_t len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#ifdef CONFIG_OF_LIBFDT
|
if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
|
||||||
if (images->ft_len) {
|
|
||||||
debug("using: FDT\n");
|
debug("using: FDT\n");
|
||||||
if (image_setup_linux(images)) {
|
if (image_setup_linux(images)) {
|
||||||
puts("FDT creation failed! hanging...");
|
puts("FDT creation failed! hanging...");
|
||||||
hang();
|
hang();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (images->legacy_hdr_valid) {
|
if (images->legacy_hdr_valid) {
|
||||||
hdr = images->legacy_hdr_os;
|
hdr = images->legacy_hdr_os;
|
||||||
if (image_check_type(hdr, IH_TYPE_MULTI)) {
|
if (image_check_type(hdr, IH_TYPE_MULTI)) {
|
||||||
|
|
|
@ -253,6 +253,7 @@ int dram_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_LMB)
|
||||||
ulong board_get_usable_ram_top(ulong total_size)
|
ulong board_get_usable_ram_top(ulong total_size)
|
||||||
{
|
{
|
||||||
phys_size_t size;
|
phys_size_t size;
|
||||||
|
@ -277,6 +278,8 @@ ulong board_get_usable_ram_top(ulong total_size)
|
||||||
|
|
||||||
return reg + size;
|
return reg + size;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
int dram_init_banksize(void)
|
int dram_init_banksize(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -537,6 +537,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_LMB)
|
||||||
/**
|
/**
|
||||||
* boot_ramdisk_high - relocate init ramdisk
|
* boot_ramdisk_high - relocate init ramdisk
|
||||||
* @lmb: pointer to lmb handle, will be used for memory mgmt
|
* @lmb: pointer to lmb handle, will be used for memory mgmt
|
||||||
|
@ -630,6 +631,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
|
||||||
error:
|
error:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int boot_get_setup(bootm_headers_t *images, u8 arch,
|
int boot_get_setup(bootm_headers_t *images, u8 arch,
|
||||||
ulong *setup_start, ulong *setup_len)
|
ulong *setup_start, ulong *setup_len)
|
||||||
|
@ -823,6 +825,7 @@ int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_LMB)
|
||||||
#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
|
#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
|
||||||
/**
|
/**
|
||||||
* boot_get_cmdline - allocate and initialize kernel cmdline
|
* boot_get_cmdline - allocate and initialize kernel cmdline
|
||||||
|
@ -932,6 +935,7 @@ int image_setup_linux(bootm_headers_t *images)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void genimg_print_size(uint32_t size)
|
void genimg_print_size(uint32_t size)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue