xref: /openbmc/qemu/include/hw/sd/aspeed_sdhci.h (revision d0a25207103bded189af1bcb8d16abb1cb86590e)
1 /*
2  * Aspeed SD Host Controller
3  * Eddie James <eajames@linux.ibm.com>
4  *
5  * Copyright (C) 2019 IBM Corp
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #ifndef ASPEED_SDHCI_H
10 #define ASPEED_SDHCI_H
11 
12 #include "hw/sd/sdhci.h"
13 #include "qom/object.h"
14 
15 #define TYPE_ASPEED_SDHCI "aspeed.sdhci"
16 #define TYPE_ASPEED_2400_SDHCI TYPE_ASPEED_SDHCI "-ast2400"
17 #define TYPE_ASPEED_2500_SDHCI TYPE_ASPEED_SDHCI "-ast2500"
18 #define TYPE_ASPEED_2600_SDHCI TYPE_ASPEED_SDHCI "-ast2600"
19 #define TYPE_ASPEED_2700_SDHCI TYPE_ASPEED_SDHCI "-ast2700"
20 OBJECT_DECLARE_TYPE(AspeedSDHCIState, AspeedSDHCIClass, ASPEED_SDHCI)
21 
22 #define ASPEED_SDHCI_NUM_SLOTS    2
23 #define ASPEED_SDHCI_NUM_REGS     (ASPEED_SDHCI_REG_SIZE / sizeof(uint32_t))
24 #define ASPEED_SDHCI_REG_SIZE     0x100
25 
26 struct AspeedSDHCIState {
27     SysBusDevice parent;
28 
29     SDHCIState slots[ASPEED_SDHCI_NUM_SLOTS];
30     uint8_t num_slots;
31 
32     MemoryRegion iomem;
33     qemu_irq irq;
34 
35     uint32_t regs[ASPEED_SDHCI_NUM_REGS];
36 };
37 
38 struct AspeedSDHCIClass {
39     SysBusDeviceClass parent_class;
40 
41     uint64_t capareg;
42 };
43 
44 #endif /* ASPEED_SDHCI_H */
45