modified Makefile to generate an elf file that bdmctrl understands.

added mcf5474.bdm to initialize firebee and flash (doesn't work yet for unknown reason)
This commit is contained in:
Markus Fröschle
2012-10-21 19:12:40 +00:00
parent 9725fe5474
commit 3a2eb0841a
3 changed files with 45 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ TCPREFIX=m68k-atari-mint-
CC=$(TCPREFIX)gcc
LD=$(TCPREFIX)ld
CPP=$(TCPREFIX)cpp
OBJCOPY=$(TCPREFIX)objcopy
INCLUDE=-Iinclude
CFLAGS=-mcpu=5474 -Wall -Wno-multichar -Os -fomit-frame-pointer
@@ -68,6 +69,7 @@ $(RAM_EXEC): TARGET_ADDRESS=0x01000000
$(FLASH_EXEC) $(RAM_EXEC): $(STRT_OBJ) $(OBJS)
$(CPP) -P -DTARGET_ADDRESS=$(TARGET_ADDRESS) $(LDCSRC) -o $(LDCFILE)
$(LD) --oformat srec -Map $(MAPFILE) --cref -T $(LDCFILE) -s -o $@
objcopy -I srec -O elf32-big --alt-machine-code 4 $@ $@.elf
# compile init_fpga with -mbitfield for testing purposes
$(OBJDIR)/init_fpga.o: CFLAGS += -mbitfield

41
BaS_GNU/mcf5474.bdm Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/local/bin/bdmctrl
#
# firebee board initialization for bdmctrl
#
open $1
reset
# notify flashlib that we have flash at address 0xE0000000, length 0x7FFFFF, plugin is flash29
flash 0xE0000000 flash29
# do not flash yet. First check if board can be initialized correctly
# set VBR
write-ctrl 0x0801 0x00000000
# Turn on MBAR at 0xFF00_0000
write-ctrl 0x0C0F 0xFF000000
# Turn on RAMBAR0 at address FF10_0000
write-ctrl 0x0C04 0xFF100035
# Turn on RAMBAR1 at address FF10_1000
write-ctrl 0x0C05 0xFF101035
# Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes)
write 0xFF000500 0xE0000000 4
write 0xFF000508 0x00001180 4 # 16-bit port
write 0xFF000504 0x007F0001 4
# SDRAM Initialization @ 0000_0000 - 1FFF_FFFF 512Mbytes
write 0xFF000004 0x000002AA 4 # SDRAMDS configuration
write 0xFF000020 0x0000001A 4 # SDRAM CS0 configuration (128Mbytes 0000_0000 - 07FF_FFFF)
write 0xFF000024 0x0800001A 4 # SDRAM CS1 configuration (128Mbytes 0800_0000 - 0FFF_FFFF)
write 0xFF000028 0x1000001A 4 # SDRAM CS2 configuration (128Mbytes 1000_0000 - 17FF_FFFF)
write 0xFF00002C 0x1800001A 4 # SDRAM CS3 configuration (128Mbytes 1800_0000 - 1FFF_FFFF)
write 0xFF000108 0x53722938 4 # SDCFG1
write 0xFF00010C 0x24330000 4 # SDCFG2
wait
# load -v ram.s19 # unfortunately, this seems to work only with elf files
load -v bas.s19.elf

View File

@@ -130,8 +130,8 @@ _mmu_init:
move.l d3,MCF_MMU_MMUOR // MMU update instruction
move.l #0x2000,d0
move.l d0,_video_tlb // setze page als video page
clr.l _video_sbt // zeit l<EFBFBD>schen
move.l d0,_video_tlb // set page as video page
clr.l _video_sbt // clear time
//-------------------------------------------------------------------------------------
// 00e0'0000 locked
move.l #0x00e00000|std_mmutr,d0