OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /minsoc/trunk/sw
    from Rev 158 to Rev 149
    Reverse comparison

Rev 158 → Rev 149

/jsp/jsp.c File deleted
jsp/jsp.c Property changes : Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: jsp/Makefile =================================================================== --- jsp/Makefile (revision 158) +++ jsp/Makefile (nonexistent) @@ -1,125 +0,0 @@ -include ../support/Makefile.inc -include $(BACKEND_DIR)/gcc-opt.mk - -#USER INPUT -SRCS = jsp.c -OR32_TARGET = jsp.hex -TARGET = -TARGETLIB = -MODEL = static #dynamic|static -VERSION = 0.1 -MODE = debug #release|debug - -INCLUDEDIRS = $(SUPPORT_DIR) $(DRIVERS_DIR) -#libsystemc or systemc (system ignores lib at the beginning) -LIBNAMES = -LIBDIRS = -DEPENDDIR = ./depend - - -#CONFIGURATION -DEBUGPARAM = -RELEASEPARAM = - -DEBUGFLAGS = -g -O0 -RELEASEFLAGS = -O2 -fomit-frame-pointer - -CFLAGS = -Wall -CC = or32-elf-gcc -AR = or32-elf-ar -RANLIB = or32-elf-ranlib - -CFLAGS += $(GCC_OPT) - - -#MECHANICS -INCLUDESPATH = $(addprefix -I, $(INCLUDEDIRS)) -LIBSPATH = $(addprefix -L, $(LIBDIRS)) -LIBSLINKAGE = $(addprefix -l, $(subst lib, , $(LIBNAMES)) ) -COMMA = , -RPATH = $(addprefix -Wl$(COMMA)-R, $(LIBDIRS)) - -OBJS = $(addsuffix .o, $(basename $(SRCS))) -DEPS = $(addprefix $(DEPENDDIR)/, $(addsuffix .d, $(basename $(SRCS) ) ) ) - -STATICLIB = $(addprefix lib, $(addsuffix .a, $(TARGETLIB) ) ) -DYNAMICLIB = $(addprefix lib, $(addsuffix .so, $(TARGETLIB) ) ) -SONAME = $(addsuffix .$(VERSION), $(DYNAMICLIB)) - -ifeq (debug,$(findstring debug, $(MODE))) -CFLAGS += $(DEBUGFLAGS) $(addprefix -D, $(DEBUGPARAM)) -else -CFLAGS += $(RELEASEFLAGS) $(addprefix -D, $(RELEASEPARAM)) -endif - -ifdef TARGETLIB -ifeq (dynamic,$(findstring dynamic, $(MODEL))) -TARGET = $(DYNAMICLIB) -CFLAGS += -fPIC -else -TARGET = $(STATICLIB) -endif -endif - - -#MAKEFILE RULES -all: $(TARGET) $(OR32_TARGET) - -depend: $(DEPS) - -docs: Doxyfile - doxygen - -distclean: - make clean - rm -rf $(DEPENDDIR) Doxygen - - --include $(DEPS) - - -ifndef TARGETLIB -$(TARGET): $(OBJS) - $(CC) $(LIBSPATH) $(RPATH) -o $@ $^ $(LIBSLINKAGE) -endif - - -$(STATICLIB): $(OBJS) - $(AR) cru $@ $^ - $(RANLIB) $@ - -$(DYNAMICLIB): $(OBJS) - $(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^ - ln -fs $@ $(SONAME) - - -%.o: %.c - $(CC) $(CFLAGS) $(INCLUDESPATH) -c $< -o $@ - - -$(DEPENDDIR)/%.d: %.c - mkdir -p $(DEPENDDIR) - $(CC) $(INCLUDESPATH) -MM -MF $@ $< - - -# DO NOT DELETE - -STEM = $(subst .hex, , $(OR32_TARGET)) -BINARY = $(addsuffix .bin, $(STEM) ) -EXECUTABLE = $(addsuffix .or32, $(STEM) ) - -$(OR32_TARGET): $(BINARY) - $(BIN2HEX) $? 1 -size_word > $@ - -$(BINARY): $(EXECUTABLE) - $(OR32_TOOL_PREFIX)-objcopy -O binary $? $@ - -#except.o and reset.o should be already inside of $(SUPPORT) (libsupport.a) but for some reason the compiler ignores that fact -#(e.g. or32-elf-objdump -t libsupport.a shows it) -$(EXECUTABLE): $(OBJS) ../support/except.o ../support/reset.o $(SUPPORT) $(DRIVERS) - $(CC) $(CFLAGS) $(GCC_LIB_OPTS) -T $(LINKER_SCRIPT) $^ -o $@ - -clean: - rm -f *.o *~ $(TARGET) $(STATICLIB) $(DYNAMICLIB) $(SONAME) $(OR32_TARGET) $(BINARY) $(EXECUTABLE) - -#EOF Index: eth/eth.c =================================================================== --- eth/eth.c (revision 158) +++ eth/eth.c (revision 149) @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -29,7 +29,7 @@ int main() { - uart_init(UART_BASE); + uart_init(); int_init(); eth_init();
/eth/Makefile
10,7 → 10,7
VERSION = 0.1
MODE = debug #release|debug
 
