removed unused files. Modifed MCDCOOK build process to use BaS_gcc

includes (no need to sync includes anymore)
This commit is contained in:
Markus Fröschle
2014-08-31 11:36:59 +00:00
parent bc33af04ab
commit 575ff4adc4
8 changed files with 200 additions and 329 deletions

View File

@@ -234,7 +234,6 @@ tos/jtagwait/sources/jtagwait.c
tos/jtagwait/include/driver_vec.h tos/jtagwait/include/driver_vec.h
tos/mcdcook/Makefile tos/mcdcook/Makefile
tos/mcdcook/sources/mcdcook.c tos/mcdcook/sources/mcdcook.c
tos/mcdcook/include/driver_vec.h
tos/jtagwait/include/bas_printf.h tos/jtagwait/include/bas_printf.h
tos/jtagwait/include/bas_string.h tos/jtagwait/include/bas_string.h
tos/jtagwait/include/MCF5475_CLOCK.h tos/jtagwait/include/MCF5475_CLOCK.h

View File

@@ -181,7 +181,7 @@ static struct driver_table bas_drivers =
.bas_version = MAJOR_VERSION, .bas_version = MAJOR_VERSION,
.bas_revision = MINOR_VERSION, .bas_revision = MINOR_VERSION,
.remove_handler = NULL, .remove_handler = NULL,
.interfaces = { interfaces } .interfaces = interfaces
}; };
void __attribute__((interrupt)) get_bas_drivers(void) void __attribute__((interrupt)) get_bas_drivers(void)

View File

@@ -31,8 +31,8 @@
enum driver_type enum driver_type
{ {
// BLOCKDEV_DRIVER, BLOCKDEV_DRIVER,
// CHARDEV_DRIVER, CHARDEV_DRIVER,
XHDI_DRIVER, XHDI_DRIVER,
MCD_DRIVER, MCD_DRIVER,
VIDEO_DRIVER, VIDEO_DRIVER,
@@ -283,7 +283,7 @@ struct driver_table
uint32_t bas_version; uint32_t bas_version;
uint32_t bas_revision; uint32_t bas_revision;
uint32_t (*remove_handler)(); /* calling this will disable the BaS' hook into trap #0 */ uint32_t (*remove_handler)(); /* calling this will disable the BaS' hook into trap #0 */
struct generic_interface *interfaces[]; struct generic_interface *interfaces;
}; };

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-08-10T15:03:49. --> <!-- Written by QtCreator 3.0.1, 2014-08-16T08:05:17. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>ProjectExplorer.Project.ActiveTarget</variable> <variable>ProjectExplorer.Project.ActiveTarget</variable>

View File

