]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r355598, r355727, r355735, r355858
authorIan Lepore <ian@FreeBSD.org>
Sun, 22 Dec 2019 19:30:13 +0000 (19:30 +0000)
committerIan Lepore <ian@FreeBSD.org>
Sun, 22 Dec 2019 19:30:13 +0000 (19:30 +0000)
commit4c3987c8857473c252dbe9995c770e4f95ffd0c8
treefa1cc2cee9f3ea909a2f251ad226770c7e592445
parent232601e306fc2c3418eee55c01d0154dcf784323
MFC r355598, r355727, r355735, r355858

r355598:
Do not attach children of owc_gpiobus until interrupts are working.

The children of the bus need to do IO on the bus to probe for hardware
presence.  Doing IO means timing the bus states using sbinuptime(), and
that requires working timecounters, which are not initialized until after
device attachment has completed.

PR: 242526

r355727 (by imp):
Create new wrapper function: bus_delayed_attach_children()

Delay the attachment of children, when requested, until after interrutps are
running. This is often needed to allow children to run transactions on i2c or
spi busses. It's a common enough idiom that it will be useful to have its own
wrapper.

Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D21465

r355735 (by imp):
Be consistent about checking return value from bus_delayed_attach_children.

Most places checked, but a couple last minute changes didn't. Make them all use
the return value.

Noticed by: rpokala@

r355858:
Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.

It used to be required that a device be a child of gpiobus(4) to manipulate
gpio pins. That requirement didn't work well for FDT-based systems with many
cross-hierarchy users of gpio, so a more modern framework was created that
removed the old hierarchy requirement.

These changes adapt the owc_gpiobus driver to use the newer gpio_pin_*
functions to acquire, release, and manipulate gpio pins. This allows a
single driver to work for both hinted-attachment and fdt-based systems, and
removes the requirement that any one-wire fdt nodes must appear at the root
of the devicetree.

Differential Revision: https://reviews.freebsd.org/D22710
share/man/man9/Makefile
share/man/man9/bus_delayed_attach_children.9 [new file with mode: 0644]
sys/arm/broadcom/bcm2835/bcm2835_bsc.c
sys/arm/freescale/imx/imx_i2c.c
sys/arm/freescale/imx/imx_spi.c
sys/arm/ti/ti_i2c.c
sys/dev/glxiic/glxiic.c
sys/dev/ichsmb/ichsmb.c
sys/dev/ow/owc_gpiobus.c
sys/kern/subr_bus.c
sys/sys/bus.h