From 78c5873de041b9d0662698464f624fc5a69f5d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sat, 28 Dec 2013 16:51:00 +0000 Subject: [PATCH] m548x runs now cleanly (had to remove radeon files from make for now) --- BaS_gcc/.gdbinit | 4 ++-- BaS_gcc/Makefile | 9 +++++---- BaS_gcc/bas.lk.in | 9 ++++++--- BaS_gcc/sys/BaS.c | 8 ++++---- BaS_gcc/sys/exceptions.S | 4 ++-- BaS_gcc/sys/mmu.c | 11 +++++++---- BaS_gcc/sys/sysinit.c | 2 +- 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/BaS_gcc/.gdbinit b/BaS_gcc/.gdbinit index 598dbde..64c2100 100644 --- a/BaS_gcc/.gdbinit +++ b/BaS_gcc/.gdbinit @@ -1,7 +1,7 @@ #set disassemble-next-line on define tr - target remote | m68k-bdm-gdbserver pipe /dev/bdmcf3 - #target remote | m68k-bdm-gdbserver pipe /dev/tblcf3 + #target remote | m68k-bdm-gdbserver pipe /dev/bdmcf3 + target remote | m68k-bdm-gdbserver pipe /dev/tblcf3 #target dbug /dev/ttyS0 #monitor bdm-reset end diff --git a/BaS_gcc/Makefile b/BaS_gcc/Makefile index 4eead06..5bebf88 100644 --- a/BaS_gcc/Makefile +++ b/BaS_gcc/Makefile @@ -106,14 +106,15 @@ CSRCS= \ videl.c \ video.c \ \ - radeon_base.c \ - radeon_vid.c \ - radeon_accel.c \ - radeon_cursor.c \ \ basflash.c \ basflash_start.c +#radeon_base.c \ +#radeon_vid.c \ +#radeon_accel.c \ +#radeon_cursor.c \ + ASRCS= \ startcf.S \ printf_helper.S \ diff --git a/BaS_gcc/bas.lk.in b/BaS_gcc/bas.lk.in index 83380c0..0662e93 100644 --- a/BaS_gcc/bas.lk.in +++ b/BaS_gcc/bas.lk.in @@ -20,6 +20,9 @@ MEMORY * target to copy BaS data segment to. 1M should be enough for now */ bas_ram (WX) : ORIGIN = SDRAM_START + SDRAM_SIZE - 0x00200000, LENGTH = 0x00100000 + /* + * driver_ram is an uncached, reserved memory area for drivers (e.g. USB) that need this type of memory + */ driver_ram (WX) : ORIGIN = SDRAM_START + SDRAM_SIZE - 0x00100000, LENGTH = 0x00100000 } @@ -79,9 +82,9 @@ SECTIONS OBJDIR/video.o OBJDIR/videl.o - OBJDIR/radeon_base.o - OBJDIR/radeon_accel.o - OBJDIR/radeon_cursor.o + //OBJDIR/radeon_base.o + //OBJDIR/radeon_accel.o + //OBJDIR/radeon_cursor.o OBJDIR/xhdi_sd.o(.text) OBJDIR/xhdi_interface.o(.text) diff --git a/BaS_gcc/sys/BaS.c b/BaS_gcc/sys/BaS.c index f831cfb..8e969e0 100644 --- a/BaS_gcc/sys/BaS.c +++ b/BaS_gcc/sys/BaS.c @@ -38,6 +38,7 @@ #include "diskio.h" #include "ff.h" #include "s19reader.h" +#include "mmu.h" #include "dma.h" #include "net.h" #include "eth.h" @@ -55,7 +56,6 @@ #endif /* imported routines */ -extern int mmu_init(); extern int vec_init(); /* Symbols from the linker script */ @@ -218,11 +218,11 @@ void enable_coldfire_interrupts() MCF_INTC_ICR62 = 0x3f; /* interrupt level 7, interrupt priority 7 */ *FPGA_INTR_ENABLE = 0xfe; /* enable int 1-7 */ -#endif /* MACHINE_FIREBEE */ MCF_EPORT_EPIER = 0xfe; /* int 1-7 on */ MCF_EPORT_EPFR = 0xff; /* clear all pending interrupts */ MCF_INTC_IMRL = 0xffffff00; /* int 1-7 on */ MCF_INTC_IMRH = 0xbffffffe; /* psc3 and timer 0 int on */ +#endif xprintf("finished\r\n"); } @@ -420,8 +420,8 @@ void BaS(void) xprintf("BaS initialization finished, enable interrupts\r\n"); enable_coldfire_interrupts(); - set_ipl(0); - network_init(); + //set_ipl(0); + //network_init(); xprintf("call EmuTOS\r\n"); ROM_HEADER* os_header = (ROM_HEADER*)TOS; diff --git a/BaS_gcc/sys/exceptions.S b/BaS_gcc/sys/exceptions.S index 58e34ae..c9be666 100644 --- a/BaS_gcc/sys/exceptions.S +++ b/BaS_gcc/sys/exceptions.S @@ -390,8 +390,8 @@ access: access_mmu: move.l MCF_MMU_MMUSR,d0 // did the last fault hit in TLB? - btst #1,d0 // no - bne bus_error // bus error handler + btst #1,d0 // yes, it did. So we already mapped that page + bne bus_error // and this must be a real bus error move.l MCF_MMU_MMUAR,d0 cmp.l #__FASTRAM_END,d0 // above max User RAM area? diff --git a/BaS_gcc/sys/mmu.c b/BaS_gcc/sys/mmu.c index 4613360..49347de 100644 --- a/BaS_gcc/sys/mmu.c +++ b/BaS_gcc/sys/mmu.c @@ -51,10 +51,13 @@ #include "pci.h" #include "cache.h" #include "util.h" -#if MACHINE_FIREBEE + +#if defined(MACHINE_FIREBEE) #include "firebee.h" -#elif MACHINE_M5484LITE +#elif defined(MACHINE_M5484LITE) #include "m5484l.h" +#else +#error "unknown machine!" #endif /* MACHINE_FIREBEE */ #define DEBUG_MMU @@ -184,7 +187,7 @@ inline uint32_t set_mmubar(uint32_t value) return ret; } -void __attribute__((flatten)) mmu_init(void) +void mmu_init(void) { extern uint8_t _MMUBAR[]; uint32_t MMUBAR = (uint32_t) &_MMUBAR[0]; @@ -204,7 +207,7 @@ void __attribute__((flatten)) mmu_init(void) ACR_ADMSK(0x3f) | /* cover 1GB area from 0xc0000000 to 0xffffffff */ ACR_BA(0xc0000000)); /* (equals area from 3 to 4 GB */ #elif MACHINE_M5484LITE - ACR_ADMSK(0xff) | /* cover 2 GB area from 0x80000000 to 0xffffffff */ + ACR_ADMSK(0x7f) | /* cover 2 GB area from 0x80000000 to 0xffffffff */ ACR_BA(0x80000000)); #endif /* MACHINE_FIREBEE */ diff --git a/BaS_gcc/sys/sysinit.c b/BaS_gcc/sys/sysinit.c index 1ff348f..de8b142 100644 --- a/BaS_gcc/sys/sysinit.c +++ b/BaS_gcc/sys/sysinit.c @@ -1132,7 +1132,7 @@ void initialize_hardware(void) /* do not try to init USB for now on the Firebee, it hangs the machine */ #ifndef MACHINE_FIREBEE - init_usb(); + //init_usb(); #endif #if MACHINE_FIREBEE