/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 2000 Tsubai Masanari. All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13* 3. The name of the author may not be used to endorse or promote products14* derived from this software without specific prior written permission.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR17* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES18* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.19* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,20* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT21* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,22* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY23* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE25* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.26*27* $NetBSD: hid.h,v 1.2 2001/08/22 21:05:25 matt Exp $28*/2930#ifndef _POWERPC_HID_H_31#define _POWERPC_HID_H_3233/* Hardware Implementation Dependent registers for the PowerPC */34#define HID0_RADIX 0x0080000000000000 /* Enable Radix page tables (POWER9) */3536#define HID0_EMCP 0x80000000 /* Enable machine check pin */37#define HID0_DBP 0x40000000 /* Disable 60x bus parity generation */38#define HID0_EBA 0x20000000 /* Enable 60x bus address parity checking */39#define HID0_EBD 0x10000000 /* Enable 60x bus data parity checking */40#define HID0_BCLK 0x08000000 /* CLK_OUT clock type selection */41#define HID0_EICE 0x04000000 /* Enable ICE output */42#define HID0_ECLK 0x02000000 /* CLK_OUT clock type selection */43#define HID0_PAR 0x01000000 /* Disable precharge of ARTRY */44#define HID0_STEN 0x01000000 /* Software table search enable (7450) */45#define HID0_DEEPNAP 0x01000000 /* Enable deep nap mode (970) */46#define HID0_HBATEN 0x00800000 /* High BAT enable (74[45][578]) */47#define HID0_DOZE 0x00800000 /* Enable doze mode */48#define HID0_NAP 0x00400000 /* Enable nap mode */49#define HID0_SLEEP 0x00200000 /* Enable sleep mode */50#define HID0_DPM 0x00100000 /* Enable Dynamic power management */51#define HID0_RISEG 0x00080000 /* Read I-SEG */52#define HID0_TG 0x00040000 /* Timebase Granularity (OEA64) */53#define HID0_BHTCLR 0x00040000 /* Clear branch history table (7450) */54#define HID0_EIEC 0x00040000 /* Enable internal error checking */55#define HID0_XAEN 0x00020000 /* Enable eXtended Addressing (7450) */56#define HID0_NHR 0x00010000 /* Not hard reset */57#define HID0_ICE 0x00008000 /* Enable i-cache */58#define HID0_DCE 0x00004000 /* Enable d-cache */59#define HID0_ILOCK 0x00002000 /* i-cache lock */60#define HID0_DLOCK 0x00001000 /* d-cache lock */61#define HID0_ICFI 0x00000800 /* i-cache flush invalidate */62#define HID0_DCFI 0x00000400 /* d-cache flush invalidate */63#define HID0_SPD 0x00000200 /* Disable speculative cache access */64#define HID0_XBSEN 0x00000100 /* Extended BAT block-size enable (7457) */65#define HID0_IFEM 0x00000100 /* Enable M-bit for I-fetch */66#define HID0_XBSEN 0x00000100 /* Extended BAT block size enable (7455+)*/67#define HID0_SGE 0x00000080 /* Enable store gathering */68#define HID0_DCFA 0x00000040 /* Data cache flush assist */69#define HID0_BTIC 0x00000020 /* Enable BTIC */70#define HID0_LRSTK 0x00000010 /* Link register stack enable (7450) */71#define HID0_ABE 0x00000008 /* Enable address broadcast */72#define HID0_FOLD 0x00000008 /* Branch folding enable (7450) */73#define HID0_BHT 0x00000004 /* Enable branch history table */74#define HID0_NOPTI 0x00000001 /* No-op the dcbt(st) */7576#define HID0_AIM_TBEN 0x04000000 /* Time base enable (7450) */7778#define HID0_E500_TBEN 0x00004000 /* Time Base and decr. enable */79#define HID0_E500_SEL_TBCLK 0x00002000 /* Select Time Base clock */80#define HID0_E500_MAS7UPDEN 0x00000080 /* Enable MAS7 update (e500v2) */8182#define HID0_E500MC_L2MMU_MHD 0x40000000 /* L2MMU Multiple Hit Detection */8384#define HID0_BITMASK \85"\20" \86"\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR" \87"\030DOZE\027NAP\026SLEEP\025DPM\024RISEG\023EIEC\022res\021NHR" \88"\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011IFEM" \89"\010SGE\007DCFA\006BTIC\005FBIOB\004ABE\003BHT\002NOPDST\001NOPTI"9091#define HID0_7450_BITMASK \92"\20" \93"\040EMCP\037b1\036b2\035b3\034b4\033TBEN\032b6\031STEN" \94"\030HBATEN\027NAP\026SLEEP\025DPM\024b12\023BHTCLR\022XAEN\021NHR" \95"\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011XBSEN" \96"\010SGE\007b25\006BTIC\005LRSTK\004FOLD\003BHT\002NOPDST\001NOPTI"9798#define HID0_E500_BITMASK \99"\20" \100"\040EMCP\037b1\036b2\035b3\034b4\033b5\032b6\031b7" \101"\030DOZE\027NAP\026SLEEP\025b11\024b12\023b13\022b14\021b15" \102"\020b16\017TBEN\016SEL_TBCLK\015b19\014b20\013b21\012b22\011b23" \103"\010EN_MAS7_UPDATE\007DCFA\006b26\005b27\004b28\003b29\002b30\001NOPTI"104105#define HID0_970_BITMASK \106"\20" \107"\040ONEPPC\037SINGLE\036ISYNCSC\035SERGP\031DEEPNAP\030DOZE" \108"\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER" \109"\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN"110111#define HID0_E500MC_BITMASK \112"\20" \113"\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \114"\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \115"\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \116"\010EN_MAS7_UPDATE\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI"117118#define HID0_E5500_BITMASK \119"\20" \120"\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \121"\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \122"\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \123"\010b24\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI"124125/*126* HID0 bit definitions per cpu model127*128* bit 603 604 750 7400 7410 7450 7457 e500129* 0 EMCP EMCP EMCP EMCP EMCP - - EMCP130* 1 - ECP DBP - - - - -131* 2 EBA EBA EBA EBA EDA - - -132* 3 EBD EBD EBD EBD EBD - - -133* 4 SBCLK - BCLK BCKL BCLK - - -134* 5 EICE - - - - TBEN TBEN -135* 6 ECLK - ECLK ECLK ECLK - - -136* 7 PAR PAR PAR PAR PAR STEN STEN -137* 8 DOZE - DOZE DOZE DOZE - HBATEN DOZE138* 9 NAP - NAP NAP NAP NAP NAP NAP139* 10 SLEEP - SLEEP SLEEP SLEEP SLEEP SLEEP SLEEP140* 11 DPM - DPM DPM DPM DPM DPM -141* 12 RISEG - - RISEG - - - -142* 13 - - - EIEC EIEC BHTCLR BHTCLR -143* 14 - - - - - XAEN XAEN -144* 15 - NHR NHR NHR NHR NHR NHR -145* 16 ICE ICE ICE ICE ICE ICE ICE -146* 17 DCE DCE DCE DCE DCE DCE DCE TBEN147* 18 ILOCK ILOCK ILOCK ILOCK ILOCK ILOCK ILOCK SEL_TBCLK148* 19 DLOCK DLOCK DLOCK DLOCK DLOCK DLOCK DLOCK -149* 20 ICFI ICFI ICFI ICFI ICFI ICFI ICFI -150* 21 DCFI DCFI DCFI DCFI DCFI DCFI DCFI -151* 22 - - SPD SPD SPG SPD SPD -152* 23 - - IFEM IFTT IFTT - XBSEN -153* 24 - SIE SGE SGE SGE SGE SGE EN_MAS7_UPDATE154* 25 - - DCFA DCFA DCFA - - DCFA155* 26 - - BTIC BTIC BTIC BTIC BTIC -156* 27 FBIOB - - - - LRSTK LRSTK -157* 28 - - ABE - - FOLD FOLD -158* 29 - BHT BHT BHT BHT BHT BHT -159* 30 - - - NOPDST NOPDST NOPDST NOPDST -160* 31 NOOPTI - NOOPTI NOPTI NOPTI NOPTI NOPTI NOPTI161*162* bit e500mc e5500163* 0 EMCP EMCP164* 1 EN_L2MMU_MHD EN_L2MMU_MHD165* 2 - -166* 3 - -167* 4 - -168* 5 - -169* 6 - -170* 7 - -171* 8 - -172* 9 - -173* 10 - -174* 11 - -175* 12 - -176* 13 - -177* 14 - -178* 15 - -179* 16 - -180* 17 - -181* 18 - -182* 19 - -183* 20 - -184* 21 - -185* 22 - -186* 23 - -187* 24 EN_MAS7_UPDATE -188* 25 DCFA DCFA189* 26 - -190* 27 CIGLSO CIGLSO191* 28 - -192* 29 - -193* 30 - -194* 31 NOPTI NOPTI195*196* 604: ECP = Enable cache parity checking197* 604: SIE = Serial instruction execution disable198* 7450: TBEN = Time Base Enable199* 7450: STEN = Software table lookup enable200* 7450: BHTCLR = Branch history clear201* 7450: XAEN = Extended Addressing Enabled202* 7450: LRSTK = Link Register Stack Enable203* 7450: FOLD = Branch folding enable204* 7457: HBATEN = High BAT Enable205* 7457: XBSEN = Extended BAT Block Size Enable206*/207208#define HID1_E500_ABE 0x00001000 /* Address broadcast enable */209#define HID1_E500_ASTME 0x00002000 /* Address bus streaming mode enable */210#define HID1_E500_RFXE 0x00020000 /* Read fault exception enable */211212#define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN | \213HID0_E500_MAS7UPDEN)214#define HID1_E500_DEFAULT_SET (HID1_E500_ABE | HID1_E500_ASTME)215#define HID0_E500MC_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD | \216HID0_E500_MAS7UPDEN)217#define HID0_E5500_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD)218219#define HID5_970_DCBZ_SIZE_HI 0x00000080UL /* dcbz does a 32-byte store */220#define HID4_970_DISABLE_LG_PG 0x00000004ULL /* disables large pages */221222#endif /* _POWERPC_HID_H_ */223224225