From patchwork Mon Jan 14 19:26:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 211869 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4042E2C009B for ; Tue, 15 Jan 2013 06:27:50 +1100 (EST) Received: from localhost ([::1]:33486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuphE-0006So-Ai for incoming@patchwork.ozlabs.org; Mon, 14 Jan 2013 14:27:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tuph4-0006S4-Ui for qemu-devel@nongnu.org; Mon, 14 Jan 2013 14:27:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tuph1-00085y-5Q for qemu-devel@nongnu.org; Mon, 14 Jan 2013 14:27:38 -0500 Received: from cantor2.suse.de ([195.135.220.15]:42399 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tuph0-00080G-WF; Mon, 14 Jan 2013 14:27:35 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 743ACA3E1C; Mon, 14 Jan 2013 20:26:50 +0100 (CET) From: Alexander Graf To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2013 20:26:47 +0100 Message-Id: <1358191607-6837-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: qemu-ppc@nongnu.org, stuart.yoder@freescale.com Subject: [Qemu-devel] [PATCH] PPC: E500: Put dtb after initrd X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We have 3 blobs we need to load when booting the system: - kernel - initrd - dtb We place them in physical memory in that order. At least we should. This patch fixes the dtb location up to take the initrd location into account, fixing its offset. Reported-by: Stuart Yoder Signed-off-by: Alexander Graf --- hw/ppc/e500.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 3a9e1c7..516d219 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -460,7 +460,7 @@ void ppce500_init(PPCE500Params *params) target_long kernel_size=0; target_ulong dt_base = 0; target_ulong initrd_base = 0; - target_long initrd_size=0; + target_long initrd_size = 0; int i = 0, j, k; unsigned int pci_irq_nrs[4] = {1, 2, 3, 4}; qemu_irq **irqs, *mpic; @@ -642,7 +642,8 @@ void ppce500_init(PPCE500Params *params) struct boot_info *boot_info; int dt_size; - dt_base = (loadaddr + kernel_size + DTC_LOAD_PAD) & ~DTC_PAD_MASK; + dt_base = (loadaddr + kernel_size + initrd_size + DTC_LOAD_PAD) & + ~DTC_PAD_MASK; dt_size = ppce500_load_device_tree(env, params, dt_base, initrd_base, initrd_size); if (dt_size < 0) {