hid.h revision 125614
1110385Sbenno/*-
2110385Sbenno * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
3110385Sbenno *
4110385Sbenno * Redistribution and use in source and binary forms, with or without
5110385Sbenno * modification, are permitted provided that the following conditions
6110385Sbenno * are met:
7110385Sbenno * 1. Redistributions of source code must retain the above copyright
8110385Sbenno *    notice, this list of conditions and the following disclaimer.
9110385Sbenno * 2. Redistributions in binary form must reproduce the above copyright
10110385Sbenno *    notice, this list of conditions and the following disclaimer in the
11110385Sbenno *    documentation and/or other materials provided with the distribution.
12110385Sbenno * 3. The name of the author may not be used to endorse or promote products
13110385Sbenno *    derived from this software without specific prior written permission.
14110385Sbenno *
15110385Sbenno * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16110385Sbenno * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17110385Sbenno * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18110385Sbenno * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19110385Sbenno * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20110385Sbenno * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21110385Sbenno * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22110385Sbenno * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23110385Sbenno * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24110385Sbenno * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25110385Sbenno *
26110385Sbenno * $NetBSD: hid.h,v 1.2 2001/08/22 21:05:25 matt Exp $
27110385Sbenno * $FreeBSD: head/sys/powerpc/include/hid.h 125614 2004-02-09 00:12:50Z grehan $
28110385Sbenno */
29110385Sbenno
30110385Sbenno#ifndef _POWERPC_HID_H_
31110385Sbenno#define _POWERPC_HID_H_
32110385Sbenno
33110385Sbenno/* Hardware Implementation Dependent registers for the PowerPC */
34110385Sbenno
35110385Sbenno#define HID0_EMCP	0x80000000  /* Enable MCP */
36110385Sbenno#define HID0_DBP	0x40000000  /* Disable 60x bus parity generation */
37110385Sbenno#define HID0_EBA	0x20000000  /* Enable 60x bus address parity checking */
38110385Sbenno#define HID0_EBD	0x10000000  /* Enable 60x bus data parity checking */
39110385Sbenno#define HID0_BCLK	0x08000000  /* CLK_OUT clock type selection */
40110385Sbenno#define HID0_EICE	0x04000000  /* Enable ICE output */
41110385Sbenno#define HID0_TBEN	0x04000000  /* Time base enable (7450) */
42110385Sbenno#define HID0_ECLK	0x02000000  /* CLK_OUT clock type selection */
43110385Sbenno#define HID0_PAR	0x01000000  /* Disable precharge of ARTRY */
44110385Sbenno#define HID0_STEN	0x01000000  /* Software table search enable (7450) */
45125614Sgrehan#define HID0_HBATEN	0x00800000  /* High BAT enable (7457) */
46110385Sbenno#define HID0_DOZE	0x00800000  /* Enable doze mode */
47110385Sbenno#define HID0_NAP	0x00400000  /* Enable nap mode */
48110385Sbenno#define HID0_SLEEP	0x00200000  /* Enable sleep mode */
49110385Sbenno#define HID0_DPM	0x00100000  /* Enable Dynamic power management */
50110385Sbenno#define HID0_RISEG	0x00080000  /* Read I-SEG */
51110385Sbenno#define HID0_BHTCLR	0x00080000  /* Clear branch history table (7450) */
52110385Sbenno#define HID0_EIEC	0x00040000  /* Enable internal error checking */
53110385Sbenno#define HID0_XAEN	0x00040000  /* Enable eXtended Addressing (7450) */
54110385Sbenno#define HID0_NHR	0x00010000  /* Not hard reset */
55110385Sbenno#define HID0_ICE	0x00008000  /* Enable i-cache */
56110385Sbenno#define HID0_DCE	0x00004000  /* Enable d-cache */
57110385Sbenno#define HID0_ILOCK	0x00002000  /* i-cache lock */
58110385Sbenno#define HID0_DLOCK	0x00001000  /* d-cache lock */
59110385Sbenno#define HID0_ICFI	0x00000800  /* i-cache flush invalidate */
60110385Sbenno#define HID0_DCFI	0x00000400  /* d-cache flush invalidate */
61110385Sbenno#define HID0_SPD	0x00000200  /* Disable speculative cache access */
62125614Sgrehan#define HID0_XBSEN	0x00000100  /* Extended BAT block-size enable (7457) */
63110385Sbenno#define HID0_IFEM	0x00000100  /* Enable M-bit for I-fetch */
64110385Sbenno#define HID0_SGE	0x00000080  /* Enable store gathering */
65110385Sbenno#define HID0_DCFA	0x00000040  /* Data cache flush assist */
66110385Sbenno#define HID0_BTIC	0x00000020  /* Enable BTIC */
67110385Sbenno#define HID0_ABE	0x00000008  /* Enable address broadcast */
68110385Sbenno#define HID0_BHT	0x00000004  /* Enable branch history table */
69110385Sbenno#define HID0_NOPTI	0x00000001  /* No-op the dcbt(st) */
70110385Sbenno
71110385Sbenno#define HID0_BITMASK							\
72110385Sbenno    "\20"								\
73110385Sbenno    "\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR"	\
74110385Sbenno    "\030DOZE\027NAP\026SLEEP\025DPM\024RISEG\023EIEC\022res\021NHR"	\
75110385Sbenno    "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011IFEM"	\
76110385Sbenno    "\010SGE\007DCFA\006BTIC\005FBIOB\004ABE\003BHT\002NOPDST\001NOPTI"
77110385Sbenno
78110385Sbenno#define HID0_7450_BITMASK						\
79110385Sbenno    "\20"								\
80110385Sbenno    "\040EMCP\037b1\036b2\035b3\034b4\033TBEN\032b6\031STEN"		\
81125614Sgrehan    "\030HBATEN\027NAP\026SLEEP\025DPM\024b12\023BHTCLR\022XAEN\021NHR"	\
82125614Sgrehan    "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011XBSEN"	\
83110385Sbenno    "\010SGE\007b25\006BTIC\005LRSTK\004FOLD\003BHT\002NOPDST\001NOPTI"
84110385Sbenno
85110385Sbenno/*
86110385Sbenno *  HID0 bit definitions per cpu model
87110385Sbenno *
88125614Sgrehan * bit	603	604	750	7400	7410   7450    7457
89125614Sgrehan *   0	EMCP	EMCP	EMCP	EMCP	EMCP   -       -
90125614Sgrehan *   1	-	ECP	DBP	-	-      -       -
91125614Sgrehan *   2	EBA	EBA	EBA	EBA	EDA    -       -
92125614Sgrehan *   3	EBD	EBD	EBD	EBD	EBD    -       -
93125614Sgrehan *   4	SBCLK	-	BCLK	BCKL	BCLK   -       -
94125614Sgrehan *   5	EICE	-	-	-	-      TBEN    TBEN
95125614Sgrehan *   6	ECLK	-	ECLK	ECLK	ECLK   -       -
96125614Sgrehan *   7	PAR	PAR	PAR	PAR	PAR    STEN    STEN
97125614Sgrehan *   8	DOZE	-	DOZE	DOZE	DOZE   -       HBATEN
98125614Sgrehan *   9	NAP	-	NAP	NAP	NAP    NAP     NAP
99125614Sgrehan *  10	SLEEP	-	SLEEP	SLEEP	SLEEP  SLEEP   SLEEP
100125614Sgrehan *  11	DPM	-	DPM	DPM	DPM    DPM     DPM
101125614Sgrehan *  12	RISEG	-	-	RISEG	-      -       -
102125614Sgrehan *  13	-	-	-	EIEC	EIEC   BHTCLR  BHTCLR
103125614Sgrehan *  14	-	-	-	-	-      XAEN    XAEN
104125614Sgrehan *  15	-	NHR	NHR	NHR	NHR    NHR     NHR
105125614Sgrehan *  16	ICE	ICE	ICE	ICE	ICE    ICE     ICE
106125614Sgrehan *  17	DCE	DCE	DCE	DCE	DCE    DCE     DCE
107125614Sgrehan *  18	ILOCK	ILOCK	ILOCK	ILOCK	ILOCK  ILOCK   ILOCK
108125614Sgrehan *  19	DLOCK	DLOCK	DLOCK	DLOCK	DLOCK  DLOCK   DLOCK
109125614Sgrehan *  20	ICFI	ICFI	ICFI	ICFI	ICFI   ICFI    ICFI
110125614Sgrehan *  21	DCFI	DCFI	DCFI	DCFI	DCFI   DCFI    DCFI
111125614Sgrehan *  22	-	-	SPD	SPD	SPG    SPD     SPD
112125614Sgrehan *  23	-	-	IFEM	IFTT	IFTT   -       XBSEN
113125614Sgrehan *  24	-	SIE	SGE	SGE	SGE    SGE     SGE
114125614Sgrehan *  25	-	-	DCFA	DCFA	DCFA   -       -
115125614Sgrehan *  26	-	-	BTIC	BTIC	BTIC   BTIC    BTIC
116125614Sgrehan *  27	FBIOB	-	-	-	-      LRSTK   LRSTK
117125614Sgrehan *  28	-	-	ABE	-	-      FOLD    FOLD
118125614Sgrehan *  29	-	BHT	BHT	BHT	BHT    BHT     BHT
119125614Sgrehan *  30	-	-	-	NOPDST	NOPDST NOPDST  NOPDST
120125614Sgrehan *  31	NOOPTI	-	NOOPTI	NOPTI	NOPTI  NOPTI   NOPTI
121110385Sbenno *
122110385Sbenno *  604: ECP = Enable cache parity checking
123110385Sbenno *  604: SIE = Serial instruction execution disable
124110385Sbenno * 7450: TBEN = Time Base Enable
125110385Sbenno * 7450: STEN = Software table lookup enable
126110385Sbenno * 7450: BHTCLR = Branch history clear
127125614Sgrehan * 7450: XAEN = Extended Addressing Enabled
128110385Sbenno * 7450: LRSTK = Link Register Stack Enable
129110385Sbenno * 7450: FOLD = Branch folding enable
130125614Sgrehan * 7457: HBATEN = High BAT Enable
131125614Sgrehan * 7457: XBSEN = Extended BAT Block Size Enable
132110385Sbenno */
133110385Sbenno
134110385Sbenno#endif /* _POWERPC_HID_H_ */
135