From patchwork Tue Feb 2 08:49:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Yu-B13201 X-Patchwork-Id: 44247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6045AB7D66 for ; Tue, 2 Feb 2010 20:06:09 +1100 (EST) Received: from localhost ([127.0.0.1]:52770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcEhs-0002Pq-Eb for incoming@patchwork.ozlabs.org; Tue, 02 Feb 2010 04:06:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcEbI-00074x-N2 for qemu-devel@nongnu.org; Tue, 02 Feb 2010 03:59:12 -0500 Received: from [199.232.76.173] (port=34767 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcEbH-00074G-MH for qemu-devel@nongnu.org; Tue, 02 Feb 2010 03:59:11 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcEbF-000125-Fw for qemu-devel@nongnu.org; Tue, 02 Feb 2010 03:59:11 -0500 Received: from az33egw02.freescale.net ([192.88.158.103]:61811) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NcEbD-000113-Jp for qemu-devel@nongnu.org; Tue, 02 Feb 2010 03:59:07 -0500 Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id o128won8009238 for ; Tue, 2 Feb 2010 01:59:00 -0700 (MST) Received: from zch01exm26.fsl.freescale.net (zch01exm26.ap.freescale.net [10.192.129.221]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id o1295PiE010317 for ; Tue, 2 Feb 2010 03:05:27 -0600 (CST) Received: from localhost ([10.193.20.106]) by zch01exm26.fsl.freescale.net with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 16:58:47 +0800 From: Liu Yu To: hollis@penguinppc.org Date: Tue, 2 Feb 2010 16:49:03 +0800 Message-Id: <1265100543-15528-2-git-send-email-yu.liu@freescale.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1265100543-15528-1-git-send-email-yu.liu@freescale.com> References: <1265100543-15528-1-git-send-email-yu.liu@freescale.com> X-OriginalArrivalTime: 02 Feb 2010 08:58:47.0057 (UTC) FILETIME=[EE137010:01CAA3E5] X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) Cc: Liu Yu , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/2] powerpc/e500: adjust fdt and ramdisk loading addr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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");