[PATCH] simplebus child device probe order control via FDT (motivated by BeagleBone Black)

Patrick Kelsey kelsey at ieee.org
Sun Mar 2 23:56:19 UTC 2014


Hi,

The attached patch (fdt_probe_order_control.patch) allows control over the
probe order of simplebus child devices by using a "probe-order" property in
simplebus child nodes in the .dts file.

This was motivated by booting FreeBSD from the eMMC on a BeagleBone Black,
which has a pluggable microSD card slot in addition to the eMMC.  The order
that the mmc units are defined in sys/boot/fdt/dts/am335x.dtsi causes the
pluggable slot to be probed/attached first, so the device name assigned to
the eMMC soldered to the board changes depending on whether there is a card
in the pluggable slot, which makes establishing appropriate /etc/fstab
contents less than convenient.

By using the "probe-order" property in
sys/boot/fdt/dts/beaglebone-black.dts (see attached
beaglebone_black_mmc_probe_order.patch), I am able to swap the order in
which the mmc units are probed/attached for that board.  This avoids
inappropriate hacking of the mmc definition order in am335x.dtsi, which is
shared among multiple boards.

This is not a general solution to the problem of wanting stable device
names for hard-wired MMC devices when pluggable slots are present in the
system.  There could, for example, be a multi-slot MMC controller with a
mixture of hard-wired and pluggable devices attached, and this would not
address that case.  However, it does address the needs of BeagleBone Black,
and the mechanism may be of use for similar issues on other platforms.

Both patches were generated against 10-STABLE, r262447.

-Patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fdt_probe_order_control.patch
Type: application/octet-stream
Size: 2091 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140302/c3b9133c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: beaglebone_black_probe_order.patch
Type: application/octet-stream
Size: 450 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140302/c3b9133c/attachment-0001.obj>


More information about the freebsd-hackers mailing list