How to handle pinmux in libbsd (was: Re: [PATCH 10/10] TI Pinmux : Port to RTEMS)

Vijay Kumar Banerjee vijaykumar9597 at gmail.com
Tue Jul 30 18:33:45 UTC 2019


On Tue, Jul 30, 2019 at 9:29 PM Gedare Bloom <gedare at rtems.org> wrote:

> On Tue, Jul 30, 2019 at 12:40 AM Christian Mauderer
> <christian.mauderer at embedded-brains.de> wrote:
> >
> > On 29/07/2019 22:11, Gedare Bloom wrote:
> > > We had a GSoC project about GPIO API implemented for RPi.
> > >
> > > https://devel.rtems.org/wiki/GSoC/2013/Raspberry_Pi_BSP_Peripherals
> >
> > Hello Gedare,
> >
> > thanks for the hint. It seems that someone used at least the
> > <bsp/gpio.h> for BBB too (in bsps/arm/beagle/gpio/bbb-gpio.c). But it
> > seems that RPi and BBB are the only BSPs using the API.
> >
> > So it would be necessary to find out in what state the API is (is it
> > general enough to theoretically support every BSP; is the support in BBB
> > in a usable state) and if yes it would be worth to implement a fdt GPIO
> > initialization based on that API.
> >
> > I'll try to take a look at that in the next few days (most likely more
> > toward the weekend). Depending on the amount of work, it could be worth
> > to just implement it or put it in a future GSoC project.
> >
> I'm sure it could be expanded to a full project by trying to
> generalize it, and by mapping for example the arduino wiring APIs over
> it.
>
>
> Hi,
I came up with a hack to allow the pinmuxing of only the HDMI pins. This
can be
used as a hack for the drivers until we have a clean permanent solution.

I wrote an overlay to add a field "rtems-pinctrl-0" in the device tree and
parsed this
property from the fdt_pinctrl file, instead of the default property name.
This enables
the initialization of only the tda pins. I have tested this with my sample
app and it
works properly with the screen.

the device tree overlay:
https://gist.github.com/thelunatic/dd274cb423ea6d3bfbf4c6b06496126c

The diff:
```
diff --git a/freebsd/sys/dev/fdt/fdt_pinctrl.c
b/freebsd/sys/dev/fdt/fdt_pinctrl.c
index c2e0c612..515325aa 100644
--- a/freebsd/sys/dev/fdt/fdt_pinctrl.c
+++ b/freebsd/sys/dev/fdt/fdt_pinctrl.c
@@ -131,8 +131,13 @@ pinctrl_configure_children(device_t pinctrl, phandle_t
parent)
  if (!ofw_bus_node_status_okay(node))
  continue;
  pinctrl_configure_children(pinctrl, node);
+#ifdef __rtems__
+ nconfigs = OF_getencprop_alloc_multi(node, "rtems-pinctrl-0",
+    sizeof(*configs), (void **)&configs);
+#else
  nconfigs = OF_getencprop_alloc_multi(node, "pinctrl-0",
     sizeof(*configs), (void **)&configs);
+#endif /* __rtems__ */
  if (nconfigs <= 0)
  continue;
  if (bootverbose) {

```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190731/2cc2c04f/attachment.html>


More information about the devel mailing list