Move sdhci.h to include/hw/sd
v7 cover Move sdhci.h to include/hw/sd
Move sdhci.h splitting it into common and internal. Create a new directory for sd in include/hw/. Correct paths of sd.h in at every instance of #include.
Sai Pavan Boddu (2):
sd.h: Move sd.h to include/hw/sd/
sdhci: Split sdhci.h for public and internal device usage
hw/sd/milkymist-memcard.c | 2 +-
hw/sd/omap_mmc.c | 2 +-
hw/sd/pl181.c | 2 +-
hw/sd/pxa2xx_mmci.c | 2 +-
hw/sd/sd.c | 2 +-
hw/sd/{sdhci.h => sdhci-internal.h} | 67 +--------------------------
hw/sd/sdhci.c | 3 +-
hw/sd/ssi-sd.c | 2 +-
include/hw/{ => sd}/sd.h | 0
include/hw/sd/sdhci.h | 92 +++++++++++++++++++++++++++++++++++++
10 files changed, 101 insertions(+), 73 deletions(-)
rename hw/sd/{sdhci.h => sdhci-internal.h} (75%)
rename include/hw/{ => sd}/sd.h (100%)
create mode 100644 include/hw/sd/sdhci.hSignature · 1 line
2.1.4
PATCH v7 1/2 sd.h: Move sd.h to include/hw/sd/
Create a sd directory under include/hw/ and move sd.h to same.
---
Changes for V7:
None
Changes for V6:
Fix commit message.
Changes for V5:
None
Changes for V4:
Fix commit message.
Changes for V3:
None.
---
hw/sd/milkymist-memcard.c | 2 +-
hw/sd/omap_mmc.c | 2 +-
hw/sd/pl181.c | 2 +-
hw/sd/pxa2xx_mmci.c | 2 +-
hw/sd/sd.c | 2 +-
hw/sd/sdhci.h | 2 +-
hw/sd/ssi-sd.c | 2 +-
include/hw/{ => sd}/sd.h | 0
8 files changed, 7 insertions(+), 7 deletions(-)
rename include/hw/{ => sd}/sd.h (100%)hw/sd/milkymist-memcard.c +1 -1
@@ -28,7 +28,7 @@#include "qemu/error-report.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" enum {ENABLE_CMD_TX = (1 <<0 ),
hw/sd/omap_mmc.c +1 -1
@@ -18,7 +18,7 @@*/ #include "hw/hw.h" #include "hw/arm/omap.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" struct omap_mmc_s {qemu_irq irq;
hw/sd/pl181.c +1 -1
@@ -10,7 +10,7 @@#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "hw/sysbus.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" //#define DEBUG_PL181 1
hw/sd/pxa2xx_mmci.c +1 -1
@@ -12,7 +12,7 @@#include "hw/hw.h" #include "hw/arm/pxa.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" #include "hw/qdev.h" struct PXA2xxMMCIState {
hw/sd/sd.c +1 -1
@@ -31,7 +31,7 @@#include "hw/hw.h" #include "sysemu/block-backend.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" #include "qemu/bitmap.h" //#define DEBUG_SD 1
hw/sd/sdhci.h +1 -1
@@ -28,7 +28,7 @@#include "qemu-common.h" #include "hw/pci/pci.h" #include "hw/sysbus.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" /* R/W SDMA System Address register 0x0 */ #define SDHC_SYSAD 0x00
hw/sd/ssi-sd.c +1 -1
@@ -13,7 +13,7 @@#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "hw/ssi.h" -#include "hw/sd.h" +#include "hw/sd/sd.h" //#define DEBUG_SSI_SD 1
include/hw/sd/sd.h renamed from include/hw/sd.h +0 -0
Signature · 1 line
2.1.4
PATCH v7 2/2 sdhci: Split sdhci.h for public and internal device usage
In reply to Sai Pavan BodduSplit sdhci.h into pubilc version (i.e include/hw/sd/sdhci.h) and internal version (i.e hw/sd/sdhci-interna.h) based on register declarations and object declaration.
---
Changes for V7:
Fix Commit message.
Changes for V6:
Fix commit message.
Chages for V5:
Rename pubilc header version as sdhci.h and internal version tosdhci-internal.h
Changes for V4:
Remain the name of internal version of sdchi.h as same. And change Re-Adding qemu-common.h header.
the one which is in includes/ to sdhci-common.h
Changes for V2:
Create new area in includes for sd. And move sdhci.h to same.
Changes for V3:
Split the headers to public and common.
---
hw/sd/{sdhci.h => sdhci-internal.h} | 67 +--------------------------
hw/sd/sdhci.c | 3 +-
include/hw/sd/sdhci.h | 92 +++++++++++++++++++++++++++++++++++++
3 files changed, 95 insertions(+), 67 deletions(-)
rename hw/sd/{sdhci.h => sdhci-internal.h} (75%)
create mode 100644 include/hw/sd/sdhci.hhw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +2 -65
@@ -21,14 +21,10 @@* You should have received a copy of the GNU General Public License along * with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef SDHCI_H #define SDHCI_H -#include "qemu-common.h" -#include "hw/pci/pci.h" -#include "hw/sysbus.h" -#include "hw/sd/sd.h" +#include "hw/sd/sdhci.h" /* R/W SDMA System Address register 0x0 */ #define SDHC_SYSAD 0x00
@@ -231,65 +227,6 @@ enum { sdhc_gap_write =2 /* SDHC stopped at block gap during write operation */ }; -/* SD/MMC host controller state */ -typedef struct SDHCIState { -union { -PCIDevice pcidev; -SysBusDevice busdev; - }; -SDState *card; -MemoryRegion iomem; - -QEMUTimer *insert_timer;/* timer for 'changing' sd card. */ -QEMUTimer *transfer_timer; -qemu_irq eject_cb; -qemu_irq ro_cb; -qemu_irq irq; - -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 */ -uint32_t argument;/* Command Argument Register */ -uint16_t trnmod;/* Transfer Mode Setting Register */ -uint16_t cmdreg;/* Command Register */ -uint32_t rspreg[4 ];/* Response Registers 0-3 */ -uint32_t prnsts;/* Present State Register */ -uint8_t hostctl;/* Host Control Register */ -uint8_t pwrcon;/* Power control Register */ -uint8_t blkgap;/* Block Gap Control Register */ -uint8_t wakcon;/* WakeUp Control Register */ -uint16_t clkcon;/* Clock control Register */ -uint8_t timeoutcon;/* Timeout Control Register */ -uint8_t admaerr;/* ADMA Error Status Register */ -uint16_t norintsts;/* Normal Interrupt Status Register */ -uint16_t errintsts;/* Error Interrupt Status Register */ -uint16_t norintstsen;/* Normal Interrupt Status Enable Register */ -uint16_t errintstsen;/* Error Interrupt Status Enable Register */ -uint16_t norintsigen;/* Normal Interrupt Signal Enable Register */ -uint16_t errintsigen;/* Error Interrupt Signal Enable Register */ -uint16_t acmd12errsts;/* Auto CMD12 error status register */ -uint64_t admasysaddr;/* ADMA System Address Register */ - -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 */ -uint8_t stopped_state;/* Current SDHC state */ -/* Buffer Data Port Register - virtual access point to R and W buffers */ -/* Software Reset Register - always reads as 0 */ -/* Force Event Auto CMD12 Error Interrupt Reg - write only */ -/* Force Event Error Interrupt Register- write only */ -/* RO Host Controller Version Register always reads as 0x2401 */ -}SDHCIState ; -extern const VMStateDescription sdhci_vmstate; -#define TYPE_PCI_SDHCI "sdhci-pci" -#define PCI_SDHCI (obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI) - -#define TYPE_SYSBUS_SDHCI "generic-sdhci" -#define SYSBUS_SDHCI (obj) \ - OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) - -#endif /* SDHCI_H */ +#endif
hw/sd/sdhci.c +1 -2
@@ -28,8 +28,7 @@#include "sysemu/dma.h" #include "qemu/timer.h" #include "qemu/bitops.h" - -#include "sdhci.h" +#include "sdhci-internal.h" /* host controller debug messages */ #ifndef SDHC_DEBUG
include/hw/sd/sdhci.h new file +92 -0
92 lines not on this page · raw message
Signature · 1 line
2.1.4
Re: [Qemu-devel] [PATCH V7 2/2] sdhci: Split sdhci.h for public and internal device usage
Quoted 7 lines · Sai Pavan Boddu
Split
sdhci.hinto pubilc version (i.einclude/hw/sd/sdhci.h) and internal version (i.ehw/sd/sdhci-interna.h) based on register declarations and object declaration.Signed-off-by Sai Pavan Boddu <[email protected]>Reviewed-by Alistair Francis <[email protected]>Reviewed-by Peter Crosthwaite <[email protected]>
Is this missing a cover? The patches utility requires a cover even for 2 patches for applying.
I assume this is for ARM SoCification so can it go via target-arm?
Regards,
Peter
Quoted 229 lines
---
Changes for V7:
Fix Commit message.
Changes for V6:
Fix commit message.
Chages for V5:
Rename pubilc header version assdhci.hand internal version tosdhci-internal.h
Changes for V4:
Remain the name of internal version ofsdchi.has same. And change Re-Addingqemu-common.hheader.
the one which is in includes/ tosdhci-common.h
Changes for V2:
Create new area in includes for sd. And movesdhci.hto same.
Changes for V3:
Split the headers to public and common.--- hw/sd/{sdhci.h => sdhci-internal.h} | 67 +-------------------------- hw/sd/sdhci.c | 3 +- include/hw/sd/sdhci.h | 92 +++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 67 deletions(-) rename hw/sd/{sdhci.h => sdhci-internal.h} (75%) create mode 100644 include/hw/sd/sdhci.hhw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +2
-65@@ -21,14 +21,10 @@* You should have received a copy of the GNU General Public License along * with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef SDHCI_H #define SDHCI_H -#include "qemu-common.h" -#include "hw/pci/pci.h" -#include "hw/sysbus.h" -#include "hw/sd/sd.h" +#include "hw/sd/sdhci.h" /* R/W SDMA System Address register 0x0 */ #define SDHC_SYSAD 0x00@@ -231,65 +227,6 @@ enum { sdhc_gap_write =2 /* SDHC stopped at block gap during write operation */ }; -/* SD/MMC host controller state */ -typedef struct SDHCIState { -union { -PCIDevice pcidev; -SysBusDevice busdev; - }; -SDState *card; -MemoryRegion iomem; - -QEMUTimer *insert_timer;/* timer for 'changing' sd card. */ -QEMUTimer *transfer_timer; -qemu_irq eject_cb; -qemu_irq ro_cb; -qemu_irq irq; - -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 */ -uint32_t argument;/* Command Argument Register */ -uint16_t trnmod;/* Transfer Mode Setting Register */ -uint16_t cmdreg;/* Command Register */ -uint32_t rspreg[4 ];/* Response Registers 0-3 */ -uint32_t prnsts;/* Present State Register */ -uint8_t hostctl;/* Host Control Register */ -uint8_t pwrcon;/* Power control Register */ -uint8_t blkgap;/* Block Gap Control Register */ -uint8_t wakcon;/* WakeUp Control Register */ -uint16_t clkcon;/* Clock control Register */ -uint8_t timeoutcon;/* Timeout Control Register */ -uint8_t admaerr;/* ADMA Error Status Register */ -uint16_t norintsts;/* Normal Interrupt Status Register */ -uint16_t errintsts;/* Error Interrupt Status Register */ -uint16_t norintstsen;/* Normal Interrupt Status Enable Register */ -uint16_t errintstsen;/* Error Interrupt Status Enable Register */ -uint16_t norintsigen;/* Normal Interrupt Signal Enable Register */ -uint16_t errintsigen;/* Error Interrupt Signal Enable Register */ -uint16_t acmd12errsts;/* Auto CMD12 error status register */ -uint64_t admasysaddr;/* ADMA System Address Register */ - -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 */ -uint8_t stopped_state;/* Current SDHC state */ -/* Buffer Data Port Register - virtual access point to R and W buffers */ -/* Software Reset Register - always reads as 0 */ -/* Force Event Auto CMD12 Error Interrupt Reg - write only */ -/* Force Event Error Interrupt Register- write only */ -/* RO Host Controller Version Register always reads as 0x2401 */ -}SDHCIState ; -extern const VMStateDescription sdhci_vmstate; -#define TYPE_PCI_SDHCI "sdhci-pci" -#define PCI_SDHCI (obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI) - -#define TYPE_SYSBUS_SDHCI "generic-sdhci" -#define SYSBUS_SDHCI (obj) \ - OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) - -#endif /* SDHCI_H */ +#endif hw/sd/sdhci.c +1
-2@@ -28,8 +28,7 @@#include "sysemu/dma.h" #include "qemu/timer.h" #include "qemu/bitops.h" - -#include "sdhci.h" +#include "sdhci-internal.h" /* host controller debug messages */ #ifndef SDHC_DEBUG include/hw/sd/sdhci.h new file +92
-1@@ -0,0 +1,92 @@ +/* +* SD Association Host Standard Specification v2.0 controller emulation +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* Mitsyanko Igor <[email protected]> +* Peter A.G. Crosthwaite <[email protected]> +* +* Based on MMC controller for Samsung S5PC1xx-based board emulation +* by Alexey Merkulov and Vladimir Monakhov. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* See the GNU General Public License for more details. +* +* You should have received a copy of the GNU _General Public License along +* with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef SDHCI_COMMON_H +#define SDHCI_COMMON_H + +#include "qemu-common.h" +#include "hw/pci/pci.h" +#include "hw/sysbus.h" +#include "hw/sd/sd.h" + +/* SD/MMC host controller state */ +typedef struct SDHCIState { +union { +PCIDevice pcidev; +SysBusDevice busdev; + }; +SDState *card; +MemoryRegion iomem; + +QEMUTimer *insert_timer;/* timer for 'changing' sd card. */ +QEMUTimer *transfer_timer; +qemu_irq eject_cb; +qemu_irq ro_cb; +qemu_irq irq; + +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 */ +uint32_t argument;/* Command Argument Register */ +uint16_t trnmod;/* Transfer Mode Setting Register */ +uint16_t cmdreg;/* Command Register */ +uint32_t rspreg[4 ];/* Response Registers 0-3 */ +uint32_t prnsts;/* Present State Register */ +uint8_t hostctl;/* Host Control Register */ +uint8_t pwrcon;/* Power control Register */ +uint8_t blkgap;/* Block Gap Control Register */ +uint8_t wakcon;/* WakeUp Control Register */ +uint16_t clkcon;/* Clock control Register */ +uint8_t timeoutcon;/* Timeout Control Register */ +uint8_t admaerr;/* ADMA Error Status Register */ +uint16_t norintsts;/* Normal Interrupt Status Register */ +uint16_t errintsts;/* Error Interrupt Status Register */ +uint16_t norintstsen;/* Normal Interrupt Status Enable Register */ +uint16_t errintstsen;/* Error Interrupt Status Enable Register */ +uint16_t norintsigen;/* Normal Interrupt Signal Enable Register */ +uint16_t errintsigen;/* Error Interrupt Signal Enable Register */ +uint16_t acmd12errsts;/* Auto CMD12 error status register */ +uint64_t admasysaddr;/* ADMA System Address Register */ + +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 */ +uint8_t stopped_state;/* Current SDHC state */ +/* Buffer Data Port Register - virtual access point to R and W buffers */ +/* Software Reset Register - always reads as 0 */ +/* Force Event Auto CMD12 Error Interrupt Reg - write only */ +/* Force Event Error Interrupt Register- write only */ +/* RO Host Controller Version Register always reads as 0x2401 */ +}SDHCIState ; + +#define TYPE_PCI_SDHCI "sdhci-pci" +#define PCI_SDHCI (obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI) + +#define TYPE_SYSBUS_SDHCI "generic-sdhci" +#define SYSBUS_SDHCI (obj) \ + OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) + +#endif /* SDHCI_H */ --2.1.4
Re: [Qemu-devel] [PATCH V7 2/2] sdhci: Split sdhci.h for public and internal device usage
Hi Peter,
Quoted 15 lines
-----Original Message-----
From: Peter Crosthwaite [mailto:[email protected]]
Sent: Saturday, September 26, 2015 11:42 PM
To: Sai Pavan Boddu; Peter Maydell
Cc: [email protected] Developers; Alistair Francis; Edgar Iglesias; Sai Pavan Boddu
Subject: Re: [PATCH V7 2/2] sdhci: Splitsdhci.hfor public and internal device usageQuoted 4 lines · Sai Pavan Boddu
Split
sdhci.hinto pubilc version (i.einclude/hw/sd/sdhci.h) and internal version (i.ehw/sd/sdhci-interna.h) based on register declarations and object declaration.
Quoted 6 lines
Quoted 3 lines
Signed-off-by Sai Pavan Boddu <[email protected]>Reviewed-by Alistair Francis <[email protected]>Reviewed-by Peter Crosthwaite <[email protected]>Is this missing a cover? The patches utility requires a cover even for 2 patches for applying.
[Sai Pavan ] Yes I have sent a cover Letter. I will resend the patch.
Quoted 31 lines
I assume this is for ARM SoCification so can it go via target-arm?
Regards,
PeterQuoted 16 lines
---
Changes for V7:
Fix Commit message.
Changes for V6:
Fix commit message.
Chages for V5:
Rename pubilc header version assdhci.hand internal version tosdhci-internal.h
Changes for V4:
Remain the name of internal version ofsdchi.has same. And change Re-Addingqemu-common.hheader.
the one which is in includes/ tosdhci-common.h
Changes for V2:
Create new area in includes for sd. And movesdhci.hto same.
Changes for V3:
Split the headers to public and common.Quoted 4 lines
--- hw/sd/{sdhci.h => sdhci-internal.h} | 67 +-------------------------- hw/sd/sdhci.c | 3 +- include/hw/sd/sdhci.h | 92+++++++++++++++++++++++++++++++++++++
Quoted 4 lines
3 files changed, 95 insertions(+), 67 deletions(-) rename hw/sd/{sdhci.h => sdhci-internal.h} (75%) create mode 100644 include/hw/sd/sdhci.h
Quoted 15 lines
hw/sd/sdhci-internal.h line 21
Quoted 9 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +0
-0@@ -21,14 +21,10 @@* You should have received a copy of the GNU General Public License along
Quoted 5 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +0
-1* with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef SDHCI_H #define SDHCI_H
[Sai Pavan ] I will correct this to SDHCI_INTERNAL_H
Thanks,
Sai Pavan
Quoted 197 lines
hw/sd/sdhci-internal.h enum { · line 227
Quoted 11 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +1
-4-#include "qemu-common.h" -#include "hw/pci/pci.h" -#include "hw/sysbus.h" -#include "hw/sd/sd.h" +#include "hw/sd/sdhci.h" /* R/W SDMA System Address register 0x0 */ #define SDHC_SYSAD 0x00@@ -231,65 +227,6 @@ enum { sdhc_gap_write =2 /* SDHC stopped at block gap during write operation */
Quoted 9 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +0
-7}; -/* SD/MMC host controller state */ -typedef struct SDHCIState { - union { - PCIDevice pcidev; - SysBusDevice busdev; - }; - SDState *card;hw/sd/sdhci-internal.h enum {
Quoted 10 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +0
-10-MemoryRegion iomem; - -QEMUTimer *insert_timer;/* timer for 'changing' sd card. */ -QEMUTimer *transfer_timer; -qemu_irq eject_cb; -qemu_irq ro_cb; -qemu_irq irq; - -uint32_t sdmasysad;/* SDMA System Address register */ -uint16_t blksize;/* Host DMA Buff Boundary and Transfer BlkSize Reg */
Quoted 29 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +0
-29-uint16_t blkcnt;/* Blocks count for current transfer */ -uint32_t argument;/* Command Argument Register */ -uint16_t trnmod;/* Transfer Mode Setting Register */ -uint16_t cmdreg;/* Command Register */ -uint32_t rspreg[4 ];/* Response Registers 0-3 */ -uint32_t prnsts;/* Present State Register */ -uint8_t hostctl;/* Host Control Register */ -uint8_t pwrcon;/* Power control Register */ -uint8_t blkgap;/* Block Gap Control Register */ -uint8_t wakcon;/* WakeUp Control Register */ -uint16_t clkcon;/* Clock control Register */ -uint8_t timeoutcon;/* Timeout Control Register */ -uint8_t admaerr;/* ADMA Error Status Register */ -uint16_t norintsts;/* Normal Interrupt Status Register */ -uint16_t errintsts;/* Error Interrupt Status Register */ -uint16_t norintstsen;/* Normal Interrupt Status Enable Register */ -uint16_t errintstsen;/* Error Interrupt Status Enable Register */ -uint16_t norintsigen;/* Normal Interrupt Signal Enable Register */ -uint16_t errintsigen;/* Error Interrupt Signal Enable Register */ -uint16_t acmd12errsts;/* Auto CMD12 error status register */ -uint64_t admasysaddr;/* ADMA System Address Register */ - -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 */ -uint8_t stopped_state;/* Current SDHC state */ -/* Buffer Data Port Register - virtual access point to R and W buffers */ hw/sd/sdhci-internal.h enum {
Quoted 10 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +0
-8-/* Software Reset Register - always reads as 0 */ -/* Force Event Auto CMD12 Error Interrupt Reg - write only */ -/* Force Event Error Interrupt Register- write only */ -/* RO Host Controller Version Register always reads as 0x2401 */ -} SDHCIState; -extern const VMStateDescription sdhci_vmstate; -#define TYPE_PCI_SDHCI "sdhci-pci" -#define PCI_SDHCI (obj) OBJECT_CHECK(SDHCIState, (obj),
TYPE_PCI_SDHCI)Quoted 38 lines
hw/sd/sdhci-internal.h renamed from hw/sd/sdhci.h +1
-6- -#define TYPE_SYSBUS_SDHCI "generic-sdhci" -#define SYSBUS_SDHCI (obj) \ - OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) - -#endif /* SDHCI_H */ +#endif hw/sd/sdhci.c +1
-2@@ -28,8 +28,7 @@#include "sysemu/dma.h" #include "qemu/timer.h" #include "qemu/bitops.h" - -#include "sdhci.h" +#include "sdhci-internal.h" /* host controller debug messages */ #ifndef SDHC_DEBUG include/hw/sd/sdhci.h new file +11
-0@@ -0,0 +1,92 @@ +/* +* SD Association Host Standard Specification v2.0 controller emulation +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* Mitsyanko Igor <[email protected]> +* Peter A.G. Crosthwaite <[email protected]> +* +* Based on MMC controller for Samsung S5PC1xx-based board emulation +* by Alexey Merkulov and Vladimir Monakhov. +* +* This program is free software; you can redistribute it and/or modify it include/hw/sd/sdhci.h line 21
Quoted 10 lines
include/hw/sd/sdhci.h new file +10
-0+* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* See the GNU General Public License for more details. +* +* You should have received a copy of the GNU _General Public License along
Quoted 18 lines
include/hw/sd/sdhci.h new file +18
-0+* with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef SDHCI_COMMON_H +#define SDHCI_COMMON_H + +#include "qemu-common.h" +#include "hw/pci/pci.h" +#include "hw/sysbus.h" +#include "hw/sd/sd.h" + +/* SD/MMC host controller state */ +typedef struct SDHCIState { + union { + PCIDevice pcidev; + SysBusDevice busdev; + }; + SDState *card;include/hw/sd/sdhci.h
Quoted 10 lines
include/hw/sd/sdhci.h new file +10
-0+MemoryRegion iomem; + +QEMUTimer *insert_timer;/* timer for 'changing' sd card. */ +QEMUTimer *transfer_timer; +qemu_irq eject_cb; +qemu_irq ro_cb; +qemu_irq irq; + +uint32_t sdmasysad;/* SDMA System Address register */ +uint16_t blksize;/* Host DMA Buff Boundary and Transfer BlkSize Reg */
Quoted 27 lines
include/hw/sd/sdhci.h new file +27
-0+uint16_t blkcnt;/* Blocks count for current transfer */ +uint32_t argument;/* Command Argument Register */ +uint16_t trnmod;/* Transfer Mode Setting Register */ +uint16_t cmdreg;/* Command Register */ +uint32_t rspreg[4 ];/* Response Registers 0-3 */ +uint32_t prnsts;/* Present State Register */ +uint8_t hostctl;/* Host Control Register */ +uint8_t pwrcon;/* Power control Register */ +uint8_t blkgap;/* Block Gap Control Register */ +uint8_t wakcon;/* WakeUp Control Register */ +uint16_t clkcon;/* Clock control Register */ +uint8_t timeoutcon;/* Timeout Control Register */ +uint8_t admaerr;/* ADMA Error Status Register */ +uint16_t norintsts;/* Normal Interrupt Status Register */ +uint16_t errintsts;/* Error Interrupt Status Register */ +uint16_t norintstsen;/* Normal Interrupt Status Enable Register */ +uint16_t errintstsen;/* Error Interrupt Status Enable Register */ +uint16_t norintsigen;/* Normal Interrupt Signal Enable Register */ +uint16_t errintsigen;/* Error Interrupt Signal Enable Register */ +uint16_t acmd12errsts;/* Auto CMD12 error status register */ +uint64_t admasysaddr;/* ADMA System Address Register */ + +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 */ include/hw/sd/sdhci.h
Quoted 10 lines
include/hw/sd/sdhci.h new file +10
-0+uint8_t stopped_state;/* Current SDHC state */ +/* Buffer Data Port Register - virtual access point to R and W buffers */ +/* Software Reset Register - always reads as 0 */ +/* Force Event Auto CMD12 Error Interrupt Reg - write only */ +/* Force Event Error Interrupt Register- write only */ +/* RO Host Controller Version Register always reads as 0x2401 */ +} SDHCIState; + +#define TYPE_PCI_SDHCI "sdhci-pci" +#define PCI_SDHCI (obj) OBJECT_CHECK(SDHCIState, (obj),
TYPE_PCI_SDHCI)Quoted 9 lines
include/hw/sd/sdhci.h new file +6
-1+ +#define TYPE_SYSBUS_SDHCI "generic-sdhci" +#define SYSBUS_SDHCI (obj) \ + OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) + +#endif /* SDHCI_H */ --2.1.4