This commit is contained in:
Markus Fröschle
2012-10-30 20:20:17 +00:00
parent 4b2bbf369a
commit ca9e947431
9 changed files with 83 additions and 62 deletions

View File

@@ -7,7 +7,6 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.500844171" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -22,7 +21,7 @@
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.2075717076" name="cdt.managedbuild.toolchain.gnu.cross.base">
<option id="cdt.managedbuild.option.gnu.cross.prefix.229077196" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.675708329" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.targetPlatform.gnu.cross.1762656328" isAbstract="false" osList="all"/>
<targetPlatform archList="all" binaryParser="" id="cdt.managedbuild.targetPlatform.gnu.cross.1762656328" isAbstract="false" osList="all"/>
<builder id="cdt.managedbuild.builder.gnu.cross.1405451926" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder"/>
</toolChain>
</folderInfo>
@@ -33,12 +32,8 @@
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686" moduleId="org.eclipse.cdt.core.settings" name="firebee-cross">
<macros>
<stringMacro name="INCLUDE" type="VALUE_TEXT" value="/usr/m68k-atari-mint/include"/>
</macros>
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -51,7 +46,7 @@
<toolChain errorParsers="" id="cdt.managedbuild.toolchain.gnu.cross.base.120730457" name="cdt.managedbuild.toolchain.gnu.cross.base" resourceTypeBasedDiscovery="true">
<option id="cdt.managedbuild.option.gnu.cross.prefix.904812232" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
<option id="cdt.managedbuild.option.gnu.cross.path.1369935770" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.targetPlatform.gnu.cross.1544284446" isAbstract="false" osList="all"/>
<targetPlatform archList="all" binaryParser="" id="cdt.managedbuild.targetPlatform.gnu.cross.1544284446" isAbstract="false" osList="all"/>
<builder buildPath="${workspace_loc:/BaS_GNU}" errorParsers="" id="cdt.managedbuild.builder.gnu.cross.2120667679" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name=""/>
@@ -69,14 +64,17 @@
</tool>
<tool errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.cross.c.compiler.359669870" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option id="gnu.c.compiler.option.include.paths.2015956820" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/usr/m68k-elf/include"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/m68k-atari-mint/4.6.3/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/BaS_GNU/include}&quot;"/>
<listOptionValue builtIn="false" value="/opt/cross-mint/m68k-atari-mint/include"/>
<listOptionValue builtIn="false" value="/usr/lib/gcc/m68k-atari-mint/4.6.3/include/stdarg.h"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.374200372" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
</toolChain>
</folderInfo>
<fileInfo id="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686.149483996" name="bas_printf.h" rcbsApplicability="disable" resourcePath="include/bas_printf.h" toolsToInvoke=""/>
<fileInfo id="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686.Makefile" name="Makefile" rcbsApplicability="disable" resourcePath="Makefile" toolsToInvoke=""/>
<sourceEntries>
<entry excluding="include|sources" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
@@ -130,6 +128,16 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686;cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686.;cdt.managedbuild.tool.gnu.cross.c.compiler.359669870;cdt.managedbuild.tool.gnu.c.compiler.input.374200372">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;" command="m68k-elf-gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686;cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686.;cdt.managedbuild.tool.gnu.cross.c.compiler.1024005096;cdt.managedbuild.tool.gnu.c.compiler.input.1427165564">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>

View File

@@ -1,6 +1,6 @@
set disassemble-next-line on
define tr
target remote | m68k-atari-mint-gdbserver pipe /dev/bdmcf3
target remote | m68k-bdm-gdbserver pipe /dev/bdmcf3
end
tr
source mcf5474.gdb

View File

@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false

View File

@@ -69,6 +69,11 @@ SECTIONS {
objs/sysinit.o(.text)
objs/init_fpga.o(.text)
objs/cache.o(.text)
#if (FORMAT == elf32-m68k)
*(.rodata)
*(.rodata.*)
. = ALIGN(4);
#endif
} > flash
.bas _Bas_base : AT (ADDR(.text) + SIZEOF(.text))
@@ -76,24 +81,20 @@ SECTIONS {
objs/BaS.o(.text)
/* put other routines into the same segment (RAM) as BaS.o */
objs/sd_card_asm.o(.text)
_xprintf_before_copy = _xprintf - (_BaS - LOADADDR(.bas));
_xprintf_after_copy = _xprintf;
objs/bas_printf.o(.text)
objs/printf_helper.o(.text)
_xprintf_before_copy = _xprintf - (_BaS - LOADADDR(.bas));
_display_progress_before_copy = _display_progress - (_BaS - LOADADDR(.bas));
objs/sd_card.o(.text)
objs/mmu.o(.text)
objs/exceptions.o(.text)
objs/supervisor.o(.text)
objs/ewf.o(.text)
objs/illegal_instruction.o(.text)
*(.data)
*(.bss)
#if (FORMAT == elf32-m68k)
*(.rodata)
*(.rodata.*)
#endif
*(.bss)
. = ALIGN(4);
_bas_end = ABSOLUTE(.);
} > ram

