diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2007-11-30 01:23:04 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2007-11-30 01:23:04 +0000 |
commit | a725a4d71f767260d85f853917cd9246ef22ff3e (patch) | |
tree | 2770bfb71c4847deb2f1b0073654fcf58ad6b9cd /c/src/lib/libbsp/powerpc/psim/startup/bspstart.c | |
parent | 2007-11-29 Till Straumann <strauman@slac.stanford.edu> (diff) | |
download | rtems-a725a4d71f767260d85f853917cd9246ef22ff3e.tar.bz2 |
2007-11-29 Till Straumann <strauman@slac.stanford.edu>
* startup/bspstart.c, Makefile.am: Initialize BATs and enable MMU
to come closer to what other BSPs do. This allows us to use the
shared irq_asm.S. No more individual assembly code :-)
Diffstat (limited to 'c/src/lib/libbsp/powerpc/psim/startup/bspstart.c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/startup/bspstart.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c index 5385cc070e..68f4aaef19 100644 --- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c @@ -24,6 +24,7 @@ #include <rtems/powerpc/powerpc.h> #include <libcpu/cpuIdent.h> +#include <libcpu/bat.h> #include <libcpu/spr.h> SPR_RW(SPRG0) @@ -226,4 +227,17 @@ void bsp_start( void ) */ BSP_rtems_irq_mng_init(0); + /* + * Setup BATs and enable MMU + */ + /* Memory */ + setdbat(0, 0x0<<24, 0x0<<24, 1<<24, _PAGE_RW); + setibat(0, 0x0<<24, 0x0<<24, 1<<24, 0); + /* PCI */ + setdbat(1, 0x8<<24, 0x8<<24, 1<<24, IO_PAGE); + setdbat(2, 0xc<<24, 0xc<<24, 1<<24, IO_PAGE); + + _write_MSR(_read_MSR() | MSR_DR | MSR_IR); + asm volatile("sync; isync"); + } |