* OpenPIC_NumInitSenses
@ 2002-01-24 12:13 Paul Mackerras
2002-01-24 17:54 ` OpenPIC_NumInitSenses Adrian Cox
2002-01-25 2:42 ` OpenPIC_NumInitSenses Dan Malek
0 siblings, 2 replies; 5+ messages in thread
From: Paul Mackerras @ 2002-01-24 12:13 UTC (permalink / raw)
To: linuxppc-dev
Who was it that wanted this horrible hack in open_pic.c?
/* Needed because of the way we overload EPIC on a standard
* Open PIC structure.
*/
if (OpenPIC_NumInitSenses > NumSources)
NumSources = OpenPIC_NumInitSenses;
I am about to add an openpic_set_sources function which will let us
handle the distributed openpic in IBM pSeries machines more cleanly
and also allow us to remove this hack.
openpic_set_sources takes three arguments: a range of openpic IRQ
numbers (first irq and number of irqs) and a pointer to the ioremapped
interrupt source registers. If the pointer is NULL it is taken to
mean that the irqs use the standard openpic interrupt source
registers. openpic_set_sources also sets NumSources to first_irq +
num_irqs if that value is larger than NumSources, and if NumSources is
set by openpic_set_sources, then openpic_init doesn't use the value
from the openpic registers. (Thus openpic_set_sources must be called
*before* openpic_init, but after you have set OpenPIC_Addr.)
Thus if you want to say how many interrupt sources there are, you will
be able to do that with openpic_set_sources(0, num_sources, NULL).
If you want to say that there are 16 sources in the standard locations
plus another 16 at some other location, you could do
openpic_set_sources(0, 16, NULL);
openpic_set_sources(16, 16, ioremap(isr_base, 16 * 32));
(Actually maybe I should let openpic_set_sources do the ioremap.)
Comments?
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: OpenPIC_NumInitSenses
2002-01-24 12:13 OpenPIC_NumInitSenses Paul Mackerras
@ 2002-01-24 17:54 ` Adrian Cox
2002-01-25 2:42 ` OpenPIC_NumInitSenses Dan Malek
1 sibling, 0 replies; 5+ messages in thread
From: Adrian Cox @ 2002-01-24 17:54 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
On Thu, 24 Jan 2002 23:13:26 +1100 (EST)
Paul Mackerras <paulus@samba.org> wrote:
> Who was it that wanted this horrible hack in open_pic.c?
I've been using it to deal with the DMA interrupts on the MPC107.
> /* Needed because of the way we overload EPIC on a standard
> * Open PIC structure.
> */
> if (OpenPIC_NumInitSenses > NumSources)
> NumSources = OpenPIC_NumInitSenses;
> [...]
> openpic_set_sources(0, 16, NULL);
> openpic_set_sources(16, 16, ioremap(isr_base, 16 * 32));
>
> (Actually maybe I should let openpic_set_sources do the ioremap.)
>
> Comments?
Looks like a lot less of a hack than the current system. I'll have to
renumber the DMA interrupts, but that's trivial work. I'm happy with
doing the ioremap in my own platform code, and it provides flexibility
for boards which have already mapped their openpic registers with
io_block_mapping().
--
Adrian Cox
http://www.humboldt.co.uk/
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: OpenPIC_NumInitSenses
2002-01-24 12:13 OpenPIC_NumInitSenses Paul Mackerras
2002-01-24 17:54 ` OpenPIC_NumInitSenses Adrian Cox
@ 2002-01-25 2:42 ` Dan Malek
2002-01-25 4:04 ` OpenPIC_NumInitSenses Paul Mackerras
1 sibling, 1 reply; 5+ messages in thread
From: Dan Malek @ 2002-01-25 2:42 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Paul Mackerras wrote:
> Who was it that wanted this horrible hack in open_pic.c?
RTFA (archives :-). We have discussed this enough in the past.
Just like the comment states, we need it because of the way the
107/EPIC maps on the "standard" OpenPIC structure. The simple
answer is the interrupts are offset by 16 on the EPIC, so the
interrupt numbers don't match the offset value. The EPIC may
say there are only 24 vectors, but for the code to work we need
to tell the OpenPIC code there are up to 16 more than that.
> I am about to add an openpic_set_sources function which will let us
> handle the distributed openpic in IBM pSeries machines more cleanly
> and also allow us to remove this hack.
There have been posts about better OpenPIC updates, but I guess they
have been ignored?
> Thus if you want to say how many interrupt sources there are, ....
I can't discuss much right now because I'm travelling with basically only
e-mail access. I'll look at some code, but I guess you should just
make the changes and we'll try again to make EPIC fit :-).
Thanks.
-- Dan
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: OpenPIC_NumInitSenses
2002-01-25 2:42 ` OpenPIC_NumInitSenses Dan Malek
@ 2002-01-25 4:04 ` Paul Mackerras
2002-01-25 17:07 ` OpenPIC_NumInitSenses Dan Malek
0 siblings, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2002-01-25 4:04 UTC (permalink / raw)
To: Dan Malek; +Cc: linuxppc-dev
Dan Malek writes:
> Just like the comment states, we need it because of the way the
> 107/EPIC maps on the "standard" OpenPIC structure. The simple
Well, you need some way to tell the openpic code how many ISRs there
are. You don't _need_ to use OpenPIC_NumInitSenses to do that. :)
> answer is the interrupts are offset by 16 on the EPIC, so the
> interrupt numbers don't match the offset value. The EPIC may
> say there are only 24 vectors, but for the code to work we need
> to tell the OpenPIC code there are up to 16 more than that.
... and they are not contiguous either (I just looked at the MPC107
manual). Who designed this thing?
Anyway, openpic_set_sources will let you say clearly and explicitly
where the ISRs are and how many of them there are. I have checked it
in, have a look - I think it should let you handle the MPC107 quite
painlessly, but if not let me know what else is needed.
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: OpenPIC_NumInitSenses
2002-01-25 4:04 ` OpenPIC_NumInitSenses Paul Mackerras
@ 2002-01-25 17:07 ` Dan Malek
0 siblings, 0 replies; 5+ messages in thread
From: Dan Malek @ 2002-01-25 17:07 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Paul Mackerras wrote:
> Well, you need some way to tell the openpic code how many ISRs there
> are. You don't _need_ to use OpenPIC_NumInitSenses to do that. :)
It was a quick hack that did the trick :-).
> .... and they are not contiguous either (I just looked at the MPC107
> manual). Who designed this thing?
Some embedded person, I guess :-).
> ... have a look - I think it should let you handle the MPC107 quite
> painlessly, but if not let me know what else is needed.
Cool. Thanks.
-- Dan
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-01-25 17:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-24 12:13 OpenPIC_NumInitSenses Paul Mackerras
2002-01-24 17:54 ` OpenPIC_NumInitSenses Adrian Cox
2002-01-25 2:42 ` OpenPIC_NumInitSenses Dan Malek
2002-01-25 4:04 ` OpenPIC_NumInitSenses Paul Mackerras
2002-01-25 17:07 ` OpenPIC_NumInitSenses Dan Malek
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).