xref: /freebsd/sys/powerpc/include/hid.h (revision 2ff63af9b88c7413b7d71715b5532625752a248e)
119ca68d9SBenno Rice /*-
251369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
351369649SPedro F. Giffuni  *
419ca68d9SBenno Rice  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
519ca68d9SBenno Rice  *
619ca68d9SBenno Rice  * Redistribution and use in source and binary forms, with or without
719ca68d9SBenno Rice  * modification, are permitted provided that the following conditions
819ca68d9SBenno Rice  * are met:
919ca68d9SBenno Rice  * 1. Redistributions of source code must retain the above copyright
1019ca68d9SBenno Rice  *    notice, this list of conditions and the following disclaimer.
1119ca68d9SBenno Rice  * 2. Redistributions in binary form must reproduce the above copyright
1219ca68d9SBenno Rice  *    notice, this list of conditions and the following disclaimer in the
1319ca68d9SBenno Rice  *    documentation and/or other materials provided with the distribution.
1419ca68d9SBenno Rice  * 3. The name of the author may not be used to endorse or promote products
1519ca68d9SBenno Rice  *    derived from this software without specific prior written permission.
1619ca68d9SBenno Rice  *
1719ca68d9SBenno Rice  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1819ca68d9SBenno Rice  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1919ca68d9SBenno Rice  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2019ca68d9SBenno Rice  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2119ca68d9SBenno Rice  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2219ca68d9SBenno Rice  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2319ca68d9SBenno Rice  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2419ca68d9SBenno Rice  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2519ca68d9SBenno Rice  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2619ca68d9SBenno Rice  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2719ca68d9SBenno Rice  *
2819ca68d9SBenno Rice  * $NetBSD: hid.h,v 1.2 2001/08/22 21:05:25 matt Exp $
2919ca68d9SBenno Rice  */
3019ca68d9SBenno Rice 
3119ca68d9SBenno Rice #ifndef _POWERPC_HID_H_
3219ca68d9SBenno Rice #define _POWERPC_HID_H_
3319ca68d9SBenno Rice 
3419ca68d9SBenno Rice /* Hardware Implementation Dependent registers for the PowerPC */
35*5ab39b65SJustin Hibbits #define	HID0_RADIX	0x0080000000000000	/* Enable Radix page tables (POWER9) */
3619ca68d9SBenno Rice 
37b9b8eb77SRafal Jaworowski #define HID0_EMCP	0x80000000  /* Enable machine check pin */
3819ca68d9SBenno Rice #define HID0_DBP	0x40000000  /* Disable 60x bus parity generation */
3919ca68d9SBenno Rice #define HID0_EBA	0x20000000  /* Enable 60x bus address parity checking */
4019ca68d9SBenno Rice #define HID0_EBD	0x10000000  /* Enable 60x bus data parity checking */
4119ca68d9SBenno Rice #define HID0_BCLK	0x08000000  /* CLK_OUT clock type selection */
4219ca68d9SBenno Rice #define HID0_EICE	0x04000000  /* Enable ICE output */
4319ca68d9SBenno Rice #define HID0_ECLK	0x02000000  /* CLK_OUT clock type selection */
4419ca68d9SBenno Rice #define HID0_PAR	0x01000000  /* Disable precharge of ARTRY */
4519ca68d9SBenno Rice #define HID0_STEN	0x01000000  /* Software table search enable (7450) */
46570d2b25SNathan Whitehorn #define HID0_DEEPNAP	0x01000000  /* Enable deep nap mode (970) */
479e8e1400SPeter Grehan #define HID0_HBATEN	0x00800000  /* High BAT enable (74[45][578])  */
4819ca68d9SBenno Rice #define HID0_DOZE	0x00800000  /* Enable doze mode */
4919ca68d9SBenno Rice #define HID0_NAP	0x00400000  /* Enable nap mode */
5019ca68d9SBenno Rice #define HID0_SLEEP	0x00200000  /* Enable sleep mode */
5119ca68d9SBenno Rice #define HID0_DPM	0x00100000  /* Enable Dynamic power management */
5219ca68d9SBenno Rice #define HID0_RISEG	0x00080000  /* Read I-SEG */
531c96bdd1SNathan Whitehorn #define HID0_TG		0x00040000  /* Timebase Granularity (OEA64) */
549e8e1400SPeter Grehan #define HID0_BHTCLR	0x00040000  /* Clear branch history table (7450) */
5519ca68d9SBenno Rice #define HID0_EIEC	0x00040000  /* Enable internal error checking */
569e8e1400SPeter Grehan #define HID0_XAEN	0x00020000  /* Enable eXtended Addressing (7450) */
5719ca68d9SBenno Rice #define HID0_NHR	0x00010000  /* Not hard reset */
5819ca68d9SBenno Rice #define HID0_ICE	0x00008000  /* Enable i-cache */
5919ca68d9SBenno Rice #define HID0_DCE	0x00004000  /* Enable d-cache */
6019ca68d9SBenno Rice #define HID0_ILOCK	0x00002000  /* i-cache lock */
6119ca68d9SBenno Rice #define HID0_DLOCK	0x00001000  /* d-cache lock */
6219ca68d9SBenno Rice #define HID0_ICFI	0x00000800  /* i-cache flush invalidate */
6319ca68d9SBenno Rice #define HID0_DCFI	0x00000400  /* d-cache flush invalidate */
6419ca68d9SBenno Rice #define HID0_SPD	0x00000200  /* Disable speculative cache access */
65e6d3e1c2SPeter Grehan #define HID0_XBSEN	0x00000100  /* Extended BAT block-size enable (7457) */
6619ca68d9SBenno Rice #define HID0_IFEM	0x00000100  /* Enable M-bit for I-fetch */
679e8e1400SPeter Grehan #define HID0_XBSEN	0x00000100  /* Extended BAT block size enable (7455+)*/
6819ca68d9SBenno Rice #define HID0_SGE	0x00000080  /* Enable store gathering */
6919ca68d9SBenno Rice #define HID0_DCFA	0x00000040  /* Data cache flush assist */
7019ca68d9SBenno Rice #define HID0_BTIC	0x00000020  /* Enable BTIC */
719e8e1400SPeter Grehan #define HID0_LRSTK	0x00000010  /* Link register stack enable (7450) */
7219ca68d9SBenno Rice #define HID0_ABE	0x00000008  /* Enable address broadcast */
739e8e1400SPeter Grehan #define HID0_FOLD	0x00000008  /* Branch folding enable (7450) */
7419ca68d9SBenno Rice #define HID0_BHT	0x00000004  /* Enable branch history table */
7519ca68d9SBenno Rice #define HID0_NOPTI	0x00000001  /* No-op the dcbt(st) */
7619ca68d9SBenno Rice 
77786e4a1bSRafal Jaworowski #define HID0_AIM_TBEN	0x04000000  /* Time base enable (7450) */
78786e4a1bSRafal Jaworowski 
79b9b8eb77SRafal Jaworowski #define HID0_E500_TBEN		0x00004000 /* Time Base and decr. enable */
80b9b8eb77SRafal Jaworowski #define HID0_E500_SEL_TBCLK	0x00002000 /* Select Time Base clock */
81b9b8eb77SRafal Jaworowski #define HID0_E500_MAS7UPDEN	0x00000080 /* Enable MAS7 update (e500v2) */
82786e4a1bSRafal Jaworowski 
83ec045376SRafal Jaworowski #define HID0_E500MC_L2MMU_MHD	0x40000000 /* L2MMU Multiple Hit Detection */
84ec045376SRafal Jaworowski 
8519ca68d9SBenno Rice #define HID0_BITMASK							\
8619ca68d9SBenno Rice     "\20"								\
8719ca68d9SBenno Rice     "\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR"	\
8819ca68d9SBenno Rice     "\030DOZE\027NAP\026SLEEP\025DPM\024RISEG\023EIEC\022res\021NHR"	\
8919ca68d9SBenno Rice     "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011IFEM"	\
9019ca68d9SBenno Rice     "\010SGE\007DCFA\006BTIC\005FBIOB\004ABE\003BHT\002NOPDST\001NOPTI"
9119ca68d9SBenno Rice 
9219ca68d9SBenno Rice #define HID0_7450_BITMASK						\
9319ca68d9SBenno Rice     "\20"								\
9419ca68d9SBenno Rice     "\040EMCP\037b1\036b2\035b3\034b4\033TBEN\032b6\031STEN"		\
95e6d3e1c2SPeter Grehan     "\030HBATEN\027NAP\026SLEEP\025DPM\024b12\023BHTCLR\022XAEN\021NHR"	\
96e6d3e1c2SPeter Grehan     "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011XBSEN"	\
9719ca68d9SBenno Rice     "\010SGE\007b25\006BTIC\005LRSTK\004FOLD\003BHT\002NOPDST\001NOPTI"
98cb9bdc64SRafal Jaworowski 
99cb9bdc64SRafal Jaworowski #define HID0_E500_BITMASK						\
100cb9bdc64SRafal Jaworowski     "\20"								\
101cb9bdc64SRafal Jaworowski     "\040EMCP\037b1\036b2\035b3\034b4\033b5\032b6\031b7"		\
102cb9bdc64SRafal Jaworowski     "\030DOZE\027NAP\026SLEEP\025b11\024b12\023b13\022b14\021b15"	\
103cb9bdc64SRafal Jaworowski     "\020b16\017TBEN\016SEL_TBCLK\015b19\014b20\013b21\012b22\011b23"	\
104cb9bdc64SRafal Jaworowski     "\010EN_MAS7_UPDATE\007DCFA\006b26\005b27\004b28\003b29\002b30\001NOPTI"
10519ca68d9SBenno Rice 
106570d2b25SNathan Whitehorn #define HID0_970_BITMASK						\
107570d2b25SNathan Whitehorn     "\20"								\
108570d2b25SNathan Whitehorn     "\040ONEPPC\037SINGLE\036ISYNCSC\035SERGP\031DEEPNAP\030DOZE"	\
109570d2b25SNathan Whitehorn     "\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER"		\
110570d2b25SNathan Whitehorn     "\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN"
111570d2b25SNathan Whitehorn 
112ec045376SRafal Jaworowski #define HID0_E500MC_BITMASK						\
113ec045376SRafal Jaworowski     "\20"								\
114ec045376SRafal Jaworowski     "\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7"	\
115ec045376SRafal Jaworowski     "\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15"		\
116ec045376SRafal Jaworowski     "\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23"		\
117ec045376SRafal Jaworowski     "\010EN_MAS7_UPDATE\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI"
118ec045376SRafal Jaworowski 
119ec045376SRafal Jaworowski #define HID0_E5500_BITMASK						\
120ec045376SRafal Jaworowski     "\20"								\
121ec045376SRafal Jaworowski     "\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7"	\
122ec045376SRafal Jaworowski     "\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15"		\
123ec045376SRafal Jaworowski     "\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23"		\
124ec045376SRafal Jaworowski     "\010b24\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI"
125ec045376SRafal Jaworowski 
12619ca68d9SBenno Rice /*
12719ca68d9SBenno Rice  *  HID0 bit definitions per cpu model
12819ca68d9SBenno Rice  *
129786e4a1bSRafal Jaworowski  * bit	603	604	750	7400	7410	7450	7457	e500
130786e4a1bSRafal Jaworowski  *   0	EMCP	EMCP	EMCP	EMCP	EMCP	-	-	EMCP
131786e4a1bSRafal Jaworowski  *   1	-	ECP	DBP	-	-	-	-	-
132786e4a1bSRafal Jaworowski  *   2	EBA	EBA	EBA	EBA	EDA	-	-	-
133786e4a1bSRafal Jaworowski  *   3	EBD	EBD	EBD	EBD	EBD	-	-	-
134786e4a1bSRafal Jaworowski  *   4	SBCLK	-	BCLK	BCKL	BCLK	-	-	-
135786e4a1bSRafal Jaworowski  *   5	EICE	-	-	-	-	TBEN	TBEN	-
136786e4a1bSRafal Jaworowski  *   6	ECLK	-	ECLK	ECLK	ECLK	-	-	-
137786e4a1bSRafal Jaworowski  *   7	PAR	PAR	PAR	PAR	PAR	STEN	STEN	-
138786e4a1bSRafal Jaworowski  *   8	DOZE	-	DOZE	DOZE	DOZE	-	HBATEN	DOZE
139786e4a1bSRafal Jaworowski  *   9	NAP	-	NAP	NAP	NAP	NAP	NAP	NAP
140786e4a1bSRafal Jaworowski  *  10	SLEEP	-	SLEEP	SLEEP	SLEEP	SLEEP	SLEEP	SLEEP
141786e4a1bSRafal Jaworowski  *  11	DPM	-	DPM	DPM	DPM	DPM	DPM	-
142786e4a1bSRafal Jaworowski  *  12	RISEG	-	-	RISEG	-	-	-	-
143786e4a1bSRafal Jaworowski  *  13	-	-	-	EIEC	EIEC	BHTCLR	BHTCLR	-
144786e4a1bSRafal Jaworowski  *  14	-	-	-	-	-	XAEN	XAEN	-
145786e4a1bSRafal Jaworowski  *  15	-	NHR	NHR	NHR	NHR	NHR	NHR	-
146786e4a1bSRafal Jaworowski  *  16	ICE	ICE	ICE	ICE	ICE	ICE	ICE	-
147786e4a1bSRafal Jaworowski  *  17	DCE	DCE	DCE	DCE	DCE	DCE	DCE	TBEN
148786e4a1bSRafal Jaworowski  *  18	ILOCK	ILOCK	ILOCK	ILOCK	ILOCK	ILOCK	ILOCK	SEL_TBCLK
149786e4a1bSRafal Jaworowski  *  19	DLOCK	DLOCK	DLOCK	DLOCK	DLOCK	DLOCK	DLOCK	-
150786e4a1bSRafal Jaworowski  *  20	ICFI	ICFI	ICFI	ICFI	ICFI	ICFI	ICFI	-
151786e4a1bSRafal Jaworowski  *  21	DCFI	DCFI	DCFI	DCFI	DCFI	DCFI	DCFI	-
152786e4a1bSRafal Jaworowski  *  22	-	-	SPD	SPD	SPG	SPD	SPD	-
153786e4a1bSRafal Jaworowski  *  23	-	-	IFEM	IFTT	IFTT	-	XBSEN	-
154786e4a1bSRafal Jaworowski  *  24	-	SIE	SGE	SGE	SGE	SGE	SGE	EN_MAS7_UPDATE
155786e4a1bSRafal Jaworowski  *  25	-	-	DCFA	DCFA	DCFA	-	-	DCFA
156786e4a1bSRafal Jaworowski  *  26	-	-	BTIC	BTIC	BTIC	BTIC	BTIC	-
157786e4a1bSRafal Jaworowski  *  27	FBIOB	-	-	-	-	LRSTK	LRSTK	-
158786e4a1bSRafal Jaworowski  *  28	-	-	ABE	-	-	FOLD	FOLD	-
159786e4a1bSRafal Jaworowski  *  29	-	BHT	BHT	BHT	BHT	BHT	BHT	-
160786e4a1bSRafal Jaworowski  *  30	-	-	-	NOPDST	NOPDST	NOPDST	NOPDST	-
161786e4a1bSRafal Jaworowski  *  31	NOOPTI	-	NOOPTI	NOPTI	NOPTI	NOPTI	NOPTI	NOPTI
16219ca68d9SBenno Rice  *
163ec045376SRafal Jaworowski  * bit	e500mc		e5500
164ec045376SRafal Jaworowski  *   0	EMCP		EMCP
165ec045376SRafal Jaworowski  *   1	EN_L2MMU_MHD	EN_L2MMU_MHD
166ec045376SRafal Jaworowski  *   2	-		-
167ec045376SRafal Jaworowski  *   3	-		-
168ec045376SRafal Jaworowski  *   4	-		-
169ec045376SRafal Jaworowski  *   5	-		-
170ec045376SRafal Jaworowski  *   6	-		-
171ec045376SRafal Jaworowski  *   7	-		-
172ec045376SRafal Jaworowski  *   8	-		-
173ec045376SRafal Jaworowski  *   9	-		-
174ec045376SRafal Jaworowski  *  10	-		-
175ec045376SRafal Jaworowski  *  11	-		-
176ec045376SRafal Jaworowski  *  12	-		-
177ec045376SRafal Jaworowski  *  13	-		-
178ec045376SRafal Jaworowski  *  14	-		-
179ec045376SRafal Jaworowski  *  15	-		-
180ec045376SRafal Jaworowski  *  16	-		-
181ec045376SRafal Jaworowski  *  17	-		-
182ec045376SRafal Jaworowski  *  18	-		-
183ec045376SRafal Jaworowski  *  19	-		-
184ec045376SRafal Jaworowski  *  20	-		-
185ec045376SRafal Jaworowski  *  21	-		-
186ec045376SRafal Jaworowski  *  22	-		-
187ec045376SRafal Jaworowski  *  23	-		-
188ec045376SRafal Jaworowski  *  24	EN_MAS7_UPDATE	-
189ec045376SRafal Jaworowski  *  25	DCFA		DCFA
190ec045376SRafal Jaworowski  *  26	-		-
191ec045376SRafal Jaworowski  *  27	CIGLSO		CIGLSO
192ec045376SRafal Jaworowski  *  28	-		-
193ec045376SRafal Jaworowski  *  29	-		-
194ec045376SRafal Jaworowski  *  30	-		-
195ec045376SRafal Jaworowski  *  31	NOPTI		NOPTI
196ec045376SRafal Jaworowski  *
19719ca68d9SBenno Rice  *  604: ECP = Enable cache parity checking
19819ca68d9SBenno Rice  *  604: SIE = Serial instruction execution disable
19919ca68d9SBenno Rice  * 7450: TBEN = Time Base Enable
20019ca68d9SBenno Rice  * 7450: STEN = Software table lookup enable
20119ca68d9SBenno Rice  * 7450: BHTCLR = Branch history clear
202e6d3e1c2SPeter Grehan  * 7450: XAEN = Extended Addressing Enabled
20319ca68d9SBenno Rice  * 7450: LRSTK = Link Register Stack Enable
20419ca68d9SBenno Rice  * 7450: FOLD = Branch folding enable
205e6d3e1c2SPeter Grehan  * 7457: HBATEN = High BAT Enable
206e6d3e1c2SPeter Grehan  * 7457: XBSEN = Extended BAT Block Size Enable
20719ca68d9SBenno Rice  */
20819ca68d9SBenno Rice 
209b9b8eb77SRafal Jaworowski #define HID1_E500_ABE	0x00001000  /* Address broadcast enable */
210b9b8eb77SRafal Jaworowski #define HID1_E500_ASTME	0x00002000  /* Address bus streaming mode enable */
211b9b8eb77SRafal Jaworowski #define HID1_E500_RFXE	0x00020000  /* Read fault exception enable */
212b9b8eb77SRafal Jaworowski 
213080286e9SJustin Hibbits #define HID0_E500_DEFAULT_SET	(HID0_EMCP | HID0_E500_TBEN | \
214080286e9SJustin Hibbits 				 HID0_E500_MAS7UPDEN)
215b9b8eb77SRafal Jaworowski #define HID1_E500_DEFAULT_SET	(HID1_E500_ABE | HID1_E500_ASTME)
216ec045376SRafal Jaworowski #define HID0_E500MC_DEFAULT_SET	(HID0_EMCP | HID0_E500MC_L2MMU_MHD | \
217ec045376SRafal Jaworowski 				 HID0_E500_MAS7UPDEN)
218ec045376SRafal Jaworowski #define HID0_E5500_DEFAULT_SET	(HID0_EMCP | HID0_E500MC_L2MMU_MHD)
219b9b8eb77SRafal Jaworowski 
220c3e289e1SNathan Whitehorn #define HID5_970_DCBZ_SIZE_HI	0x00000080UL	/* dcbz does a 32-byte store */
221c3e289e1SNathan Whitehorn #define HID4_970_DISABLE_LG_PG	0x00000004ULL	/* disables large pages */
2228cf9d6cdSNathan Whitehorn 
22319ca68d9SBenno Rice #endif /* _POWERPC_HID_H_ */
224