linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Configure CPM2 PORTC pin (PC9) for external interrupt?
@ 2009-08-14 14:27 Baojun Wang
  2009-08-14 22:39 ` Guillaume Knispel
  0 siblings, 1 reply; 3+ messages in thread
From: Baojun Wang @ 2009-08-14 14:27 UTC (permalink / raw)
  To: linuxppc-dev

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

hi, list:

  I need to configure CPM2 PORTC pin (PC9) for external interrupt, when I
read the MPC8555ERM.pdf and cpm2-pic.c, I find that PC9 interrupt number is
56, and I request the IRQ in this way:

  hw_irq = 56;
  virq = irq_create_mapping(cpm2_host, hw_irq);

  reqeust_irq(virq, ...);

  I can request the irq successfully, but the interrupt is never generated
(ISR is not called) to the PC9 pins, even though the hardware said an
interrupt was raised. (the hardware have a register with a special bit)

  Should I configure the cpm2 io port first to allow PORTC interrupt? I have
read the cpm2 io port documentation, and I initialize the PC9 as:

  PPARC[pc9_bit] = 0;    /* for general purpose IO, not dedicated */
  PSORC[pc9_bit] = 0;    /* no special option */
  PDIRC[pc9_bit] = 0;     /* for both input/output */

  Am I missing some thing? Any suggestion will be greatly appreciated.

  Best Regards,
- Wang

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Configure CPM2 PORTC pin (PC9) for external interrupt?
  2009-08-14 14:27 Configure CPM2 PORTC pin (PC9) for external interrupt? Baojun Wang
@ 2009-08-14 22:39 ` Guillaume Knispel
  2009-08-15  4:32   ` Baojun Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Knispel @ 2009-08-14 22:39 UTC (permalink / raw)
  To: Baojun Wang; +Cc: linuxppc-dev

On Fri, 14 Aug 2009 22:27:39 +0800
Baojun Wang <wangbj.ml@gmail.com> wrote:

>   I need to configure CPM2 PORTC pin (PC9) for external interrupt, when I
> read the MPC8555ERM.pdf and cpm2-pic.c, I find that PC9 interrupt number is
> 56, and I request the IRQ in this way:
> 
>   hw_irq = 56;
>   virq = irq_create_mapping(cpm2_host, hw_irq);
> 
>   reqeust_irq(virq, ...);
> 
>   I can request the irq successfully, but the interrupt is never generated
> (ISR is not called) to the PC9 pins, even though the hardware said an
> interrupt was raised. (the hardware have a register with a special bit)
> 
>   Should I configure the cpm2 io port first to allow PORTC interrupt? I have
> read the cpm2 io port documentation, and I initialize the PC9 as:
> 
>   PPARC[pc9_bit] = 0;    /* for general purpose IO, not dedicated */
>   PSORC[pc9_bit] = 0;    /* no special option */
>   PDIRC[pc9_bit] = 0;     /* for both input/output */
> 
>   Am I missing some thing? Any suggestion will be greatly appreciated.

Hi,

Have a look on commit 7f3ea17f316577e31db868f720ac575c74d20163, which
fixes a linux bug about Port C interrupts

Also note that the 8555 have the same issue that the 8272 about
PC2 / PC3 missing which shifts other vectors, but I don't know if 56
for PC9 take that into account.

PS: in the future make sure to include your Linux version number, so we
know if an issue apply or not.

-- 
Guillaume KNISPEL

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Configure CPM2 PORTC pin (PC9) for external interrupt?
  2009-08-14 22:39 ` Guillaume Knispel
@ 2009-08-15  4:32   ` Baojun Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Baojun Wang @ 2009-08-15  4:32 UTC (permalink / raw)
  To: Guillaume Knispel; +Cc: linuxppc-dev

hi, Guillaume

    Thank you very much. the kernel I'm using is linux-2.6.21 (for the
target system), actually I have also read 2.6.30 source code, but I
didn't find the change, and I think the problem was caused by fault
configuration of the PORTC io-port. The commit you mentioned haven't
applied for 2.6.21.

    Next time I will include the exact kernel version (and related)
info, many thanks again.

    Best Regards,
Wang Baojun

On Sat, Aug 15, 2009 at 6:39 AM, Guillaume Knispel
<gknispel@proformatique.com> wrote:
>
> On Fri, 14 Aug 2009 22:27:39 +0800
> Baojun Wang <wangbj.ml@gmail.com> wrote:
>
> > =A0 I need to configure CPM2 PORTC pin (PC9) for external interrupt, wh=
en I
> > read the MPC8555ERM.pdf and cpm2-pic.c, I find that PC9 interrupt numbe=
r is
> > 56, and I request the IRQ in this way:
> >
> > =A0 hw_irq =3D 56;
> > =A0 virq =3D irq_create_mapping(cpm2_host, hw_irq);
> >
> > =A0 reqeust_irq(virq, ...);
> >
> > =A0 I can request the irq successfully, but the interrupt is never gene=
rated
> > (ISR is not called) to the PC9 pins, even though the hardware said an
> > interrupt was raised. (the hardware have a register with a special bit)
> >
> > =A0 Should I configure the cpm2 io port first to allow PORTC interrupt?=
 I have
> > read the cpm2 io port documentation, and I initialize the PC9 as:
> >
> > =A0 PPARC[pc9_bit] =3D 0; =A0 =A0/* for general purpose IO, not dedicat=
ed */
> > =A0 PSORC[pc9_bit] =3D 0; =A0 =A0/* no special option */
> > =A0 PDIRC[pc9_bit] =3D 0; =A0 =A0 /* for both input/output */
> >
> > =A0 Am I missing some thing? Any suggestion will be greatly appreciated=
.
>
> Hi,
>
> Have a look on commit 7f3ea17f316577e31db868f720ac575c74d20163, which
> fixes a linux bug about Port C interrupts
>
> Also note that the 8555 have the same issue that the 8272 about
> PC2 / PC3 missing which shifts other vectors, but I don't know if 56
> for PC9 take that into account.
>
> PS: in the future make sure to include your Linux version number, so we
> know if an issue apply or not.
>
> --
> Guillaume KNISPEL

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-15  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-14 14:27 Configure CPM2 PORTC pin (PC9) for external interrupt? Baojun Wang
2009-08-14 22:39 ` Guillaume Knispel
2009-08-15  4:32   ` Baojun Wang

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).