View File

@@ -8,4 +8,6 @@ extern void xvprintf(const char *fmt, va_list va);
extern void xprintf(const char *fmt, ...);
extern void xsnprintf(char *str, size_t size, const char *fmt, ...);
extern void display_progress(void);
#endif /* _BAS_PRINTF_H_ */

View File

@@ -5,21 +5,16 @@
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
wait
# set VBR
write-ctrl 0x0801 0x00000000
#write-ctrl 0x0801 0x00000000
sleep 10
# Turn on MBAR at 0xFF00_0000
write-ctrl 0x0C0F 0xFF000000
sleep 10
write-ctrl 0x0C0F 0xFF000000
# Turn on MMUBAR at 0xFF04_0000
#write-ctrl 0x0008 0xFF000001
#write 0xFF000008 0x00000000 4
write-ctrl 0x0008 0xFF040001
# Turn on RAMBAR0 at address FF10_0000
write-ctrl 0x0C04 0xFF100007
@@ -32,38 +27,49 @@ sleep 10
write 0xFF000500 0xE0000000 4
write 0xFF000508 0x00001180 4
write 0xFF000504 0x007F0001 4
# Init CS1 (Atari I/O address range)
#write 0xFF00050C 0xFFF00000 4
#write 0xFF000514 0x00002180 4
#write 0xFF000510 0x000F0001 4
# Init CS2 (FireBee 32 bit I/O address range)
#write 0xFF000518 0xF0000000 4
#write 0xFF000520 0x00002100 4
#write 0xFF00051C 0x07FF0001 4
# Init CS3 (FireBee 16 bit I/O address range)
#write 0xFF000524 0xF8000000 4
#write 0xFF00052C 0x00000180 4
#write 0xFF000528 0x03FF0001 4
# Init CS4 (FireBee video address range)
#write 0xFF000530 0x40000000 4
#write 0xFF000538 0x00000018 4
#write 0xFF000534 0x003F0001 4
# SDRAM Initialization @ 0000_0000 - 1FFF_FFFF 512Mbytes
write 0xFF000004 0x000002AA 4 # SDRAMDS configuration
sleep 10
write 0xFF000020 0x0000001A 4 # SDRAM CS0 configuration (128Mbytes 0000_0000 - 07FF_FFFF)
sleep 10
write 0xFF000024 0x0800001A 4 # SDRAM CS1 configuration (128Mbytes 0800_0000 - 0FFF_FFFF)
sleep 10
write 0xFF000028 0x1000001A 4 # SDRAM CS2 configuration (128Mbytes 1000_0000 - 17FF_FFFF)
sleep 10
write 0xFF00002C 0x1800001A 4 # SDRAM CS3 configuration (128Mbytes 1800_0000 - 1FFF_FFFF)
sleep 10
write 0xFF000108 0x73622830 4 # SDCFG1
sleep 10
write 0xFF00010C 0x46770000 4 # SDCFG2
sleep 10
write 0xFF000104 0xE10D0002 4 # SDCR + IPALL
sleep 10
write 0xFF000100 0x40010000 4 # SDMR (write to LEMR)
sleep 10
write 0xFF000100 0x048D0000 4 # SDMR (write to LMR)
sleep 10
write 0xFF000104 0xE10D0002 4 # SDCR + IPALL
sleep 10
write 0xFF000104 0xE10D0004 4 # SDCR + IREF (first refresh)
sleep 10
write 0xFF000104 0xE10D0004 4 # SDCR + IREF (first refresh)
sleep 10
write 0xFF000100 0x008D0000 4 # SDMR (write to LMR)
sleep 10
write 0xFF000104 0x710D0F00 4 # SDCR (lock SDMR and enable refresh)
load -v ram.s19.elf
execute 0x10000000
write 0xFF000240 0x80000000 4 # disable watchdog arbiter
# 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
load -v ram.elf
wait
sleep 1000
execute

