sorted sources per functionality in different subdirs

This commit is contained in:
Markus Fröschle
2013-12-19 13:02:39 +00:00
parent 515bc6cee3
commit 72c7b9a963
47 changed files with 48 additions and 148 deletions

View File

@@ -1,5 +1,4 @@
#
# Makefile for Firebee BaS
# # Makefile for Firebee BaS
#
# This Makefile is meant for cross compiling the BaS with Vincent Riviere's cross compilers.
# If you want to compile native on an Atari (you will need at least GCC 4.6.3), set
@@ -40,11 +39,12 @@ CFLAGS=-mcpu=5474 \
-fleading-underscore \
-Wa,--register-prefix-optional
SRCDIR=sources
TRGTDIRS= ./firebee ./m5484lite
OBJDIRS=$(patsubst %, %/objs,$(TRGTDIRS))
TOOLDIR=util
VPATH=dma:exe:flash:fs:if:kbd:pci:spi:sys:usb:util:xhdi
# Linker control file. The final $(LDCFILE) is intermediate only (preprocessed version of $(LDCSRC)
LDCFILE=bas.lk
LDRFILE=ram.lk
@@ -59,53 +59,53 @@ RAM_EXEC=ram.$(EXE)
BASFLASH_EXEC=basflash.$(EXE)
CSRCS= \
$(SRCDIR)/sysinit.c \
$(SRCDIR)/init_fpga.c \
$(SRCDIR)/mmu.c \
$(SRCDIR)/fault_vectors.c \
$(SRCDIR)/interrupts.c \
$(SRCDIR)/bas_printf.c \
$(SRCDIR)/bas_string.c \
$(SRCDIR)/BaS.c \
$(SRCDIR)/cache.c \
$(SRCDIR)/mmc.c \
$(SRCDIR)/unicode.c \
$(SRCDIR)/ff.c \
$(SRCDIR)/sd_card.c \
$(SRCDIR)/wait.c \
$(SRCDIR)/s19reader.c \
$(SRCDIR)/flash.c \
$(SRCDIR)/dma.c \
$(SRCDIR)/xhdi_sd.c \
$(SRCDIR)/xhdi_interface.c \
$(SRCDIR)/pci.c \
$(SRCDIR)/dspi.c \
$(SRCDIR)/driver_vec.c \
$(SRCDIR)/MCD_dmaApi.c \
$(SRCDIR)/MCD_tasks.c \
$(SRCDIR)/MCD_tasksInit.c \
sysinit.c \
init_fpga.c \
mmu.c \
fault_vectors.c \
interrupts.c \
bas_printf.c \
bas_string.c \
BaS.c \
cache.c \
mmc.c \
unicode.c \
ff.c \
sd_card.c \
wait.c \
s19reader.c \
flash.c \
dma.c \
xhdi_sd.c \
xhdi_interface.c \
pci.c \
dspi.c \
driver_vec.c \
MCD_dmaApi.c \
MCD_tasks.c \
MCD_tasksInit.c \
\
$(SRCDIR)/usb.c \
$(SRCDIR)/usb_mem.c \
$(SRCDIR)/ohci-hcd.c \
$(SRCDIR)/ehci-hcd.c \
$(SRCDIR)/usb_mouse.c \
usb.c \
usb_mem.c \
ohci-hcd.c \
ehci-hcd.c \
usb_mouse.c \
\
$(SRCDIR)/ikbd.c \
ikbd.c \
\
$(SRCDIR)/basflash.c \
$(SRCDIR)/basflash_start.c
basflash.c \
basflash_start.c
ASRCS= \
$(SRCDIR)/startcf.S \
$(SRCDIR)/printf_helper.S \
$(SRCDIR)/exceptions.S \
$(SRCDIR)/supervisor.S \
$(SRCDIR)/illegal_instruction.S \
$(SRCDIR)/xhdi_vec.S
startcf.S \
printf_helper.S \
exceptions.S \
supervisor.S \
illegal_instruction.S \
xhdi_vec.S
COBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.c,%.o,$(CSRCS)))
AOBJS=$(patsubst $(SRCDIR)/%.o,%.o,$(patsubst %.S,%.o,$(ASRCS)))
COBJS=$(patsubst %.c,%.o,$(CSRCS))
AOBJS=$(patsubst %.S,%.o,$(ASRCS))
OBJS=$(COBJS) $(AOBJS)
LIBBAS=libbas.a
@@ -145,10 +145,10 @@ ifeq (firebee,$(1))
else
MACHINE=MACHINE_M5484LITE
endif
$(1)/objs/%.o:$(SRCDIR)/%.c
$(1)/objs/%.o:%.c
$(CC) $$(CFLAGS) -D$$(MACHINE) $(INCLUDE) -c $$< -o $$@
$(1)/objs/%.o:$(SRCDIR)/%.S
$(1)/objs/%.o:%.S
$(CC) $$(CFLAGS) -Wa,--bitwise-or -D$$(MACHINE) $(INCLUDE) -c $$< -o $$@
endef
$(foreach DIR,$(TRGTDIRS),$(eval $(call CC_TEMPLATE,$(DIR))))

