diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-19 06:28:01 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 13:08:32 +0200 |
commit | d7d66d7d4523b904c8ccc6aea3709dc0d5aa5bdc (patch) | |
tree | caa54b4229e86a68c84ab5961af34e087dce5302 /c/src/lib/libbsp/nios2 | |
parent | bsps/powerpc: Move shared btimer support (diff) | |
download | rtems-d7d66d7d4523b904c8ccc6aea3709dc0d5aa5bdc.tar.bz2 |
bsps: Move console drivers to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/nios2')
-rw-r--r-- | c/src/lib/libbsp/nios2/nios2_iss/Makefile.am | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/nios2/nios2_iss/console/console.c | 98 |
2 files changed, 2 insertions, 100 deletions
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am index c05ddd151f..2fe8023b42 100644 --- a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am +++ b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am @@ -31,8 +31,8 @@ librtemsbsp_a_SOURCES += startup/setvec.c # clock librtemsbsp_a_SOURCES +=../../../../../../bsps/nios2/nios2_iss/clock/clock.c # console -librtemsbsp_a_SOURCES += console/console.c -librtemsbsp_a_SOURCES += ../../shared/console-polled.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/nios2/nios2_iss/console/console.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-polled.c # timer librtemsbsp_a_SOURCES += timer/timer.c diff --git a/c/src/lib/libbsp/nios2/nios2_iss/console/console.c b/c/src/lib/libbsp/nios2/nios2_iss/console/console.c deleted file mode 100644 index 9197c6486c..0000000000 --- a/c/src/lib/libbsp/nios2/nios2_iss/console/console.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file implements simple console IO via JTAG UART. - */ - -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * Altera-specific code is - * COPYRIGHT (c) 2005-2006 Kolja Waschk, rtemsdev/ixo.de - * - * 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. - */ - -#define NO_BSP_INIT - -#include <bsp.h> -#include <bsp/console-polled.h> -#include <rtems/libio.h> - -/* #define JTAG_UART_REGS \ - ((altera_avalon_jtag_uart_regs*)NIOS2_IO_BASE(JTAG_UART_BASE)) */ - -/* is_character_ready - * - * If a character is available, this routine reads it and stores - * it in reads the character and stores - */ -static bool is_character_ready( - char *ch -) -{ - altera_avalon_jtag_uart_regs *ajur = NIOS2_IO_BASE(JTAG_UART_BASE); - unsigned int data = ajur->data; - - if (data & ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK) { - *ch = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK) - >> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST; - return true; - } - - return false; -} - -void console_initialize_hardware(void) -{ -} - -/* - * This routine reads a character from the SOURCE. - */ -int console_inbyte_nonblocking( - int port -) -{ - char ch; - - /* - * Wait until a character is available. - */ - if (is_character_ready(&ch)) - return ch; - return -1; -} - -/* - * This routine transmits a character out the SOURCE. - */ -void console_outbyte_polled( - int port, - char ch -) -{ - altera_avalon_jtag_uart_regs *ajur = NIOS2_IO_BASE(JTAG_UART_BASE); - - /* - * Wait for the transmitter to be ready. - * Check for flow control requests and process. - * Then output the character. - */ - while ((ajur->control & ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK) == 0); - - ajur->data = ch; -} - -/* - * To support printk - */ - -#include <rtems/bspIo.h> - -static void ISS_output_char(char c) { console_outbyte_polled( 0, c ); } - -BSP_output_char_function_type BSP_output_char = ISS_output_char; -BSP_polling_getchar_function_type BSP_poll_char = NULL; - |