summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/csb337/console/uarts.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-02 22:19:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-02 22:19:44 +0000
commite7bde49248aedbc6e4cc8d71357683e2ace42ba3 (patch)
tree871489e71229dd83a09da1a259ec1abe7bd6669b /c/src/lib/libbsp/arm/csb337/console/uarts.c
parentAs per Freescale chip errata, disable buffered writes. (diff)
downloadrtems-e7bde49248aedbc6e4cc8d71357683e2ace42ba3.tar.bz2
2009-06-02 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac, preinstall.am, console/uarts.c, include/bsp.h, startup/memmap.c: Add support for /dev/fbcons which is a console type output only device to print to the LCD screen. The video controller (SED) and fonts are copied from MicroMonitor and proper attribution is made in those files and confirmed by Ed Sutter. * console/fbcons.c, console/font8x16.h, console/sed1356.c, console/sed1356_16bit.h, include/sed1356.h: New files.
Diffstat (limited to 'c/src/lib/libbsp/arm/csb337/console/uarts.c')
-rw-r--r--c/src/lib/libbsp/arm/csb337/console/uarts.c79
1 files changed, 54 insertions, 25 deletions
diff --git a/c/src/lib/libbsp/arm/csb337/console/uarts.c b/c/src/lib/libbsp/arm/csb337/console/uarts.c
index c0bd331ad7..a4713dd5a5 100644
--- a/c/src/lib/libbsp/arm/csb337/console/uarts.c
+++ b/c/src/lib/libbsp/arm/csb337/console/uarts.c
@@ -9,11 +9,13 @@
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
- *
* http://www.rtems.com/license/LICENSE.
*
+ * FrameBuffer Console Device Support added By Joel Sherrill, 2009.
+ *
* $Id$
*/
+
#include <bsp.h>
#include <rtems/libio.h>
#include <termios.h>
@@ -23,17 +25,22 @@
#include <at91rm9200_dbgu.h>
#include <libchip/serial.h>
#include <libchip/sersupp.h>
+#include <bspopts.h>
-/* How many serial ports? */
-#define NUM_DEVS 1
+/* rtems console uses the following minor number */
+rtems_device_minor_number Console_Port_Minor = 0;
+extern console_fns dbgu_fns;
+#if ENABLE_LCD
+ extern console_fns fbcons_fns;
+ #define NUM_DEVS 2
+#else
+ #define NUM_DEVS 1
+#endif
/* These are used by code in console.c */
unsigned long Console_Port_Count = NUM_DEVS;
console_data Console_Port_Data[NUM_DEVS];
-/* rtems console uses the following minor number */
-rtems_device_minor_number Console_Port_Minor = 0;
-extern console_fns dbgu_fns;
/*
* There's one item in array for each UART.
@@ -45,25 +52,47 @@ extern console_fns dbgu_fns;
* structure to a generic uart.c file with only this in it
*/
console_tbl Console_Port_Tbl[] = {
- {
- "/dev/console", /* sDeviceName */
- SERIAL_CUSTOM, /* deviceType */
- &dbgu_fns, /* pDeviceFns */
- NULL, /* deviceProbe */
- NULL, /* pDeviceFlow */
- 0, /* ulMargin - NOT USED */
- 0, /* ulHysteresis - NOT USED */
- NULL, /* pDeviceParams */
- DBGU_BASE, /* ulCtrlPort1 - Pointer to DBGU regs */
- 0, /* ulCtrlPort2 - NOT USED */
- 0, /* ulDataPort - NOT USED */
- NULL, /* getRegister - NOT USED */
- NULL, /* setRegister - NOT USED */
- NULL, /* getData - NOT USED */
- NULL, /* setData - NOT USED */
- 0, /* ulClock - NOT USED */
- 0 /* ulIntVector - NOT USED */
- }};
+ {
+ "/dev/console", /* sDeviceName */
+ SERIAL_CUSTOM, /* deviceType */
+ &dbgu_fns, /* pDeviceFns */
+ NULL, /* deviceProbe */
+ NULL, /* pDeviceFlow */
+ 0, /* ulMargin - NOT USED */
+ 0, /* ulHysteresis - NOT USED */
+ NULL, /* pDeviceParams */
+ DBGU_BASE, /* ulCtrlPort1 - Pointer to DBGU regs */
+ 0, /* ulCtrlPort2 - NOT USED */
+ 0, /* ulDataPort - NOT USED */
+ NULL, /* getRegister - NOT USED */
+ NULL, /* setRegister - NOT USED */
+ NULL, /* getData - NOT USED */
+ NULL, /* setData - NOT USED */
+ 0, /* ulClock - NOT USED */
+ 0 /* ulIntVector - NOT USED */
+ },
+#if ENABLE_LCD
+ {
+ "/dev/fbcons", /* sDeviceName */
+ SERIAL_CUSTOM, /* deviceType */
+ &fbcons_fns, /* pDeviceFns */
+ NULL, /* deviceProbe */
+ NULL, /* pDeviceFlow */
+ 0, /* ulMargin - NOT USED */
+ 0, /* ulHysteresis - NOT USED */
+ NULL, /* pDeviceParams */
+ 0, /* ulCtrlPort1 - Pointer to DBGU regs */
+ 0, /* ulCtrlPort2 - NOT USED */
+ 0, /* ulDataPort - NOT USED */
+ NULL, /* getRegister - NOT USED */
+ NULL, /* setRegister - NOT USED */
+ NULL, /* getData - NOT USED */
+ NULL, /* setData - NOT USED */
+ 0, /* ulClock - NOT USED */
+ 0 /* ulIntVector - NOT USED */
+ }
+#endif
+};
console_tbl *BSP_get_uart_from_minor(int minor)