Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jul 2012 19:14:28 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Interfacing devices with multiple parents within newbus
Message-ID:  <CACqU3MU6iv%2Bo26fCdL5M6Kg6XMM1uZPih5FBiBKPOD9WDx%2BNGg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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@50004000 { /* ESDHC1 */
        cd-gpios = <&gpio2 13 0>; /* GPIO3_13 */
        wp-gpios = <&gpio3 11 0>; /* GPIO4_11 */
        status = "okay";
};

or:

ecspi@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@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 ?

Thanks,
 - Arnaud

[0]: as a matter of comparison, old PXA27x have up to 121 GPIOs



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MU6iv%2Bo26fCdL5M6Kg6XMM1uZPih5FBiBKPOD9WDx%2BNGg>