Trying to get a 1PPS GPS interrupt going on IRQ7/40 for TS7260!
We read all the notes in EP9301 User's Guide, in particular
the bottom of page 525 seems important. We have been inspecting
the driver's results using a user-space mapping of /dev/mem,
but now we have simplified, we use the /dev/mem technique sans
the driver and the interrupt keeps getting disabled!?
Simple user space code:
int val = 0x00000004, cuz;
int fd = open("/dev/mem", O_RDWR|O_SYNC);
gpio_ptr = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x80840000);
PFDR = (unsigned int *)(gpio_ptr + 0x30); // port f data register
PFDDR = (unsigned int *)(gpio_ptr + 0x34); // port f direction register
GPIOFIntEn = (unsigned int *)(gpio_ptr + 0x58);
GPIOFIntType1 = (unsigned int *)(gpio_ptr + 0x4C);
GPIOFIntType2 = (unsigned int *)(gpio_ptr + 0x50);
GPIOFDB = (unsigned int *)(gpio_ptr + 0x64); // debounce on port f
/* Exactly as given on pp 525 */
cuz = *GPIOFIntEn; cuz &= ~val; *GPIOFIntEn = cuz;
cuz = *PFDDR; cuz &= ~val; *PFDDR = cuz;
cuz = *GPIOFIntType1; cuz |= val; *GPIOFIntType1 = cuz;
cuz = *GPIOFIntType2; cuz |= val; *GPIOFIntType2 = cuz;
cuz = *GPIOFIntEn; cuz |= val; *GPIOFIntEn = cuz;
printf( "Aft: PFDR=0x%x PFDDR=0x%x GPIOFDB=0x%x GPIOFIntEn=0x%x
GPIOFIntType1=0x%x GPIOFIntType2=0x%x\n", *PFDR, *PFDDR, *GPIOFDB, *GPIOFIntEn,
*GPIOFIntType1, *GPIOFIntType2 );
___________________________
The first time it runs, we achieve nada:
Aft: PFDR=0xff PFDDR=0x0 GPIOFDB=0x0 GPIOFIntEn=0x0 GPIOFIntType1=0x0
GPIOFIntType2=0x0
But the second time it runs immediately after, we get:
Aft: PFDR=0xff PFDDR=0x0 GPIOFDB=0x0 GPIOFIntEn=0x4 GPIOFIntType1=0x4
GPIOFIntType2=0x4
Now this looks good! But when we run the /dev/mem reader immediately following
that, we get:
PFDR=0xff PFDDR=0x0 GPIOFDB=0x0 GPIOFIntEn=0x0 GPIOFIntType1=0x0
GPIOFIntType2=0x0
Disabled by what? This is Matthieu's stock 2.6.29.1, lsmod: 8250, tsscard,
rtc_ep93xx, the rest the usual suspects.
Any ideas? Thanks
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|