<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/mmc, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-17T20:45:13Z</updated>
<entry>
<title>bus: Document special ranges of IVARs</title>
<updated>2026-02-17T20:45:13Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2026-02-17T20:45:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6cf4e30252fe48b230b9d76cac20576d5b3d2ffa'/>
<id>urn:sha1:6cf4e30252fe48b230b9d76cac20576d5b3d2ffa</id>
<content type='text'>
Some IVAR indices are special in that they have global meaning across
multiple buses where as other IVARs are always private to the local bus.
Try to document this a bit and add constants for the various ranges to
avoid future conflicts.

This is a no-op, but IVAR indices are now generally defined as enums
as that makes it easier to define them in terms of ranges.

Reviewed by:	imp, royger, andrew
Differential Revision:	https://reviews.freebsd.org/D54159
</content>
</entry>
<entry>
<title>gpio_alloc_intr_resource: Pass rid by value</title>
<updated>2025-12-09T20:03:03Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2025-12-09T20:03:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=01dcb4e6645f1a551e52763d58ba4375efbc5428'/>
<id>urn:sha1:01dcb4e6645f1a551e52763d58ba4375efbc5428</id>
<content type='text'>
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D53407
</content>
</entry>
<entry>
<title>mmc_fdt: handle broken-cd property</title>
<updated>2025-11-05T14:40:34Z</updated>
<author>
<name>Mitchell Horne</name>
<email>mhorne@FreeBSD.org</email>
</author>
<published>2025-11-05T14:37:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=768ee6d454821cc63247cb4ffe526c5a06accff0'/>
<id>urn:sha1:768ee6d454821cc63247cb4ffe526c5a06accff0</id>
<content type='text'>
The documented properties [1] for card-detection are one of:
 - cd-gpios
 - non-removable
 - broken-cd

In cd_setup() we handle the first two, but not the latter, resulting in
a silently undetected card on an affected system.

To work around this, force cd_disabled when broken-cd is specified, so
that the card detect helper function gets to run. A more complete
solution would implement some kind of polling mechanism to detect the
card's presence or removal.

Some variants of the Allwinner D1, such as the Lichee Rv, specify this
property in the mmc0 device node.

[1] sys/contrib/device-tree/Bindings/mmc/mmc-controller.yaml

Reported by:	Haowu Ge &lt;gehaowu@bitmoe.com&gt;
Tested by:	Haowu Ge &lt;gehaowu@bitmoe.com&gt;
Reviewed by:	imp, manu, mmel
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D53546
</content>
</entry>
<entry>
<title>sys/: rename bio_error variable to abio_error</title>
<updated>2025-11-04T04:11:11Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2025-10-25T08:37:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=58e5f3b84df0aeaaf4b56a5e48bcb4b3e1d9c097'/>
<id>urn:sha1:58e5f3b84df0aeaaf4b56a5e48bcb4b3e1d9c097</id>
<content type='text'>
to prevent future name collision with some buf/bio macros

Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D53351
</content>
</entry>
<entry>
<title>dwmmc: cleanup cmd and locking, consistency between mmc and mmccam</title>
<updated>2025-07-31T17:37:54Z</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2025-07-29T12:36:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0f8a8416a4e07ddeaecc4eafd6f418da0f21efc7'/>
<id>urn:sha1:0f8a8416a4e07ddeaecc4eafd6f418da0f21efc7</id>
<content type='text'>
In general sprinkle locking assertions and harmonized KASSERTs
throughout the upper part of the driver to document expectations.

In dwmmc_cmd_done() "cmd" should be set correctly and be used for
both MMCCAM and classic mmc rather than special-casing mmccam.
In dwmmc_next_operation() place variable declarations on the top
for both cases before the first debug and lock assertion calls;
then factor out common parts at the end and put both cases in the
same order.
By calling dwmmc_next_operation() directly from both dwmmc_request()
in the mmc case, and dwmmc_cam_request() in the mmccase (rather than)
chaining calls in the latter, we avoid unlocking the sc in the mmccam
case and have a consistent call path from both; also removing the
mmccam #ifdef from dwmmc_request() brings more clarity.
In dwmmc_next_operation() enhance the panic/error messages with
some extra information and assert that we come in with a cam pinfo
on CAM_ACTIVE_INDEX.

