From patchwork Tue Aug 11 14:15:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 52313 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 5E0C722FEE for ; Tue, 11 Aug 2015 14:15:30 +0000 (UTC) Received: by labia3 with SMTP id ia3sf51156909lab.1 for ; Tue, 11 Aug 2015 07:15:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=FaFxfGC9AtRSzUqA6BgSsrBcIKJ0NpMGbB8O3R4ZJ+w=; b=jsNLU0LfJdyFRdjzVp8PjoEYcjO2xnvtazf2mW9dWNpxWlATB7+yYnyCINvXmxNB+W 0gbgguNs6BaOtkhkXLGlg3OFP69Wac76TWFSdBaWSLgN4XxzOZXh17OAnXbEh1QTp/Pc GBtIlrjolINVLw+Na1RPMj8EWrVBIBwml0cTBrASs84r2wbHDC/zT42t9X472kemQ1QB RXkptHmaNb5/Da/3ZpAds/HpUbeKsXP3SB8XA0HD1+zaZLWiS5Vc5ofKLTmuu9EHtwTQ ysEswLZ8yVtYmR7XgyEZGtV2haWXIL239T6k66NAjA3V/C8BHytVBa/WQ2sCOtRheeXH ZjmQ== X-Gm-Message-State: ALoCoQmmSP3vSqr76gorNE3jQJMUN0pkr5PQtXVYy7Mw4UHSBuMCSPlAy7Kmeu+bdt+QXPqtlk8y X-Received: by 10.152.182.226 with SMTP id eh2mr8061357lac.0.1439302529273; Tue, 11 Aug 2015 07:15:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.198 with SMTP id 6ls314969law.79.gmail; Tue, 11 Aug 2015 07:15:29 -0700 (PDT) X-Received: by 10.112.61.132 with SMTP id p4mr26489095lbr.48.1439302527701; Tue, 11 Aug 2015 07:15:27 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id l3si1448040lbq.158.2015.08.11.07.15.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 07:15:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbsx3 with SMTP id sx3so30465637lbb.0 for ; Tue, 11 Aug 2015 07:15:27 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr26244531lbc.41.1439302527594; Tue, 11 Aug 2015 07:15:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2557906lba; Tue, 11 Aug 2015 07:15:26 -0700 (PDT) X-Received: by 10.180.80.138 with SMTP id r10mr35245145wix.18.1439302526701; Tue, 11 Aug 2015 07:15:26 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id u9si3910622wiy.90.2015.08.11.07.15.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 11 Aug 2015 07:15:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZPAKq-0004zO-Sw; Tue, 11 Aug 2015 15:15:24 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Markus Armbruster Subject: [PATCH 3/3] hw/sd/pxa2xx_mmci: Add reset function Date: Tue, 11 Aug 2015 15:15:24 +0100 Message-Id: <1439302524-19142-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1439302524-19142-1-git-send-email-peter.maydell@linaro.org> References: <1439302524-19142-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a reset function to the pxa2xx_mmci device; previously it had no handling for system reset at all. Signed-off-by: Peter Maydell --- hw/sd/pxa2xx_mmci.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index ea42434..0dec8c8 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -468,6 +468,35 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly, sd_set_cb(s->card, readonly, coverswitch); } +static void pxa2xx_mmci_reset(DeviceState *d) +{ + PXA2xxMMCIState *s = PXA2XX_MMCI(d); + + s->status = 0; + s->clkrt = 0; + s->spi = 0; + s->cmdat = 0; + s->resp_tout = 0; + s->read_tout = 0; + s->blklen = 0; + s->numblk = 0; + s->intmask = 0; + s->intreq = 0; + s->cmd = 0; + s->arg = 0; + s->active = 0; + s->bytesleft = 0; + s->tx_start = 0; + s->tx_len = 0; + s->rx_start = 0; + s->rx_len = 0; + s->resp_len = 0; + s->cmdreq = 0; + memset(s->tx_fifo, 0, sizeof(s->tx_fifo)); + memset(s->rx_fifo, 0, sizeof(s->rx_fifo)); + memset(s->resp_fifo, 0, sizeof(s->resp_fifo)); +} + static void pxa2xx_mmci_instance_init(Object *obj) { PXA2xxMMCIState *s = PXA2XX_MMCI(obj); @@ -513,6 +542,7 @@ static void pxa2xx_mmci_class_init(ObjectClass *klass, void *data) dc->realize = pxa2xx_mmci_realize; dc->props = pxa2xx_mmci_properties; dc->vmsd = &vmstate_pxa2xx_mmci; + dc->reset = pxa2xx_mmci_reset; } static const TypeInfo pxa2xx_mmci_info = {