xref: /openbmc/qemu/include/hw/sd/cadence_sdhci.h (revision 7d87775f)
1 /*
2  * Cadence SDHCI emulation
3  *
4  * Copyright (c) 2020 Wind River Systems, Inc.
5  *
6  * Author:
7  *   Bin Meng <bin.meng@windriver.com>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 or
12  * (at your option) version 3 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef CADENCE_SDHCI_H
24 #define CADENCE_SDHCI_H
25 
26 #include "hw/sd/sdhci.h"
27 
28 #define CADENCE_SDHCI_REG_SIZE  0x100
29 #define CADENCE_SDHCI_NUM_REGS  (CADENCE_SDHCI_REG_SIZE / sizeof(uint32_t))
30 
31 typedef struct CadenceSDHCIState {
32     SysBusDevice parent;
33 
34     MemoryRegion container;
35     MemoryRegion iomem;
36     BusState *bus;
37 
38     uint32_t regs[CADENCE_SDHCI_NUM_REGS];
39 
40     SDHCIState sdhci;
41 } CadenceSDHCIState;
42 
43 #define TYPE_CADENCE_SDHCI  "cadence.sdhci"
44 #define CADENCE_SDHCI(obj)  OBJECT_CHECK(CadenceSDHCIState, (obj), \
45                                          TYPE_CADENCE_SDHCI)
46 
47 #endif /* CADENCE_SDHCI_H */
48