summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc/sdhc.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2023-10-01 08:56:25 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2023-10-01 08:56:25 +0000
commit963817131a8c379c89fafa7a15a3b0f87489390d (patch)
treee56b190752f25d1585afdaf13d542cefa532cc4d /sys/dev/sdmmc/sdhc.c
parent58f6657e7878655e149a55ce5bce16d2f8b38ace (diff)
Print the correct SDHC spec version.
ok deraadt@
Diffstat (limited to 'sys/dev/sdmmc/sdhc.c')
-rw-r--r--sys/dev/sdmmc/sdhc.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index 2f3a6f4bce7..eb0a8e5374b 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -244,6 +244,7 @@ sdhc_host_found(struct sdhc_softc *sc, bus_space_tag_t iot,
struct sdmmcbus_attach_args saa;
struct sdhc_host *hp;
uint32_t caps;
+ int major, minor;
int error = 1;
int max_clock;
@@ -310,8 +311,20 @@ sdhc_host_found(struct sdhc_softc *sc, bus_space_tag_t iot,
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