qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yu <yu.liu@freescale.com>
To: hollis@penguinppc.org
Cc: Liu Yu <yu.liu@freescale.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/2] powerpc/e500: adjust fdt and ramdisk loading addr
Date: Tue,  2 Feb 2010 16:49:03 +0800	[thread overview]
Message-ID: <1265100543-15528-2-git-send-email-yu.liu@freescale.com> (raw)
In-Reply-To: <1265100543-15528-1-git-send-email-yu.liu@freescale.com>

Since kernel uimage is getting bigger,
old fixed loading bases will result in regions overlap.

Add pad for fdt and ramdisk, so that they won't overlap with uimage.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
 hw/ppce500_mpc8544ds.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index 9a5654b..3826156 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -34,8 +34,10 @@
 
 #define BINARY_DEVICE_TREE_FILE    "mpc8544ds.dtb"
 #define UIMAGE_LOAD_BASE           0
-#define DTB_LOAD_BASE              0x600000
-#define INITRD_LOAD_BASE           0x2000000
+#define DTC_LOAD_PAD               0x500000
+#define DTC_PAD_MASK               0xFFFFF
+#define INITRD_LOAD_PAD            0x2000000
+#define INITRD_PAD_MASK            0xFFFFFF
 
 #define RAM_SIZES_ALIGN            (64UL << 20)
 
@@ -170,8 +172,8 @@ static void mpc8544ds_init(ram_addr_t ram_size,
     target_phys_addr_t entry=0;
     target_phys_addr_t loadaddr=UIMAGE_LOAD_BASE;
     target_long kernel_size=0;
-    target_ulong dt_base=DTB_LOAD_BASE;
-    target_ulong initrd_base=INITRD_LOAD_BASE;
+    target_ulong dt_base = 0;
+    target_ulong initrd_base = 0;
     target_long initrd_size=0;
     int i=0;
     unsigned int pci_irq_nrs[4] = {1, 2, 3, 4};
@@ -246,6 +248,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,
 
     /* Load initrd. */
     if (initrd_filename) {
+        initrd_base = (kernel_size + INITRD_LOAD_PAD) & ~INITRD_PAD_MASK;
         initrd_size = load_image_targphys(initrd_filename, initrd_base,
                                           ram_size - initrd_base);
 
@@ -258,6 +261,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,
 
     /* If we're loading a kernel directly, we must load the device tree too. */
     if (kernel_filename) {
+        dt_base = (kernel_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK;
         if (mpc8544_load_device_tree(dt_base, ram_size,
                     initrd_base, initrd_size, kernel_cmdline) < 0) {
             fprintf(stderr, "couldn't load device tree\n");
-- 
1.6.4

  reply	other threads:[~2010-02-02  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02  8:49 [Qemu-devel] [PATCH 1/2] powerpc/booke: move fdt loading to rom infrastructure Liu Yu
2010-02-02  8:49 ` Liu Yu [this message]
2010-02-27 15:33 ` Aurelien Jarno
2010-02-27 18:49   ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265100543-15528-2-git-send-email-yu.liu@freescale.com \
    --to=yu.liu@freescale.com \
    --cc=hollis@penguinppc.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).