2010-07-21 21:50:24     BF518 cant use the Edge sensitive interrupt!

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-07-21 21:50:24     BF518 cant use the Edge sensitive interrupt!

zhang zhihua (CHINA)

Message: 91541   

 

Hi,

 

    I want to use BF518's GPIO PH2 to request a interrupt ,I request is like this:

 

  request_irq (IRQF_PH2,my_task,IRQF_TRIGGER_RISING,DEVICE_NAME,NULL);

 

  static irqreturn_t my_task(int irq,void *dev_id)

 

{

 

printk("This is my_task!\n");

 

return IRQ_HANDLED;

 

}

 

if give a rising edge to the PH2,enter the "my_task()" founction,but I found it cant go out the intrrupt and the system restart!

TranslateQuoteReplyEditDelete

 

 

2010-07-21 23:40:59     Re: BF518 cant use the Edge sensitive interrupt!

Sonic Zhang (CHINA)

Message: 91542   

 

What do you mean "it cant go out the intrrupt"? Do you see "This is my_task!" in the console?

QuoteReplyEditDelete

 

 

2010-07-22 01:22:03     Re: BF518 cant use the Edge sensitive interrupt!

zhang zhihua (CHINA)

Message: 91543   

 

sonic,你好,

 

    我就是让console在每次进入中断都打印一条信息,但是如果我使用上升沿中断的话每次只要我在PH2口点一个高电平它就不停的打印信息,然后操作系统就重启了,使用高电平中断则不会有这样的问题,当把PH2拉低时就退出中断了!

TranslateQuoteReplyEditDelete

 

 

2010-07-22 03:43:23     BF518 cant use the Edge sensitive interrupt!

Michael Hennerich (GERMANY)

Message: 91571    EDGE sensitive interrupts must be acknowledged by clearing the latch bit in the GPIO data registers.

This is done automatically be the generic irq layer

- it calls bfin_gpio_ack_irq() (see blackfin/mach-common/ints-priority.c)

 

Try to modify bfin_gpio_ack_irq() like this to see if it is being called.

 

#if !defined(CONFIG_BF54x)

static void bfin_gpio_ack_irq(unsigned int irq)

{

/* AFAIK ack_irq in case mask_ack is provided

* get's only called for edge sense irqs

*/

if (irq == IRQ_PH2)

printk("%s: Called gpio = %d\n", irq_to_gpio(irq));

 

set_gpio_data(irq_to_gpio(irq), 0);

}

QuoteReplyEditDelete

 

 

2010-07-22 03:53:58     BF518 cant use the Edge sensitive interrupt!

Michael Hennerich (GERMANY)

Message: 91572    Typo -__func__ arg missing...

 

if (irq == IRQ_PH2)

printk("%s: Called gpio = %d\n",__func__, irq_to_gpio(irq));

QuoteReplyEditDelete

 

 

2010-07-22 04:52:10     Re: BF518 cant use the Edge sensitive interrupt!

zhang zhihua (CHINA)

Message: 91573   

 

Hi,Michael,

 

    It has not been called!

TranslateQuoteReplyEditDelete

 

 

2010-07-22 05:03:31     Re: BF518 cant use the Edge sensitive interrupt!

Michael Hennerich (GERMANY)

Message: 91574    What kernel (release?, svn?) version are you using?

QuoteReplyEditDelete

 

 

2010-07-22 05:29:18     Re: BF518 cant use the Edge sensitive interrupt!

zhang zhihua (CHINA)

Message: 91576   

 

release 2009R1!

TranslateQuoteReplyEditDelete

 

 

2010-07-22 05:36:13     Re: BF518 cant use the Edge sensitive interrupt!

Michael Hennerich (GERMANY)

Message: 91577    Works for me - see below.

 

root:/> bfin_gpio_ack_irq: Called gpio = 34

This is my_task!

bfin_gpio_ack_irq: Called gpio = 34

This is my_task!

 

root:/> version

kernel: Linux release 2.6.28.10-ADI-2009R1.1-svn8988, build #611 Thu Jul 22 11:25:00 CEST 2010

toolchain: bfin-uclinux-gcc release gcc version 4.3.5 (ADI-trunk/svn-4700)

user-dist: release svn-9613, build #286 Thu Jul 22 11:24:40 CEST 2010

 

root:/> cat /proc/cpuinfo

processor : 0

vendor_id : Analog Devices

cpu family : 0x27e8

model name : ADSP-BF518 400(MHz CCLK) 80(MHz SCLK) (mpu off)

stepping : 0

cpu MHz : 400.000/80.000

bogomips : 796.67

Calibration : 398336000 loops

cache size : 16 KB(L1 icache) 32 KB(L1 dcache-wb) 0 KB(L2 cache)

dbank-A/B : cache/cache

icache setup : 4 Sub-banks/4 Ways, 32 Lines/Way

dcache setup : 2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/Way

board name : ADI BF518F-EZBRD

board memory : 65536 kB (0x00000000 -> 0x04000000)

kernel memory : 64504 kB (0x00001000 -> 0x03eff000)

 

root:/>

 

From top of my head I don't know if we fixed a bug related to this on the 2009R1 branch -

I would try to update to branch 2009R1 head.

 

-Michael

QuoteReplyEditDelete

 

 

2010-07-22 20:46:30     Re: BF518 cant use the Edge sensitive interrupt!

zhang zhihua (CHINA)

Message: 91628   

 

Hi,Michael,

 

root:/> version

kernel:    Linux release 2.6.28.10-ADI-2009R1, build #475 Wed Jul 21 19:04:26 PD

T 2010

toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release 2009R1, build #245 Mon Jul 19 22:05:35 PDT 2010

 

root:/> cat /proc/cpuinfo

processor       : 0

vendor_id       : Analog Devices

cpu family      : 0x27e8

model name      : ADSP-BF518 400(MHz CCLK) 80(MHz SCLK) (mpu off)

stepping        : 1

cpu MHz         : 400.000/80.000

bogomips        : 794.62

Calibration     : 397312000 loops

cache size      : 16 KB(L1 icache) 32 KB(L1 dcache-wb) 0 KB(L2 cache)

dbank-A/B       : cache/cache

icache setup    : 4 Sub-banks/4 Ways, 32 Lines/Way

dcache setup    : 2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/Way

board name      : ADI BF518F-EZBRD

board memory    : 32768 kB (0x00000000 -> 0x02000000)

kernel memory   : 31736 kB (0x00001000 -> 0x01eff000)

Attachments

    Outcomes