From nobody Wed Apr 16 16:45:03 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; 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; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534762574388654.208634993399; Mon, 20 Aug 2018 03:56:14 -0700 (PDT) Received: from localhost ([::1]:46156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frhr3-0000Pi-Az for importer@patchew.org; Mon, 20 Aug 2018 06:56:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frhUP-00043U-Kg for qemu-devel@nongnu.org; Mon, 20 Aug 2018 06:32:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frhUO-0005g1-TU for qemu-devel@nongnu.org; Mon, 20 Aug 2018 06:32:49 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:44580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1frhUO-0005fg-M6 for qemu-devel@nongnu.org; Mon, 20 Aug 2018 06:32:48 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1frhUN-0003F4-Ps for qemu-devel@nongnu.org; Mon, 20 Aug 2018 11:32:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 11:32:10 +0100 Message-Id: <20180820103212.2810-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180820103212.2810-1-peter.maydell@linaro.org> References: <20180820103212.2810-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 23/25] hw/dma/pl080: Provide device reset 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 The PL080/PL081 model is missing a reset function; implement it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/pl080.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c index 8f9f3e08d9a..a7aacad74f0 100644 --- a/hw/dma/pl080.c +++ b/hw/dma/pl080.c @@ -348,6 +348,30 @@ static const MemoryRegionOps pl080_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 +static void pl080_reset(DeviceState *dev) +{ + PL080State *s =3D PL080(dev); + int i; + + s->tc_int =3D 0; + s->tc_mask =3D 0; + s->err_int =3D 0; + s->err_mask =3D 0; + s->conf =3D 0; + s->sync =3D 0; + s->req_single =3D 0; + s->req_burst =3D 0; + s->running =3D 0; + + for (i =3D 0; i < s->nchannels; i++) { + s->chan[i].src =3D 0; + s->chan[i].dest =3D 0; + s->chan[i].lli =3D 0; + s->chan[i].ctrl =3D 0; + s->chan[i].conf =3D 0; + } +} + static void pl080_init(Object *obj) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); @@ -393,6 +417,7 @@ static void pl080_class_init(ObjectClass *oc, void *dat= a) dc->vmsd =3D &vmstate_pl080; dc->realize =3D pl080_realize; dc->props =3D pl080_properties; + dc->reset =3D pl080_reset; } =20 static const TypeInfo pl080_info =3D { --=20 2.18.0