1
0
mirror of https://github.com/openbsd/src.git synced 2026-05-01 17:46:35 +00:00

bcmsdhost: Set bus clock after reset

The host reset during attach nukes SDCDIV that the bus clock setup has
initialized right before. Reorder to keep the correct value in SDCDIV.

ok kettenis@
This commit is contained in:
cludwig
2026-01-15 14:36:43 +00:00
parent 81aba1088b
commit 28304016fe

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: bcm2835_sdhost.c,v 1.2 2022/04/06 18:59:28 naddy Exp $ */
/* $OpenBSD: bcm2835_sdhost.c,v 1.3 2026/01/15 14:36:43 cludwig Exp $ */
/*
* Copyright (c) 2020 Tobias Heider <tobhe@openbsd.org>
@@ -274,9 +274,9 @@ bcmsdhost_attach(struct device *parent, struct device *self, void *aux)
printf(": %u MHz base clock\n", sc->sc_rate / 1000000);
bcmsdhost_write(sc, SDHCFG, SDHCFG_BUSY_EN);
bcmsdhost_bus_clock(sc, 400, false);
bcmsdhost_host_reset(sc);
bcmsdhost_bus_width(sc, 1);
bcmsdhost_bus_clock(sc, 400, false);
memset(&saa, 0, sizeof(saa));
saa.saa_busname = "sdmmc";