2 * libqos driver framework
4 * Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>
19 #ifndef QGRAPH_QSDHCI_H
20 #define QGRAPH_QSDHCI_H
25 typedef struct QSDHCI QSDHCI
;
26 typedef struct QSDHCI_MemoryMapped QSDHCI_MemoryMapped
;
27 typedef struct QSDHCI_PCI QSDHCI_PCI
;
28 typedef struct QSDHCIProperties QSDHCIProperties
;
30 /* Properties common to all QSDHCI devices */
31 struct QSDHCIProperties
{
41 uint16_t (*readw
)(QSDHCI
*s
, uint32_t reg
);
42 uint64_t (*readq
)(QSDHCI
*s
, uint32_t reg
);
43 void (*writeq
)(QSDHCI
*s
, uint32_t reg
, uint64_t val
);
44 QSDHCIProperties props
;
47 /* Memory Mapped implementation of QSDHCI */
48 struct QSDHCI_MemoryMapped
{
55 /* PCI implementation of QSDHCI */
64 * qos_init_sdhci_mm(): external constructor used by all drivers/machines
65 * that "contain" a #QSDHCI_MemoryMapped driver
67 void qos_init_sdhci_mm(QSDHCI_MemoryMapped
*sdhci
, QTestState
*qts
,
68 uint32_t addr
, QSDHCIProperties
*common
);