@@ -116,6 +116,11 @@ typedef struct SDHCIClass {
const MemoryRegionOps *io_ops;
uint32_t quirks;
uint64_t iomem_size;
+
+ /* Read-only registers */
+ struct {
+ uint64_t capareg;
+ } ro;
} SDHCIClass;
/*
@@ -73,6 +73,7 @@ static bool sdhci_check_capab_freq_range(SDHCIState *s, const char *desc,
static void sdhci_check_capareg(SDHCIState *s, Error **errp)
{
+ SDHCIClass *sc = SYSBUS_SDHCI_GET_CLASS(s);
uint64_t msk = s->capareg;
uint32_t val;
bool y;
@@ -208,6 +209,11 @@ static void sdhci_check_capareg(SDHCIState *s, Error **errp)
qemu_log_mask(LOG_UNIMP,
"SDHCI: unknown CAPAB mask: 0x%016" PRIx64 "\n", msk);
}
+ msk = sc->ro.capareg & ~s->capareg;
+ if (msk) {
+ qemu_log_mask(LOG_UNIMP,
+ "SDHCI: ignored CAPAB mask: 0x%016" PRIx64 "\n", msk);
+ }
}
static uint8_t sdhci_slotint(SDHCIState *s)
Capability register is read-only. Since we allow instances to clear/set extra bits, log when read-only bits normally set by hardware are cleared at board level. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/hw/sd/sdhci.h | 5 +++++ hw/sd/sdhci.c | 6 ++++++ 2 files changed, 11 insertions(+)