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>
29 int write_bat (ppc_bat_t bat, unsigned long upper, unsigned long lower)
33 mtspr (DBAT0L, lower);
34 mtspr (DBAT0U, upper);
37 mtspr (IBAT0L, lower);
38 mtspr (IBAT0U, upper);
41 mtspr (DBAT1L, lower);
42 mtspr (DBAT1U, upper);
45 mtspr (IBAT1L, lower);
46 mtspr (IBAT1U, upper);
49 mtspr (DBAT2L, lower);
50 mtspr (DBAT2U, upper);
53 mtspr (IBAT2L, lower);
54 mtspr (IBAT2U, upper);
57 mtspr (DBAT3L, lower);
58 mtspr (DBAT3U, upper);
61 mtspr (IBAT3L, lower);
62 mtspr (IBAT3U, upper);
64 #ifdef CONFIG_HIGH_BATS
66 mtspr (DBAT4L, lower);
67 mtspr (DBAT4U, upper);
70 mtspr (IBAT4L, lower);
71 mtspr (IBAT4U, upper);
74 mtspr (DBAT5L, lower);
75 mtspr (DBAT5U, upper);
78 mtspr (IBAT5L, lower);
79 mtspr (IBAT5U, upper);
82 mtspr (DBAT6L, lower);
83 mtspr (DBAT6U, upper);
86 mtspr (IBAT6L, lower);
87 mtspr (IBAT6U, upper);
90 mtspr (DBAT7L, lower);
91 mtspr (DBAT7U, upper);
94 mtspr (IBAT7L, lower);
95 mtspr (IBAT7U, upper);
105 int read_bat (ppc_bat_t bat, unsigned long *upper, unsigned long *lower)
107 unsigned long register u;
108 unsigned long register l;
143 #ifdef CONFIG_HIGH_BATS
187 void print_bats(void)
189 printf("BAT registers:\n");
191 printf ("\tIBAT0L = 0x%08X ", mfspr (IBAT0L));
192 printf ("\tIBAT0U = 0x%08X\n", mfspr (IBAT0U));
193 printf ("\tDBAT0L = 0x%08X ", mfspr (DBAT0L));
194 printf ("\tDBAT0U = 0x%08X\n", mfspr (DBAT0U));
195 printf ("\tIBAT1L = 0x%08X ", mfspr (IBAT1L));
196 printf ("\tIBAT1U = 0x%08X\n", mfspr (IBAT1U));
197 printf ("\tDBAT1L = 0x%08X ", mfspr (DBAT1L));
198 printf ("\tDBAT1U = 0x%08X\n", mfspr (DBAT1U));
199 printf ("\tIBAT2L = 0x%08X ", mfspr (IBAT2L));
200 printf ("\tIBAT2U = 0x%08X\n", mfspr (IBAT2U));
201 printf ("\tDBAT2L = 0x%08X ", mfspr (DBAT2L));
202 printf ("\tDBAT2U = 0x%08X\n", mfspr (DBAT2U));
203 printf ("\tIBAT3L = 0x%08X ", mfspr (IBAT3L));
204 printf ("\tIBAT3U = 0x%08X\n", mfspr (IBAT3U));
205 printf ("\tDBAT3L = 0x%08X ", mfspr (DBAT3L));
206 printf ("\tDBAT3U = 0x%08X\n", mfspr (DBAT3U));
208 #ifdef CONFIG_HIGH_BATS
209 printf ("\tIBAT4L = 0x%08X ", mfspr (IBAT4L));
210 printf ("\tIBAT4U = 0x%08X\n", mfspr (IBAT4U));
211 printf ("\tDBAT4L = 0x%08X ", mfspr (DBAT4L));
212 printf ("\tDBAT4U = 0x%08X\n", mfspr (DBAT4U));
213 printf ("\tIBAT5L = 0x%08X ", mfspr (IBAT5L));
214 printf ("\tIBAT5U = 0x%08X\n", mfspr (IBAT5U));
215 printf ("\tDBAT5L = 0x%08X ", mfspr (DBAT5L));
216 printf ("\tDBAT5U = 0x%08X\n", mfspr (DBAT5U));
217 printf ("\tIBAT6L = 0x%08X ", mfspr (IBAT6L));
218 printf ("\tIBAT6U = 0x%08X\n", mfspr (IBAT6U));
219 printf ("\tDBAT6L = 0x%08X ", mfspr (DBAT6L));
220 printf ("\tDBAT6U = 0x%08X\n", mfspr (DBAT6U));
221 printf ("\tIBAT7L = 0x%08X ", mfspr (IBAT7L));
222 printf ("\tIBAT7U = 0x%08X\n", mfspr (IBAT7U));
223 printf ("\tDBAT7L = 0x%08X ", mfspr (DBAT7L));
224 printf ("\tDBAT7U = 0x%08X\n", mfspr (DBAT7U));