omap irda problem
Hello all,
I am using omap5910 and kernel 2.6.8.1. I am supposed to make IrDa operational so I can communicate with other devices (for example: desktop PC using some terminal emulation program).
Is there any open sorce avaible for that? Could anyone give some advice how to start dealing with this issue (I am beginning from zero)
Thanx :-)
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Hi,
Quoted 3 lines · Zgembo Adislic
Hello all,
I am using omap5910 and kernel 2.6.8.1. I am supposed to make IrDa operational so I can communicate with other devices (for example: desktop PC using some terminal emulation program).
Is there any open sorce avaible for that? Could anyone give some advice how to start dealing with this issue (I am beginning from zero)
There's the OMAP IrDA driver in drivers/net/irda/omap-ir.c that supports 16xx and some other CPUs, but not any of 15xx out of the box. I don't know if it's as old as 2.6.8.1 but you'll probably want to upgrade your tree anyway if you want to start modifying it.
Now I have a OMAP 311 (which is 15xx) and I have been playing with this driver and I eventually got it to work (or it seems like it), with a couple of rather simple changes so it's possible that it will also work on your processor. Here are the main changes I had to make in omap-ir.c (writing from memory, I don't have the code here):
1) In the irq handler the driver accesses a DMA register directly to check how many bytes were received. The register is called something like CPDC and it turns out that 15xx have a different register at this address so wrong data is returned. This is because 15xx has only one CPC register per channel and 16xx and the other CPUs have separate registers for source addresses and destination addresses called CPSC and CPDC respectively (or similar). So, either change the irda driver to use CPSC, cause 15xx's CPC has the same offset, or better add proper register names for 15xx in include/asm/arch/dma.h and use these. (The 15xx and 16xx DMAs also differ in other places which causes many accesses to non-existent registers in dma.c. I have patches for this)
Another idea is to use the IrDA (UART3) registers to retrieve last frame length instead of DMA registers.
2) It seems that the DMA receives always (frame length + 1) bytes instead of (frame length + 2) on my device so replace the "w - 2" with "w - 1" in the driver. However, this is strange because the documentation says that two bytes of CRC are written in the buffer with each frame.
3) I don't receive the TX Underrun interrupt, so I placed the netif_queue_wake() call in the TX dma callback. This, however, makes the driver start sending some frames too early and they overwrite endings of previous frames, at high traffic. I prevent it by polling the registers until the TX fifo drains, maybe I can find a better way later.
4) The driver leaves the OSC_12M_SEL register untouched so I zero it at init. You can skip this if you're sure that no other OS was running before Linux after machine reset. Or set OSC_12M_SEL and divide baud rate appropriately.
I also changed the driver to use the clk_* api instead of writing to clock registers.
I can't show you any code because I'm away from my computer (call it holidays...). I didn't manage to get irlan/ircomm/obex to work but it's likely that my other device was responsible, to which I was trying to connect. I just don't know which end is more broken now. Maybe it was an irda-utils version mismatch or something.
I tested rx and tx with some generated frames and they were usually transmitted correctly. I hacked up a fake tty driver on top of omap-ir.c and it works for a remote console.
Hope this helps.
Quoted 11 lines
Thanx :-)
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source
Signature · 1 line
balrog 2oo6
informaton about gpio of omap
hi:
i'd ever met with problems of omap's gpio.it'd confused me. but i find some
useful information about it now.
it 'll be helpful for fresh man as me!
http://tree.celinuxforum.org/CelfPubWiki/OSK . in the homepage,you can find information about gpio.
good luck
problem about io.h file!!!!
hi:
i 'd written a simeple program.and i'd found some questions about io.h.
the following code is:
that:
#include<asm/arch/gpio.h>main()
{omap_request_gpio(3);omap_set_gpio_direction(3,1);
}
compile command :
arm-linux-gcc -I linux-2.6.13.4/include -c main.c
and then i got the following error information:
linux-2.6.13.4/include/asm/arch/io.h:91 error:parse error before "offset" linux-2.6.13.4/include/asm/arch/io.h:97 error:parse error before "offset" linux-2.6.13.4/include/asm/arch/io.h:102 error:parse error before "offset".
the toolchains which i used is gcc-3.4.1 for omap 5912,and the kernel is linux-2.6.13.4 for osk.
Is the file wrong? i'm not sure about it!!!!!!!
who has interest in it? i hope to get your help.
Re: problem about io.h file!!!!
Quoted 7 lines · w.b.b
that:
#include<asm/arch/gpio.h>main()
{omap_request_gpio(3);omap_set_gpio_direction(3,1);
}
You cannot call these functions in user space. They are available only in kernel. Write a simple char driver to use them.
stefano
Signature · 3 lines
stefano <[email protected]> GPG Key: 0x55814DDE Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE
Is there wrong with the file :io.h????????
In reply to w.b.b hi:
i 'd written a simeple program.and i'd found some questions about io.h.
the following code is:
that:
#include<asm/arch/gpio.h>main()
{omap_request_gpio(3);omap_set_gpio_direction(3,1);
}
compile command :
arm-linux-gcc -I linux-2.6.13.4/include -c main.c
and then i got the following error information:
linux-2.6.13.4/include/asm/arch/io.h:91 error:parse error before "offset" linux-2.6.13.4/include/asm/arch/io.h:97 error:parse error before "offset" linux-2.6.13.4/include/asm/arch/io.h:102 error:parse error before "offset".
the toolchains which i used is gcc-3.4.1 for omap 5912,and the kernel is linux-2.6.13.4 for osk.
Is the file wrong? i'm not sure about it!!!!!!!
who has interest in it? i hope to get your help.
Re: Is there wrong with the file :io.h????????
i had found the way to avoid the error. modify the file asm/arch/io.h.
to change the data types ,such as u8,u16,u32 with uint8_t,uint16_t,uint32_t. then there is no error when you compile that file.
i think there is a little bug in the io.h!!!
----- Original Message -----
From: "w.b.b" <[email protected]>
To: <[email protected]>
Sent: Tuesday, September 19, 2006 4:54 PM
Subject: Is there wrong with the file :io.h????????
Quoted 11 lines
hi:
i 'd written a simeple program.and i'd found some questions aboutio.h. the following code is:
that:
#include<asm/arch/gpio.h>main()
{omap_request_gpio(3);omap_set_gpio_direction(3,1);
}
compile command :
Quoted 11 lines
arm-linux-gcc -I linux-2.6.13.4/include -c
main.c
and then i got the following error information:linux-2.6.13.4/include/asm/arch/io.h:91error:parse error before "offset"linux-2.6.13.4/include/asm/arch/io.h:97error:parse error before "offset"linux-2.6.13.4/include/asm/arch/io.h:102error:parse error before "offset".
the toolchains which i used is gcc-3.4.1 for omap 5912,and the kernel is linux-2.6.13.4 for osk. Is the file wrong? i'm not sure about it!!!!!!!
who has interest in it? i hope to get your help.
--------------------------------------------------------------------------------
Quoted 5 lines
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source
Re: Is there wrong with the file :io.h????????
Hi,
I think you need to create a char driver in order to use the GPIO APIs. In this way you can already control GPIO in the userspace through your char driver. There are many linux device driver books that you could refer to make a char driver.
Best Regards,
OJ
Quoted 31 lines · --- "w.b.b
i had found the way to avoid the error. modify the file
asm/arch/io.h.
to change the data types ,such as u8,u16,u32 with
uint8_t,uint16_t,uint32_t.
then there is no error when you compile that file. i think there is a little bug in theio.h!!!----- Original Message -----
From: "w.b.b" <[email protected]>
To: <[email protected]>
Sent: Tuesday, September 19, 2006 4:54 PM
Subject: Is there wrong with the file :io.h????????Quoted 2 lines
hi:
i 'd written a simeple program.and i'd found somequestions about
io.h.Quoted 4 lines
the following code is:
that:
#include<asm/arch/gpio.h>main()Quoted 8 lines
{
omap_request_gpio(3);omap_set_gpio_direction(3,1);
}
compile command :
arm-linux-gcc -I linux-2.6.13.4/include -cmain.c
and then i got the following error information:linux-2.6.13.4/include/asm/arch/io.h:91error:parse error before "offset"
Quoted 1 line
linux-2.6.13.4/include/asm/arch/io.h:97
Quoted 11 lines
error:parse error before "offset"
Quoted 1 line
linux-2.6.13.4/include/asm/arch/io.h:102error:parse error before "offset".
Quoted 1 line
the toolchains which i used is gcc-3.4.1 for omap
5912,and the kernel is linux-2.6.13.4 for osk.
Quoted 2 lines
Is the file wrong? i'm not sure about it!!!!!!!
who has interest in it? i hope to getyour help.
Quoted 2 lines
Quoted 2 lines
http://linux.omap.com/mailman/listinfo/linux-omap-open-source
Quoted 4 lines
Quoted 1 line
Quoted 1 line
--------------------------------------------------------------------------------
Quoted 7 lines
Quoted 6 lines
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source
Quoted 4 lines
Quoted 1 line
Quoted 1 line
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source
Quoted 1 line
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com