All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB
@ 2020-12-17 21:48 ` Atish Patra
  0 siblings, 0 replies; 42+ messages in thread
From: Atish Patra @ 2020-12-17 21:48 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv
  Cc: Sagar Karandikar, Bastian Koppelmann, Anup Patel, Atish Patra,
	Alistair Francis, Palmer Dabbelt, Bin Meng

Currently, we place the DTB at 2MB from 4GB or end of DRAM which ever is
lesser. However, Linux kernel can address only 1GB of memory for RV32.
Thus, it can not map anything beyond 3GB (assuming 2GB is the starting address).
As a result, it can not process DT and panic if opensbi dynamic firmware
is used.

Fix this by placing the DTB at 2MB from 3GB or end of DRAM whichever is lower.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
---
 hw/riscv/boot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index d62f3dc7581e..9e77b22e4d56 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -203,9 +203,9 @@ uint32_t riscv_load_fdt(hwaddr dram_base, uint64_t mem_size, void *fdt)
      * We should put fdt as far as possible to avoid kernel/initrd overwriting
      * its content. But it should be addressable by 32 bit system as well.
      * Thus, put it at an aligned address that less than fdt size from end of
-     * dram or 4GB whichever is lesser.
+     * dram or 3GB whichever is lesser.
      */
-    temp = MIN(dram_end, 4096 * MiB);
+    temp = MIN(dram_end, 3072 * MiB);
     fdt_addr = QEMU_ALIGN_DOWN(temp - fdtsize, 2 * MiB);
 
     fdt_pack(fdt);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2021-01-06  2:14 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 21:48 [PATCH] RISC-V: Place DTB at 3GB boundary instead of 4GB Atish Patra
2020-12-17 21:48 ` Atish Patra
2020-12-17 22:31 ` Palmer Dabbelt
2020-12-17 22:31   ` Palmer Dabbelt
2020-12-17 22:35   ` Atish Patra
2020-12-17 22:35     ` Atish Patra
2020-12-17 22:39     ` Palmer Dabbelt
2020-12-17 22:39       ` Palmer Dabbelt
2020-12-18  7:21 ` Bin Meng
2020-12-18  7:21   ` Bin Meng
2020-12-18  7:27   ` Atish Patra
2020-12-18  7:27     ` Atish Patra
2020-12-18  7:33     ` Bin Meng
2020-12-18  7:33       ` Bin Meng
2020-12-18  8:00       ` Atish Patra
2020-12-18  8:00         ` Atish Patra
2020-12-18  8:42         ` Bin Meng
2020-12-18  8:42           ` Bin Meng
2020-12-18 19:46           ` Atish Patra
2020-12-18 19:46             ` Atish Patra
2020-12-22  5:35             ` Bin Meng
2020-12-22  5:35               ` Bin Meng
2020-12-22 19:59               ` Atish Patra
2020-12-22 19:59                 ` Atish Patra
2020-12-23  1:20                 ` Bin Meng
2020-12-23  1:20                   ` Bin Meng
2020-12-29  4:49                   ` Bin Meng
2020-12-29  4:49                     ` Bin Meng
2021-01-04 20:24                     ` Atish Patra
2021-01-04 20:24                       ` Atish Patra
2021-01-05  3:06                       ` Bin Meng
2021-01-05  3:06                         ` Bin Meng
2021-01-05  3:11 ` Bin Meng
2021-01-05  3:11   ` Bin Meng
2021-01-05 21:02   ` Alistair Francis
2021-01-05 21:02     ` Alistair Francis
2021-01-05 23:44   ` Atish Patra
2021-01-05 23:44     ` Atish Patra
2021-01-06  0:04     ` Bin Meng
2021-01-06  0:04       ` Bin Meng
2021-01-06  2:14       ` Atish Patra
2021-01-06  2:14         ` Atish Patra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.