Home | History | Annotate | Line # | Download | only in pci
empbreg.h revision 1.2
      1 /*	$NetBSD: empbreg.h,v 1.2 2012/05/31 21:29:02 rkujawa Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 2012 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Radoslaw Kujawa.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 /*
     33  * Elbox Mediator registers. This information was obtained using reverse
     34  * engineering methods by Frank Wille and Radoslaw Kujawa (without access to
     35  * official documentation).
     36  */
     37 
     38 #ifndef _AMIGA_EMPBREG_H_
     39 
     40 /* Zorro IDs */
     41 #define ZORRO_MANID_ELBOX	2206
     42 #define ZORRO_PRODID_MEDZIV	31
     43 #define ZORRO_PRODID_MED1K2	32
     44 #define ZORRO_PRODID_MED4K	33
     45 #define ZORRO_PRODID_MED1K2SX	40
     46 #define ZORRO_PRODID_MED1K2LT2	48
     47 #define ZORRO_PRODID_MED1K2LT4	49
     48 #define ZORRO_PRODID_MED1K2TX	60
     49 #define ZORRO_PRODID_MED4KMKII	63
     50 
     51 #define ZORRO_PRODID_MEDZIV_MEM		ZORRO_PRODID_MEDZIV+0x80
     52 #define ZORRO_PRODID_MED1K2_MEM		ZORRO_PRODID_MED1K2+0x80
     53 #define ZORRO_PRODID_MED4K_MEM		ZORRO_PRODID_MED4K+0x80
     54 #define ZORRO_PRODID_MED1K2SX_MEM	ZORRO_PRODID_MED1K2SX+0x80
     55 #define ZORRO_PRODID_MED1K2LT2_MEM	ZORRO_PRODID_MED1K2LT2+0x80
     56 #define ZORRO_PRODID_MED1K2LT4_MEM	ZORRO_PRODID_MED1K2LT4+0x80
     57 #define ZORRO_PRODID_MED1K2TX_MEM	ZORRO_PRODID_MED1K2TX+0x80
     58 #define ZORRO_PRODID_MED4KMKII_MEM	ZORRO_PRODID_MED4KMKII+0x80
     59 
     60 /*
     61  * Mediator 1200 consists of two boards. First board lives in Z2 I/O
     62  * space and is internally divided into two 64kB spaces. Second board, used
     63  * as a window into PCI memory space is configured somewhere within 24-bit Fast
     64  * RAM space (its size depends on a WINDOW jumper setting).
     65  */
     66 #define EMPB_SETUP_OFF		0x00000000
     67 #define EMPB_SETUP_SIZE		0xFFFF
     68 
     69 #define EMPB_SETUP_WINDOW_OFF	0x2	/* set memory window position */
     70 #define EMPB_SETUP_BRIDGE_OFF	0x7	/* select between conf or I/O */
     71 
     72 #define BRIDGE_CONF		0xA0	/* switch into configuration space */
     73 #define BRIDGE_IO		0x20	/* switch into I/O space */
     74 
     75 #define EMPB_BRIDGE_OFF		0x00010000
     76 #define EMPB_BRIDGE_SIZE	0xFFFF
     77 
     78 #define	EMPB_CONF_DEV_STRIDE	0x800	/* offset between PCI devices */
     79 #define EMPB_CONF_FUNC_STRIDE	0x100 	/* XXX: offset between PCI funcs */
     80 
     81 #define EMPB_WINDOW_SHIFT	0x10
     82 #define EMPB_WINDOW_MASK_8M	0xFF80
     83 #define EMPB_WINDOW_MASK_4M	0xFFC0
     84 
     85 /* All PCI interrupt lines are wired to INT2? */
     86 #define EMPB_INT		2	// XXX: wild guess
     87 
     88 #endif /* _AMIGA_EMPBREG_H_ */
     89