summaryrefslogtreecommitdiff
path: root/include/or1k/generic_or1k/bsp
diff options
context:
space:
mode:
Diffstat (limited to 'include/or1k/generic_or1k/bsp')
-rw-r--r--include/or1k/generic_or1k/bsp/irq.h45
-rw-r--r--include/or1k/generic_or1k/bsp/linker-symbols.h79
-rw-r--r--include/or1k/generic_or1k/bsp/uart.h42
3 files changed, 166 insertions, 0 deletions
diff --git a/include/or1k/generic_or1k/bsp/irq.h b/include/or1k/generic_or1k/bsp/irq.h
new file mode 100644
index 0000000000..791aefcae0
--- /dev/null
+++ b/include/or1k/generic_or1k/bsp/irq.h
@@ -0,0 +1,45 @@
+/**
+ * @file
+ *
+ * @ingroup OR1K_IRQ
+ *
+ * @brief Interrupt definitions.
+ */
+
+/**
+ * COPYRIGHT (c) 2014-2015 Hesham ALMatary <heshamelmatary@gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE
+ */
+
+#ifndef LIBBSP_GENERIC_OR1K_IRQ_H
+#define LIBBSP_GENERIC_OR1K_IRQ_H
+
+#ifndef ASM
+
+#include <rtems.h>
+#include <rtems/irq.h>
+#include <rtems/irq-extension.h>
+
+#define BSP_INTERRUPT_VECTOR_MIN 0x100
+#define BSP_INTERRUPT_VECTOR_MAX 0x1F00
+
+/* Interrupt Identification Register */
+#define OR1K_BSP_UART_REG_INT_ID_MSI (0x00)
+#define OR1K_BSP_UART_REG_INT_ID_NO_INT (0x01)
+#define OR1K_BSP_UART_REG_INT_ID_THRI (0x02)
+#define OR1K_BSP_UART_REG_INT_ID_RDI (0x04)
+#define OR1K_BSP_UART_REG_INT_ID_ID (0x06)
+#define OR1K_BSP_UART_REG_INT_ID_RLSI (0x06)
+#define OR1K_BSP_UART_REG_INT_ID_TOI (0x0c)
+
+/* Interrupt Enable Register */
+#define OR1K_BSP_UART_REG_INT_ENABLE_RDI (0x01)
+#define OR1K_BSP_UART_REG_INT_ENABLE_THRI (0x02)
+#define OR1K_BSP_UART_REG_INT_ENABLE_RLSI (0x04)
+#define OR1K_BSP_UART_REG_INT_ENABLE_MSI (0x08)
+
+#endif /* ASM */
+#endif /* LIBBSP_GENERIC_OR1K_IRQ_H */
diff --git a/include/or1k/generic_or1k/bsp/linker-symbols.h b/include/or1k/generic_or1k/bsp/linker-symbols.h
new file mode 100644
index 0000000000..f0f8377892
--- /dev/null
+++ b/include/or1k/generic_or1k/bsp/linker-symbols.h
@@ -0,0 +1,79 @@
+#ifndef LIBBSP_OR1k_SHARED_LINKER_SYMBOLS_H
+#define LIBBSP_OR1k_SHARED_LINKER_SYMBOLS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @defgroup or1k_linker Linker Support
+ *
+ * @ingroup or1k_shared
+ *
+ * @brief Linker support.
+ *
+ * @{
+ */
+
+#ifndef ASM
+ #define LINKER_SYMBOL(sym) extern char sym [];
+#else
+ #define LINKER_SYMBOL(sym) .extern sym
+#endif
+
+LINKER_SYMBOL(bsp_section_start_begin)
+LINKER_SYMBOL(bsp_section_start_end)
+LINKER_SYMBOL(bsp_section_start_size)
+
+LINKER_SYMBOL(bsp_section_vector_begin)
+LINKER_SYMBOL(bsp_section_vector_end)
+LINKER_SYMBOL(bsp_section_vector_size)
+
+LINKER_SYMBOL(bsp_section_text_begin)
+LINKER_SYMBOL(bsp_section_text_end)
+LINKER_SYMBOL(bsp_section_text_size)
+LINKER_SYMBOL(bsp_section_text_load_begin)
+LINKER_SYMBOL(bsp_section_text_load_end)
+
+LINKER_SYMBOL(bsp_section_rodata_begin)
+LINKER_SYMBOL(bsp_section_rodata_end)
+LINKER_SYMBOL(bsp_section_rodata_size)
+LINKER_SYMBOL(bsp_section_rodata_load_begin)
+LINKER_SYMBOL(bsp_section_rodata_load_end)
+
+LINKER_SYMBOL(bsp_section_data_begin)
+LINKER_SYMBOL(bsp_section_data_end)
+LINKER_SYMBOL(bsp_section_data_size)
+LINKER_SYMBOL(bsp_section_data_load_begin)
+LINKER_SYMBOL(bsp_section_data_load_end)
+
+LINKER_SYMBOL(bsp_section_bss_begin)
+LINKER_SYMBOL(bsp_section_bss_end)
+LINKER_SYMBOL(bsp_section_bss_size)
+
+LINKER_SYMBOL(bsp_section_work_begin)
+LINKER_SYMBOL(bsp_section_work_end)
+LINKER_SYMBOL(bsp_section_work_size)
+
+LINKER_SYMBOL(bsp_section_stack_begin)
+LINKER_SYMBOL(bsp_section_stack_end)
+LINKER_SYMBOL(bsp_section_stack_size)
+
+LINKER_SYMBOL(bsp_vector_table_begin)
+LINKER_SYMBOL(bsp_vector_table_end)
+LINKER_SYMBOL(bsp_vector_table_size)
+
+LINKER_SYMBOL(bsp_start_vector_table_begin)
+LINKER_SYMBOL(bsp_start_vector_table_end)
+LINKER_SYMBOL(bsp_start_vector_table_size)
+
+LINKER_SYMBOL(bsp_translation_table_base)
+LINKER_SYMBOL(bsp_translation_table_end)
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_OR1K_SHARED_LINKER_SYMBOLS_H */
diff --git a/include/or1k/generic_or1k/bsp/uart.h b/include/or1k/generic_or1k/bsp/uart.h
new file mode 100644
index 0000000000..dbf3bbf9ef
--- /dev/null
+++ b/include/or1k/generic_or1k/bsp/uart.h
@@ -0,0 +1,42 @@
+/**
+ * @file
+ *
+ * @ingroup generic_or1k_uart
+ *
+ * @brief UART support.
+ */
+
+/*
+ * COPYRIGHT (c) 2014-2015 Hesham ALMatary <heshamelmatary@gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE
+ */
+
+/**
+ * @defgroup generic_or1k_uart UART Support
+ *
+ * @ingroup generic_or1k
+ *
+ * @brief Universal Asynchronous Receiver/Transmitter (UART) Support
+ */
+
+#ifndef LIBBSP_GENERIC_OR1K_UART_H
+#define LIBBSP_GENERIC_OR1K_UART_H
+
+#include <libchip/serial.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define OR1K_UART_DEFAULT_BAUD 115200
+#define OR1K_BSP_UART_IRQ 2
+extern const console_fns generic_or1k_uart_fns;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_GENERIC_OR1K_UART_H */