View File

@@ -66,7 +66,7 @@ static void xputchar(int c)
"bsr printf_helper\n\t"
/* output */:
/* input */: "r" (c)
/* clobber */: "d0","d2","a0"
/* clobber */: "d0","d2","a0","memory"
);
}

View File

@@ -14,32 +14,28 @@
#define FPGA_CONF_DONE (1 << 5)
extern void xprintf_before_copy(const char *fmt, ...);
#define xprintf xprintf_before_copy
extern void display_progress_before_copy(void);
extern void wait_10ms();
#define xprintf xprintf_before_copy
#define display_progress display_progress_before_copy
/*
* load FPGA
*/
void init_fpga(void)
{
register uint8_t *fpga_data;
register uint32_t *fpga_data;
register int i;
xprintf("FPGA load data...");
xprintf("FPGA load data...\r\n");
MCF_GPIO_PODR_FEC1L &= ~FPGA_CLOCK; /* FPGA clock => low */
MCF_GPIO_PODR_FEC1L &= ~FPGA_CONFIG; /* FPGA config => low */
while (((MCF_GPIO_PPDSDR_FEC1L & FPGA_STATUS)) || ((MCF_GPIO_PPDSDR_FEC1L & FPGA_CONF_DONE)));
wait_10us();
MCF_GPIO_PODR_FEC1L |= FPGA_CONFIG; /* pull FPGA_CONFIG high */
wait_10us();
while (!(MCF_GPIO_PPDSDR_FEC1L & FPGA_STATUS)) /* wait until status becomes high */
{
wait_10us();
}
while ((MCF_GPIO_PPDSDR_FEC1L & FPGA_STATUS) && (MCF_GPIO_PPDSDR_FEC1L & FPGA_CONF_DONE));
MCF_GPIO_PODR_FEC1L |= FPGA_CONFIG; /* pull FPGA_CONFIG high */
while (!(MCF_GPIO_PPDSDR_FEC1L & FPGA_STATUS)); /* wait until status becomes high */
/*
* excerpt from an Altera configuration manual:
@@ -60,11 +56,17 @@ void init_fpga(void)
* which is pulled high by a pull-up resistor. A low to high transition on CONF_DONE indicates
* configuration is complete and initialization of the device can begin.
*/
fpga_data = (uint8_t *) FPGA_FLASH_DATA;
fpga_data = (uint32_t *) FPGA_FLASH_DATA;
do
{
uint8_t value = *fpga_data++;
for (i = 0; i < 8; i++, value >>= 1)
uint32_t value = *fpga_data++;
if (((int) fpga_data % 0x100) == 0) {
xprintf("%08x ", fpga_data);
display_progress();
}
for (i = 0; i < 32; i++, value >>= 1)
{
if (value & 1)
@@ -81,9 +83,9 @@ void init_fpga(void)
MCF_GPIO_PODR_FEC1L |= FPGA_CLOCK;
MCF_GPIO_PODR_FEC1L &= ~FPGA_CLOCK;
}
} while (!(MCF_GPIO_PPDSDR_FEC1L & FPGA_CONF_DONE) && (fpga_data < FPGA_FLASH_DATA_END));
} while ((!(MCF_GPIO_PPDSDR_FEC1L & FPGA_CONF_DONE)) && (fpga_data < (uint32_t *) FPGA_FLASH_DATA_END));
if (fpga_data < FPGA_FLASH_DATA_END)
if (fpga_data < (uint32_t *) FPGA_FLASH_DATA_END)
{
for (i = 0; i < 4000; i++)
{

View File

@@ -12,7 +12,7 @@ void sd_card_idle(void)
"bsr sd_idle\n\t"
/* output */:
/* input */ :
/* clobber */: "a0","a1","a2","a3","a4","a5","a6",
/* clobber */: "a0","a1","a2","a3","a4","a5",
"d0","d1","d2","d3","d4","d5","d6","d7","memory"
);
}
@@ -28,7 +28,7 @@ int sd_card_init(void)
"bsr.l sd_init\n\t"
/* output */: "=r" (ret)
/* input */ :
/* clobber */: "a0","a1","a2","a3","a4","a5","a6",
/* clobber */: "a0","a1","a2","a3","a4","a5",
"d1","d2","d3","d4","d5","d6","d7","memory"
);