From patchwork Sun Sep 13 21:18:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 517235 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1F32D14076C for ; Mon, 14 Sep 2015 07:21:53 +1000 (AEST) Received: from localhost ([::1]:37227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbEic-0005kJ-UC for incoming@patchwork.ozlabs.org; Sun, 13 Sep 2015 17:21:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbEfi-000090-IN for qemu-devel@nongnu.org; Sun, 13 Sep 2015 17:18:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbEfh-0003rc-Gz for qemu-devel@nongnu.org; Sun, 13 Sep 2015 17:18:50 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:33209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbEfh-0003r4-BV for qemu-devel@nongnu.org; Sun, 13 Sep 2015 17:18:49 -0400 Received: from weber.rr44.fr ([2001:bc8:30d7:120:7e05:7ff:fe0d:f152]) by hall.aurel32.net with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1ZbEff-0001Xz-RD; Sun, 13 Sep 2015 23:18:48 +0200 Received: from aurel32 by weber.rr44.fr with local (Exim 4.85) (envelope-from ) id 1ZbEff-0007is-0l; Sun, 13 Sep 2015 23:18:47 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sun, 13 Sep 2015 23:18:45 +0200 Message-Id: <1442179125-29608-7-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442179125-29608-1-git-send-email-aurelien@aurel32.net> References: <1442179125-29608-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:bc8:30d7:100::1 Cc: Aurelien Jarno , Guenter Roeck Subject: [Qemu-devel] [PULL 6/6] sh4: Fix initramfs initialization for endiannes-mismatched targets 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 From: Guenter Roeck If host and target endianness does not match, loding an initramfs does not work. Fix by writing boot parameters with appropriate endianness conversion. Signed-off-by: Guenter Roeck Signed-off-by: Aurelien Jarno --- hw/sh4/r2d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 5e22ed7..3b0b2ec 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -338,9 +338,9 @@ static void r2d_init(MachineState *machine) } /* initialization which should be done by firmware */ - boot_params.loader_type = 1; - boot_params.initrd_start = INITRD_LOAD_OFFSET; - boot_params.initrd_size = initrd_size; + boot_params.loader_type = tswap32(1); + boot_params.initrd_start = tswap32(INITRD_LOAD_OFFSET); + boot_params.initrd_size = tswap32(initrd_size); } if (kernel_cmdline) {