• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision65168910adaae3a4ac91fd5acf30941a28facc0e (tree)
l'heure2022-07-26 15:23:54
AuteurAshok Reddy Soma <ashok.reddy.soma@xili...>
CommiterMichal Simek

Message de Log

zynqmp: Run board_get_usable_ram_top() only on main U-Boot

With commit ce39ee28ec31 ("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

Change Summary

Modification

--- a/arch/arc/lib/bootm.c
+++ b/arch/arc/lib/bootm.c
@@ -29,9 +29,11 @@ static int boot_prep_linux(bootm_headers_t *images)
2929 {
3030 int ret;
3131
32- ret = image_setup_linux(images);
33- if (ret)
34- return ret;
32+ if (CONFIG_IS_ENABLED(LMB)) {
33+ ret = image_setup_linux(images);
34+ if (ret)
35+ return ret;
36+ }
3537
3638 return board_prep_linux(images);
3739 }
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -199,7 +199,7 @@ static void boot_prep_linux(bootm_headers_t *images)
199199 {
200200 char *commandline = env_get("bootargs");
201201
202- if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
202+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
203203 debug("using: FDT\n");
204204 if (image_setup_linux(images)) {
205205 panic("FDT creation failed!");
--- a/arch/m68k/lib/bootm.c
+++ b/arch/m68k/lib/bootm.c
@@ -60,9 +60,11 @@ int do_bootm_linux(int flag, int argc, char *const argv[],
6060 }
6161 set_clocks_in_mhz(kbd);
6262
63- ret = image_setup_linux(images);
64- if (ret)
65- goto error;
63+ if (CONFIG_IS_ENABLED(LMB)) {
64+ ret = image_setup_linux(images);
65+ if (ret)
66+ goto error;
67+ }
6668
6769 kernel = (void (*)(struct bd_info *, ulong, ulong, ulong, ulong))images->ep;
6870
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -73,7 +73,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
7373
7474 static void boot_prep_linux(bootm_headers_t *images)
7575 {
76- if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
76+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
7777 debug("using: FDT\n");
7878 if (image_setup_linux(images)) {
7979 printf("FDT creation failed! hanging...");
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -214,9 +214,11 @@ static int boot_body_linux(bootm_headers_t *images)
214214 if (ret)
215215 return ret;
216216
217- ret = image_setup_linux(images);
218- if (ret)
219- return ret;
217+ if (CONFIG_IS_ENABLED(LMB)) {
218+ ret = image_setup_linux(images);
219+ if (ret)
220+ return ret;
221+ }
220222
221223 return 0;
222224 }
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -64,7 +64,7 @@ static void announce_and_cleanup(int fake)
6464
6565 static void boot_prep_linux(bootm_headers_t *images)
6666 {
67- if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
67+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
6868 debug("using: FDT\n");
6969 if (image_setup_linux(images)) {
7070 printf("FDT creation failed! hanging...");
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -78,15 +78,14 @@ static int boot_prep_linux(bootm_headers_t *images)
7878 size_t len;
7979 int ret;
8080
81-#ifdef CONFIG_OF_LIBFDT
82- if (images->ft_len) {
81+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
8382 debug("using: FDT\n");
8483 if (image_setup_linux(images)) {
8584 puts("FDT creation failed! hanging...");
8685 hang();
8786 }
8887 }
89-#endif
88+
9089 if (images->legacy_hdr_valid) {
9190 hdr = images->legacy_hdr_os;
9291 if (image_check_type(hdr, IH_TYPE_MULTI)) {
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -253,6 +253,7 @@ int dram_init(void)
253253 return 0;
254254 }
255255
256+#if defined(CONFIG_LMB)
256257 ulong board_get_usable_ram_top(ulong total_size)
257258 {
258259 phys_size_t size;
@@ -277,6 +278,8 @@ ulong board_get_usable_ram_top(ulong total_size)
277278
278279 return reg + size;
279280 }
281+#endif
282+
280283 #else
281284 int dram_init_banksize(void)
282285 {
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -537,6 +537,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
537537 return 0;
538538 }
539539
540+#if defined(CONFIG_LMB)
540541 /**
541542 * boot_ramdisk_high - relocate init ramdisk
542543 * @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,
630631 error:
631632 return -1;
632633 }
634+#endif
633635
634636 int boot_get_setup(bootm_headers_t *images, u8 arch,
635637 ulong *setup_start, ulong *setup_len)
@@ -823,6 +825,7 @@ int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
823825 return 0;
824826 }
825827
828+#if defined(CONFIG_LMB)
826829 #ifdef CONFIG_SYS_BOOT_GET_CMDLINE
827830 /**
828831 * boot_get_cmdline - allocate and initialize kernel cmdline
@@ -932,6 +935,7 @@ int image_setup_linux(bootm_headers_t *images)
932935
933936 return 0;
934937 }
938+#endif
935939
936940 void genimg_print_size(uint32_t size)
937941 {