All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: CF <cfoissac@free.fr>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] RTDM for a GPIO line in RT mode
Date: Thu, 23 May 2013 09:14:09 +0200	[thread overview]
Message-ID: <519DC1C1.3020005@xenomai.org> (raw)
In-Reply-To: <519D4262.2070206@free.fr>

On 05/23/2013 12:10 AM, CF wrote:

> Hello,
> 
> Despite my munerous reading, i'm locked in how to perform a basic RTDM
> for a simple ppc board.
> 
> This is a simple pin level setting. The linux kernel module i developped
> follow theses steps:
> -reading DTS for IOCTL et GPIOCTL base adress registers
> - out_be32(addr, value) at theses register to set line as an output and
> then set the logical level with setbits32(addr, bit) or clrbits32(addr,bit)
> 
> Basically, it works but in NRT  ops modes, so i'm unable (or at least i
> lack indication) to do this in RT ops mode (i don't think it is
> important, but i use ioctl to make my changes). I based my work on
> tut01/tut02 drivers, except i end up in using ioctl instead or
> read/write in the RTDM driver.
> 
> I guess i still could read the DTS in nrt mode (because it is done at
> rtdm_dev_register() time and won't interfere with RT task), but how can
> i drive the hardware directly in RT op mode ?


Hi,

I am not sure I understand the problem you have. If the board you use
uses gpiolib (I do not know if gpiolib is customary on ppc), you simply
have to check that the gpiolib callbacks do not use any Linux services
which can not be called from RT mode (if it uses a spinlock, the usual
method is to turn the spinlock into an I-pipe spinlock, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#GPIOs_in_real-time_drivers)

If you are accessing directly the GPIO controller registers, and need a
"read-modify-write" operation, which what you posted seem to suggest,
you probably want to put a spinlock around these operations, but apart
from that, you can do this from an RT driver ioctl callback.

Regards.

-- 
                                                                Gilles.


  reply	other threads:[~2013-05-23  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 22:10 [Xenomai] RTDM for a GPIO line in RT mode CF
2013-05-23  7:14 ` Gilles Chanteperdrix [this message]
2013-05-25 10:28   ` CF
2013-05-25 11:22     ` Gilles Chanteperdrix
2013-05-25 11:38       ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519DC1C1.3020005@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=cfoissac@free.fr \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.