Skip to contentSkip to conversation

Mem mapped i/o in RTDM driver

Xenomai-help jeff angielski 2 participants 4 messages Apr 23, 2009 – Apr 30, 2009

lore
Share & tools
lore
#0 lore raw

A basic RTDM question:

In a normal Linux device driver you typically use request_mem_region() and ioremap_nocache() to setup access to some memory mapped i/o. Then you just iowrite()/ioread() to/from that address.

Do I still do this for the XXXXX_nrt operations in my RTDM driver?

How about for the XXXX_rt operations?

I do see that gpioirqbench uses the Linux memory management indirectly since it relies on the OF mpc52xx_find_and_map("mpc5200-gpio") but because the driver supports both Linux and RTDM, the requirements are not clear.

Thanks.

Signature · 3 lines
Jeff Angielski
The PTR Group
www.theptrgroup.com
#1 lore raw
Quoted 7 lines · jeff angielski

A basic RTDM question:

In a normal Linux device driver you typically use request_mem_region() and ioremap_nocache() to setup access to some memory mapped i/o. Then you just iowrite()/ioread() to/from that address.

Do I still do this for the XXXXX_nrt operations in my RTDM driver?

Yes.

Quoted 3 lines

How about for the XXXX_rt operations?

ioread/iowrite will be usable the same way, but you will have to ioremap() in a non RT context first.

Quoted 4 lines

I do see that gpioirqbench uses the Linux memory management indirectly since it relies on the OF mpc52xx_find_and_map("mpc5200-gpio") but because the driver supports both Linux and RTDM, the requirements are not clear.

Care is taken to always refer to MPC52xx_GPIO from a plain Linux context.

Quoted 4 lines

Thanks.

Signature · 1 line
Philippe.
#2 lore raw
In reply to jeff angielski
Quoted 5 lines · jeff angielski

A basic RTDM question:

In a normal Linux device driver you typically use request_mem_region() and ioremap_nocache() to setup access to some memory mapped i/o. Then you just iowrite()/ioread() to/from that address.

Btw, maybe readb/w/l() and writeb/w/l() are more appropriate since ioread/write is a legacy interface?

Quoted 13 lines

Do I still do this for the XXXXX_nrt operations in my RTDM driver?

How about for the XXXX_rt operations?

I do see that gpioirqbench uses the Linux memory management indirectly since it relies on the OF mpc52xx_find_and_map("mpc5200-gpio") but because the driver supports both Linux and RTDM, the requirements are not clear.

Thanks.

Signature · 1 line
Philippe.
#3 lore raw
Quoted 9 lines · Philippe Gerum
Quoted 5 lines · jeff angielski

A basic RTDM question:

In a normal Linux device driver you typically use request_mem_region() and ioremap_nocache() to setup access to some memory mapped i/o. Then you just iowrite()/ioread() to/from that address.

Btw, maybe readb/w/l() and writeb/w/l() are more appropriate since ioread/write is a legacy interface?

i.e. in MMIO mode.

Quoted 14 lines
Quoted 14 lines

Do I still do this for the XXXXX_nrt operations in my RTDM driver?

How about for the XXXX_rt operations?

I do see that gpioirqbench uses the Linux memory management indirectly since it relies on the OF mpc52xx_find_and_map("mpc5200-gpio") but because the driver supports both Linux and RTDM, the requirements are not clear.

Thanks.

Signature · 1 line
Philippe.