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 | |
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')
-rw-r--r-- | c/src/lib/libcpu/powerpc/ChangeLog | 10 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c | 13 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c | 9 |
3 files changed, 11 insertions, 21 deletions
diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog index a8cb41b79b..155a0939a7 100644 --- a/c/src/lib/libcpu/powerpc/ChangeLog +++ b/c/src/lib/libcpu/powerpc/ChangeLog @@ -1,12 +1,16 @@ 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. + +2007-11-30 Till Straumann <strauman@slac.stanford.edu> + * mpc6xx/clock/c_clock.c, mpc6xx/clock/c_clock.h: added support for bookE/ppc405 style CPUs where the decrementer works slightly differently. -2007-11-30 Till Straumann <strauman@slac.stanford.edu> - - * mpc6xx/mmu/bat.c, mpc6xx/mmu/pte121.c 2007-11-29 Till Straumann <strauman@slac.stanford.edu> * mpc6xx/exceptions/raw_exception.c, 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 (); diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c index bbb4c7f166..2878cc6918 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c +++ b/c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c @@ -428,14 +428,7 @@ triv121PgTblInit (unsigned long base, unsigned ldSize) * performance, screwing deterministic latency! * (Could still be useful for debugging, though) */ - if ( PPC_604 != current_ppc_cpu - && PPC_604e != current_ppc_cpu - && PPC_604r != current_ppc_cpu - && PPC_750 != current_ppc_cpu - && PPC_7400 != current_ppc_cpu - && PPC_7455 != current_ppc_cpu - && PPC_7457 != current_ppc_cpu - ) + if ( ! ppc_cpu_has_hw_ptbl_lkup() ) return 0; /* unsupported by this CPU */ pgTbl.base = (APte) base; |