How to define pins as open-collector?

Andrew Jeffery andrew at aj.id.au
Sun Jul 23 09:18:55 AEST 2017


Hi David,

On Sat, Jul 22, 2017, at 18:02, David Müller (ELSOFT AG) wrote:
> Hello
> 
> On our design we have several signals between the BMC and the rest of
> the system which are driven by more than one source, therefore the
> correspondig pins have to be defined as open-collector.
> 
> How can I define a pin as open-collector in the OpenBMC board wiring
> conf file?

If you're trying to do this via the python machine config file then it
looks like you're out of luck, as the GPIO sysfs interface doesn't
support configuring a pin in single-ended mode. Open-collector needs the
single-ended and active-low properties configured on the pin. The sysfs
interface does support setting active low, but it's not quite enough.

For GPIOs requested by kernel drivers it's specified  through the
devicetree via the bindings:

https://github.com/openbmc/linux/blob/dev-4.10/Documentation/devicetree/bindings/gpio/gpio.txt

There is a helper header you can include in the dts files that defines
the GPIO_OPEN_DRAIN flags macro, which will configure the pin as you
need.

https://github.com/openbmc/linux/blob/dev-4.10/include/dt-bindings/gpio/gpio.h

Hope that helps.

Andrew


More information about the openbmc mailing list