summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/console
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-12-11 14:49:49 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-01-04 13:44:56 -0600
commit607c85465dc1115a0b86ff1168db8c5f670e40a7 (patch)
tree71df682f5e91d8faeb5c08c94d97e2aa344f8a02 /c/src/lib/libbsp/i386/pc386/console
parentCorrect error return mismatches (diff)
downloadrtems-607c85465dc1115a0b86ff1168db8c5f670e40a7.tar.bz2
pc386: Add BSP_ENABLE_VGA BSP option
This allows the VGA and keyboard console to be completely disabled. It is useful on PCs without displays and prevents a very slow boot time on the Intel Edison.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/console')
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/conscfg.c7
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/console_control.c6
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/printk_support.c37
3 files changed, 35 insertions, 15 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/conscfg.c b/c/src/lib/libbsp/i386/pc386/console/conscfg.c
index f0295ef29e..72ccfe3709 100644
--- a/c/src/lib/libbsp/i386/pc386/console/conscfg.c
+++ b/c/src/lib/libbsp/i386/pc386/console/conscfg.c
@@ -18,12 +18,17 @@
#include <bsp.h>
#include <libchip/serial.h>
#include <libchip/ns16550.h>
+#if BSP_ENABLE_VGA
#include "vgacons.h"
+#endif
#include <bsp/irq.h>
#include <rtems/pci.h>
#include <bsp/rtd316.h>
+#if BSP_ENABLE_VGA
#define VGA_CONSOLE_FUNCTIONS &vgacons_fns
+#endif
+
#if 0
#define COM_CONSOLE_FUNCTIONS &ns16550_fns_polled
#else
@@ -54,6 +59,7 @@ static void com_set_register(uint32_t addr, uint8_t i, uint8_t val)
}
console_tbl Console_Configuration_Ports[] = {
+#if BSP_ENABLE_VGA
{
"/dev/vgacons", /* sDeviceName */
VGA_CONSOLE, /* deviceType */
@@ -73,6 +79,7 @@ console_tbl Console_Configuration_Ports[] = {
0X0, /* ulClock */
0x0 /* ulIntVector -- base for port */
},
+#endif
{
"/dev/com1", /* sDeviceName */
SERIAL_NS16550, /* deviceType */
diff --git a/c/src/lib/libbsp/i386/pc386/console/console_control.c b/c/src/lib/libbsp/i386/pc386/console/console_control.c
index 4bdae45809..e0201de570 100644
--- a/c/src/lib/libbsp/i386/pc386/console/console_control.c
+++ b/c/src/lib/libbsp/i386/pc386/console/console_control.c
@@ -26,7 +26,9 @@
#include <rtems/termiostypes.h>
#include <libchip/serial.h>
#include <rtems/mouse_parser.h>
+#if BSP_ENABLE_VGA
#include "keyboard.h"
+#endif
#include "../../../shared/console_private.h"
/*
@@ -40,6 +42,7 @@ rtems_device_driver console_control(
void * arg
)
{
+#if BSP_ENABLE_VGA
rtems_libio_ioctl_args_t *args = arg;
switch (args->command) {
@@ -60,4 +63,7 @@ rtems_device_driver console_control(
args->ioctl_return = 0;
return RTEMS_SUCCESSFUL;
+#else
+ return rtems_termios_ioctl (arg);
+#endif
}
diff --git a/c/src/lib/libbsp/i386/pc386/console/printk_support.c b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
index 371c720743..b34e3e9f79 100644
--- a/c/src/lib/libbsp/i386/pc386/console/printk_support.c
+++ b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
@@ -19,7 +19,9 @@
#include <rtems.h>
#include <rtems/bspIo.h>
-#include <rtems/keyboard.h>
+#if BSP_ENABLE_VGA
+ #include <rtems/keyboard.h>
+#endif
#include <bsp.h>
#include <libchip/serial.h>
#include <libchip/ns16550.h>
@@ -36,27 +38,32 @@ int BSP_inch(void);
void BSP_outch(char ch)
{
- if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
- _IBMPC_outch( ch );
- } else {
- console_tbl *cptr;
+ #if BSP_ENABLE_VGA
+ if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
+ _IBMPC_outch( ch );
+ return;
+ }
+ #endif
+ console_tbl *cptr;
- cptr = &Console_Configuration_Ports[BSPPrintkPort];
- cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
- }
+ cptr = &Console_Configuration_Ports[BSPPrintkPort];
+ cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
}
int BSP_inch(void)
{
int result;
- if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
- result = BSP_wait_polled_input();
- } else {
- do {
- result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
- } while (result == -1);
- }
+ #if BSP_ENABLE_VGA
+ if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
+ result = BSP_wait_polled_input();
+ } else
+ #endif
+ {
+ do {
+ result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
+ } while (result == -1);
+ }
return result;
}