+2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
+
+ * or1k/Makefile.in: Build and install board libraries
+ * or1k/board.h: New file
+ * or1k/boards/README: New file
+ * or1k/boards/atlys.S: New file
+ * or1k/boards/de0_nano.S: New file
+ * or1k/boards/ml501.S: New file
+ * or1k/boards/ml509.S: New file
+ * or1k/boards/optimsoc.S: New file
+ * or1k/boards/or1ksim-uart.S: New file
+ * or1k/boards/or1ksim.S: New file
+ * or1k/boards/ordb1a3pe1500.S: New file
+ * or1k/boards/ordb2a.S: New file
+ * or1k/boards/orpsocrefdesign.S: New file
+ * or1k/boards/tmpl.S: New file
+ * or1k/boards/tmpl.c: New file
+
2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
* or1k/Makefile.in: Add libor1k
LIBOR1K_FILES = $(COMMON_FILES)
LIBOR1K_OBJS = $(addsuffix .o,$(LIBOR1K_FILES))
+BOARDS = atlys \
+ de0_nano \
+ ml501 \
+ optimsoc \
+ or1ksim \
+ or1ksim-uart \
+ ordb1a3pe1500 \
+ ordb2a \
+ orpsocrefdesign
+
+BOARD_LIBS = $(addprefix libboard-,$(addsuffix .a,$(BOARDS)))
+BOARD_OBJS = $(addprefix libboard-,$(addsuffix .o,$(BOARDS)))
+
GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
then echo -L${objroot}/../gcc ; fi`
-OUTPUTS = libor1k.a crt0.o
+OUTPUTS = libor1k.a crt0.o ${BOARD_LIBS}
# Host specific makefile fragment comes in here.
@host_makefile_frag@
${AR} ${ARFLAGS} $@ $(LIBOR1K_OBJS)
${RANLIB} $@
+libboard-%.o: boards/%.S
+ ${CC} ${CFLAGS} -o $@ -c $<
+
+libboard-%.o: boards/%.c
+ ${CC} ${CFLAGS} -o $@ -c $<
+
+libboard-%.a: libboard-%.o
+ ${AR} ${ARFLAGS} $@ $<
+ ${RANLIB} $@
+
doc:
clean mostlyclean:
--- /dev/null
+/* board.h -- board variable definitions for OpenRISC 1000.
+ *
+ * Copyright (c) 2014 Authors
+ *
+ * Contributor Stefan Wallentowitz <stefan.wallentowitz@tum.de>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#ifndef __BOARD_H__
+#define __BOARD_H__
+
+#include <stdint.h>
+
+extern void* _or1k_board_mem_base;
+extern uint32_t _or1k_board_mem_size;
+extern uint32_t _or1k_board_clk_freq;
+
+extern uint32_t _or1k_board_uart_base;
+extern uint32_t _or1k_board_uart_baud;
+extern uint32_t _or1k_board_uart_IRQ;
+
+extern void _or1k_board_exit(void);
+extern void _or1k_board_init_early(void);
+extern void _or1k_board_init(void);
+
+#endif // __BOARD_H__
--- /dev/null
+# Add a new board
+
+Before adding a new board, you may consider if your board can use another
+board definition and simply overwrite the weak symbols.
+
+If you think it is worth adding a new board, you need to perform the following
+steps:
+
+ * Decide for a meaningful board name (refered to as <board> below). It should
+ be specific enough (not openrisc..), but be rather generic if it may cover
+ similar boards as well.
+
+ * Create a file <board>.S (assembler) or <board>.c (C). Of course, C is easier
+ to write and you can implement everything in C, but there are restrictions:
+
+ * There is an early initialization function. It is called before the C
+ library and even the stack are initialized. A default implementation skips
+ this step, so everything will compile, but if you really need
+ initialization that early you are bound to assembly language.
+
+ * You essentially should not use the C library functions as this may lead to
+ link issues and circular dependencies.
+
+ You can copy board_tmpl.S or board_tmpl.c as starting point for your board.
+
+ * The following symbols must be defined in your board file:
+
+ * _or1k_board_mem_base: Memory base address
+
+ * _or1k_board_mem_size: Memory size
+
+ * _or1k_board_clk_freq: Clock frequency
+
+ * _or1k_board_uart_base: UART base address. Set to 0 if no UART present.
+
+ * _or1k_board_uart_baud: UART baud rate. Only used if UART base is > 0
+
+ * _or1k_board_uart_IRQ: UART interrupt line. Only used if UART base is > 0
+
+ You can define a weak attribute for all of the symbols so that they can
+ be overwritten by the user (more flexibility).
+
+ * The following functions need to be implemented:
+
+ * _or1k_board_init: Is called after C library initialization and UART
+ initialization.
+
+ * _or1k_board_exit: Is called after the program has exited and the C library
+ finished all deconstructions etc.
+
+ Similar to the symbols you can define those functions weak.
+
+ * The following functions can be implemented:
+
+ * _or1k_board_init_early: Only in assembly (see above). Is called before
+ anything is initialized, not even the stack! You can use all registers
+ in this function. The default implementation in crt0.S skips this step,
+ which is fine in most cases. If you decide to implement it, you need to
+ define it with the global attribute to overwrite the default
+ implementation. It is recommended to do so in assembler board files to
+ keep the ability to overwrite the default implementation by the user.
+
+When you are done with your board, add it to libgloss/or1k/Makefile.in to the
+BOARDS variable and compile.
+
--- /dev/null
+/* atlys.S -- Support for the Atlys board.
+ *
+ * Copyright (c) 2012 Authors
+ *
+ * Contributor Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x2000000
+
+_or1k_board_clk_freq: .long 50000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* de0_nano.S -- Support for the DE0 nano board.
+ *
+ * Copyright (c) 2012 Authors
+ *
+ * Contributor Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x2000000
+
+_or1k_board_clk_freq: .long 50000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+
--- /dev/null
+/* ml501.S -- Support for the Xilinx ML501 board.
+ *
+ * Copyright (c) 2011 Authors
+ *
+ * Contributor Julius Baxter <juliusbaxter@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x800000
+
+_or1k_board_clk_freq: .long 66666666
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* ml509.S -- Support for the Xilinx ML509 board (XUPV5).
+ *
+ * Copyright (c) 2014 Authors
+ *
+ * Contributor Matthew Hicks <firefalcon@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x08000000
+
+_or1k_board_clk_freq: .long 50000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* optimsoc.S -- Support for OpTiMSoC systems.
+ *
+ * Copyright (c) 2014 Authors
+ *
+ * Contributor Stefan Wallentowitz <stefan.wallentowitz@saunalahti.fi>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+#define OPTIMSOC_NA_BASE 0xe0000000
+
+#define OPTIMSOC_NA_REGS OPTIMSOC_NA_BASE + 0x00000
+#define OPTIMSOC_NA_LMEM_SIZE OPTIMSOC_NA_REGS + 0x24
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x0
+
+_or1k_board_clk_freq: .long 50000000
+
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+_or1k_board_uart_base: .long 0x0
+_or1k_board_uart_baud: .long 0
+_or1k_board_uart_IRQ: .long 0
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+#ifndef __OR1K_MULTICORE__
+ l.nop 0x1
+.die:
+ OR1K_DELAYED_NOP(l.j die)
+#endif
+ l.movhi r1,hi(OPTIMSOC_NA_LMEM_SIZE)
+ l.ori r1,r1,lo(OPTIMSOC_NA_LMEM_SIZE)
+ l.lwz r1,0(r1)
+ l.movhi r2,hi(_or1k_board_mem_size)
+ l.ori r2,r2,lo(_or1k_board_mem_size)
+ l.sw 0(r2),r1
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* or1ksim-uart.S -- Support for or1ksim with UART support.
+ *
+ * Copyright (c) 2011 Authors
+ *
+ * Contributor Julius Baxter <juliusbaxter@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x800000
+_or1k_board_clk_freq: .long 100000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* or1ksim.S -- Support for or1ksim.
+ *
+ * Copyright (c) 2011 Authors
+ *
+ * Contributor Julius Baxter <juliusbaxter@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x800000
+
+_or1k_board_clk_freq: .long 100000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x0
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 13
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
+
--- /dev/null
+/* ordb1a3pe1500.S -- Support for orpsocv2 Actel board.
+ *
+ * Copyright (c) 2011 Authors
+ *
+ * Contributor Julius Baxter <juliusbaxter@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x02000000
+
+_or1k_board_clk_freq: .long 20000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* ordb2a.S -- Support for the new OpenRISC ORPSoC reference design.
+ *
+ * Copyright (c) 2012 Authors
+ *
+ * Contributor Olof Kindgren <olof.kindgren@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ * Olof Kindgren olof at opencores.org
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x02000000
+
+_or1k_board_clk_freq: .long 50000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0x90000000
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* orpsocrefdesign.S -- Support for the orpsoc reference design.
+ *
+ * Copyright (c) 2011 Authors
+ *
+ * Contributor Julius Baxter <juliusbaxter@gmail.com>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+_or1k_board_mem_base: .long 0x0
+_or1k_board_mem_size: .long 0x800000
+
+_or1k_board_clk_freq: .long 50000000
+
+/* Peripheral information - Set base to 0 if not present*/
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+
+_or1k_board_uart_base: .long 0
+_or1k_board_uart_baud: .long 115200
+_or1k_board_uart_IRQ: .long 2
+
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_K_EXIT_QUIET
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* tmpl.S -- Template for new boards.
+ *
+ * Copyright (c) 2014 Authors
+ *
+ * Contributor Stefan Wallentowitz <stefan.wallentowitz@saunalahti.fi>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "../include/or1k-asm.h"
+#include "../include/or1k-nop.h"
+
+/*
+ * Define symbols to be used during startup - file is linked at compile time
+ *
+ */
+.weak _or1k_board_mem_base
+.weak _or1k_board_mem_size
+.weak _or1k_board_clk_freq
+
+// TODO: set memory base here
+_or1k_board_mem_base: .long 0x0
+// TODO: set memory size here
+_or1k_board_mem_size: .long 0x0
+
+// TODO: set board clock frequency here
+_or1k_board_clk_freq: .long 50000000
+
+// TODO: UART configuration
+.weak _or1k_board_uart_base
+.weak _or1k_board_uart_baud
+.weak _or1k_board_uart_IRQ
+_or1k_board_uart_base: .long 0x0
+_or1k_board_uart_baud: .long 0
+_or1k_board_uart_IRQ: .long 0
+
+// TODO: Board exit function, default: loop
+.weak _or1k_board_exit
+_or1k_board_exit:
+ l.nop OR1K_NOP_EXIT_SILENT
+.Lexitloop:
+ OR1K_DELAYED_NOP(l.j .Lexitloop)
+
+// TODO: Early initialization (if really needed!)
+.global _or1k_board_init_early
+_or1k_board_init_early:
+ OR1K_DELAYED_NOP(l.jr r9)
+
+// TODO: Board initialization
+.weak _or1k_board_init
+_or1k_board_init:
+ OR1K_DELAYED_NOP(l.jr r9)
--- /dev/null
+/* tmpl.c -- Template for new boards.
+ *
+ * Copyright (c) 2014 Authors
+ *
+ * Contributor Stefan Wallentowitz <stefan.wallentowitz@saunalahti.fi>
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+// TODO: set memory base here
+unsigned long __attribute__((weak)) _or1k_board_mem_base = 0x0;
+
+// TODO: set memory size here
+unsigned long __attribute__((weak)) _or1k_board_mem_size = 0x0;
+
+// TODO: set board clock frequency here
+unsigned long __attribute__((weak)) _or1k_board_clk_freq = 0x0;
+
+// TODO: UART configuration
+unsigned long __attribute__((weak)) _or1k_board_uart_base = 0x0;
+unsigned long __attribute__((weak)) _or1k_board_uart_baud = 0x0;
+unsigned long __attribute__((weak)) _or1k_board_uart_IRQ = 0x0;
+
+// TODO: Board exit function, default: loop
+void __attribute__((weak)) _or1k_board_exit(void) {
+ while (1) {}
+}
+
+// TODO: Board initialization
+void __attribute__((weak)) _or1k_board_init(void) {
+ return;
+}