From patchwork Sat Jan 13 05:07:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 860281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Jz0P4p8O"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJSLj3dJKz9t42 for ; Sat, 13 Jan 2018 16:08:27 +1100 (AEDT) Received: from localhost ([::1]:38814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaE3M-0000Nn-Eu for incoming@patchwork.ozlabs.org; Sat, 13 Jan 2018 00:08:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaE2c-0000Lv-Uq for qemu-devel@nongnu.org; Sat, 13 Jan 2018 00:07:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaE2c-0003o7-0m for qemu-devel@nongnu.org; Sat, 13 Jan 2018 00:07:38 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:38852) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eaE2b-0003nX-TL for qemu-devel@nongnu.org; Sat, 13 Jan 2018 00:07:37 -0500 Received: by mail-qt0-x242.google.com with SMTP id d4so8556077qtj.5 for ; Fri, 12 Jan 2018 21:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H55m8SAxQCZteXEHo639T3ncP9waoJie0p/fu8nR8T8=; b=Jz0P4p8O79wgewt1NtxnpNkHEH2F/xoI8vM9nTtrLJgHreB3Venyq9P6Xl3C8DcBs+ lHkqnCVn5aODcSS58gHylgEjLVgNqLhk+I/momkf3kf+HPh8JWuGzbqnZ12E9GbltYRD Vy+C+qb6wNMeiUCoQxJJF+zkQjVOuE9NowBVWQl9KkQ126b9fI+oL+mG6o+nMwym8M9M HvQPsWiqqEelG8QRr6RvPXpDBVTLHDlrMptLyLV0Wsk6MVgZ3/FmcgcAlqy+jT7IHMwj epw+YG9LmDzGQCWU7SXR22buAf/fCH8Kc8CMqDESz+iPU08QnWzQZqt5OrH73TzLcu5w JwVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=H55m8SAxQCZteXEHo639T3ncP9waoJie0p/fu8nR8T8=; b=XoXWvX6sXCc1P7K4XzwlCOC+dKhDWC7lu6G3OURt+M8H60jQBHEYByk6bD3DatWo00 GU85Y8g/KFWf7hUnlCm/KpFiznasoYCvevpMR7gxFtB+YYW+FxvAClvt6cjDYyT0UQMu 3eI1dYQfh2iNj68LIFO2PFlVSCotAzSqsRyncA66dxxMTIPVIsh1EB616rKwdAvHShTF ZeJAhtGZslKwXSP/qNzB0o7uT491B76Le/2qYMsMi8hd9kKD6qfDr9u1v+RaJx0TVIlI vxyu0ac87oMRbwKrYaW1C/HJyz7Gx3toCFYdSdwvsd3kfqxW32H1B8sGzn9Y7FSfBut/ L9jA== X-Gm-Message-State: AKwxytfYaG2UyCAlQmsQfKI2BOSjaVvoXjr3AbomD7uP8ObfyHE5u6Mv /MPkfDRmrXsDMuK/hi1Xv3Q= X-Google-Smtp-Source: ACJfBot4ouOTmGrO9TnSJoncawgXpn7LtHHA1HY5+H28OHUV9kF510jM+OXRYh4S/jzcTX7gka84wA== X-Received: by 10.200.19.136 with SMTP id h8mr10845535qtj.238.1515820057386; Fri, 12 Jan 2018 21:07:37 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id d26sm5165209qtk.54.2018.01.12.21.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 21:07:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Sat, 13 Jan 2018 02:07:04 -0300 Message-Id: <20180113050717.22969-2-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180113050717.22969-1-f4bug@amsat.org> References: <20180113050717.22969-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v7 01/14] sdhci: clean up includes 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: "Edgar E . Iglesias" , Andrey Smirnov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Kevin O'Connor , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/sd/sdhci-internal.h | 4 ---- include/hw/sd/sdhci.h | 7 ++++++- hw/sd/sdhci.c | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h index 161177cf39..248fd027f9 100644 --- a/hw/sd/sdhci-internal.h +++ b/hw/sd/sdhci-internal.h @@ -24,8 +24,6 @@ #ifndef SDHCI_INTERNAL_H #define SDHCI_INTERNAL_H -#include "hw/sd/sdhci.h" - /* R/W SDMA System Address register 0x0 */ #define SDHC_SYSAD 0x00 @@ -227,6 +225,4 @@ enum { sdhc_gap_write = 2 /* SDHC stopped at block gap during write operation */ }; -extern const VMStateDescription sdhci_vmstate; - #endif diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 0f0c3f1e64..1335373d3c 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -26,17 +26,19 @@ #define SDHCI_H #include "qemu-common.h" -#include "hw/block/block.h" #include "hw/pci/pci.h" #include "hw/sysbus.h" #include "hw/sd/sd.h" /* SD/MMC host controller state */ typedef struct SDHCIState { + /*< private >*/ union { PCIDevice pcidev; SysBusDevice busdev; }; + + /*< public >*/ SDBus sdbus; MemoryRegion iomem; @@ -46,6 +48,7 @@ typedef struct SDHCIState { qemu_irq ro_cb; qemu_irq irq; + /* Registers cleared on reset */ uint32_t sdmasysad; /* SDMA System Address register */ uint16_t blksize; /* Host DMA Buff Boundary and Transfer BlkSize Reg */ uint16_t blkcnt; /* Blocks count for current transfer */ @@ -70,8 +73,10 @@ typedef struct SDHCIState { uint16_t acmd12errsts; /* Auto CMD12 error status register */ uint64_t admasysaddr; /* ADMA System Address Register */ + /* Read-only registers */ uint32_t capareg; /* Capabilities Register */ uint32_t maxcurr; /* Maximum Current Capabilities Register */ + uint8_t *fifo_buffer; /* SD host i/o FIFO buffer */ uint32_t buf_maxsz; uint16_t data_count; /* current element in FIFO buffer */ diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index b064a087c9..b7d2a20985 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -29,6 +29,7 @@ #include "sysemu/dma.h" #include "qemu/timer.h" #include "qemu/bitops.h" +#include "hw/sd/sdhci.h" #include "sdhci-internal.h" #include "qemu/log.h"