-/* $OpenBSD: sdhc.c,v 1.75 2023/04/19 02:01:02 dlg Exp $ */
+/* $OpenBSD: sdhc.c,v 1.76 2023/10/01 08:56:24 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
struct sdmmcbus_attach_args saa;
struct sdhc_host *hp;
uint32_t caps;
+ int major, minor;
int error = 1;
int max_clock;
goto err;
}
- printf("%s: SDHC %d.0, %d MHz base clock\n", DEVNAME(sc),
- SDHC_SPEC_VERSION(hp->version) + 1, hp->clkbase / 1000);
+ switch (SDHC_SPEC_VERSION(hp->version)) {
+ case SDHC_SPEC_VERS_4_10:
+ major = 4, minor = 10;
+ break;
+ case SDHC_SPEC_VERS_4_20:
+ major = 4, minor = 20;
+ break;
+ default:
+ major = SDHC_SPEC_VERSION(hp->version) + 1, minor = 0;
+ break;
+ }
+
+ printf("%s: SDHC %d.%02d, %d MHz base clock\n", DEVNAME(sc),
+ major, minor, hp->clkbase / 1000);
/*
* XXX Set the data timeout counter value according to
-/* $OpenBSD: sdhcreg.h,v 1.9 2018/09/06 10:15:17 patrick Exp $ */
+/* $OpenBSD: sdhcreg.h,v 1.10 2023/10/01 08:56:24 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
#define SDHC_HOST_CTL_VERSION 0xfe
#define SDHC_SPEC_VERS_SHIFT 0
#define SDHC_SPEC_VERS_MASK 0xff
+#define SDHC_SPEC_VERS_4_10 0x04
+#define SDHC_SPEC_VERS_4_20 0x05
#define SDHC_VENDOR_VERS_SHIFT 8
#define SDHC_VENDOR_VERS_MASK 0xff
#define SDHC_SPEC_V1 0