From patchwork Fri Jan 7 14:43:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: y@volta.aurel32.net X-Patchwork-Id: 77877 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 AD19EB708B for ; Sat, 8 Jan 2011 01:44:39 +1100 (EST) Received: from localhost ([127.0.0.1]:40186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbDYS-0004nG-Hi for incoming@patchwork.ozlabs.org; Fri, 07 Jan 2011 09:44:36 -0500 Received: from [140.186.70.92] (port=33281 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbDXg-0004jC-8m for qemu-devel@nongnu.org; Fri, 07 Jan 2011 09:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbDXf-0006ix-B4 for qemu-devel@nongnu.org; Fri, 07 Jan 2011 09:43:48 -0500 Received: from hall.aurel32.net ([88.191.126.93]:49571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbDXf-0006ik-6M for qemu-devel@nongnu.org; Fri, 07 Jan 2011 09:43:47 -0500 Received: from [2001:470:d4ed:0:5e26:aff:fe2b:6f5b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PbDXe-00050T-EQ; Fri, 07 Jan 2011 15:43:46 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.72) (envelope-from ) id 1PbDXR-0003uM-6t; Fri, 07 Jan 2011 15:43:33 +0100 From: y@volta.aurel32.net To: qemu-devel@nongnu.org Date: Fri, 7 Jan 2011 15:43:29 +0100 Message-Id: <1294411409-14991-1-git-send-email-y> X-Mailer: git-send-email 1.7.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH] lsi53c895a: fix endianness issues 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 From: Aurelien Jarno lsi_ram_read*() and lsi_ram_write*() are not consistent, one uses leXX_to_cpu() the other uses nothing. As the comment above the RAM declaration says: "Script ram is stored as 32-bit words in host byteorder.", remove the leXX_to_cpu() calls. This fixes the boot of an ARM versatile machine on MIPS and PowerPC hosts. Signed-off-by: Aurelien Jarno --- hw/lsi53c895a.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 0129ae3..9c761cd 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -1930,7 +1930,7 @@ static uint32_t lsi_ram_readw(void *opaque, target_phys_addr_t addr) val = s->script_ram[addr >> 2]; if (addr & 2) val >>= 16; - return le16_to_cpu(val); + return val; } static uint32_t lsi_ram_readl(void *opaque, target_phys_addr_t addr) @@ -1938,7 +1938,7 @@ static uint32_t lsi_ram_readl(void *opaque, target_phys_addr_t addr) LSIState *s = opaque; addr &= 0x1fff; - return le32_to_cpu(s->script_ram[addr >> 2]); + return s->script_ram[addr >> 2]; } static CPUReadMemoryFunc * const lsi_ram_readfn[3] = {