3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/processor.h>
30 int write_bat (ppc_bat_t bat, unsigned long upper, unsigned long lower)
36 mtspr (DBAT0L, lower);
37 mtspr (DBAT0U, upper);
40 mtspr (IBAT0L, lower);
41 mtspr (IBAT0U, upper);
44 mtspr (DBAT1L, lower);
45 mtspr (DBAT1U, upper);
48 mtspr (IBAT1L, lower);
49 mtspr (IBAT1U, upper);
52 mtspr (DBAT2L, lower);
53 mtspr (DBAT2U, upper);
56 mtspr (IBAT2L, lower);
57 mtspr (IBAT2U, upper);
60 mtspr (DBAT3L, lower);
61 mtspr (DBAT3U, upper);
64 mtspr (IBAT3L, lower);
65 mtspr (IBAT3U, upper);
67 #ifdef CONFIG_HIGH_BATS
69 mtspr (DBAT4L, lower);
70 mtspr (DBAT4U, upper);
73 mtspr (IBAT4L, lower);
74 mtspr (IBAT4U, upper);
77 mtspr (DBAT5L, lower);
78 mtspr (DBAT5U, upper);
81 mtspr (IBAT5L, lower);
82 mtspr (IBAT5U, upper);
85 mtspr (DBAT6L, lower);
86 mtspr (DBAT6U, upper);
89 mtspr (IBAT6L, lower);
90 mtspr (IBAT6U, upper);
93 mtspr (DBAT7L, lower);
94 mtspr (DBAT7U, upper);
97 mtspr (IBAT7L, lower);
98 mtspr (IBAT7U, upper);
111 int read_bat (ppc_bat_t bat, unsigned long *upper, unsigned long *lower)
113 unsigned long register u;
114 unsigned long register l;
149 #ifdef CONFIG_HIGH_BATS
193 void print_bats(void)
195 printf("BAT registers:\n");
197 printf ("\tIBAT0L = 0x%08X ", mfspr (IBAT0L));
198 printf ("\tIBAT0U = 0x%08X\n", mfspr (IBAT0U));
199 printf ("\tDBAT0L = 0x%08X ", mfspr (DBAT0L));
200 printf ("\tDBAT0U = 0x%08X\n", mfspr (DBAT0U));
201 printf ("\tIBAT1L = 0x%08X ", mfspr (IBAT1L));
202 printf ("\tIBAT1U = 0x%08X\n", mfspr (IBAT1U));
203 printf ("\tDBAT1L = 0x%08X ", mfspr (DBAT1L));
204 printf ("\tDBAT1U = 0x%08X\n", mfspr (DBAT1U));
205 printf ("\tIBAT2L = 0x%08X ", mfspr (IBAT2L));
206 printf ("\tIBAT2U = 0x%08X\n", mfspr (IBAT2U));
207 printf ("\tDBAT2L = 0x%08X ", mfspr (DBAT2L));
208 printf ("\tDBAT2U = 0x%08X\n", mfspr (DBAT2U));
209 printf ("\tIBAT3L = 0x%08X ", mfspr (IBAT3L));
210 printf ("\tIBAT3U = 0x%08X\n", mfspr (IBAT3U));
211 printf ("\tDBAT3L = 0x%08X ", mfspr (DBAT3L));
212 printf ("\tDBAT3U = 0x%08X\n", mfspr (DBAT3U));
214 #ifdef CONFIG_HIGH_BATS
215 printf ("\tIBAT4L = 0x%08X ", mfspr (IBAT4L));
216 printf ("\tIBAT4U = 0x%08X\n", mfspr (IBAT4U));
217 printf ("\tDBAT4L = 0x%08X ", mfspr (DBAT4L));
218 printf ("\tDBAT4U = 0x%08X\n", mfspr (DBAT4U));
219 printf ("\tIBAT5L = 0x%08X ", mfspr (IBAT5L));
220 printf ("\tIBAT5U = 0x%08X\n", mfspr (IBAT5U));
221 printf ("\tDBAT5L = 0x%08X ", mfspr (DBAT5L));
222 printf ("\tDBAT5U = 0x%08X\n", mfspr (DBAT5U));
223 printf ("\tIBAT6L = 0x%08X ", mfspr (IBAT6L));
224 printf ("\tIBAT6U = 0x%08X\n", mfspr (IBAT6U));
225 printf ("\tDBAT6L = 0x%08X ", mfspr (DBAT6L));
226 printf ("\tDBAT6U = 0x%08X\n", mfspr (DBAT6U));
227 printf ("\tIBAT7L = 0x%08X ", mfspr (IBAT7L));
228 printf ("\tIBAT7U = 0x%08X\n", mfspr (IBAT7U));
229 printf ("\tDBAT7L = 0x%08X ", mfspr (DBAT7L));
230 printf ("\tDBAT7U = 0x%08X\n", mfspr (DBAT7U));