@@ -19,7 +19,11 @@ extern long _FPGA_JTAG_VALID;
#define SRAM1_END SRAM1_START + 0x1000 #define SRAM1_END SRAM1_START + 0x1000
#define SAFE_STACK SRAM1_END - 4 #define SAFE_STACK SRAM1_END - 4
#define NOP() __asm__ __volatile__("nop\n\t" : : : "memory")
long bas_start = 0xe0000000; long bas_start = 0xe0000000;
volatile uint32_t *_VRAM = (uint32_t *) 0xFFF00000;
void wait_for_jtag(void) void wait_for_jtag(void)
{ {
@@ -66,7 +70,17 @@ void wait_for_jtag(void)
/* wait */ /* wait */
xprintf("wait a little to let things settle...\r\n"); xprintf("wait a little to let things settle...\r\n");
for (i = 0; i < 1000000; i++); for (i = 0; i < 100000000; i++);
xprintf("write byte data to FPGA memory\r\n");
for (i = 0; i < 512; i++)
{
_VRAM[i] = i;
}
hexdump((uint8_t *) _VRAM, 512);
xprintf("wait a little to let things settle...\r\n");
for (i = 0; i < 100000000; i++);
__asm__ __volatile__( __asm__ __volatile__(
" jmp (%[bas_start])\n\t" " jmp (%[bas_start])\n\t"
@@ -79,6 +93,8 @@ void wait_for_jtag(void)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
printf("\033E\r\nFPGA JTAG configuration support\r\n"); printf("\033E\r\nFPGA JTAG configuration support\r\n");
printf("<C> 2014 M. Fröschle\r\n");
printf("You may now savely load a new FPGA configuration through the JTAG interface\r\n" printf("You may now savely load a new FPGA configuration through the JTAG interface\r\n"
"and your Firebee will reboot once finished using that new configuration.\r\n"); "and your Firebee will reboot once finished using that new configuration.\r\n");
if (argc == 2) if (argc == 2)

View File

@@ -21,7 +21,9 @@ endif
DEPEND=depend DEPEND=depend
TOPDIR= ../.. TOPDIR= ../..
INCLUDE=-I$(TOPDIR)/../libcmini/include -nostdlib BAS_INCLUDE=-I$(TOPDIR)/../BaS_gcc/include
INCLUDE=-I$(TOPDIR)/../libcmini/include $(BAS_INCLUDE) -nostdlib
LIBS=-lcmini -nostdlib -lgcc LIBS=-lcmini -nostdlib -lgcc
CC=$(PREFIX)/bin/gcc CC=$(PREFIX)/bin/gcc
@@ -39,8 +41,6 @@ CFLAGS=\
-Wall -Wall
SRCDIR=sources SRCDIR=sources
INCDIR=include
INCLUDE+=-I$(INCDIR)
CSRCS=\ CSRCS=\
$(SRCDIR)/mcdcook.c $(SRCDIR)/mcdcook.c
@@ -50,20 +50,16 @@ COBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.c,%.o,$(CSRCS)))
AOBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.S,%.o,$(ASRCS))) AOBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.S,%.o,$(ASRCS)))
OBJS=$(COBJS) $(AOBJS) OBJS=$(COBJS) $(AOBJS)
TRGTDIRS=. ./m68020-60 ./m5475 ./mshort ./m68020-60/mshort ./m5475/mshort TRGTDIRS=.
OBJDIRS=$(patsubst %,%/objs,$(TRGTDIRS)) OBJDIRS=$(patsubst %,%/objs,$(TRGTDIRS))
# #
# multilib flags. These must match m68k-atari-mint-gcc -print-multi-lib output # multilib flags. These must match m68k-atari-mint-gcc -print-multi-lib output
# #
m68020-60/$(APP):CFLAGS += -m68020-60 $(APP):CFLAGS += -mcpu=5475
m5475/$(APP):CFLAGS += -mcpu=5475
mshort/$(APP):CFLAGS += -mshort all: $(TEST_APP)
m68020-60/mshort/$(APP): CFLAGS += -m68020-60 -mshort
m5475/mshort/$(APP): CFLAGS += -mcpu=5475 -mshort
ctest: $(TEST_APP)
all:$(patsubst %,%/$(APP),$(TRGTDIRS))
# #
# generate pattern rules for multilib object files. # generate pattern rules for multilib object files.
# #
@@ -76,7 +72,7 @@ $(1)/objs/%.o:$(SRCDIR)/%.S
$(1)_OBJS=$(patsubst %,$(1)/objs/%,$(OBJS)) $(1)_OBJS=$(patsubst %,$(1)/objs/%,$(OBJS))
$(1)/$(APP): $$($(1)_OBJS) $(1)/$(APP): $$($(1)_OBJS)
$(CC) $$(CFLAGS) -o $$@ $(TOPDIR)/../libcmini/$(1)/startup.o $$($(1)_OBJS) -L$(TOPDIR)/../libcmini/$(1) $(LIBS) $(CC) $$(CFLAGS) -o $$@ $(TOPDIR)/../libcmini/m5475/startup.o $$($(1)_OBJS) -L$(TOPDIR)/../libcmini/m5475 $(LIBS)
$(STRIP) $$@ $(STRIP) $$@
endef endef
$(foreach DIR,$(TRGTDIRS),$(eval $(call CC_TEMPLATE,$(DIR)))) $(foreach DIR,$(TRGTDIRS),$(eval $(call CC_TEMPLATE,$(DIR))))
@@ -99,19 +95,3 @@ printvars:
ifneq (clean,$(MAKECMDGOALS)) ifneq (clean,$(MAKECMDGOALS))
-include $(DEPEND) -include $(DEPEND)
endif endif
test: $(TEST_APP)
$(HATARI) --grab -w --tos $(TOPDIR)/../emutos/etos512k.img \
--machine falcon -s 14 --cpuclock 32 --cpulevel 3 --vdi true --vdi-planes 4 \
--vdi-width 640 --vdi-height 480 -d . $(APP)
ftest: $(TEST_APP)
$(HATARI) --grab -w --tos /usr/share/hatari/TOS404.IMG \
--machine falcon --cpuclock 32 --cpulevel 3 \
-d . $(APP)
sttest: $(TEST_APP)
$(HATARI) --grab -w --tos "/usr/share/hatari/tos106de.img" \
--machine st --cpuclock 32 --cpulevel 3 --vdi true --vdi-planes 4 \
--vdi-width 640 --vdi-height 480 \
-d . $(APP)

