[linux-sh:03402] Re: shift from irq_imask to irq_ipr

Stuart MENEFY <[email protected]> Tue, 10 May 2005 19:33:10 +0100
Newsgroups gmane.linux.ports.sh.general
Organization STMicroelectronics (Bristol)
Message-ID <[email protected]>
--Signature=_Tue__10_May_2005_19_33_10_+0100_cxf_5KqOTWhZrpnC
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Vijay

On Mon, 9 May 2005 04:17:58 -0700 (PDT) R Vijay <[email protected]> wrote:

> Hi Everyone!
> 
> I am porting linux kernel 2.4.26 on MS7751RCP01 board.
> The kernel works fine with support of devices like
> pcmcia, usb, uart, lcd etc, with the irq_imask (refer
> arch/sh/kernel/irq_imask.c).  
> 
> I am trying to change the handler model to irq_ipr. 
> The FPGA seems to be non-co-operative.  As many many
> encoding is hard inside, and cant be programmed as
> other boards from hitachi/renesas.
> 
> Is there any way to eliminate irq_imask model for
> external hardware (at least for USB), and to run
> new(?) model which doesn't change the CPU registers
> but go for other way-around.

Its hard to answer this without knowing what hardware there is on the
board, and how it is connected, so this is just generalising.

In order to use anything other than the irq_imask technique, you need a
way to disable each specific interrupt source. You have to be able to do
this to prevent the interrupt handler being reentered (assuming you don't
run with SA_INTERRUPT set).

So does the FPGA or any other glue logic provide any way to disable the
interrupts between the peripheral and the SH4? You'd need to write a
custom interrupt type, but there are plenty of example of how to do this
in the kernel sources.

Or alternatively, do the interrupts get connected to the 7751 notIRL
pins directly (without being priority encoded)? In this case you could
use the IPRD register in the 7751's interrupt controller. This has the
advantage that your could use the existing irq_ipr code.

Finally if the peripherals themselves provides some way to disable
interrupts, you could write a custom interrupt type for just those
peripherals which are giving you problems. Its a fair bit of work, but
might be the only option if the previous two solutions aren't
possible.  Not surprisingly, I'm not aware of any existing platforms
which resort to this!

Otherwise, I think you're stuck with the IMASK technique.

Hope this helps

Stuart

-- 
Stuart Menefy                                        [email protected]
STMicroelectronics Ltd                      ST Intranet: linux.bri.st.com
Bristol, UK                        Rest of the World: www.superhlinux.com

--Signature=_Tue__10_May_2005_19_33_10_+0100_cxf_5KqOTWhZrpnC
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCgP5m61BlSKQGbXkRApjNAJ41j+Rmi2AAuMdHWbXaFgdtUfOP/ACgiocr
MeZ07B/mptgQHb918n8HcdI=
=FvLN
-----END PGP SIGNATURE-----

--Signature=_Tue__10_May_2005_19_33_10_+0100_cxf_5KqOTWhZrpnC--