From patchwork Thu Jan 1 23:38:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 424942 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 16922140082 for ; Fri, 2 Jan 2015 10:39:40 +1100 (AEDT) Received: from localhost ([::1]:49888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6pL8-0001CY-As for incoming@patchwork.ozlabs.org; Thu, 01 Jan 2015 18:39:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6pKh-0000WQ-DZ for qemu-devel@nongnu.org; Thu, 01 Jan 2015 18:39:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y6pKZ-0002WZ-9t for qemu-devel@nongnu.org; Thu, 01 Jan 2015 18:39:11 -0500 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:41819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6pKZ-0002WL-1L for qemu-devel@nongnu.org; Thu, 01 Jan 2015 18:39:03 -0500 Received: by mail-lb0-f181.google.com with SMTP id l4so14393465lbv.26 for ; Thu, 01 Jan 2015 15:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=L8B8bGwRCEEoBsbfYPe6sFPHh3nd0HTaavzdjI/gDfY=; b=pCL+kW2axwmygO6f9SEgrksOyh3G8joLURwLRfvkg9ZEpEB+bCSdAUam4Vuqck6vjD r8NH1voAb+c5J8EE15Z/vjEqhQHkkr+SEuHNBhi29w4PYjCuE0VhtibQt0bDkN/0+EW2 mFQekQaSSBEAGH7dgC+3J057Mcb65Y7GIwrsq8tRxHi34tlUpPfAl74T4Ok8d9p+nHER m6ahqSEGcas5rFkAVd1SlcqrVxszjpBnbBjOTpbZqBUNCJljD5CWeLst3lwGJ541ojRI XQlxORGZzG7Wwv3eXaGZ2Dd9hRW6gLYrnvFcTZ2ob0+BJIpNozOTfID6GUPfY3zylZE4 01RQ== X-Received: by 10.112.27.133 with SMTP id t5mr73632399lbg.45.1420155542235; Thu, 01 Jan 2015 15:39:02 -0800 (PST) Received: from octofox.metropolis ([5.19.183.212]) by mx.google.com with ESMTPSA id zo3sm12312030lbb.10.2015.01.01.15.39.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 15:39:01 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Fri, 2 Jan 2015 02:38:28 +0300 Message-Id: <1420155509-30451-2-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1420155509-30451-1-git-send-email-jcmvbkbc@gmail.com> References: <1420155509-30451-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::235 Cc: Max Filippov Subject: [Qemu-devel] [PATCH 1/2] hw/xtensa: allow reads/writes in the system I/O region 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 Ignore writes to unassigned areas of system I/O regison and return 0 for reads. This makes drivers for unimportant unimplemented hardware blocks happy. Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index e5a6bba..2c2f997 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -162,6 +162,23 @@ static void lx60_reset(void *opaque) cpu_reset(CPU(cpu)); } +static uint64_t lx60_io_read(void *opaque, hwaddr addr, + unsigned size) +{ + return 0; +} + +static void lx60_io_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ +} + +static const MemoryRegionOps lx60_io_ops = { + .read = lx60_io_read, + .write = lx60_io_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + static void lx_init(const LxBoardDesc *board, MachineState *machine) { #ifdef TARGET_WORDS_BIGENDIAN @@ -211,7 +228,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine) memory_region_add_subregion(system_memory, 0, ram); system_io = g_malloc(sizeof(*system_io)); - memory_region_init(system_io, NULL, "lx60.io", 224 * 1024 * 1024); + memory_region_init_io(system_io, NULL, &lx60_io_ops, NULL, "lx60.io", + 224 * 1024 * 1024); memory_region_add_subregion(system_memory, 0xf0000000, system_io); lx60_fpga_init(system_io, 0x0d020000); if (nd_table[0].used) {