GSoC Linux UIO driver for PRU

Nils Hölscher nilhoel1 at gmail.com
Mon Jul 15 08:10:04 UTC 2019


Thanks this is very helpful.
But has anyone an existing example of a similar driver?
I wasn't able find one in /bsps, maybe I didn't search long enough.

On Mon, 15 Jul 2019 at 08:47, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 14/07/2019 01:34, Joel Sherrill wrote:
> > On Sat, Jul 13, 2019 at 1:42 PM Chris Johns <chrisj at rtems.org
> > <mailto:chrisj at rtems.org>> wrote:
> >
> >
> >
> >     On 13/7/19 5:16 pm, Nils Hölscher wrote:
> >      > Hi,
> >      >
> >      > After I made sure that my fdt is correct I wondered why the pruss
> >     was still not
> >      > accessible.
> >      > When I researched more about userspace drivers in Linux I found
> >     out, that I have
> >      > overseen the pru UIO module in Linux.
> >      > This is the part that links the PRUs to the /dev/uio[0-7].
> >      > Which then would be used by the sources I currently use.
> >      > The UIO source is available here:
> >      >
> https://github.com/beagleboard/linux/blob/3.8/drivers/uio/uio_pruss.c
> >      > However this requires the linux UIO lib to load the modules and
> >     abstract the
> >      > device into a file.
> >      >
> >      > While researching I also found that BSD has a PRU driver.
> >      > Also this driver is more feature rich as it support PRU debugging.
> >      > The sources can be found her:
> >      > https://bitbucket.org/rpaulo/libpru/src/default/
> >      > Additionally I found these sources in the FreeBSD tree:
> >      >
> >
> https://github.com/freebsd/freebsd/blob/250e158ddf52459661439141407bca505d199c19/sys/arm/ti/ti_pruss.c
> >      > This code also registers the PRUs in /dev/.
> >      > On the other hand the BSD drivers have no documentation at all.
> >      >
> >      > These are the code lines that will fail without a file in /dev.
> >      > Linux:
> >     https://github.com/nilhoel1/rtems-pru/blob/master/ti/prussdrv.c#L265
> >      > BSD:
> >
> https://bitbucket.org/rpaulo/libpru/src/5cb7271533a96d177e73492f7cc40fa4b28396a5/ti-pru.c#lines-614
> >      >
> >      > So my questions are:
> >      > 1. How are drivers registered to /dev in RTEMS? (examples)
> >
> >     I suggest you look at cpukit/include/rtems/io.h and then for
> >     examples of this
> >     interface being used in the bsp directory.
> >
> >
> > There is a helper in the IO Manager which is implemented as a call to
> > mknod()
> > which is a standard call.
>
>
> In libbsd devices should be added with IMFS_make_generic_node():
>
> freebsd/sys/net/bpf.c:  rv = IMFS_make_generic_node("/dev/bpf", mode,
> &bpf_imfs_control, NULL);
> freebsd/sys/kern/uipc_usrreq.c: rv = IMFS_make_generic_node(soun->sun_path,
> rtemsbsd/sys/fs/devfs/devfs_devs.c:     rv =
> IMFS_make_generic_node(dev->si_path, mode, &devfs_imfs_control,
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190715/73f41852/attachment-0002.html>


More information about the devel mailing list