View File

@@ -789,10 +789,10 @@ void init_pci(void)
xprintf("initializing PCI bridge:\r\n");
(void) res; /* for now */
res = register_interrupt_handler(5, INT_SOURCE_PCIARB, 5, 1, pci_arb_interrupt);
res = register_interrupt_handler(0, INT_SOURCE_PCIARB, 5, 5, pci_arb_interrupt);
debug_printf("registered interrupt handler for PCI arbiter: %s\r\n",
(res < 0 ? "failed" : "succeeded"));
register_interrupt_handler(5, INT_SOURCE_XLBPCI, 5, 0, xlb_pci_interrupt);
register_interrupt_handler(0, INT_SOURCE_XLBPCI, 5, 5, xlb_pci_interrupt);
debug_printf("registered interrupt handler for XLB PCI: %s\r\n",
(res < 0 ? "failed" : "succeeded"));

View File

@@ -1,100 +0,0 @@
/*----------------------------------------------------------------------*/
/* FatFs sample project for generic microcontrollers (C)ChaN, 2012 */
/*----------------------------------------------------------------------*/
#include <stdio.h>
#include "ff.h"
FATFS Fatfs; /* File system object */
FIL Fil; /* File object */
uint8_t Buff[128]; /* File read buffer */
void die ( /* Stop with dying message */
FRESULT rc /* FatFs return value */
)
{
xprintf("Failed with rc=%u.\n", rc);
for (;;) ;
}
/*-----------------------------------------------------------------------*/
/* Program Main */
/*-----------------------------------------------------------------------*/
int main (void)
{
FRESULT rc; /* Result code */
DIR dir; /* Directory object */
FILINFO fno; /* File information object */
uint32_t bw, br, i;
f_mount(0, &Fatfs); /* Register volume work area (never fails) */
xprintf("\nOpen an existing file (message.txt).\n");
rc = f_open(&Fil, "MESSAGE.TXT", FA_READ);
if (rc) die(rc);
xprintf("\nType the file content.\n");
for (;;) {
rc = f_read(&Fil, Buff, sizeof Buff, &br); /* Read a chunk of file */
if (rc || !br) break; /* Error or end of file */
for (i = 0; i < br; i++) /* Type the data */
putchar(Buff[i]);
}
if (rc) die(rc);
xprintf("\nClose the file.\n");
rc = f_close(&Fil);
if (rc) die(rc);
xprintf("\nCreate a new file (hello.txt).\n");
rc = f_open(&Fil, "HELLO.TXT", FA_WRITE | FA_CREATE_ALWAYS);
if (rc) die(rc);
xprintf("\nWrite a text data. (Hello world!)\n");
rc = f_write(&Fil, "Hello world!\r\n", 14, &bw);
if (rc) die(rc);
xprintf("%u bytes written.\n", bw);
xprintf("\nClose the file.\n");
rc = f_close(&Fil);
if (rc) die(rc);
xprintf("\nOpen root directory.\n");
rc = f_opendir(&dir, "");
if (rc) die(rc);
xprintf("\nDirectory listing...\n");
for (;;) {
rc = f_readdir(&dir, &fno); /* Read a directory item */
if (rc || !fno.fname[0]) break; /* Error or end of dir */
if (fno.fattrib & AM_DIR)
xprintf(" <dir> %s\n", fno.fname);
else
xprintf("%8lu %s\n", fno.fsize, fno.fname);
}
if (rc) die(rc);
xprintf("\nTest completed.\n");
for (;;) ;
}
/*---------------------------------------------------------*/
/* User Provided Timer Function for FatFs module */
/*---------------------------------------------------------*/
uint32_t get_fattime (void)
{
return ((uint32_t)(2012 - 1980) << 25) /* Year = 2012 */
| ((uint32_t)1 << 21) /* Month = 1 */
| ((uint32_t)1 << 16) /* Day_m = 1*/
| ((uint32_t)0 << 11) /* Hour = 0 */
| ((uint32_t)0 << 5) /* Min = 0 */
| ((uint32_t)0 >> 1); /* Sec = 0 */
}