* How to setup interrupts for a new board?
@ 2010-09-29 14:06 Ardelean, Andrei
2010-09-29 14:06 ` Ardelean, Andrei
2010-09-29 16:24 ` David Daney
0 siblings, 2 replies; 9+ messages in thread
From: Ardelean, Andrei @ 2010-09-29 14:06 UTC (permalink / raw)
To: linux-mips
Hi,
I created new board specific files gd_xxxx similar with malta_xxxx and I
am trying to configure Linux interrupts in gd-int.c.
My board has no external interrupt controller like Malta has, it has no
PCI, I use Vectored interrupt mode and a mux routes the external
interrupts to the MIPS h/w interrupts.
Wthat is the meaning of the following switches and how to set them:
cpu_has_divec
cpu_has_vce
cpu_has_llsc
cpu_has_counter
cpu_has_vint
What is the difference between:
setup_irq()
set_irq_handler()
set_vi_handler()
Can you point me to document regarding interrupts implementation in MIPS
Linux?
Thanks,
Andrei
^ permalink raw reply [flat|nested] 9+ messages in thread
* How to setup interrupts for a new board?
2010-09-29 14:06 How to setup interrupts for a new board? Ardelean, Andrei
@ 2010-09-29 14:06 ` Ardelean, Andrei
2010-09-29 16:24 ` David Daney
1 sibling, 0 replies; 9+ messages in thread
From: Ardelean, Andrei @ 2010-09-29 14:06 UTC (permalink / raw)
To: linux-mips
Hi,
I created new board specific files gd_xxxx similar with malta_xxxx and I
am trying to configure Linux interrupts in gd-int.c.
My board has no external interrupt controller like Malta has, it has no
PCI, I use Vectored interrupt mode and a mux routes the external
interrupts to the MIPS h/w interrupts.
Wthat is the meaning of the following switches and how to set them:
cpu_has_divec
cpu_has_vce
cpu_has_llsc
cpu_has_counter
cpu_has_vint
What is the difference between:
setup_irq()
set_irq_handler()
set_vi_handler()
Can you point me to document regarding interrupts implementation in MIPS
Linux?
Thanks,
Andrei
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to setup interrupts for a new board?
2010-09-29 14:06 How to setup interrupts for a new board? Ardelean, Andrei
2010-09-29 14:06 ` Ardelean, Andrei
@ 2010-09-29 16:24 ` David Daney
2010-09-29 16:52 ` Ardelean, Andrei
1 sibling, 1 reply; 9+ messages in thread
From: David Daney @ 2010-09-29 16:24 UTC (permalink / raw)
To: Ardelean, Andrei; +Cc: linux-mips
On 09/29/2010 07:06 AM, Ardelean, Andrei wrote:
> Hi,
>
> I created new board specific files gd_xxxx similar with malta_xxxx and I
> am trying to configure Linux interrupts in gd-int.c.
> My board has no external interrupt controller like Malta has, it has no
> PCI, I use Vectored interrupt mode and a mux routes the external
> interrupts to the MIPS h/w interrupts.
> Wthat is the meaning of the following switches and how to set them:
> cpu_has_divec
> cpu_has_vce
> cpu_has_llsc
> cpu_has_counter
> cpu_has_vint
>
> What is the difference between:
> setup_irq()
> set_irq_handler()
> set_vi_handler()
>
> Can you point me to document regarding interrupts implementation in MIPS
> Linux?
Other than the Linux Kernel source code, make sure you have a copy of:
MD00090-2B-MIPS32PRA-AFP, the "MIPS32® Architecture for Programmers
Volume III: The MIPS32® Privileged Resource Architecture"
It can be downloaded from mips.com
David Daney
>
> Thanks,
> Andrei
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: How to setup interrupts for a new board?
2010-09-29 16:24 ` David Daney
@ 2010-09-29 16:52 ` Ardelean, Andrei
2010-09-29 16:52 ` Ardelean, Andrei
2010-09-30 2:31 ` Maciej W. Rozycki
0 siblings, 2 replies; 9+ messages in thread
From: Ardelean, Andrei @ 2010-09-29 16:52 UTC (permalink / raw)
To: David Daney; +Cc: linux-mips
Hi David,
I checked in the MIPS documentation and I couldn't find relevant
information about this particular way of implementation. Unfortunately
in the MIPS kernel source there are no enough comments.
Thanks,
Andrei
-----Original Message-----
From: David Daney [mailto:ddaney@caviumnetworks.com]
Sent: Wednesday, September 29, 2010 12:25 PM
To: Ardelean, Andrei
Cc: linux-mips@linux-mips.org
Subject: Re: How to setup interrupts for a new board?
On 09/29/2010 07:06 AM, Ardelean, Andrei wrote:
> Hi,
>
> I created new board specific files gd_xxxx similar with malta_xxxx and
I
> am trying to configure Linux interrupts in gd-int.c.
> My board has no external interrupt controller like Malta has, it has
no
> PCI, I use Vectored interrupt mode and a mux routes the external
> interrupts to the MIPS h/w interrupts.
> Wthat is the meaning of the following switches and how to set them:
> cpu_has_divec
> cpu_has_vce
> cpu_has_llsc
> cpu_has_counter
> cpu_has_vint
>
> What is the difference between:
> setup_irq()
> set_irq_handler()
> set_vi_handler()
>
> Can you point me to document regarding interrupts implementation in
MIPS
> Linux?
Other than the Linux Kernel source code, make sure you have a copy of:
MD00090-2B-MIPS32PRA-AFP, the "MIPS32(r) Architecture for Programmers
Volume III: The MIPS32(r) Privileged Resource Architecture"
It can be downloaded from mips.com
David Daney
>
> Thanks,
> Andrei
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: How to setup interrupts for a new board?
2010-09-29 16:52 ` Ardelean, Andrei
@ 2010-09-29 16:52 ` Ardelean, Andrei
2010-09-30 2:31 ` Maciej W. Rozycki
1 sibling, 0 replies; 9+ messages in thread
From: Ardelean, Andrei @ 2010-09-29 16:52 UTC (permalink / raw)
To: David Daney; +Cc: linux-mips
Hi David,
I checked in the MIPS documentation and I couldn't find relevant
information about this particular way of implementation. Unfortunately
in the MIPS kernel source there are no enough comments.
Thanks,
Andrei
-----Original Message-----
From: David Daney [mailto:ddaney@caviumnetworks.com]
Sent: Wednesday, September 29, 2010 12:25 PM
To: Ardelean, Andrei
Cc: linux-mips@linux-mips.org
Subject: Re: How to setup interrupts for a new board?
On 09/29/2010 07:06 AM, Ardelean, Andrei wrote:
> Hi,
>
> I created new board specific files gd_xxxx similar with malta_xxxx and
I
> am trying to configure Linux interrupts in gd-int.c.
> My board has no external interrupt controller like Malta has, it has
no
> PCI, I use Vectored interrupt mode and a mux routes the external
> interrupts to the MIPS h/w interrupts.
> Wthat is the meaning of the following switches and how to set them:
> cpu_has_divec
> cpu_has_vce
> cpu_has_llsc
> cpu_has_counter
> cpu_has_vint
>
> What is the difference between:
> setup_irq()
> set_irq_handler()
> set_vi_handler()
>
> Can you point me to document regarding interrupts implementation in
MIPS
> Linux?
Other than the Linux Kernel source code, make sure you have a copy of:
MD00090-2B-MIPS32PRA-AFP, the "MIPS32(r) Architecture for Programmers
Volume III: The MIPS32(r) Privileged Resource Architecture"
It can be downloaded from mips.com
David Daney
>
> Thanks,
> Andrei
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: How to setup interrupts for a new board?
2010-09-29 16:52 ` Ardelean, Andrei
2010-09-29 16:52 ` Ardelean, Andrei
@ 2010-09-30 2:31 ` Maciej W. Rozycki
2010-09-30 13:31 ` Ardelean, Andrei
1 sibling, 1 reply; 9+ messages in thread
From: Maciej W. Rozycki @ 2010-09-30 2:31 UTC (permalink / raw)
To: Ardelean, Andrei; +Cc: David Daney, linux-mips
Hi Andrei,
> I checked in the MIPS documentation and I couldn't find relevant
> information about this particular way of implementation. Unfortunately
> in the MIPS kernel source there are no enough comments.
With reasonable understanding what the MIPS architecture features covered
by these macros, functions, etc. are you should be able to infer from
Linux code what it actually does.
May I suggest some reading on the architecture first then? I realise
MIPS Technologies' architecture specifications may not be the best way to
learn how the architecture works, so why not try a MIPS textbook instead,
such as Dominic Sweetman's excellent "See MIPS Run Linux" (ISBN
978-0-12-088421-6)? While not covering such details of Linux as you are
looking for, it includes related introductory subjects to get you started.
And of course it covers the MIPS architecture itself. You may be able to
find the book at your nearby (or less near) library.
I think it's about as much as we can help -- you need to get down to
understanding the details yourself or you'll be bound to asking around
helplessly all the time.
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: How to setup interrupts for a new board?
2010-09-30 2:31 ` Maciej W. Rozycki
@ 2010-09-30 13:31 ` Ardelean, Andrei
2010-09-30 13:31 ` Ardelean, Andrei
2010-09-30 15:39 ` Maciej W. Rozycki
0 siblings, 2 replies; 9+ messages in thread
From: Ardelean, Andrei @ 2010-09-30 13:31 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: David Daney, linux-mips
Hi Maciej,
I have read all the books you suggested and I work having all of them on
my desk. I come back to them frequently to check diverse stuff. My
problems are:
- Why Malta implementation doesn't activate cpu_has_veic although they
have 8259 external interrupt controller? Malta implementation doesn't
activate cpu_has_vint too although Vectored interrupt mode should be the
minimum recommended mode if external controller is not present.
- Looking at Malta_xxxx specific files, it seems to me that they do not
follow Linux Porting Guide document I have read on MIPS Linux.
In addition, my company pays Timesys for support and regarding
cpu-feature.h define switches, they said that they know nothing.
What I was hoping was to find a MIPS Linux implementation which uses
Vectored Interrupt Mode (VI) with few h/w interrupts including the timer
routed to the MIPS processor or at least some document with some details
of implementation. That will shorten significantly my porting. Sure, if
I find nothing, I'll write from scratch as I understand, but it takes
for sure much longer and is worth to try first finding a close example.
Thanks,
Andrei
-----Original Message-----
From: Maciej W. Rozycki [mailto:macro@linux-mips.org]
Sent: Wednesday, September 29, 2010 10:32 PM
To: Ardelean, Andrei
Cc: David Daney; linux-mips@linux-mips.org
Subject: RE: How to setup interrupts for a new board?
Hi Andrei,
> I checked in the MIPS documentation and I couldn't find relevant
> information about this particular way of implementation. Unfortunately
> in the MIPS kernel source there are no enough comments.
With reasonable understanding what the MIPS architecture features
covered
by these macros, functions, etc. are you should be able to infer from
Linux code what it actually does.
May I suggest some reading on the architecture first then? I realise
MIPS Technologies' architecture specifications may not be the best way
to
learn how the architecture works, so why not try a MIPS textbook
instead,
such as Dominic Sweetman's excellent "See MIPS Run Linux" (ISBN
978-0-12-088421-6)? While not covering such details of Linux as you are
looking for, it includes related introductory subjects to get you
started.
And of course it covers the MIPS architecture itself. You may be able
to
find the book at your nearby (or less near) library.
I think it's about as much as we can help -- you need to get down to
understanding the details yourself or you'll be bound to asking around
helplessly all the time.
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: How to setup interrupts for a new board?
2010-09-30 13:31 ` Ardelean, Andrei
@ 2010-09-30 13:31 ` Ardelean, Andrei
2010-09-30 15:39 ` Maciej W. Rozycki
1 sibling, 0 replies; 9+ messages in thread
From: Ardelean, Andrei @ 2010-09-30 13:31 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: David Daney, linux-mips
Hi Maciej,
I have read all the books you suggested and I work having all of them on
my desk. I come back to them frequently to check diverse stuff. My
problems are:
- Why Malta implementation doesn't activate cpu_has_veic although they
have 8259 external interrupt controller? Malta implementation doesn't
activate cpu_has_vint too although Vectored interrupt mode should be the
minimum recommended mode if external controller is not present.
- Looking at Malta_xxxx specific files, it seems to me that they do not
follow Linux Porting Guide document I have read on MIPS Linux.
In addition, my company pays Timesys for support and regarding
cpu-feature.h define switches, they said that they know nothing.
What I was hoping was to find a MIPS Linux implementation which uses
Vectored Interrupt Mode (VI) with few h/w interrupts including the timer
routed to the MIPS processor or at least some document with some details
of implementation. That will shorten significantly my porting. Sure, if
I find nothing, I'll write from scratch as I understand, but it takes
for sure much longer and is worth to try first finding a close example.
Thanks,
Andrei
-----Original Message-----
From: Maciej W. Rozycki [mailto:macro@linux-mips.org]
Sent: Wednesday, September 29, 2010 10:32 PM
To: Ardelean, Andrei
Cc: David Daney; linux-mips@linux-mips.org
Subject: RE: How to setup interrupts for a new board?
Hi Andrei,
> I checked in the MIPS documentation and I couldn't find relevant
> information about this particular way of implementation. Unfortunately
> in the MIPS kernel source there are no enough comments.
With reasonable understanding what the MIPS architecture features
covered
by these macros, functions, etc. are you should be able to infer from
Linux code what it actually does.
May I suggest some reading on the architecture first then? I realise
MIPS Technologies' architecture specifications may not be the best way
to
learn how the architecture works, so why not try a MIPS textbook
instead,
such as Dominic Sweetman's excellent "See MIPS Run Linux" (ISBN
978-0-12-088421-6)? While not covering such details of Linux as you are
looking for, it includes related introductory subjects to get you
started.
And of course it covers the MIPS architecture itself. You may be able
to
find the book at your nearby (or less near) library.
I think it's about as much as we can help -- you need to get down to
understanding the details yourself or you'll be bound to asking around
helplessly all the time.
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: How to setup interrupts for a new board?
2010-09-30 13:31 ` Ardelean, Andrei
2010-09-30 13:31 ` Ardelean, Andrei
@ 2010-09-30 15:39 ` Maciej W. Rozycki
1 sibling, 0 replies; 9+ messages in thread
From: Maciej W. Rozycki @ 2010-09-30 15:39 UTC (permalink / raw)
To: Ardelean, Andrei; +Cc: David Daney, linux-mips
Hi Andrei,
> I have read all the books you suggested and I work having all of them on
> my desk. I come back to them frequently to check diverse stuff. My
> problems are:
> - Why Malta implementation doesn't activate cpu_has_veic although they
> have 8259 external interrupt controller? Malta implementation doesn't
> activate cpu_has_vint too although Vectored interrupt mode should be the
> minimum recommended mode if external controller is not present.
I am fairly sure at least some configurations with the Malta do use the
VEIC or VINT mode; probably both, though not at a time of course,
depending on the exact setup. Please note however that the Malta supports
a diverse set of CPU cards, some of which not even featuring a MIPS
architecture processor (such as the QED RM5261 CPU that is only the legacy
MIPS IV ISA). Therefore for the Malta you cannot simply override our
default of the dynamic interrupt configuration by hardcoding cpu_has_veic
or cpu_has_vint to 1. The value has to be determined at the run time
(note that by default cpu_has_veic, etc. macros expand to variable
references).
The design of the Malta itself (which is from ~2000) also predates the
second revision of the MIPS architecture that introduced the VEIC mode and
does not allow the 8259 to be used in a manner that would give any
advantage for vectored interrupts -- the output of the PIC is simply wired
to one of the core card's inputs, that is then routed to one of the CPU
interrupt lines, perhaps via the system controller (depending on the exact
one used -- they vary significantly between core cards too), and the
actual originating source at the 8259 can only be determined either by
poking at a special register in the system controller that makes it
generate a PCI INTA cycle and returns the vector the 8259 responded with
or by the PIC's OCW3 command.
> - Looking at Malta_xxxx specific files, it seems to me that they do not
> follow Linux Porting Guide document I have read on MIPS Linux.
No surprise as I'd expect them to predate the document by many years.
> In addition, my company pays Timesys for support and regarding
> cpu-feature.h define switches, they said that they know nothing.
Hmm, change your support provider then? If I paid someone for support,
then I'd expect them to be able to figure out the details I ask them
about. And I wouldn't care if they did that themselves or asked someone
else in turn.
> What I was hoping was to find a MIPS Linux implementation which uses
> Vectored Interrupt Mode (VI) with few h/w interrupts including the timer
> routed to the MIPS processor or at least some document with some details
> of implementation. That will shorten significantly my porting. Sure, if
> I find nothing, I'll write from scratch as I understand, but it takes
> for sure much longer and is worth to try first finding a close example.
While a reasonably comprehensive choice, with its complexity and
diversity the Malta is certainly not the simplest one to start with. You
may be able to find a simpler one, but I don't know which one that would
be (I seem to tend to stick to the complicated bits ;) ) so I cannot point
you at that, sorry. You may be able to figure it out yourself -- I
suggest starting by checking platforms that do not hardcode cpu_has_veic
to 0 (I'm assuming you have verified none sets it to 1 already as
otherwise you wouldn't be asking these questions, would you?). Also
someone else, more familiar with some platforms that we support, may be
able to help you with that.
Anyway, good luck!
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-09-30 15:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 14:06 How to setup interrupts for a new board? Ardelean, Andrei
2010-09-29 14:06 ` Ardelean, Andrei
2010-09-29 16:24 ` David Daney
2010-09-29 16:52 ` Ardelean, Andrei
2010-09-29 16:52 ` Ardelean, Andrei
2010-09-30 2:31 ` Maciej W. Rozycki
2010-09-30 13:31 ` Ardelean, Andrei
2010-09-30 13:31 ` Ardelean, Andrei
2010-09-30 15:39 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox