3 Copyright 2006 Broadcom Corp. All Rights Reserved.
5 This program is free software; you can distribute it and/or modify it
6 under the terms of the GNU General Public License (Version 2) as
7 published by the Free Software Foundation.
9 This program is distributed in the hope it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 #ifndef __BCM6358_CPU_H
21 #define __BCM6358_CPU_H
28 #************************************************************************
29 #* Coprocessor 0 Register Names
30 #************************************************************************
32 #define C0_BCM_CONFIG $22
37 # Bits 30:25 MMU Size (Num TLB entries-1)
38 # Bits 24:22 ICache sets/way (2^n * 64)
39 # Bits 21:19 ICache Line size (2^(n+1) bytes) 0=No Icache
40 # Bits 18:16 ICache Associativity (n+1) way
41 # Bits 15:13 DCache sets/way (2^n * 64)
42 # Bits 12:10 DCache Line size (2^(n+1) bytes) 0=No Dcache
43 # Bits 9:7 DCache Associativity (n+1) way
45 # Bit 3: 1=At least 1 watch register
46 # Bit 2: 1=MIPS16 code compression implemented
47 # Bit 1: 1=EJTAG implemented
48 # Bit 0: 1=FPU implemented
50 #define CP0_CFG_ISMSK (0x7 << 22)
51 #define CP0_CFG_ISSHF 22
52 #define CP0_CFG_ILMSK (0x7 << 19)
53 #define CP0_CFG_ILSHF 19
54 #define CP0_CFG_IAMSK (0x7 << 16)
55 #define CP0_CFG_IASHF 16
56 #define CP0_CFG_DSMSK (0x7 << 13)
57 #define CP0_CFG_DSSHF 13
58 #define CP0_CFG_DLMSK (0x7 << 10)
59 #define CP0_CFG_DLSHF 10
60 #define CP0_CFG_DAMSK (0x7 << 7)
61 #define CP0_CFG_DASHF 7
64 #************************************************************************
65 #* Coprocessor 0 Broadcom Config Register Bits
66 #************************************************************************
68 #define CP0_BCM_CFG_ICSHEN (0x1 << 31)
69 #define CP0_BCM_CFG_DCSHEN (0x1 << 30)
70 #define CP0_BCM_CFG_BTHD (0x1 << 21)
71 #define CP0_BCM_CFG_NBK (0x1 << 17)
74 #************************************************************************
75 #* Coprocessor 0 CMT Interrupt Register
76 #************************************************************************
78 #define CP0_CMT_XIR_4 (0x1 << 31)
79 #define CP0_CMT_XIR_3 (0x1 << 30)
80 #define CP0_CMT_XIR_2 (0x1 << 29)
81 #define CP0_CMT_XIR_1 (0x1 << 28)
82 #define CP0_CMT_XIR_0 (0x1 << 27)
83 #define CP0_CMT_SIR_1 (0x1 << 16)
84 #define CP0_CMT_SIR_0 (0x1 << 15)
85 #define CP0_CMT_NMIR_TP1 (0x1 << 1)
86 #define CP0_CMT_NMIR_TP0 (0x1 << 0)
89 #************************************************************************
90 #* Coprocessor 0 CMT Control Register
91 #************************************************************************
93 #define CP0_CMT_DSU_TP1 (0x1 << 30)
94 #define CP0_CMT_TPS3 (0x1 << 19)
95 #define CP0_CMT_TPS2 (0x1 << 18)
96 #define CP0_CMT_TPS1 (0x1 << 17)
97 #define CP0_CMT_TPS0 (0x1 << 16)
98 #define CP0_CMT_PRIO_TP1 (0x1 << 5)
99 #define CP0_CMT_PRIO_TP0 (0x1 << 4)
100 #define CP0_CMT_RSTSE (0x1 << 0)
103 #************************************************************************
104 #* Coprocessor 0 CMT Local Register
105 #************************************************************************
107 #define CP0_CMT_TPID (0x1 << 31)
110 #************************************************************************
112 #************************************************************************
115 #define MIPS_BASE_BOOT 0xbfa00000
116 #define MIPS_BASE 0xff400000
118 #define MIPS_RAC_CR0 0x00 // RAC Configuration Register
119 #define MIPS_RAC_CR1 0x08 // RAC Configuration Register 1
120 #define RAC_FLH (1 << 8)
121 #define RAC_DPF (1 << 6)
122 #define RAC_NCH (1 << 5)
123 #define RAC_C_INV (1 << 4)
124 #define RAC_PF_D (1 << 3)
125 #define RAC_PF_I (1 << 2)
126 #define RAC_D (1 << 1)
127 #define RAC_I (1 << 0)
129 #define MIPS_RAC_ARR 0x04 // RAC Address Range Register
130 #define RAC_UPB_SHFT 16
131 #define RAC_LWB_SHFT 0
133 #define MIPS_LMB_CR 0x1C // LMB Control Register
134 #define LMB_EN (1 << 0)
135 #define DISABLE_UCL_FIX (1 << 23)
136 #define DISABLE_UCS_FIX (1 << 24)
137 #define DISABLE_UC_FIX (1 << 25)
139 #define MIPS_SBR 0x20 // System Base Register
141 #define MIPS_TP0_ALT_BV 0x30000
142 #define MIPS_TP1_ALT_BV 0x38000
143 #define ENABLE_ALT_BV (1 << 19)