From patchwork Mon Sep 19 19:54:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SmFrdWIgSmVybcOhxZk=?= X-Patchwork-Id: 9340431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD822607D0 for ; Mon, 19 Sep 2016 20:03:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D53F2984E for ; Mon, 19 Sep 2016 20:03:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FD8729855; Mon, 19 Sep 2016 20:03:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88ED62984E for ; Mon, 19 Sep 2016 20:03:33 +0000 (UTC) Received: from localhost ([::1]:57961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm4mq-00071r-Ae for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Sep 2016 16:03:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm4em-0000Xd-24 for qemu-devel@nongnu.org; Mon, 19 Sep 2016 15:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm4ei-0007KV-UF for qemu-devel@nongnu.org; Mon, 19 Sep 2016 15:55:12 -0400 Received: from tmave.modry.cz ([82.208.58.129]:45238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm4ei-0007Hp-NW; Mon, 19 Sep 2016 15:55:08 -0400 Received: from 93-153-64-87.tmcz.cz ([93.153.64.87] helo=gorgo.localdomain) by tmave.modry.cz with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bm4eT-00077H-As; Mon, 19 Sep 2016 21:55:05 +0200 From: =?UTF-8?q?Jakub=20Jerm=C3=A1=C5=99?= To: qemu-devel@nongnu.org Date: Mon, 19 Sep 2016 21:54:12 +0200 Message-Id: <1474314852-29465-1-git-send-email-jakub@jermar.eu> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 82.208.58.129 Subject: [Qemu-devel] [PATCH] hw/arm: Fix Integrator/CP memsz initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Jakub=20Jerm=C3=A1=C5=99?= , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP * Do not assume memsz is already initialized in integratorcm_init * Calculate memsz directly from MachineState * Get rid of the now unused memsz property Signed-off-by: Jakub Jermar --- hw/arm/integratorcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 96dc150..3d88369 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -247,7 +247,9 @@ static void integratorcm_init(Object *obj) { IntegratorCMState *s = INTEGRATOR_CM(obj); SysBusDevice *dev = SYS_BUS_DEVICE(obj); + MachineState *machine = MACHINE(qdev_get_machine()); + s->memsz = machine->ram_size >> 20; s->cm_osc = 0x01000048; /* ??? What should the high bits of this value be? */ s->cm_auxosc = 0x0007feff; @@ -574,7 +576,6 @@ static void integratorcp_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0x80000000, ram_alias); dev = qdev_create(NULL, TYPE_INTEGRATOR_CM); - qdev_prop_set_uint32(dev, "memsz", ram_size >> 20); qdev_init_nofail(dev); sysbus_mmio_map((SysBusDevice *)dev, 0, 0x10000000); @@ -624,7 +625,6 @@ static void integratorcp_machine_init(MachineClass *mc) DEFINE_MACHINE("integratorcp", integratorcp_machine_init) static Property core_properties[] = { - DEFINE_PROP_UINT32("memsz", IntegratorCMState, memsz, 0), DEFINE_PROP_END_OF_LIST(), };