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