Home | History | Annotate | Line # | Download | only in include
openpicreg.h revision 1.2.2.2
      1  1.2.2.2  bouyer /*	$NetBSD: openpicreg.h,v 1.2.2.2 2001/02/11 19:11:53 bouyer Exp $	*/
      2  1.2.2.2  bouyer 
      3  1.2.2.2  bouyer /*
      4  1.2.2.2  bouyer  * Copyright 2001 Wasabi Systems, Inc.
      5  1.2.2.2  bouyer  * All rights reserved.
      6  1.2.2.2  bouyer  *
      7  1.2.2.2  bouyer  * Written by Allen Briggs for Wasabi Systems, Inc.
      8  1.2.2.2  bouyer  *
      9  1.2.2.2  bouyer  * Redistribution and use in source and binary forms, with or without
     10  1.2.2.2  bouyer  * modification, are permitted provided that the following conditions
     11  1.2.2.2  bouyer  * are met:
     12  1.2.2.2  bouyer  * 1. Redistributions of source code must retain the above copyright
     13  1.2.2.2  bouyer  *    notice, this list of conditions and the following disclaimer.
     14  1.2.2.2  bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.2.2.2  bouyer  *    notice, this list of conditions and the following disclaimer in the
     16  1.2.2.2  bouyer  *    documentation and/or other materials provided with the distribution.
     17  1.2.2.2  bouyer  * 3. All advertising materials mentioning features or use of this software
     18  1.2.2.2  bouyer  *    must display the following acknowledgement:
     19  1.2.2.2  bouyer  *      This product includes software developed for the NetBSD Project by
     20  1.2.2.2  bouyer  *      Wasabi Systems, Inc.
     21  1.2.2.2  bouyer  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22  1.2.2.2  bouyer  *    or promote products derived from this software without specific prior
     23  1.2.2.2  bouyer  *    written permission.
     24  1.2.2.2  bouyer  *
     25  1.2.2.2  bouyer  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26  1.2.2.2  bouyer  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27  1.2.2.2  bouyer  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28  1.2.2.2  bouyer  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29  1.2.2.2  bouyer  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30  1.2.2.2  bouyer  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31  1.2.2.2  bouyer  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32  1.2.2.2  bouyer  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33  1.2.2.2  bouyer  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34  1.2.2.2  bouyer  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35  1.2.2.2  bouyer  * POSSIBILITY OF SUCH DAMAGE.
     36  1.2.2.2  bouyer  */
     37  1.2.2.2  bouyer 
     38  1.2.2.2  bouyer /*
     39  1.2.2.2  bouyer  * INTERRUPT SOURCE register
     40  1.2.2.2  bouyer  * This is kind of odd on the MPC8240.  The interrupts are kind of
     41  1.2.2.2  bouyer  * spread around.
     42  1.2.2.2  bouyer  *	* The 5 external interrupts are at 0x10200 + irq * 0x20
     43  1.2.2.2  bouyer  *	* The next 3 interrupts are at 0x11000 + (irq - 4) * 0x20
     44  1.2.2.2  bouyer  *	* The next interrupt is at 0x110C0 + (irq - 4) * 0x20
     45  1.2.2.2  bouyer  *	* The last interrupts are at 0x01120 + (irq - 9) * 0x20
     46  1.2.2.2  bouyer  */
     47  1.2.2.2  bouyer 
     48  1.2.2.2  bouyer /* interrupt vector/priority reg */
     49  1.2.2.2  bouyer #define OPENPIC_SRC_VECTOR(irq) \
     50  1.2.2.2  bouyer 	    ((irq <= 4) ? (0x10200 + (irq) * 0x20) \
     51  1.2.2.2  bouyer 		: ((irq <= 7) ? (0x11000 + ((irq) - 4) * 0x20) \
     52  1.2.2.2  bouyer 		    : ((irq == 8) ? 0x110C0 \
     53  1.2.2.2  bouyer 		       : (0x01120 + ((irq) - 9) * 0x40))))
     54  1.2.2.2  bouyer 
     55  1.2.2.2  bouyer #define	OPENPIC_INIT_SRC(irq) \
     56  1.2.2.2  bouyer 	    (((OPENPIC_IMASK | (8 << OPENPIC_PRIORITY_SHIFT)) | \
     57  1.2.2.2  bouyer 		(((irq) <= 4) ? \
     58  1.2.2.2  bouyer 		    (OPENPIC_POLARITY_NEGATIVE | OPENPIC_SENSE_LEVEL) : 0)) \
     59  1.2.2.2  bouyer 	    | (irq))
     60  1.2.2.2  bouyer 
     61  1.2.2.2  bouyer #define OPENPIC_IDEST(irq)		OPENPIC_SRC_VECTOR(irq) + 0x10
     62  1.2.2.2  bouyer 
     63  1.2.2.2  bouyer void openpic_init __P((unsigned char *));
     64  1.2.2.2  bouyer 
     65  1.2.2.2  bouyer #include <powerpc/openpicreg.h>
     66