1 1.15 rillig /* $NetBSD: hid.h,v 1.15 2024/03/10 17:07:31 rillig Exp $ */ 2 1.1 matt 3 1.1 matt /*- 4 1.1 matt * Copyright (c) 2000 Tsubai Masanari. All rights reserved. 5 1.1 matt * 6 1.1 matt * Redistribution and use in source and binary forms, with or without 7 1.1 matt * modification, are permitted provided that the following conditions 8 1.1 matt * are met: 9 1.1 matt * 1. Redistributions of source code must retain the above copyright 10 1.1 matt * notice, this list of conditions and the following disclaimer. 11 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright 12 1.1 matt * notice, this list of conditions and the following disclaimer in the 13 1.1 matt * documentation and/or other materials provided with the distribution. 14 1.1 matt * 3. The name of the author may not be used to endorse or promote products 15 1.1 matt * derived from this software without specific prior written permission. 16 1.1 matt * 17 1.1 matt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 1.1 matt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 1.1 matt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 1.1 matt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 1.1 matt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 1.1 matt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 1.1 matt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 1.1 matt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 1.1 matt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 1.1 matt * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 1.1 matt */ 28 1.1 matt 29 1.1 matt #ifndef _POWERPC_OEA_HID_H_ 30 1.1 matt #define _POWERPC_OEA_HID_H_ 31 1.1 matt 32 1.13 rin #ifdef _KERNEL_OPT 33 1.13 rin #include "opt_ppcarch.h" 34 1.13 rin #endif 35 1.13 rin 36 1.1 matt /* Hardware Implementation Dependent registers for the PowerPC */ 37 1.1 matt 38 1.11 macallan #if defined(_ARCH_PPC64) || defined (PPC_OEA64_BRIDGE) 39 1.11 macallan /* this way we can use the same bit numbers as IBM's PowerPC manuals */ 40 1.11 macallan #define HIDBIT(x) (0x8000000000000000LL >> x) 41 1.11 macallan #define HID0_64_ONE_PPC HIDBIT(0) /* one instruction per dispatch group */ 42 1.11 macallan #define HID0_64_DO_SNGL HIDBIT(1) /* single group completion mode */ 43 1.11 macallan #define HID0_64_ISYNCSC HIDBIT(2) /* Disable isync scoreboard optimization */ 44 1.11 macallan #define HID0_64_SER_GP HIDBIT(3) /* Serialize group dispatch */ 45 1.11 macallan #define HID0_64_DEEPNAP HIDBIT(7) /* Enable deep nap mode (970) */ 46 1.11 macallan #define HID0_64_DOZE HIDBIT(8) /* Enable doze mode */ 47 1.11 macallan #define HID0_64_NAP HIDBIT(9) /* Enable nap mode */ 48 1.11 macallan #define HID0_64_DPM HIDBIT(11) /* Enable Dynamic power management */ 49 1.11 macallan #define HID0_64_TG HIDBIT(13) /* Perfmon threshold granularity control */ 50 1.11 macallan #define HID0_64_HNG_DIS HIDBIT(14) /* Disable processor hang-detection */ 51 1.11 macallan #define HID0_64_NHR HIDBIT(15) /* No Hard Reset */ 52 1.11 macallan #define HID0_64_INORDER HIDBIT(16) /* Serialized group issue mode */ 53 1.11 macallan #define HID0_64_TB_CTRL HIDBIT(18) /* TB keeps running if CPU stopped */ 54 1.11 macallan #define HID0_64_EX_TBEN HIDBIT(19) /* timebase runs at external clock */ 55 1.11 macallan #define HID0_64_CIABREN HIDBIT(22) /* enable CIABR register */ 56 1.11 macallan #define HID0_64_HDICEEN HIDBIT(23) /* hypervisor decrementer enable */ 57 1.11 macallan #define HID0_64_EN_ATTN HIDBIT(31) /* support processor attention inst. */ 58 1.11 macallan #define HID0_64_EN_MCHK HIDBIT(32) /* ext. mchk interrupts */ 59 1.11 macallan #endif 60 1.1 matt #define HID0_EMCP 0x80000000 /* Enable MCP */ 61 1.1 matt #define HID0_DBP 0x40000000 /* Disable 60x bus parity generation */ 62 1.1 matt #define HID0_EBA 0x20000000 /* Enable 60x bus address parity checking */ 63 1.1 matt #define HID0_EBD 0x10000000 /* Enable 60x bus data parity checking */ 64 1.1 matt #define HID0_BCLK 0x08000000 /* CLK_OUT clock type selection */ 65 1.1 matt #define HID0_EICE 0x04000000 /* Enable ICE output */ 66 1.1 matt #define HID0_TBEN 0x04000000 /* Time base enable (7450) */ 67 1.1 matt #define HID0_ECLK 0x02000000 /* CLK_OUT clock type selection */ 68 1.1 matt #define HID0_PAR 0x01000000 /* Disable precharge of ARTRY */ 69 1.1 matt #define HID0_STEN 0x01000000 /* Software table search enable (7450) */ 70 1.1 matt #define HID0_DOZE 0x00800000 /* Enable doze mode */ 71 1.5 matt #define HID0_HIGH_BAT_EN 0x00800000 /* Enable additional BATs (74[45][578]) */ 72 1.1 matt #define HID0_NAP 0x00400000 /* Enable nap mode */ 73 1.1 matt #define HID0_SLEEP 0x00200000 /* Enable sleep mode */ 74 1.1 matt #define HID0_DPM 0x00100000 /* Enable Dynamic power management */ 75 1.1 matt #define HID0_RISEG 0x00080000 /* Read I-SEG */ 76 1.5 matt #define HID0_BHTCLR 0x00040000 /* Clear branch history table (7450) */ 77 1.1 matt #define HID0_EIEC 0x00040000 /* Enable internal error checking */ 78 1.5 matt #define HID0_XAEN 0x00020000 /* Enable eXtended Addressing (7450) */ 79 1.1 matt #define HID0_NHR 0x00010000 /* Not hard reset */ 80 1.1 matt #define HID0_ICE 0x00008000 /* Enable i-cache */ 81 1.1 matt #define HID0_DCE 0x00004000 /* Enable d-cache */ 82 1.1 matt #define HID0_ILOCK 0x00002000 /* i-cache lock */ 83 1.1 matt #define HID0_DLOCK 0x00001000 /* d-cache lock */ 84 1.14 jmcneill #define HID0_ICFI 0x00000800 /* i-cache flash invalidate */ 85 1.14 jmcneill #define HID0_DCFI 0x00000400 /* d-cache flash invalidate */ 86 1.1 matt #define HID0_SPD 0x00000200 /* Disable speculative cache access */ 87 1.1 matt #define HID0_IFEM 0x00000100 /* Enable M-bit for I-fetch */ 88 1.6 matt #define HID0_XBSEN 0x00000100 /* Extended BAT block size enable (7455+) */ 89 1.1 matt #define HID0_SGE 0x00000080 /* Enable store gathering */ 90 1.1 matt #define HID0_DCFA 0x00000040 /* Data cache flush assist */ 91 1.1 matt #define HID0_BTIC 0x00000020 /* Enable BTIC */ 92 1.2 matt #define HID0_LRSTK 0x00000010 /* Link register stack enable (7450) */ 93 1.1 matt #define HID0_ABE 0x00000008 /* Enable address broadcast */ 94 1.2 matt #define HID0_FOLD 0x00000008 /* Branch folding enable (7450) */ 95 1.1 matt #define HID0_BHT 0x00000004 /* Enable branch history table */ 96 1.9 phx #define HID0_BTCD 0x00000002 /* Branch target addr cache disable (604) */ 97 1.1 matt #define HID0_NOPTI 0x00000001 /* No-op the dcbt(st) */ 98 1.1 matt 99 1.1 matt #define HID0_BITMASK "\020" \ 100 1.1 matt "\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR" \ 101 1.1 matt "\030DOZE\027NAP\026SLEEP\025DPM\024RISEG\023EIEC\022res\021NHR" \ 102 1.1 matt "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011IFEM" \ 103 1.1 matt "\010SGE\007DCFA\006BTIC\005FBIOB\004ABE\003BHT\002NOPDST\001NOPTI" 104 1.1 matt 105 1.1 matt #define HID0_7450_BITMASK "\020" \ 106 1.1 matt "\040EMCP\037b1\036b2\035b3\034b4\033TBEN\032b6\031STEN" \ 107 1.4 chs "\030HIGH_BAT_EN\027NAP\026SLEEP\025DPM\024b12\023BHTCLR\022XAEN\021NHR" \ 108 1.6 matt "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011XBSEN" \ 109 1.1 matt "\010SGE\007b25\006BTIC\005LRSTK\004FOLD\003BHT\002NOPDST\001NOPTI" 110 1.1 matt 111 1.11 macallan #define HID0_970_BITMASK "\020" \ 112 1.11 macallan "\040EMCP" 113 1.11 macallan 114 1.11 macallan #define HID0_970_BITMASK_U "\020" \ 115 1.15 rillig "\040ONEPPC\037DOSNGL\036ISYNCSC\035SERGP\034res\033res\032res\031DEEPNAP" \ 116 1.11 macallan "\030DOZE\027NAP\026res\025DPM\024res\023TG\022HNGDIS\021NHR" \ 117 1.11 macallan "\020INORDER\017res\016TBCTRL\015EXTBEN\014res\013res\012CIABREN\011HDICEEN" \ 118 1.11 macallan "\001ENATTN" 119 1.1 matt /* 120 1.3 wiz * HID0 bit definitions per CPU model 121 1.1 matt * 122 1.1 matt * bit 603 604 750 7400 7410 7450 123 1.1 matt * 0 EMCP EMCP EMCP EMCP EMCP - 124 1.1 matt * 1 - ECP DBP - - - 125 1.1 matt * 2 EBA EBA EBA EBA EDA - 126 1.1 matt * 3 EBD EBD EBD EBD EBD - 127 1.1 matt * 4 SBCLK - BCLK BCKL BCLK - 128 1.1 matt * 5 EICE - - - - TBEN 129 1.1 matt * 6 ECLK - ECLK ECLK ECLK - 130 1.1 matt * 7 PAR PAR PAR PAR PAR STEN 131 1.4 chs * 8 DOZE - DOZE DOZE DOZE HIGH_BAT_EN 132 1.1 matt * 9 NAP - NAP NAP NAP NAP 133 1.1 matt * 10 SLEEP - SLEEP SLEEP SLEEP SLEEP 134 1.1 matt * 11 DPM - DPM DPM DPM DPM 135 1.1 matt * 12 RISEG - - RISEG - - 136 1.1 matt * 13 - - - EIEC EIEC BHTCLR 137 1.1 matt * 14 - - - - - XAEN 138 1.1 matt * 15 - NHR NHR NHR NHR NHR 139 1.1 matt * 16 ICE ICE ICE ICE ICE ICE 140 1.1 matt * 17 DCE DCE DCE DCE DCE DCE 141 1.1 matt * 18 ILOCK ILOCK ILOCK ILOCK ILOCK ILOCK 142 1.1 matt * 19 DLOCK DLOCK DLOCK DLOCK DLOCK DLOCK 143 1.1 matt * 20 ICFI ICFI ICFI ICFI ICFI ICFI 144 1.1 matt * 21 DCFI DCFI DCFI DCFI DCFI DCFI 145 1.1 matt * 22 - - SPD SPD SPG SPD 146 1.6 matt * 23 - - IFEM IFTT IFTT XBSEN 147 1.1 matt * 24 - SIE SGE SGE SGE SGE 148 1.1 matt * 25 - - DCFA DCFA DCFA - 149 1.1 matt * 26 - - BTIC BTIC BTIC BTIC 150 1.1 matt * 27 FBIOB - - - - LRSTK 151 1.1 matt * 28 - - ABE - - FOLD 152 1.1 matt * 29 - BHT BHT BHT BHT BHT 153 1.9 phx * 30 - BTCD - NOPDST NOPDST NOPDST 154 1.1 matt * 31 NOOPTI - NOOPTI NOPTI NOPTI NOPTI 155 1.1 matt * 156 1.1 matt * 604: ECP = Enable cache parity checking 157 1.1 matt * 604: SIE = Serial instruction execution disable 158 1.9 phx * 604: BTCD = Branch target address cache disable 159 1.1 matt * 7450: TBEN = Time Base Enable 160 1.1 matt * 7450: STEN = Software table lookup enable 161 1.1 matt * 7450: BHTCLR = Branch history clear 162 1.1 matt * 7450: LRSTK = Link Register Stack Enable 163 1.1 matt * 7450: FOLD = Branch folding enable 164 1.1 matt */ 165 1.1 matt 166 1.6 matt #define HID1_EMCP 0x80000000 /* Machine Check Signal Enable */ 167 1.6 matt #define HID1_EBA 0x20000000 /* Enable/Disable 60x/MPX Bus Address 168 1.6 matt Parity Checking */ 169 1.6 matt #define HID1_EBD 0x10000000 /* Enable/Disable 60x/MPX Bus Data 170 1.6 matt Parity Checking */ 171 1.6 matt #define HID1_BCLK 0x08000000 /* CLK_OUT */ 172 1.6 matt #define HID1_ECLK 0x02000000 /* CLK_OUT */ 173 1.6 matt #define HID1_PAR 0x01000000 /* Disable Precharge for ... */ 174 1.6 matt #define HID1_DFS4 0x00800000 /* Dynamic Freq Switch / 4 (7448) */ 175 1.6 matt #define HID1_DFS2 0x00400000 /* Dynamic Freq Switch / 2 (7447A) */ 176 1.10 matt #define HID1_SYNCBE 0x00000800 /* Enable sync/eieio broadcast */ 177 1.10 matt #define HID1_ABE 0x00000400 /* Enable address broadcast */ 178 1.6 matt 179 1.12 macallan /* PPC970 HID4 */ 180 1.12 macallan #define HID4_RMLR0 0x0000000000000020 /* real mode limit bit 0 */ 181 1.12 macallan #define HID4_RMLR1 0x4000000000000000 /* real mode limit bit 1 */ 182 1.12 macallan #define HID4_RMLR2 0x2000000000000000 /* real mode limit bit 2 */ 183 1.12 macallan /* 184 1.12 macallan * real mode limit bits 012 185 1.12 macallan * 011 - 64MB 186 1.12 macallan * 111 - 128MB 187 1.12 macallan * 100 - 256MB 188 1.12 macallan * x10 - 1GB 189 1.12 macallan * x01 - 16GB 190 1.12 macallan * 000 - 256GB 191 1.12 macallan */ 192 1.12 macallan 193 1.1 matt #endif /* _POWERPC_OEA_HID_H_ */ 194