From 7c6dc866dc2c842d8f84c770f9a748d3128ec685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 23 Jul 2013 05:04:02 +0000 Subject: [PATCH] added missing NOP() when accessing MMU register to let the processor pipeline sync (according to Coldfire manual). --- BaS_gcc/sources/BaS.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BaS_gcc/sources/BaS.c b/BaS_gcc/sources/BaS.c index 379144e..8de23ef 100644 --- a/BaS_gcc/sources/BaS.c +++ b/BaS_gcc/sources/BaS.c @@ -53,6 +53,8 @@ extern uint8_t _EMUTOS[]; extern uint8_t _EMUTOS_SIZE[]; #define EMUTOS_SIZE ((uint32_t)_EMUTOS_SIZE) /* size of EmuTOS, in bytes */ +#define NOP() __asm__ __volatile__("nop\n\t" : : : "memory") /* need this to force pipeline sync after MMUCR write */ + /* * check if it is possible to transfer data to PIC */ @@ -206,6 +208,7 @@ void BaS(void) xprintf("finished\r\n"); MCF_MMU_MMUCR = MCF_MMU_MMUCR_EN; /* MMU on */ + NOP(); /* force pipeline sync */ xprintf("IDE reset: "); /* IDE reset */ @@ -267,8 +270,6 @@ void BaS(void) * (uint32_t *) 0x5a4 = FASTRAM_END; /* ramtop TOS system variable */ * (uint32_t *) 0x5a8 = 0x1357bd13; /* ramvalid TOS system variable */ -#define NOP() __asm__ __volatile__("nop\n\t" : : : "memory") - xprintf("init ACIA: "); /* init ACIA */ * (uint8_t *) 0xfffffc00 = 3;