From 74f3fdb197a99f3f4412039c1ebbdb73bf5afef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Wed, 7 Aug 2013 10:13:31 +0000 Subject: [PATCH] moved cache flush (immediately before MMU enable) --- BaS_gcc/sources/BaS.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/BaS_gcc/sources/BaS.c b/BaS_gcc/sources/BaS.c index 68a91cd..eff3a0d 100644 --- a/BaS_gcc/sources/BaS.c +++ b/BaS_gcc/sources/BaS.c @@ -231,9 +231,6 @@ void BaS(void) memcpy(dst, src, EMUTOS_SIZE); xprintf("finished\r\n"); - /* we have copied a code area, so flush the caches */ - flush_and_invalidate_caches(); - xprintf("initialize MMU: "); mmu_init(); xprintf("finished\r\n"); @@ -242,11 +239,10 @@ void BaS(void) vec_init(); xprintf("finished\r\n"); - xprintf("enable MMU: "); + xprintf("flush caches and enable MMU: "); + flush_and_invalidate_caches(); MCF_MMU_MMUCR = MCF_MMU_MMUCR_EN; /* MMU on */ NOP(); /* force pipeline sync */ - flush_and_invalidate_caches(); - xprintf("finished\r\n"); xprintf("IDE reset: "); @@ -280,7 +276,7 @@ void BaS(void) xprintf("finished\r\n"); - //sd_card_init(); + sd_card_init(); /* * memory setup @@ -319,7 +315,7 @@ void BaS(void) __asm__ __volatile__("move.w #0x0700,sr \n\t" : : : "memory"); } - //srec_execute("BASFLASH.S19"); + srec_execute("BASFLASH.S19"); /* Jump into the OS */ typedef void void_func(void);