INCLUDEDIRS = $(SUPPORT_DIR) $(DRIVERS_DIR)
INCLUDEDIRS = $(BACKEND_DIR) $(SUPPORT_DIR) $(DRIVERS_DIR)
#libsystemc or systemc (system ignores lib at the beginning)
LIBNAMES =
LIBDIRS =
/uart/uart.c
1,4 → 1,4
#include <interconnect.h>
#include <board.h>
#include <support.h>
#include <or1200.h>
#include <int.h>
7,7 → 7,7
 
int main()
{
uart_init(UART_BASE);
uart_init();
 
int_init();
int_add(UART_IRQ, &uart_interrupt, NULL);
/uart/Makefile
10,7 → 10,7
VERSION = 0.1
MODE = debug #release|debug
 
INCLUDEDIRS = $(SUPPORT_DIR) $(DRIVERS_DIR)
INCLUDEDIRS = $(BACKEND_DIR) $(SUPPORT_DIR) $(DRIVERS_DIR)
#libsystemc or systemc (system ignores lib at the beginning)
LIBNAMES =
LIBDIRS =
/drivers/uart.c
6,49 → 6,47
 
#define WAIT_FOR_XMITR \
do { \
lsr = REG8(uart_base + UART_LSR); \
lsr = REG8(UART_BASE + UART_LSR); \
} while ((lsr & BOTH_EMPTY) != BOTH_EMPTY)
 
#define WAIT_FOR_THRE \
do { \
lsr = REG8(uart_base + UART_LSR); \
lsr = REG8(UART_BASE + UART_LSR); \
} while ((lsr & UART_LSR_THRE) != UART_LSR_THRE)
 
#define CHECK_FOR_CHAR (REG8(uart_base + UART_LSR) & UART_LSR_DR)
#define CHECK_FOR_CHAR (REG8(UART_BASE + UART_LSR) & UART_LSR_DR)
 
#define WAIT_FOR_CHAR \
do { \
lsr = REG8(uart_base + UART_LSR); \
lsr = REG8(UART_BASE + UART_LSR); \
} while ((lsr & UART_LSR_DR) != UART_LSR_DR)
 
#define UART_TX_BUFF_LEN 32
#define UART_TX_BUFF_MASK (UART_TX_BUFF_LEN -1)
 
static unsigned long uart_base = 0;
 
char tx_buff[UART_TX_BUFF_LEN];
volatile int tx_level, rx_level;
 
void uart_init(unsigned long base)
void uart_init(void)
{
int divisor;
uart_base = base;
 
/* Reset receiver and transmiter */
/* Set RX interrupt for each byte */
REG8(uart_base + UART_FCR) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_1;
REG8(UART_BASE + UART_FCR) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_1;
 
/* Enable RX interrupt */
REG8(uart_base + UART_IER) = UART_IER_RDI | UART_IER_THRI;
REG8(UART_BASE + UART_IER) = UART_IER_RDI | UART_IER_THRI;
 
/* Set 8 bit char, 1 stop bit, no parity */
REG8(uart_base + UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY);
REG8(UART_BASE + UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY);
 
/* Set baud rate */
divisor = IN_CLK/(16 * UART_BAUD_RATE);
REG8(uart_base + UART_LCR) |= UART_LCR_DLAB;
REG8(uart_base + UART_DLM) = (divisor >> 8) & 0x000000ff;
REG8(uart_base + UART_DLL) = divisor & 0x000000ff;
REG8(uart_base + UART_LCR) &= ~(UART_LCR_DLAB);
REG8(UART_BASE + UART_LCR) |= UART_LCR_DLAB;
REG8(UART_BASE + UART_DLM) = (divisor >> 8) & 0x000000ff;
REG8(UART_BASE + UART_DLL) = divisor & 0x000000ff;
REG8(UART_BASE + UART_LCR) &= ~(UART_LCR_DLAB);
 
return;
}
58,7 → 56,7
unsigned char lsr;
 
WAIT_FOR_THRE;
REG8(uart_base + UART_TX) = c;
REG8(UART_BASE + UART_TX) = c;
WAIT_FOR_XMITR;
}
 
67,7 → 65,7
char uart_getc()
{
char c;
c = REG8(uart_base + UART_RX);
c = REG8(UART_BASE + UART_RX);
return c;
}
 
76,7 → 74,7
{
char lala;
unsigned char interrupt_id;
interrupt_id = REG8(uart_base + UART_IIR);
interrupt_id = REG8(UART_BASE + UART_IIR);
if ( interrupt_id & UART_IIR_RDI )
{
lala = uart_getc();
/drivers/eth.c
1,5 → 1,5
#include <board.h>
#include <support.h>
#include "interconnect.h"
#include "eth.h"
 
int eth_tx_done;
/drivers/can.c
1,5 → 1,5
#include <board.h>
#include <support.h>
#include "interconnect.h"
#include "can.h"
 
int can_rx_done, can_tx_done;
/drivers/i2c.c
1,5 → 1,5
#include <board.h>
#include <support.h>
#include "interconnect.h"
#include "i2c.h"
 
int i2c_rd_done, i2c_wr_done;
/drivers/uart.h
117,7 → 117,7
#define UART_EFR_ENI 0x10 /* Enhanced Interrupt */
 
 
void uart_init(unsigned long);
void uart_init(void);
void uart_putc(char);
char uart_getc(void);
void uart_print_str(char *);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.