MFC after:      3 days
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D51628
</content>
</entry>
<entry>
<title>mmc: SPI-mode support for SD cards.</title>
<updated>2025-04-09T11:21:05Z</updated>
<author>
<name>Ruslan Bukin</name>
<email>br@FreeBSD.org</email>
</author>
<published>2025-04-09T10:23:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=253c83058deb5ff77dc0a3b60bf7c1d10f9ef5e8'/>
<id>urn:sha1:253c83058deb5ff77dc0a3b60bf7c1d10f9ef5e8</id>
<content type='text'>
Introduce SPI-mode support which allows an SD card to communicate with a
host system using SPI protocol, as described in the SD Card Specification.

This feature is useful for low-end, FPGA or RISC-V research systems when a
SoC is limited in terms of peripherals available (e.g. lack of a dedicated
MMC controller in hardware). Examples of such systems include Codasip,
lowRISC and CVA6.

Project timeline:
2007: Warner first discussed SPI operational mode in his MMC presentation:
      https://people.freebsd.org/~imp/bsdcan2007.pdf
2012: Patrick Kelsey engineered the support.
2025: Ruslan cleaned up, tested on Codasip X730 platform (RISC-V FPGA)
      and put the patch to review.
2025: Patrick Kelsey reviewed the patch and aligned with the current MMC
      code.

Reviewed by:	pkelsey
Sponsored by:	UKRI
Differential Revision:	https://reviews.freebsd.org/D49248
</content>
</entry>
<entry>
<title>mmc: support for SPI bus type</title>
<updated>2025-04-09T11:20:54Z</updated>
<author>
<name>Ruslan Bukin</name>
<email>br@FreeBSD.org</email>
</author>
<published>2025-04-09T10:20:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=07da3bb5d56c85325252cd1a9ae32fb5d3536dea'/>
<id>urn:sha1:07da3bb5d56c85325252cd1a9ae32fb5d3536dea</id>
<content type='text'>
- Introduce the bus_type accessor, which allows to skip card selection
  and timing settings in SPI mode;
- Add MMC_CMD_IS_APP flag for commands followed by the APP command,
  which is required by the upcoming MMCSPI driver.

Reviewed by:	pkelsey
Sponsored by:	UKRI
Differential Revision:	https://reviews.freebsd.org/D49249
</content>
</entry>
<entry>
<title>Disable HS200 on rockchip_dwmmc in attach</title>
<updated>2025-03-18T17:01:21Z</updated>
<author>
<name>Stephen Hurd</name>
<email>shurd@FreeBSD.org</email>
</author>
<published>2025-03-17T07:16:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0f684b5aec50b4766dc2a8f010fd7b9568af5063'/>
<id>urn:sha1:0f684b5aec50b4766dc2a8f010fd7b9568af5063</id>
<content type='text'>
HS200 mode requires tuning, and there is no code to perform this
tuning at present.  Until there is, leave HS200 mode disabled.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D49400
</content>
</entry>
<entry>
<title>mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devices</title>
<updated>2025-03-10T17:32:53Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2025-03-10T17:32:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c0bed9bd0bda2ca9239f5913cd2d5c1bd5d29bfa'/>
<id>urn:sha1:c0bed9bd0bda2ca9239f5913cd2d5c1bd5d29bfa</id>
<content type='text'>
Some drivers held regular mutexes across some new-bus calls; instead
depend on bus_topo_lock to protect the relevant softc members.  This
also fixes the bus_topo_lock to be explicit in these drivers rather
than relying on the implicit Giant from taskqueue_swi_giant.  It
avoids calling sleepable routines like device_probe_and_attach from an
swi context.

Differential Revision:	https://reviews.freebsd.org/D49270
</content>
</entry>
<entry>
<title>Use bus_generic_detach instead of device_delete_children in detach</title>
<updated>2025-01-02T18:24:28Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2025-01-02T18:24:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3ddaf8200bc90b1410755ebac7b5c979ea90a2f6'/>
<id>urn:sha1:3ddaf8200bc90b1410755ebac7b5c979ea90a2f6</id>
<content type='text'>
While here, check for errors from bus_generic_detach and move it to
the start of detach if necessary.

Differential Revision:	https://reviews.freebsd.org/D47969
</content>
</entry>
</feed>
