From patchwork Wed Aug 12 14:20:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 506658 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 33D0B14018C for ; Thu, 13 Aug 2015 00:21:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=roeck-us.net header.i=@roeck-us.net header.b=5Ezsj/OP; dkim-atps=neutral Received: from localhost ([::1]:38888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPWu2-0007ur-4S for incoming@patchwork.ozlabs.org; Wed, 12 Aug 2015 10:21:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPWti-0007Wy-4r for qemu-devel@nongnu.org; Wed, 12 Aug 2015 10:20:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPWtc-0001TZ-4h for qemu-devel@nongnu.org; Wed, 12 Aug 2015 10:20:53 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:43821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPWtb-0001T5-P4; Wed, 12 Aug 2015 10:20:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=3q/2HU3NZy3D0AhTkth14PJdn9f1vkT6TDN64twF1w0=; b=5Ezsj/OPLaBxsPrcWz3sHVXVgQbtdQge74ZKlbst0Z4mRZr0mQizVX4tXruzz+u5FRTripBP+Du85VzwzMcZnyB0c+Z2oIaId78pfTOyeruINZkgt+T6mIOwPrVGXM/Pa7J4zX6TJWWEWnE0SWiF0m0gaRQghKY1tfA0tpVvHeg=; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:58223 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.85) (envelope-from ) id 1ZPWtX-003Hm3-E0; Wed, 12 Aug 2015 14:20:43 +0000 From: Guenter Roeck To: qemu-devel@nongnu.org Date: Wed, 12 Aug 2015 07:20:36 -0700 Message-Id: <1439389236-22158-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.1.4 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - nongnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.91.199.152 Cc: qemu-trivial@nongnu.org, Guenter Roeck , Aurelien Jarno Subject: [Qemu-devel] [PATCH] 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 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 Reviewed-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) {