summaryrefslogtreecommitdiffstats
path: root/bsps/or1k
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /bsps/or1k
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'bsps/or1k')
-rw-r--r--bsps/or1k/generic_or1k/headers.am12
-rw-r--r--bsps/or1k/generic_or1k/include/bsp.h45
-rw-r--r--bsps/or1k/generic_or1k/include/bsp/generic_or1k.h118
-rw-r--r--bsps/or1k/generic_or1k/include/bsp/irq.h45
-rw-r--r--bsps/or1k/generic_or1k/include/bsp/uart.h42
-rw-r--r--bsps/or1k/generic_or1k/include/tm27.h1
-rw-r--r--bsps/or1k/headers.am6
-rw-r--r--bsps/or1k/include/bsp/cache_.h43
-rw-r--r--bsps/or1k/include/bsp/linker-symbols.h79
9 files changed, 391 insertions, 0 deletions
diff --git a/bsps/or1k/generic_or1k/headers.am b/bsps/or1k/generic_or1k/headers.am
new file mode 100644
index 0000000000..3576c64a9c
--- /dev/null
+++ b/bsps/or1k/generic_or1k/headers.am
@@ -0,0 +1,12 @@
+## This file was generated by "./boostrap -H".
+
+include_HEADERS =
+include_HEADERS += ../../../../../../bsps/or1k/generic_or1k/include/bsp.h
+include_HEADERS += include/bspopts.h
+include_HEADERS += ../../../../../../bsps/or1k/generic_or1k/include/tm27.h
+
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS =
+include_bsp_HEADERS += ../../../../../../bsps/or1k/generic_or1k/include/bsp/generic_or1k.h
+include_bsp_HEADERS += ../../../../../../bsps/or1k/generic_or1k/include/bsp/irq.h
+include_bsp_HEADERS += ../../../../../../bsps/or1k/generic_or1k/include/bsp/uart.h
diff --git a/bsps/or1k/generic_or1k/include/bsp.h b/bsps/or1k/generic_or1k/include/bsp.h
new file mode 100644
index 0000000000..16839930a4
--- /dev/null
+++ b/bsps/or1k/generic_or1k/include/bsp.h
@@ -0,0 +1,45 @@
+/**
+ * @file
+ *
+ * @ingroup generic_or1k
+ *
+ * @brief Global BSP 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_H
+#define LIBBSP_GENERIC_OR1K_H
+
+#include <bspopts.h>
+#include <rtems.h>
+#include <bsp/generic_or1k.h>
+
+#include <bsp/default-initial-extension.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define BSP_FEATURE_IRQ_EXTENSION
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_GENERIC_OR1K_H */
+
+/**
+ * @defgroup generic_or1k support
+ *
+ * @ingroup bsp_or1k
+ *
+ * @brief generic_or1k support package
+ *
+ */
diff --git a/bsps/or1k/generic_or1k/include/bsp/generic_or1k.h b/bsps/or1k/generic_or1k/include/bsp/generic_or1k.h
new file mode 100644
index 0000000000..e4d9760640
--- /dev/null
+++ b/bsps/or1k/generic_or1k/include/bsp/generic_or1k.h
@@ -0,0 +1,118 @@
+/**
+ * @file
+ *
+ * @ingroup generic_or1k_reg
+ *
+ * @brief Register 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_H
+#define LIBBSP_GENERIC_OR1K_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup generic_or1k_reg Register Definitions
+ *
+ * @ingroup generic_or1k
+ *
+ * @brief Shared register definitions for or1k systems.
+ *
+ * @{
+ */
+
+/**
+ * @name Register Macros
+ *
+ * @{
+ */
+
+ #define OR1K_REG(x) (*((volatile unsigned char *) (x)))
+ #define OR1K_BIT(n) (1 << (n))
+
+/** @} */
+
+/**
+ * @name Internal OR1K UART Registers
+ *
+ * @{
+ */
+#define OR1K_BSP_CLOCK_FREQ 50000000UL
+#define OR1K_BSP_UART_BASE 0x90000000
+
+#define OR1K_BSP_UART_REG_TX (OR1K_BSP_UART_BASE+0)
+#define OR1K_BSP_UART_REG_RX (OR1K_BSP_UART_BASE+0)
+#define OR1K_BSP_UART_REG_DEV_LATCH_LOW (OR1K_BSP_UART_BASE+0)
+#define OR1K_BSP_UART_REG_DEV_LATCH_HIGH (OR1K_BSP_UART_BASE+1)
+#define OR1K_BSP_UART_REG_INT_ENABLE (OR1K_BSP_UART_BASE+1)
+#define OR1K_BSP_UART_REG_INT_ID (OR1K_BSP_UART_BASE+2)
+#define OR1K_BSP_UART_REG_FIFO_CTRL (OR1K_BSP_UART_BASE+2)
+#define OR1K_BSP_UART_REG_LINE_CTRL (OR1K_BSP_UART_BASE+3)
+#define OR1K_BSP_UART_REG_MODEM_CTRL (OR1K_BSP_UART_BASE+4)
+#define OR1K_BSP_UART_REG_LINE_STATUS (OR1K_BSP_UART_BASE+5)
+#define OR1K_BSP_UART_REG_MODEM_STATUS (OR1K_BSP_UART_BASE+6)
+#define OR1K_BSP_UART_REG_SCRATCH (OR1K_BSP_UART_BASE+7)
+
+/* FIFO Control Register */
+#define OR1K_BSP_UART_REG_FIFO_CTRL_TRIGGER_1 (0x00)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_ENABLE_FIFO (0x01)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_CLEAR_RCVR (0x02)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_CLEAR_XMIT (0x03)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_DMA_SELECT (0x08)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_TRIGGER_4 (0x40)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_TRIGGER_8 (0x80)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_TRIGGER_14 (0xC0)
+#define OR1K_BSP_UART_REG_FIFO_CTRL_TRIGGER_MASK (0xC0)
+
+/* Line Control Register */
+#define OR1K_BSP_UART_REG_LINE_CTRL_WLEN5 (0x00)
+#define OR1K_BSP_UART_REG_LINE_CTRL_WLEN6 (0x01)
+#define OR1K_BSP_UART_REG_LINE_CTRL_WLEN7 (0x02)
+#define OR1K_BSP_UART_REG_LINE_CTRL_WLEN8 (0x03)
+#define OR1K_BSP_UART_REG_LINE_CTRL_STOP (0x04)
+#define OR1K_BSP_UART_REG_LINE_CTRL_PARITY (0x08)
+#define OR1K_BSP_UART_REG_LINE_CTRL_EPAR (0x10)
+#define OR1K_BSP_UART_REG_LINE_CTRL_SPAR (0x20)
+#define OR1K_BSP_UART_REG_LINE_CTRL_SBC (0x40)
+#define OR1K_BSP_UART_REG_LINE_CTRL_DLAB (0x80)
+
+/* Line Status Register */
+#define OR1K_BSP_UART_REG_LINE_STATUS_DR (0x01)
+#define OR1K_BSP_UART_REG_LINE_STATUS_OE (0x02)
+#define OR1K_BSP_UART_REG_LINE_STATUS_PE (0x04)
+#define OR1K_BSP_UART_REG_LINE_STATUS_FE (0x08)
+#define OR1K_BSP_UART_REG_LINE_STATUS_BI (0x10)
+#define OR1K_BSP_UART_REG_LINE_STATUS_THRE (0x20)
+#define OR1K_BSP_UART_REG_LINE_STATUS_TEMT (0x40)
+
+/* Modem Control Register */
+#define OR1K_BSP_UART_REG_MODEM_CTRL_DTR (0x01)
+#define OR1K_BSP_UART_REG_MODEM_CTRL_RTS (0x02)
+#define OR1K_BSP_UART_REG_MODEM_CTRL_OUT1 (0x04)
+#define OR1K_BSP_UART_REG_MODEM_CTRL_OUT2 (0x08)
+#define OR1K_BSP_UART_REG_MODEM_CTRL_LOOP (0x10)
+
+/* Modem Status Register */
+#define OR1K_BSP_UART_REG_MODEM_STATUS_DCTS (0x01)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_DDSR (0x02)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_TERI (0x04)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_DDCD (0x08)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_CTS (0x10)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_DSR (0x20)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_RI (0x40)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_DCD (0x80)
+#define OR1K_BSP_UART_REG_MODEM_STATUS_ANY_DELTA (0x0F)
+
+/** @} */
+
+/** @} */
+
+#endif /* LIBBSP_GENERIC_OR1K_H */
diff --git a/bsps/or1k/generic_or1k/include/bsp/irq.h b/bsps/or1k/generic_or1k/include/bsp/irq.h
new file mode 100644
index 0000000000..791aefcae0
--- /dev/null
+++ b/bsps/or1k/generic_or1k/include/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/bsps/or1k/generic_or1k/include/bsp/uart.h b/bsps/or1k/generic_or1k/include/bsp/uart.h
new file mode 100644
index 0000000000..dbf3bbf9ef
--- /dev/null
+++ b/bsps/or1k/generic_or1k/include/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 */
diff --git a/bsps/or1k/generic_or1k/include/tm27.h b/bsps/or1k/generic_or1k/include/tm27.h
new file mode 100644
index 0000000000..0dfa7bf628
--- /dev/null
+++ b/bsps/or1k/generic_or1k/include/tm27.h
@@ -0,0 +1 @@
+#include <rtems/tm27-default.h>
diff --git a/bsps/or1k/headers.am b/bsps/or1k/headers.am
new file mode 100644
index 0000000000..7729a76231
--- /dev/null
+++ b/bsps/or1k/headers.am
@@ -0,0 +1,6 @@
+## This file was generated by "./boostrap -H".
+
+include_bspdir = $(includedir)/bsp
+include_bsp_HEADERS =
+include_bsp_HEADERS += ../../../../../bsps/or1k/include/bsp/cache_.h
+include_bsp_HEADERS += ../../../../../bsps/or1k/include/bsp/linker-symbols.h
diff --git a/bsps/or1k/include/bsp/cache_.h b/bsps/or1k/include/bsp/cache_.h
new file mode 100644
index 0000000000..ed2053858e
--- /dev/null
+++ b/bsps/or1k/include/bsp/cache_.h
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT (c) 2014 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_OR1K_SHARED_CACHE_H
+#define LIBBSP_OR1K_SHARED_CACHE_H
+
+#include <assert.h>
+#include <bsp.h>
+#include <rtems/rtems/intr.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* These two defines also ensure that the rtems_cache_* functions have bodies */
+#define CPU_DATA_CACHE_ALIGNMENT 32
+#define CPU_INSTRUCTION_CACHE_ALIGNMENT 32
+
+#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS 1
+
+static inline size_t
+_CPU_cache_get_data_cache_size( const uint32_t level )
+{
+ return (level == 0 || level == 1)? 8192 : 0;
+}
+
+static inline size_t
+_CPU_cache_get_instruction_cache_size( const uint32_t level )
+{
+ return (level == 0 || level == 1)? 8192 : 0;
+}
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_OR1K_SHARED_CACHE_H */
diff --git a/bsps/or1k/include/bsp/linker-symbols.h b/bsps/or1k/include/bsp/linker-symbols.h
new file mode 100644
index 0000000000..f0f8377892
--- /dev/null
+++ b/bsps/or1k/include/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 */