From nobody Wed Nov 5 14:32:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153482694234615.991903041202818; Mon, 20 Aug 2018 21:49:02 -0700 (PDT) Received: from localhost ([::1]:50723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fryb5-0001wf-Tr for importer@patchew.org; Tue, 21 Aug 2018 00:48:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fryMt-0004C6-TC for qemu-devel@nongnu.org; Tue, 21 Aug 2018 00:34:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fryMq-0000Ob-Eo for qemu-devel@nongnu.org; Tue, 21 Aug 2018 00:34:11 -0400 Received: from ozlabs.org ([203.11.71.1]:60469) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fryMo-0000JD-U6; Tue, 21 Aug 2018 00:34:07 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 41vd9G0HVJz9sBs; Tue, 21 Aug 2018 14:33:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1534826034; bh=7YSlCNmZ3tCmbPhFV2/phIjP52fdmbGBYq43xtbxyTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fqv197POsJWnSdwEWd8L5S1WXcucxqROAptAKDOhS3oxjmJ5x7At7pwcj69zOTAqf 03nq7oQv1prQJSgF3ito2tbOuRGSfFVdqiW6TurpupAcE/2kLkEie7uWvviMc71rwj xQnR1NdsAR00LBiUMcSrEsYrc+5gogtQX1XVhLQs= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 21 Aug 2018 14:33:40 +1000 Message-Id: <20180821043343.7514-24-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180821043343.7514-1-david@gibson.dropbear.id.au> References: <20180821043343.7514-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 23/26] mac_oldworld: don't use legacy fw_cfg_init_mem() function 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: lvivier@redhat.com, aik@ozlabs.ru, Mark Cave-Ayland , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Instead initialise the device via qdev to allow us to set device properties directly as required. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/ppc/mac_oldworld.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 064d7eb30a..80b5525775 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -309,7 +309,17 @@ static void ppc_heathrow_init(MachineState *machine) =20 /* No PCI init: the BIOS will do it */ =20 - fw_cfg =3D fw_cfg_init_mem(CFG_ADDR, CFG_ADDR + 2); + dev =3D qdev_create(NULL, TYPE_FW_CFG_MEM); + fw_cfg =3D FW_CFG(dev); + qdev_prop_set_uint32(dev, "data_width", 1); + qdev_prop_set_bit(dev, "dma_enabled", false); + object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG, + OBJECT(fw_cfg), NULL); + qdev_init_nofail(dev); + s =3D SYS_BUS_DEVICE(dev); + sysbus_mmio_map(s, 0, CFG_ADDR); + sysbus_mmio_map(s, 1, CFG_ADDR + 2); + fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); --=20 2.17.1