View File

@@ -1,125 +0,0 @@
/*
* driver_vec.h
*
* Interface for exposure of BaS drivers to the OS
*
* This file is part of BaS_gcc.
*
* BaS_gcc is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BaS_gcc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BaS_gcc. If not, see <http://www.gnu.org/licenses/>.
*
* Created on: 24.10.2013
* Author: Markus Fröschle
*/
#ifndef _DRIVER_VEC_H_
#define _DRIVER_VEC_H_
enum driver_type
{
END_OF_DRIVERS, /* marks end of driver list */
BLOCKDEV_DRIVER,
CHARDEV_DRIVER,
VIDEO_DRIVER,
XHDI_DRIVER,
MCD_DRIVER,
};
struct generic_driver_interface
{
uint32_t (*init)(void);
uint32_t (*read)(void *buf, size_t count);
uint32_t (*write)(const void *buf, size_t count);
uint32_t (*ioctl)(uint32_t request, ...);
};
/* Chained buffer descriptor */
typedef volatile struct MCD_bufDesc_struct MCD_bufDesc;
struct MCD_bufDesc_struct {
uint32_t flags; /* flags describing the DMA */
uint32_t csumResult; /* checksum from checksumming performed since last checksum reset */
int8_t *srcAddr; /* the address to move data from */
int8_t *destAddr; /* the address to move data to */
int8_t *lastDestAddr; /* the last address written to */
uint32_t dmaSize; /* the number of bytes to transfer independent of the transfer size */
MCD_bufDesc *next; /* next buffer descriptor in chain */
uint32_t info; /* private information about this descriptor; DMA does not affect it */
};
/* Progress Query struct */
typedef volatile struct MCD_XferProg_struct {
int8_t *lastSrcAddr; /* the most-recent or last, post-increment source address */
int8_t *lastDestAddr; /* the most-recent or last, post-increment destination address */
uint32_t dmaSize; /* the amount of data transferred for the current buffer */
MCD_bufDesc *currBufDesc;/* pointer to the current buffer descriptor being DMAed */
} MCD_XferProg;
struct dma_driver_interface
{
int32_t version;
int32_t magic;
int32_t (*dma_set_initiator)(int initiator);
uint32_t (*dma_get_initiator)(int requestor);
void (*dma_free_initiator)(int requestor);
int32_t (*dma_set_channel)(int requestor, void (*handler)(void));
int (*dma_get_channel)(int requestor);
void (*dma_free_channel)(int requestor);
void (*dma_clear_channel)(int channel);
int (*MCD_startDma)(int channel, int8_t *srcAddr, int16_t srcIncr, int8_t *destAddr, int16_t destIncr,
uint32_t dmaSize, uint32_t xferSize, uint32_t initiator, int32_t priority, uint32_t flags,
uint32_t funcDesc);
int (*MCD_dmaStatus)(int channel);
int (*MCD_XferProgrQuery)(int channel, MCD_XferProg *progRep);
int (*MCD_killDma)(int channel);
int (*MCD_continDma)(int channel);
int (*MCD_pauseDma)(int channel);
int (*MCD_resumeDma)(int channel);
int (*MCD_csumQuery)(int channel, uint32_t *csum);
void *(*dma_malloc)(long amount);
int (*dma_free)(void *addr);
};
struct xhdi_driver_interface
{
uint32_t (*xhdivec)();
};
union interface
{
struct generic_driver_interface *gdi;
struct xhdi_driver_interface *xhdi;
struct dma_driver_interface *dma;
};
struct generic_interface
{
enum driver_type type;
char name[16];
char description[64];
int version;
int revision;
union interface interface;
};
struct driver_table
{
uint32_t bas_version;
uint32_t bas_revision;
uint32_t (*remove_handler)(); /* calling this will disable the BaS' hook into trap #0 */
struct generic_interface *interfaces;
};
#endif /* _DRIVER_VEC_H_ */

View File

@@ -76,6 +76,7 @@ static char *dt_to_str(enum driver_type dt)
case VIDEO_DRIVER: return "video/framebuffer driver"; case VIDEO_DRIVER: return "video/framebuffer driver";
case XHDI_DRIVER: return "XHDI compatible hard disk driver"; case XHDI_DRIVER: return "XHDI compatible hard disk driver";
case MCD_DRIVER: return "multichannel DMA driver"; case MCD_DRIVER: return "multichannel DMA driver";
case PCI_DRIVER: return "PCI interface driver";
default: return "unknown driver type"; default: return "unknown driver type";
} }
} }