xref: /openbsd-src/sys/arch/hppa/include/iomod.h (revision 39ceab0ae87a7205bb90ec0c37131d1ae31bca74)
1*39ceab0aSmiod /*	$OpenBSD: iomod.h,v 1.19 2009/02/06 17:26:21 miod Exp $	*/
29c0b8818Smickey 
39c0b8818Smickey /*
4fef2e65fSmickey  * Copyright (c) 2000-2004 Michael Shalayeff
55bc44868Smickey  * All rights reserved.
65bc44868Smickey  *
75bc44868Smickey  * Redistribution and use in source and binary forms, with or without
85bc44868Smickey  * modification, are permitted provided that the following conditions
95bc44868Smickey  * are met:
105bc44868Smickey  * 1. Redistributions of source code must retain the above copyright
115bc44868Smickey  *    notice, this list of conditions and the following disclaimer.
125bc44868Smickey  * 2. Redistributions in binary form must reproduce the above copyright
135bc44868Smickey  *    notice, this list of conditions and the following disclaimer in the
145bc44868Smickey  *    documentation and/or other materials provided with the distribution.
155bc44868Smickey  *
165bc44868Smickey  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
175bc44868Smickey  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
185bc44868Smickey  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
195bc44868Smickey  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
205bc44868Smickey  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
215bc44868Smickey  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
225bc44868Smickey  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
235bc44868Smickey  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
245bc44868Smickey  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
255bc44868Smickey  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
265bc44868Smickey  * THE POSSIBILITY OF SUCH DAMAGE.
275bc44868Smickey  */
285bc44868Smickey /*
299c0b8818Smickey  * Copyright (c) 1990 mt Xinu, Inc.  All rights reserved.
309c0b8818Smickey  * Copyright (c) 1990,1991,1992,1994 University of Utah.  All rights reserved.
319c0b8818Smickey  *
329c0b8818Smickey  * Permission to use, copy, modify and distribute this software is hereby
339c0b8818Smickey  * granted provided that (1) source code retains these copyright, permission,
349c0b8818Smickey  * and disclaimer notices, and (2) redistributions including binaries
359c0b8818Smickey  * reproduce the notices in supporting documentation, and (3) all advertising
369c0b8818Smickey  * materials mentioning features or use of this software display the following
379c0b8818Smickey  * acknowledgement: ``This product includes software developed by the
389c0b8818Smickey  * Computer Systems Laboratory at the University of Utah.''
399c0b8818Smickey  *
409c0b8818Smickey  * Copyright (c) 1990 mt Xinu, Inc.
419c0b8818Smickey  * This file may be freely distributed in any form as long as
429c0b8818Smickey  * this copyright notice is included.
439c0b8818Smickey  * MTXINU, THE UNIVERSITY OF UTAH, AND CSL PROVIDE THIS SOFTWARE ``AS
449c0b8818Smickey  * IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
459c0b8818Smickey  * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
469c0b8818Smickey  * FITNESS FOR A PARTICULAR PURPOSE.
479c0b8818Smickey  *
489c0b8818Smickey  * CSL requests users of this software to return to csl-dist@cs.utah.edu any
499c0b8818Smickey  * improvements that they make and grant CSL redistribution rights.
509c0b8818Smickey  *
519c0b8818Smickey  *	Utah $Hdr: iomod.h 1.6 94/12/14$
52b79994e1Smickey  *	Author: Jeff Forys (CSS), Dave Slattengren (mtXinu)
539c0b8818Smickey  */
549c0b8818Smickey 
55b2cc206bSmickey #ifndef	_MACHINE_IOMOD_H_
56b2cc206bSmickey #define	_MACHINE_IOMOD_H_
579c0b8818Smickey 
589c0b8818Smickey #include <machine/pdc.h>
599c0b8818Smickey 
609c0b8818Smickey /*
619c0b8818Smickey  * Structures and definitions for I/O Modules on HP-PA (9000/800).
629c0b8818Smickey  *
639c0b8818Smickey  * Memory layout:
649c0b8818Smickey  *
659c0b8818Smickey  *	0x00000000	+---------------------------------+
669c0b8818Smickey  *			|           Page Zero             |
679c0b8818Smickey  *	0x00000800	+ - - - - - - - - - - - - - - - - +
689c0b8818Smickey  *			|                                 |
699c0b8818Smickey  *			|                                 |
709c0b8818Smickey  *			|      Memory Address Space       |
719c0b8818Smickey  *			|                                 |
729c0b8818Smickey  *			|                                 |
739c0b8818Smickey  *	0xEF000000	+---------------------------------+
749c0b8818Smickey  *			|                                 |
759c0b8818Smickey  *			|        PDC Address Space        |
769c0b8818Smickey  *			|                                 |
779c0b8818Smickey  *	0xF1000000	+---------------------------------+
789c0b8818Smickey  *			|                                 |
799c0b8818Smickey  *			|                                 |
809c0b8818Smickey  *			|        I/O Address Space        |
819c0b8818Smickey  *			|                                 |
829c0b8818Smickey  *			|                                 |
839c0b8818Smickey  *	0xFFF80000	+ - - - - - - - - - - - - - - - - +
849c0b8818Smickey  *			|  Fixed Physical Address Space   |
859c0b8818Smickey  *	0xFFFC0000	+ - - - - - - - - - - - - - - - - +
869c0b8818Smickey  *			|  Local Broadcast Address Space  |
879c0b8818Smickey  *	0xFFFE0000	+ - - - - - - - - - - - - - - - - +
889c0b8818Smickey  *			| Global Broadcast Address Space  |
899c0b8818Smickey  *	0xFFFFFFFF	+---------------------------------+
909c0b8818Smickey  *
919c0b8818Smickey  * "Memory Address Space" is used by memory modules,
929c0b8818Smickey  *   "Page Zero" is described below.
939c0b8818Smickey  * "PDC Address Space" is used by Processor-Dependent Code.
949c0b8818Smickey  * "I/O Address Space" is used by I/O modules (and is not cached),
959c0b8818Smickey  *   "Fixed Physical" is used by modules on the central bus,
969c0b8818Smickey  *   "Local Broadcast" is used to reach all modules on the same bus, and
979c0b8818Smickey  *   "Global Broadcast" is used to reach all modules (thru bus converters).
989c0b8818Smickey  *
999c0b8818Smickey  * SPA space (see below) ranges from 0xF1000000 thru 0xFFFC0000.
1009c0b8818Smickey  */
1019c0b8818Smickey 
1026d6f4087Smickey #define	PDC_LOW		0xEF000000	/* define some ranges */
1036d6f4087Smickey #define	PDC_HIGH	0xF1000000
1046d6f4087Smickey #define	FPA_LOW		0xFFF80000
1056d6f4087Smickey #define	FPA_HIGH	0xFFFC0000
1066d6f4087Smickey #define	SPA_LOW		0xF1000000
1076d6f4087Smickey #define	SPA_HIGH	0xFFFC0000
1086d6f4087Smickey #define	SGC_LOW		0xF4000000
1096d6f4087Smickey #define	SGC_HIGH	0xFA000000
1109c0b8818Smickey 
1119c0b8818Smickey #define	FPA_IOMOD	((FPA_HIGH-FPA_LOW)/sizeof(struct iomod))
1129c0b8818Smickey #define	MAXMODBUS	((int)(FPA_IOMOD))	/* maximum modules/bus */
1139c0b8818Smickey 
114b2cc206bSmickey /* size of HPA space for any device */
115b2cc206bSmickey #define	IOMOD_HPASIZE	0x1000
116b2cc206bSmickey 
11729f5f77bSmickey /* ASP prom offset for an lan stattion id */
11829f5f77bSmickey #define	ASP_PROM	(0xf0810000)
11929f5f77bSmickey 
120b2cc206bSmickey /* offset to the device-specific registers,
121b2cc206bSmickey  * basically sizeof(struct iomod) (see later)
1229c0b8818Smickey  */
123b2cc206bSmickey #define	IOMOD_DEVOFFSET	0x800
124b2cc206bSmickey 
125b2cc206bSmickey #if !defined(_LOCORE)
1269c0b8818Smickey 
1279c0b8818Smickey /*
1289c0b8818Smickey  * The first 2K of Soft Physical Address space on the Initial Memory Module
1299c0b8818Smickey  * is aptly called "page zero".  The following structure defines the format
1309c0b8818Smickey  * of page zero.  Individual members of this structure should be accessed
1319c0b8818Smickey  * as "PAGE0->member".
1329c0b8818Smickey  */
1339c0b8818Smickey 
1349c0b8818Smickey #define	PAGE0	((struct pagezero *)0)	/* can't get any lower than this! */
1359c0b8818Smickey 
1369c0b8818Smickey struct pagezero {
1379c0b8818Smickey 	/* [0x000] Initialize Vectors */
1389c0b8818Smickey 	int	ivec_special;		/* must be zero */
1396d6f4087Smickey 	u_int	ivec_mempf;		/* powerfail recovery software */
1406d6f4087Smickey 	u_int	ivec_toc;		/* exec'd after Transfer Of Control */
141b2cc206bSmickey 	u_int	ivec_toclen;		/* bytes of ivec_toc code */
1426d6f4087Smickey 	u_int	ivec_rendz;		/* exec'd after Rendezvous Signal */
143b2cc206bSmickey 	u_int	ivec_mempflen;		/* bytes of ivec_mempf code */
1445bc44868Smickey 	u_int	ivec_resv[2];		/* (reserved) */
1455bc44868Smickey 	u_int	ivec_mbz;		/* must be zero */
1465bc44868Smickey 	u_int	ivec_resv2[7];		/* (reserved) */
1479c0b8818Smickey 
1489c0b8818Smickey 	/* [0x040] Processor Dependent */
1499c0b8818Smickey 	union	{
150b2714ea3Smickey 		u_int	pd_Resv1[112];	/* (reserved) processor dependent */
1519c0b8818Smickey 		struct	{		/* Viper-specific data */
152b2714ea3Smickey 			u_int	v_Resv1[39];
1539c0b8818Smickey 			u_int	v_Ctrlcpy;	/* copy of Viper `vi_control' */
154b2714ea3Smickey 			u_int	v_Resv2[72];
1559c0b8818Smickey 		} pd_Viper;
1569c0b8818Smickey 	} pz_Pdep;
1579c0b8818Smickey 
1585bc44868Smickey 	/* [0x200] IODC Data Area Descriptors
1595bc44868Smickey 		   use PDC_ALLOC to allocate these memory regions */
1605bc44868Smickey 	u_int	iodc_cons_base;		/* */
1615bc44868Smickey 	u_int	iodc_cons_size;		/* */
1625bc44868Smickey 	u_int	iodc_kbrd_base;		/* */
1635bc44868Smickey 	u_int	iodc_kbrd_size;		/* */
1645bc44868Smickey 	u_int	iodc_boot_base;		/* */
1655bc44868Smickey 	u_int	iodc_boot_size;		/* */
1669c0b8818Smickey 
1675bc44868Smickey 	/* [0x218] */
1685bc44868Smickey 	u_int	resv1[0x41];
1695bc44868Smickey 
1705bc44868Smickey 	/* [0x31C] Capability Flags */
171*39ceab0aSmiod 	u_int	cap_flags;		/* system capabilities */
1725bc44868Smickey #define	HPPA_CAP_WIDESCSI	0x00000001
1735bc44868Smickey 
1745bc44868Smickey 	/* [0x320] Keyboard Extensions */
1755bc44868Smickey 	u_int	kbrd_ext[2];
1765bc44868Smickey 
1775bc44868Smickey 	/* [0x328] Boot Device Extensions */
1785bc44868Smickey 	u_int	boot_ext[2];
1795bc44868Smickey 
1805bc44868Smickey 	/* [0x330] Console/Display Extensions */
1815bc44868Smickey 	u_int	cons_ext[2];
1825bc44868Smickey 
1835bc44868Smickey 	/* [0x338] Initial Memory Module Extensions */
1845bc44868Smickey 	u_int	imm_ext[2];
1855bc44868Smickey 
1865bc44868Smickey 	/* [0x340] Memory Configuration */
1875bc44868Smickey 	u_int	memc_cont_l;		/* memc_cont low part */
1885bc44868Smickey 	u_int	memc_phsize_l;		/* memc_phsize low part */
1895bc44868Smickey 	u_int	memc_adsize_l;		/* memc_adsize low part */
1905bc44868Smickey 	u_int	memc_resv;		/* (reserved) */
191b2714ea3Smickey 	u_int	memc_cont;		/* bytes of contiguous valid memory */
192b2714ea3Smickey 	u_int	memc_phsize;		/* bytes of valid physical memory */
193b2714ea3Smickey 	u_int	memc_adsize;		/* bytes of SPA space used by PDC */
1945bc44868Smickey 	u_int	memc_hpa_h;		/* HPA of CPU (high) */
1959c0b8818Smickey 
1969c0b8818Smickey 	/* [0x360] Miscellaneous */
1979c0b8818Smickey 	struct boot_err mem_be[8];	/* boot errors (see above) */
198b2714ea3Smickey 	u_int	mem_free;		/* first free phys. memory location */
1995bc44868Smickey 	u_int	mem_hpa;		/* HPA of CPU */
2006d6f4087Smickey 	u_int	mem_pdc;		/* PDC entry point */
2019c0b8818Smickey 	u_int	mem_10msec;		/* # of Interval Timer ticks in 10msec*/
2029c0b8818Smickey 
2039c0b8818Smickey 	/* [0x390] Initial Memory Module */
2046d6f4087Smickey 	u_int	imm_hpa;		/* HPA of Initial Memory module */
205b2714ea3Smickey 	u_int	imm_soft_boot;		/* 0 == hard boot, 1 == soft boot */
206b2714ea3Smickey 	u_int	imm_spa_size;		/* bytes of SPA in IMM */
207b2714ea3Smickey 	u_int	imm_max_mem;		/* bytes of mem in IMM (<= spa_size) */
2089c0b8818Smickey 
2099c0b8818Smickey 	/* [0x3A0] Boot Console/Display, Device, and Keyboard */
2109c0b8818Smickey 	struct pz_device mem_cons;	/* description of console device */
2119c0b8818Smickey 	struct pz_device mem_boot;	/* description of boot device */
2129c0b8818Smickey 	struct pz_device mem_kbd;	/* description of keyboard device */
2139c0b8818Smickey 
2149c0b8818Smickey 	/* [0x430] Reserved */
215b2714ea3Smickey 	u_int	resv2[116];		/* (reserved) */
2169c0b8818Smickey 
2179c0b8818Smickey 	/* [0x600] Processor Dependent */
218b2714ea3Smickey 	u_int	pd_resv2[128];		/* (reserved) processor dependent */
2199c0b8818Smickey };
2209c0b8818Smickey #define	v_ctrlcpy	pz_Pdep.pd_Viper.v_Ctrlcpy
2219c0b8818Smickey 
2229c0b8818Smickey 
2239c0b8818Smickey /*
2249c0b8818Smickey  * Every module has 4K-bytes of address space associated with it.
2259c0b8818Smickey  * A Hard Physical Address (HPA) can be broken down as follows.
2269c0b8818Smickey  *
2279c0b8818Smickey  * Since this is an I/O space, the high 4 bits are always 1's.
2289c0b8818Smickey  *
2299c0b8818Smickey  * The "flex" address specifies which bus a module is on; there are
2309c0b8818Smickey  * 256K-bytes of HPA space for each bus, however only values from
2319c0b8818Smickey  * 64 - 1022 are valid for the "flex" field (1022 designates the
2329c0b8818Smickey  * central bus).  The "flex" addr is set at bus configuration time.
2339c0b8818Smickey  *
2349c0b8818Smickey  * The "fixed" address specifies a particular module on the same
2359c0b8818Smickey  * bus (i.e. among modules with the same "flex" address).  This
2369c0b8818Smickey  * value can also be found in "device_path.dp_mod" in "pdc.h".
2379c0b8818Smickey  *
2389c0b8818Smickey  * A modules HPA space consists of 2 pages; the "up" bit specifies
2399c0b8818Smickey  * which of these pages is being addressed.  In general, the lower
2409c0b8818Smickey  * page is privileged and the upper page it module-type dependent.
2419c0b8818Smickey  *
2429c0b8818Smickey  */
2439c0b8818Smickey 
2449c0b8818Smickey struct hpa {
2459c0b8818Smickey 	u_int	hpa_ones: 4,	/* must be 1's; this is an I/O space addr */
2469c0b8818Smickey 		hpa_flex:10,	/* bus address for this module */
2479c0b8818Smickey 		hpa_fixed:6,	/* location of module on bus */
2489c0b8818Smickey 		hpa_up	: 1,	/* 1 == upper page, 0 == lower page */
2499c0b8818Smickey 		hpa_set	: 5,	/* register set */
2509c0b8818Smickey 		hpa_reg	: 4,	/* register number within a register set */
2519c0b8818Smickey 		hpa_zeros:2;	/* must be 0's; addrs are word aligned */
2529c0b8818Smickey };
2539c0b8818Smickey 
2549c0b8818Smickey 
2559c0b8818Smickey /*
2569c0b8818Smickey  * Certain modules require additional memory (i.e. more than that
2579c0b8818Smickey  * provided by the HPA space).  A Soft Physical Address (SPA) can be
2589c0b8818Smickey  * broken down as follows, on a module-type specific basis (either
2599c0b8818Smickey  * Memory SPA or I/O SPA).
2609c0b8818Smickey  *
2619c0b8818Smickey  * SPA space must be a power of 2, and aligned accordingly.  The IODC
2629c0b8818Smickey  * provides all information needed by software to configure SPA space
2639c0b8818Smickey  * for a particular module.
2649c0b8818Smickey  */
2659c0b8818Smickey 
2669c0b8818Smickey struct memspa {
2679c0b8818Smickey 	u_int	spa_page:21,	/* page of memory */
2689c0b8818Smickey 		spa_off	:11;	/* offset into memory page */
2699c0b8818Smickey };
2709c0b8818Smickey 
2719c0b8818Smickey struct iospa {
2729c0b8818Smickey 	u_int	spa_ones: 4,	/* must be 1's; this is an I/O space addr */
2739c0b8818Smickey 		spa_iopg:17,	/* page in I/O address space */
2749c0b8818Smickey 		spa_set	: 5,	/* register set */
2759c0b8818Smickey 		spa_reg	: 4,	/* register number within a register set */
2769c0b8818Smickey 		spa_mode: 2;	/* aligned according to bus transaction mode */
2779c0b8818Smickey };
2789c0b8818Smickey 
2799c0b8818Smickey 
2809c0b8818Smickey /*
2819c0b8818Smickey  * It is possible to send a command to all modules on a particular bus
2829c0b8818Smickey  * (local broadcast), or all modules (global broadcast).  A Broadcast
2839c0b8818Smickey  * Physical Address (BPA) can be broken down as follows.
2849c0b8818Smickey  *
2859c0b8818Smickey  * Read and Clear transactions are not allowed in BPA space.  All pages
2869c0b8818Smickey  * in BPA space are privileged.
2879c0b8818Smickey  */
2889c0b8818Smickey 
2899c0b8818Smickey struct bpa {
2909c0b8818Smickey 	u_int	bpa_ones:14,	/* must be 1's; this is in BPA space */
2919c0b8818Smickey 		bpa_gbl	: 1,	/* 0 == local, 1 == global broadcast */
2929c0b8818Smickey 		bpa_page: 6,	/* page in local/global BPA space */
2939c0b8818Smickey 		bpa_set	: 5,	/* register set */
2949c0b8818Smickey 		bpa_reg	: 4,	/* register number within a register set */
2959c0b8818Smickey 		bpa_zeros:2;	/* must be 0's; addrs are word aligned */
2969c0b8818Smickey };
2979c0b8818Smickey 
2989c0b8818Smickey 
2999c0b8818Smickey /*
3009c0b8818Smickey  * All I/O and Memory modules have 4K-bytes of HPA space associated with
3019c0b8818Smickey  * it (described above), however not all modules implement every register.
302af18ceffSjmc  * The first 2K-bytes of registers are "privileged".
3039c0b8818Smickey  *
3049c0b8818Smickey  * (WO) == Write Only, (RO) == Read Only
3059c0b8818Smickey  */
3069c0b8818Smickey 
3079c0b8818Smickey struct iomod {
3089c0b8818Smickey /* SRS (Supervisor Register Set) */
3099c0b8818Smickey 	u_int	io_eir;		/* (WO) interrupt CPU; set bits in EIR CR */
3109c0b8818Smickey 	u_int	io_eim;		/* (WO) External Interrupt Message address */
3119c0b8818Smickey 	u_int	io_dc_rw;	/* write address of IODC to read IODC data */
312b2714ea3Smickey 	u_int	io_ii_rw;	/* read/clear external intrpt msg (bit-26) */
3136d6f4087Smickey 	u_int	io_dma_link;	/* pointer to "next quad" in DMA chain */
3149c0b8818Smickey 	u_int	io_dma_command;	/* (RO) chain command to exec on "next quad" */
3156d6f4087Smickey 	u_int	io_dma_address;	/* (RO) start of DMA */
316b2714ea3Smickey 	u_int	io_dma_count;	/* (RO) number of bytes remaining to xfer */
3176d6f4087Smickey 	u_int	io_flex;	/* (WO) HPA flex addr, LSB: bus master flag */
3186d6f4087Smickey 	u_int	io_spa;		/* (WO) SPA space; 0-20:addr, 24-31:iodc_spa */
319b2714ea3Smickey 	u_int	resv1[2];	/* (reserved) */
3209c0b8818Smickey 	u_int	io_command;	/* (WO) module commands (see below) */
3219c0b8818Smickey 	u_int	io_status;	/* (RO) error returns (see below) */
3229c0b8818Smickey 	u_int	io_control;	/* memory err logging (bit-9), bc forwarding */
3239c0b8818Smickey 	u_int	io_test;	/* (RO) self-test information */
3249c0b8818Smickey /* ARS (Auxiliary Register Set) */
3259c0b8818Smickey 	u_int	io_err_sadd;	/* (RO) slave bus error or memory error addr */
3266d6f4087Smickey 	u_int	chain_addr;	/* start address of chain RAM */
3279c0b8818Smickey 	u_int	sub_mask_clr;	/* ignore intrpts on sub-channel (bitmask) */
3289c0b8818Smickey 	u_int	sub_mask_set;	/* service intrpts on sub-channel (bitmask) */
3299c0b8818Smickey 	u_int	diagnostic;	/* diagnostic use (reserved) */
330b2714ea3Smickey 	u_int	resv2[2];	/* (reserved) */
3316d6f4087Smickey 	u_int	nmi_address;	/* address to send data to when NMI detected */
3326d6f4087Smickey 	u_int	nmi_data;	/* NMI data to be sent */
333b2714ea3Smickey 	u_int	resv3[3];	/* (reserved) */
3349c0b8818Smickey 	u_int	io_mem_low;	/* bottom of memory address range */
3359c0b8818Smickey 	u_int	io_mem_high;	/* top of memory address range */
3369c0b8818Smickey 	u_int	io_io_low;	/* bottom of I/O HPA address Range */
3379c0b8818Smickey 	u_int	io_io_high;	/* top of I/O HPA address Range */
3389c0b8818Smickey 
339b2714ea3Smickey 	u_int	priv_trs[160];	/* TRSes (Type-dependent Reg Sets) */
3409c0b8818Smickey 
341b2714ea3Smickey 	u_int	priv_hvrs[320];	/* HVRSes (HVERSION-dependent Register Sets) */
3429c0b8818Smickey 
343b2714ea3Smickey 	u_int	hvrs[512];	/* HVRSes (HVERSION-dependent Register Sets) */
3449c0b8818Smickey };
3459c0b8818Smickey #endif	/* !_LOCORE */
3469c0b8818Smickey 
3478109945cSmickey /* primarily for a "reboot" and "_rtt" routines */
3488109945cSmickey #define	iomod_command	(4*12)
3498109945cSmickey 
3509c0b8818Smickey /* io_flex */
3519c0b8818Smickey #define	DMA_ENABLE	0x1	/* flex register enable DMA bit */
3529c0b8818Smickey 
3539c0b8818Smickey /* io_spa */
3549c0b8818Smickey #define	IOSPA(spa,iodc_data)	\
355b2cc206bSmickey 	((volatile caddr_t)		\
3569c0b8818Smickey 	 (spa | iodc_data.iodc_spa_shift | iodc_data.iodc_spa_enb << 5 | \
3579c0b8818Smickey 	  iodc_data.iodc_spa_pack << 6 | iodc_data.iodc_spa_io << 7))
3589c0b8818Smickey 
3599c0b8818Smickey /* io_command */
3609c0b8818Smickey #define	CMD_STOP	0	/* halt any I/O, enable diagnostic access */
3619c0b8818Smickey #define	CMD_FLUSH	1	/* abort DMA */
3629c0b8818Smickey #define	CMD_CHAIN	2	/* initiate DMA */
3639c0b8818Smickey #define	CMD_CLEAR	3	/* clear errors */
3649c0b8818Smickey #define	CMD_RESET	5	/* reset any module */
3659c0b8818Smickey 
3669c0b8818Smickey /* io_status */
3679c0b8818Smickey #define	IO_ERR_MEM_SL	0x10000	/* SPA space lost or corrupted */
3689c0b8818Smickey #define	IO_ERR_MEM_SE	0x00200	/* severity: minor */
3699c0b8818Smickey #define	IO_ERR_MEM_HE	0x00100	/* severity: affects invalid parts */
3709c0b8818Smickey #define	IO_ERR_MEM_FE	0x00080	/* severity: bad */
3719c0b8818Smickey #define	IO_ERR_MEM_RY	0x00040	/* IO_COMMAND register ready for command */
3729c0b8818Smickey #define	IO_ERR_DMA_DG	0x00010	/* module in diagnostic mode */
3739c0b8818Smickey #define	IO_ERR_DMA_PW	0x00004	/* Power Failing */
3749c0b8818Smickey #define	IO_ERR_DMA_PL	0x00002	/* Power Lost */
3759c0b8818Smickey #define	IO_ERR_VAL(x)	 (((x) >> 10) & 0x3f)
3769c0b8818Smickey #define	IO_ERR_DEPEND	 0	/* unspecified error */
3779c0b8818Smickey #define	IO_ERR_SPA	 1	/* (module-type specific) */
3789c0b8818Smickey #define	IO_ERR_INTERNAL	 2	/* (module-type specific) */
379c2a89830Smiod #define	IO_ERR_MODE	 3	/* invalid mode or address space mapping */
3809c0b8818Smickey #define	IO_ERR_ERROR_M	 4	/* bus error (master detect) */
3819c0b8818Smickey #define	IO_ERR_DPARITY_S 5	/* data parity (slave detect) */
3829c0b8818Smickey #define	IO_ERR_PROTO_M	 6	/* protocol error (master detect) */
3839c0b8818Smickey #define	IO_ERR_ADDRESS	 7	/* no slave acknowledgement in transaction */
384a0e124d9Sdavid #define	IO_ERR_MORE	 8	/* device transferred more data than expected */
385a0e124d9Sdavid #define	IO_ERR_LESS	 9	/* device transferred less data than expected */
386c2a89830Smiod #define	IO_ERR_SAPARITY	10	/* slave address phase parity */
3879c0b8818Smickey #define	IO_ERR_MAPARITY	11	/* master address phase parity */
3889c0b8818Smickey #define	IO_ERR_MDPARITY	12	/* mode phase parity */
3899c0b8818Smickey #define	IO_ERR_STPARITY	13	/* status phase parity */
3909c0b8818Smickey #define	IO_ERR_CMD	14	/* unimplemented I/O Command */
3919c0b8818Smickey #define	IO_ERR_BUS	15	/* generic bus error */
3929c0b8818Smickey #define	IO_ERR_CORR	24	/* correctable memory error */
3939c0b8818Smickey #define	IO_ERR_UNCORR	25	/* uncorrectable memory error */
3949c0b8818Smickey #define	IO_ERR_MAP	26	/* equivalent to IO_ERR_CORR */
3959c0b8818Smickey #define	IO_ERR_LINK	28	/* Bus Converter "link" (connection) error */
3969c0b8818Smickey #define	IO_ERR_CCMD	32	/* Illegal DMA command */
3979c0b8818Smickey #define	IO_ERR_ERROR_S	52	/* bus error (slave detect) */
3989c0b8818Smickey #define	IO_ERR_DPARITY_M 53	/* data parity (master detect) */
3999c0b8818Smickey #define	IO_ERR_PROTOCOL	54	/* protocol error (slave detect) */
4009c0b8818Smickey #define	IO_ERR_SELFTEST	58	/* (module-type specific) */
4019c0b8818Smickey #define	IO_ERR_BUSY	59	/* slave was busy too often or too long */
402c2a89830Smiod #define	IO_ERR_RETRY	60	/* "busied" transaction not retried soon enough */
4039c0b8818Smickey #define	IO_ERR_ACCESS	61	/* illegal register access */
4049c0b8818Smickey #define	IO_ERR_IMPROP	62	/* "improper" data written */
4059c0b8818Smickey #define	IO_ERR_UNKNOWN	63
4069c0b8818Smickey 
4079c0b8818Smickey /* io_control (memory) */
4089c0b8818Smickey #define	IO_CTL_MEMINIT	0x0	/* prevent some bus errors during memory init */
4099c0b8818Smickey #define	IO_CTL_MEMOKAY	0x100	/* enable all bus error logging */
4109c0b8818Smickey 
4119c0b8818Smickey /* io_spa */
4129c0b8818Smickey #define	SPA_ENABLE	0x20	/* io_spa register enable spa bit */
4139c0b8818Smickey 
414b2cc206bSmickey #endif	/* _MACHINE_IOMOD_H_ */
415