diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2007-12-01 00:24:25 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2007-12-01 00:24:25 +0000 |
commit | bd1cc5f09cf1eb119739242ca07f813a23491f3e (patch) | |
tree | bda5c5b8ffdec7cec29a26fc098cc4e1a9a71541 /c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c | |
parent | 2007-11-30 Till Straumann <strauman@slac.stanford.edu> (diff) | |
download | rtems-bd1cc5f09cf1eb119739242ca07f813a23491f3e.tar.bz2 |
2007-11-30 Till Straumann <strauman@slac.stanford.edu>
* mpc6xx/mmu/bat.c, mpc6xx/mmu/pte121.c: use new
feature-checks from cpuIdent.h rather than filtering
CPU types when checking for availability of high BATs
and an MMU with hardware page-table lookup.
Diffstat (limited to 'c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c')
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c index 1068fb2588..1eb479da8e 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c +++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c @@ -162,8 +162,6 @@ bat_addrs_put (ubat * bat, int typ, int idx) static void bat_addrs_init () { - ppc_cpu_id_t cpu = get_ppc_cpu_type (); - ubat bat; GETBAT (DBAT0, bat.words.u, bat.words.l); @@ -185,8 +183,7 @@ bat_addrs_init () bat_addrs_put (&bat, TYP_I, 3); - if ((cpu == PPC_7455 || cpu == PPC_7457) - && (HID0_7455_HIGH_BAT_EN & _read_HID0 ())) { + if ( ppc_cpu_has_8_bats() && (HID0_7455_HIGH_BAT_EN & _read_HID0 ())) { GETBAT (DBAT4, bat.words.u, bat.words.l); bat_addrs_put (&bat, TYP_D, 4); GETBAT (DBAT5, bat.words.u, bat.words.l); @@ -251,9 +248,7 @@ check_bat_index (int i) if (i >= 0 && i < 4) return 0; if (i >= 4 && i < 8) { - /* don't use current_ppc_cpu because we don't know if it has been set already */ - ppc_cpu_id_t cpu = get_ppc_cpu_type (); - if (cpu != PPC_7455 && cpu != PPC_7457) + if ( ! ppc_cpu_has_8_bats() ) return -1; /* OK, we're on the right hardware; * check if we are already enabled @@ -298,9 +293,7 @@ check_bat_size (unsigned long size) } /* bit < 17 is not really legal but we aliased it to 0 in the past */ if (bit > (11 + 17)) { - /* don't use current_ppc_cpu because we don't know if it has been set already */ - ppc_cpu_id_t cpu = get_ppc_cpu_type (); - if (cpu != PPC_7455 && cpu != PPC_7457) + if ( ! ppc_cpu_has_8_bats() ) return -1; hid0 = _read_HID0 (); |