From patchwork Tue Apr 15 02:22:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 339135 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A876E14007B for ; Tue, 15 Apr 2014 12:23:21 +1000 (EST) Received: from localhost ([::1]:46470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZt1r-0006gs-GF for incoming@patchwork.ozlabs.org; Mon, 14 Apr 2014 22:23:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZt1Q-0006Xo-12 for qemu-devel@nongnu.org; Mon, 14 Apr 2014 22:22:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZt1I-0003Ux-3M for qemu-devel@nongnu.org; Mon, 14 Apr 2014 22:22:51 -0400 Received: from mail-qc0-f178.google.com ([209.85.216.178]:54231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZt1H-0003Ut-WE for qemu-devel@nongnu.org; Mon, 14 Apr 2014 22:22:44 -0400 Received: by mail-qc0-f178.google.com with SMTP id i8so9592163qcq.23 for ; Mon, 14 Apr 2014 19:22:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=omgH5tBd9qMPNt3vGgLJC75b4ZUSyBiHHbt7Zmf6tTI=; b=B3NeVPmP4XEsq615NXbWRNiJVHZJ9Z7qoNZ2ZUwcg96mJtI5TloCeS07FVaTdDs8Vf TCyd572vQEuRJDhINE4bx6Aso9OJbbC8yNIVI/ONRm5ziFoIkvlBJwvRt3GBCBFxTkvP aYjvEzakhS8/SMVc0p4HTt70uLsV++7dDcbBTS8G6RjTyQ8WYx+ML90V/F7nvGo0imbW zd4g/vIFoKMtuWkygSlGcRh4eSDa1FrBLv7vAE8vWfiLtgXHEm3CcVPYmIzXl2TPHuoQ pPjN7j4uTleOhSjEHlyjRaztEvyjsbTLladUudx6fa6AsmbGkbmcgkhPtUzz3xn5DbBb fmfQ== X-Gm-Message-State: ALoCoQn+kNoUqfHxfpDIZGOk9m3aJiGpm1jrQWfN8SEGUZ4d6q7A6LCNPO8DUFydHDL4E8D4Gwf1 X-Received: by 10.140.96.51 with SMTP id j48mr394773qge.24.1397528563672; Mon, 14 Apr 2014 19:22:43 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id u15sm22863165qge.2.2014.04.14.19.22.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 19:22:43 -0700 (PDT) From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Mon, 14 Apr 2014 19:22:11 -0700 Message-Id: X-Mailer: git-send-email 1.9.2.1.g06c4abd In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.216.178 Cc: peter.maydell@linaro.org, agraf@suse.de, armbru@redhat.com, edgar.iglesias@gmail.com, alistair.francis@xilinx.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v1 3/3] arm: xilinx_zynq: Use Sysbus Memory device for RAMs 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 For consistency with other devices and completeness of system device tree. Signed-off-by: Peter Crosthwaite --- hw/arm/xilinx_zynq.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 9ee21e7..7a0c951 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -110,9 +110,6 @@ static void zynq_init(QEMUMachineInitArgs *args) const char *initrd_filename = args->initrd_filename; ObjectClass *cpu_oc; ARMCPU *cpu; - MemoryRegion *address_space_mem = get_system_memory(); - MemoryRegion *ext_ram = g_new(MemoryRegion, 1); - MemoryRegion *ocm_ram = g_new(MemoryRegion, 1); DeviceState *dev; SysBusDevice *busdev; qemu_irq pic[64]; @@ -149,14 +146,18 @@ static void zynq_init(QEMUMachineInitArgs *args) } /* DDR remapped to address zero. */ - memory_region_init_ram(ext_ram, NULL, "zynq.ext_ram", ram_size); - vmstate_register_ram_global(ext_ram); - memory_region_add_subregion(address_space_mem, 0, ext_ram); + dev = qdev_create(NULL, "sysbus-memory"); + qdev_prop_set_string(dev, "device-id", "zynq.ext_ram"); + qdev_prop_set_uint64(dev, "size", ram_size); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0); /* 256K of on-chip memory */ - memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10); - vmstate_register_ram_global(ocm_ram); - memory_region_add_subregion(address_space_mem, 0xFFFC0000, ocm_ram); + dev = qdev_create(NULL, "sysbus-memory"); + qdev_prop_set_string(dev, "device-id", "zynq.ocm_ram"); + qdev_prop_set_uint64(dev, "size", 256 << 10); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0xFFFC0000); DriveInfo *dinfo = drive_get(IF_PFLASH, 0, 0);