From patchwork Thu Aug 9 13:01:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 143854 Delivered-To: patches@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2066011ljj; Thu, 9 Aug 2018 06:01:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzTJlRQAQEKCuOeTHKuLok0HTb/kg+9DvboBOusouQrPb0Y3hqtlAa9/ZWTXC3uJtCVLLpu X-Received: by 2002:a1c:ec86:: with SMTP id h6-v6mr1591881wmi.53.1533819692605; Thu, 09 Aug 2018 06:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533819692; cv=none; d=google.com; s=arc-20160816; b=Axngb1UBSk3Ry6XrV35eCLiLfy46F2jFSWAJVyA1BNPbU84JlHWN669g3n+IrO33/6 CjAJTYwLBfbJ6DaQypHaA7BiK0dtT58oeOBEyiI4SrHcgshwkfHl3VywXp5Gx3O3VZLW 0JD6eZi1zOY4MuG/TxQi+77b5HXDSxchmWzmAkl5LAI23vav4p5N0nEiHGVZum6fYBxC DVrUz4U6ofl9iwL11nneln6LqD7a0XlNDTzcn9l0phSPmf2UoMpqhQZlcMeVxVLrFF0O tJo8Tbi3JfuHcAEl/uITInlF+0qHAdA5/164orYbjs9tKrF89Ig8b4cAhB1cMG4z6s2L y8qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=n8uuyt2ZudM98RA82kXcYbhpvrT9oTgQmSk1xPoMa/0=; b=VsqP7yGOi7ATLKOAdIq9FJMXsC6pEzqJiZ2aFnkVDz1cboMNmb+xV+rFhRxjnmYYgU d8Ucxd3EaD/yMEqW1Dh/GLJ8oybtw/o40s3SRNADeOvxSn+ZIY5QISw3TedoJ8uFzuLQ Y38gAZlZFeB6jCXFXjpjr8OuIOxSzJokyelcMPJJjxq59VwvNLYAw2n95GISo4+LsP3Z MQbQ9iSzHWvxXz3zaZ9xg+uFnMyEXTQQU+ySjyEoJkZFum1a+8ohSIb0tK8vijAgjuAZ kX95WNtxuAYXJg+h7EGhqq57ELWa/Y97NaERB4cm+o4weZCTco4tufGSFSJJyP1iaupv FRvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id l190-v6si6077300wmb.208.2018.08.09.06.01.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 06:01:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fnkZI-0003Ko-1x; Thu, 09 Aug 2018 14:01:32 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 13/16] hw/dma/pl080: Provide device reset function Date: Thu, 9 Aug 2018 14:01:12 +0100 Message-Id: <20180809130115.28951-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809130115.28951-1-peter.maydell@linaro.org> References: <20180809130115.28951-1-peter.maydell@linaro.org> The PL080/PL081 model is missing a reset function; implement it. Signed-off-by: Peter Maydell --- hw/dma/pl080.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé 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 = { .endianness = DEVICE_NATIVE_ENDIAN, }; +static void pl080_reset(DeviceState *dev) +{ + PL080State *s = PL080(dev); + int i; + + s->tc_int = 0; + s->tc_mask = 0; + s->err_int = 0; + s->err_mask = 0; + s->conf = 0; + s->sync = 0; + s->req_single = 0; + s->req_burst = 0; + s->running = 0; + + for (i = 0; i < s->nchannels; i++) { + s->chan[i].src = 0; + s->chan[i].dest = 0; + s->chan[i].lli = 0; + s->chan[i].ctrl = 0; + s->chan[i].conf = 0; + } +} + static void pl080_init(Object *obj) { SysBusDevice *sbd = SYS_BUS_DEVICE(obj); @@ -393,6 +417,7 @@ static void pl080_class_init(ObjectClass *oc, void *data) dc->vmsd = &vmstate_pl080; dc->realize = pl080_realize; dc->props = pl080_properties; + dc->reset = pl080_reset; } static const TypeInfo pl080_info = {