Re: Interfacing devices with multiple parents within newbus

From: Warner Losh <imp_at_bsdimp.com>
Date: Thu, 5 Jul 2012 23:04:19 -0600
On Jul 5, 2012, at 5:14 PM, Arnaud Lacombe wrote:

> Hi folks,
> 
> The problem has been raised in the last BSDCan during a talk, but no
> clear answer has been given. Some (pseudo-)devices might require
> resources from multiple other (pseudo-)devices.
> 
> For example, a device is sitting on an SMBus, but need to access a
> software controlled LED, sitting on a GPIO bus, itself sitting on an
> LPC bus... Or a variant where everything is controlled on the same
> chip, but different GPIO banks. For that specific example, all the
> GPIO pin could be implement on the same GPIObus, however, gpiobus(4)
> is limited to 32 pins and the chip provides 5 banks of 8 pins, ie. a
> total of 40 pins[0]. In the same idea, a device sitting on GPIOs
> controlled by two independant chips, say one being an ICH10R chipset
> on a PCI device function, and the other being a
> SuperIO on an LPC bus.
> 
> This situation make me really dubious that FreeBSD will be able to
> support configuration such as:
> 
> esdhc_at_50004000 { /* ESDHC1 */
>        cd-gpios = <&gpio2 13 0>; /* GPIO3_13 */
>        wp-gpios = <&gpio3 11 0>; /* GPIO4_11 */
>        status = "okay";
> };
> 
> or:
> 
> ecspi_at_50010000 { /* ECSPI1 */
>        fsl,spi-num-chipselects = <2>;
>        cs-gpios = <&gpio1 30 0>, /* GPIO2_30 */
>                   <&gpio2 19 0>; /* GPIO3_19 */
>        status = "okay";
> [...]
> 
> This example is taken from Linux' `arch/arm/boot/dts/imx53-smd.dts'.
> Here, SDHC or SPI controller are using different GPIO devices. Note
> that these GPIO pins does not seem to be multi-function pins as
> another .dts defines ESDHC1 as:
> 
> esdhc_at_50004000 { /* ESDHC1 */
>        cd-gpios = <&gpio2 13 0>; /* GPIO3_13 */
>        wp-gpios = <&gpio2 14 0>; /* GPIO3_14 */
>        status = "okay";
> };
> 
> AFAIK, newbus is unable to model any of the above situation without
> being bypassed one way or another.
> 
> any hints ?

That's not correct.  You don't need a parent-child relationship in newbus to interact with another node in the tree.  You can look up the other node by name, and then call functions based on finding that other device.

Warner
Received on Fri Jul 06 2012 - 03:04:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:28 UTC