linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: bennett78 <bennett78@digis.net>
To: Frank Bennett <bennett78@digis.net>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: mpc5200 timer3 Interrupts stopped working
Date: Fri, 24 Feb 2006 15:49:26 -0700	[thread overview]
Message-ID: <43FF8D76.7030807@digis.net> (raw)
In-Reply-To: <43FF2D69.3030902@digis.net>

[-- Attachment #1: Type: text/plain, Size: 3715 bytes --]

bennett78 wrote:

> Help, how do I debug timer3 Interrupts?  My driver was working and 
> then interrupts

Never mind H/W problem...the J27 jumper on the 5200Lite was missing.  I 
did get a change to
review arch/ppc/kernel/mpc5xxx-pic.c & my interrupt masks settings!

Sorry for the thread interrupt!

Frank Bennett

> stopped coming (most likely blocked).  I have a driver that is very 
> similar to
>      linuxppc_2_4_devel/drivers/char/pp01_ad64.c
> I have attached the complete driver (et.c)
>
> / # insmod et
> ET Display Driver v0.1 loaded ET_TIN irq 16
>
> et_init 00 intr->per_mask  1bfffc00
> et_init 10 intr->ctrl      00c01001
> et_init 14 intr->main_mask 00010e00
> et_init 24 intr->enc_stat  00000001
> et_init 28 intr->crit_stat 00000000
> et_init 2c intr->main_stat 00002000
> et_init 30 intr->per_stat  00000000
> et_init 38 intr->per_error 00000000
>
> / # cat /proc/interrupts
>            CPU0
>  16:          0  MPC5xxx Edge      et Trubine
>  23:       1049  MPC5xxx Edge      eth_xmit
>  24:       2468  MPC5xxx Edge      eth_recv
>  39:         51  MPC5xxx Edge      serial
>  40:          0  MPC5xxx Edge      serial
>  43:         69  MPC5xxx Edge      eth_err
> BAD:          0
>
> with a pulse train on timer3 input "et_interrupt" no longer gets
> called.
>
> code snippets
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> #define ET_TIN         3   // Turbine PULSE IN
>
> static void et_interrupt (int irq, void *dev_id, struct pt_regs * regs)
> {
>     int port = ET_IRQ_TO_PORT(irq);
>     unsigned long stat;
>
>     printk(KERN_INFO "et_interrupt IRQ %d port %d main_stat %x gpt.sr 
> %x \n",
>                         irq, port, intr->main_status, gpt[port].sr );
>
>     if( port == ET_TIN ) {
>         // Clear pending interrupt
>         stat = in_be32(&gpt[port].sr) & 0xffff;
>         out_be32(&gpt[port].sr,  MPC5xxx_GPT_SR_CAPT);
>         printk(KERN_INFO "et_int irq=%d port=%d stat %0lx \n", irq, 
> port, stat);
>         // wake_up_interruptible(&et_wait);
>     } else {
>         printk(KERN_ERR ET_MSG "Unexpected IRQ %d received", irq);
>     }
>     spin_lock (&et_lock);
>     turbine_per = in_be32(&gpt[port].sr) >> 16;
>     spin_unlock (&et_lock);
> }
>
>
> static int __init et_init (void)
> ....
> if (request_irq(ET_PORT_TO_IRQ(ET_TIN), et_interrupt, 0, "et Trubine", 
> NULL)) {
>             printk(KERN_ERR ET_MSG "couldn't register interrupts\n");
>             goto abort_remove_proc;
>     }
> out_be32(&gpt[ET_TIN].cir, (   66<<16) | 1 );  /* prescale(16), 
> period(16)  */
> out_be32(&gpt[ET_TIN].emsr,
>         MPC5xxx_GPT_EMSR_INP_CAPTURE
>       | MPC5xxx_GPT_EMSR_ICT_FALLING
>       | MPC5xxx_GPT_EMSR_INT_ENABLE);
> ...
> printk(KERN_INFO "ET Display Driver v%s loaded ET_TIN irq %d\n",
>         ET_VERSION, ET_PORT_TO_IRQ(ET_TIN) );
>
>     //broke with or without the following
>     intr->main_mask &= ~(0x000000ff);   /* enable timer ints */
>
>     printk(KERN_INFO "et_init 00 intr->per_mask  %08x\n", intr->per_mask);
>     printk(KERN_INFO "et_init 10 intr->ctrl      %08x\n", intr->ctrl);
>     printk(KERN_INFO "et_init 14 intr->main_mask %08x\n", 
> intr->main_mask);
>     printk(KERN_INFO "et_init 24 intr->enc_stat  %08x\n", 
> intr->enc_status);
>     printk(KERN_INFO "et_init 28 intr->crit_stat %08x\n", 
> intr->crit_status);
>     printk(KERN_INFO "et_init 2c intr->main_stat %08x\n", 
> intr->main_status);
>     printk(KERN_INFO "et_init 30 intr->per_stat  %08x\n", 
> intr->per_status);
>     printk(KERN_INFO "et_init 38 intr->per_error %08x\n", 
> intr->per_error);
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> thanks in advance for any help,
>
> Frank Bennett
>

[-- Attachment #2: Type: text/html, Size: 6339 bytes --]

      reply	other threads:[~2006-02-24 22:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-24 15:59 mpc5200 timer3 Interrupts stopped working bennett78
2006-02-24 22:49 ` bennett78 [this message]

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=43FF8D76.7030807@digis.net \
    --to=bennett78@digis.net \
    --cc=linuxppc-embedded@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).