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