Date: Mon, 09 Feb 2026 15:54:33 +0000 From: Tom Jones <thj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ec5d4664915f - main - aw_mmc: Reset card Message-ID: <698a0339.18d63.51e281da@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=ec5d4664915f51ae62daec09fa4f9765c969adab commit ec5d4664915f51ae62daec09fa4f9765c969adab Author: Tom Jones <thj@FreeBSD.org> AuthorDate: 2026-02-09 15:48:24 +0000 Commit: Tom Jones <thj@FreeBSD.org> CommitDate: 2026-02-09 15:53:29 +0000 aw_mmc: Reset card On H616 (and I think H6, but this isn't verified) we need to reset the card to have a functioning device. With this commit all my pending patches for H616 are in tree. We run well on my test device (Orange Pi Zero3), however there is an uninvestigated issue with ethernet and graphics are an open question. Reviewed by: manu, adrian MFC After: 1 week Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55097 --- sys/arm/allwinner/aw_mmc.c | 8 ++++++++ sys/arm/allwinner/aw_mmc.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c index e10e98aea261..4d85c62279fc 100644 --- a/sys/arm/allwinner/aw_mmc.c +++ b/sys/arm/allwinner/aw_mmc.c @@ -117,6 +117,7 @@ static const struct aw_mmc_conf a64_emmc_conf = { static const struct aw_mmc_conf h616_mmc_conf = { .dma_xferlen = 0x10000, + .dma_desc_shift = 2, .mask_data0 = true, .can_calibrate = true, .new_timing = true, @@ -737,6 +738,13 @@ aw_mmc_reset(struct aw_mmc_softc *sc) if (timeout == 0) return (ETIMEDOUT); + /* + * Assert hardware reset and have the card move to the pre-idle state. + * This is needed on H616 to get the card into a functional state. + */ + AW_MMC_WRITE_4(sc, AW_MMC_HWRST, AW_MMC_HWRST_ASSERT); + AW_MMC_WRITE_4(sc, AW_MMC_HWRST, AW_MMC_HWRST_DEASSERT); + return (0); } diff --git a/sys/arm/allwinner/aw_mmc.h b/sys/arm/allwinner/aw_mmc.h index de15afd6de22..6974ab3bd327 100644 --- a/sys/arm/allwinner/aw_mmc.h +++ b/sys/arm/allwinner/aw_mmc.h @@ -169,6 +169,10 @@ /* AW_MMC_NTSR */ #define AW_MMC_NTSR_MODE_SELECT (1U << 31) +/* AW_MMC_HWRST */ +#define AW_MMC_HWRST_ASSERT (0U << 0) +#define AW_MMC_HWRST_DEASSERT (1U << 0) + /* IDMA CONTROLLER BUS MOD BIT FIELD */ #define AW_MMC_DMAC_IDMAC_SOFT_RST (1U << 0) #define AW_MMC_DMAC_IDMAC_FIX_BURST (1U << 1)home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698a0339.18d63.51e281da>
