aboutsummaryrefslogtreecommitdiff
path: root/VexRiscvSocSoftware/projects/briey/libs
diff options
context:
space:
mode:
Diffstat (limited to 'VexRiscvSocSoftware/projects/briey/libs')
-rw-r--r--VexRiscvSocSoftware/projects/briey/libs/briey.h36
-rwxr-xr-xVexRiscvSocSoftware/projects/briey/libs/linker.ld122
-rw-r--r--VexRiscvSocSoftware/projects/briey/libs/makefile1
3 files changed, 159 insertions, 0 deletions
diff --git a/VexRiscvSocSoftware/projects/briey/libs/briey.h b/VexRiscvSocSoftware/projects/briey/libs/briey.h
new file mode 100644
index 0000000..0426cee
--- /dev/null
+++ b/VexRiscvSocSoftware/projects/briey/libs/briey.h
@@ -0,0 +1,36 @@
+/*
+ * briey.h
+ *
+ * Created on: Aug 24, 2016
+ * Author: clp
+ */
+
+#ifndef BRIEY_H_
+#define BRIEY_H_
+
+#include "timer.h"
+#include "prescaler.h"
+#include "interrupt.h"
+#include "uart.h"
+#include "vga.h"
+#include "gpio.h"
+
+#define CORE_HZ 50000000
+
+#define GPIO_A_BASE ((Gpio_Reg*)(0xF0000000))
+#define GPIO_B_BASE ((Gpio_Reg*)(0xF0001000))
+#define UART ((Uart_Reg*)(0xF0010000))
+#define VGA_BASE ((Vga_Reg*)(0xF0030000))
+
+
+#define TIMER_PRESCALER ((Prescaler_Reg*)0xF0020000)
+#define TIMER_INTERRUPT ((InterruptCtrl_Reg*)0xF0020010)
+#define TIMER_A ((Timer_Reg*)0xF0020040)
+#define TIMER_B ((Timer_Reg*)0xF0020050)
+#define TIMER_C ((Timer_Reg*)0xF0020060)
+#define TIMER_D ((Timer_Reg*)0xF0020070)
+
+#define UART_SAMPLE_PER_BAUD 8
+
+
+#endif /* BRIEY_H_ */
diff --git a/VexRiscvSocSoftware/projects/briey/libs/linker.ld b/VexRiscvSocSoftware/projects/briey/libs/linker.ld
new file mode 100755
index 0000000..1f7f96d
--- /dev/null
+++ b/VexRiscvSocSoftware/projects/briey/libs/linker.ld
@@ -0,0 +1,122 @@
+/*======================================================================*/
+/* Proxy kernel linker script */
+/*======================================================================*/
+/* This is the linker script used when building the proxy kernel. */
+
+/*----------------------------------------------------------------------*/
+/* Setup */
+/*----------------------------------------------------------------------*/
+
+/* The OUTPUT_ARCH command specifies the machine architecture where the
+ argument is one of the names used in the BFD library. More
+ specifically one of the entires in bfd/cpu-mips.c */
+
+/*
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+*/
+OUTPUT_FORMAT("elf32-littleriscv", "elf32-littleriscv", "elf32-littleriscv")
+OUTPUT_ARCH(riscv)
+ENTRY(crtStart)
+
+MEMORY {
+ onChipRam (W!RX)/*(RX)*/ : ORIGIN = 0x80000000, LENGTH = 4K
+ sdram (W!RX) : ORIGIN = 0x40000000, LENGTH = 64M
+}
+_stack_size = 2k;
+_heap_size = 0k;
+
+SECTIONS /*TODO don't initialize useless things, restore literal loading that use 2 instruction in place of onChipRam word */
+{
+ .vector : {
+ *crt.o(.text);
+ } > onChipRam
+
+ .memory : {
+ *(.text);
+ end = .;
+ } > sdram
+
+ .rodata :
+ {
+ *(.rdata)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.r.*)
+ } > sdram
+
+ .ctors :
+ {
+ . = ALIGN(4);
+ _ctors_start = .;
+ KEEP(*(.init_array*))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ . = ALIGN(4);
+ _ctors_end = .;
+ } > sdram
+
+ .data :
+ {
+ *(.rdata)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.r.*)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ . = ALIGN(8);
+ PROVIDE( __global_pointer$ = . + 0x800 );
+ *(.sdata .sdata.*)
+ *(.gnu.linkonce.s.*)
+ . = ALIGN(8);
+ *(.srodata.cst16)
+ *(.srodata.cst8)
+ *(.srodata.cst4)
+ *(.srodata.cst2)
+ *(.srodata .srodata.*)
+ } > sdram
+
+ .bss (NOLOAD) : {
+ . = ALIGN(4);
+ /* This is used by the startup in order to initialize the .bss secion */
+ _bss_start = .;
+ *(.sbss*)
+ *(.gnu.linkonce.sb.*)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _bss_end = .;
+ } > sdram
+
+ .noinit (NOLOAD) : {
+ . = ALIGN(4);
+ *(.noinit .noinit.*)
+ . = ALIGN(4);
+ } > sdram
+
+
+ ._user_heap (NOLOAD):
+ {
+ . = ALIGN(8);
+ PROVIDE ( end = . );
+ PROVIDE ( _end = . );
+ PROVIDE ( _heap_start = .);
+ . = . + _heap_size;
+ . = ALIGN(8);
+ PROVIDE ( _heap_end = .);
+ } > sdram
+
+ ._stack (NOLOAD):
+ {
+ . = ALIGN(16);
+ PROVIDE (_stack_end = .);
+ . = . + _stack_size;
+ . = ALIGN(16);
+ PROVIDE (_stack_start = .);
+ } > onChipRam
+
+
+}
diff --git a/VexRiscvSocSoftware/projects/briey/libs/makefile b/VexRiscvSocSoftware/projects/briey/libs/makefile
new file mode 100644
index 0000000..63dc497
--- /dev/null
+++ b/VexRiscvSocSoftware/projects/briey/libs/makefile
@@ -0,0 +1 @@
+include ../../../resources/recursive.mk \ No newline at end of file