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