summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/ep1a
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2011-08-23 18:06:08 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2011-08-23 18:06:08 +0000
commit76c0fb0012b6e2650feec67497ef0ea370b72e1c (patch)
tree70141ba992ea99ef7690b9f27cb6773ad0177989 /c/src/lib/libbsp/powerpc/ep1a
parent2011-08-23 Jennifer Averett <Jennifer.Averett@OARcorp.com> (diff)
downloadrtems-76c0fb0012b6e2650feec67497ef0ea370b72e1c.tar.bz2
2011-08-23 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* Makefile.am, console/config.c: Resolved printk issues. * console/printk_support.c: New file.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/ep1a')
-rw-r--r--c/src/lib/libbsp/powerpc/ep1a/ChangeLog5
-rw-r--r--c/src/lib/libbsp/powerpc/ep1a/Makefile.am3
-rw-r--r--c/src/lib/libbsp/powerpc/ep1a/console/config.c8
-rw-r--r--c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c51
4 files changed, 66 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/powerpc/ep1a/ChangeLog b/c/src/lib/libbsp/powerpc/ep1a/ChangeLog
index d86f63ab25..4e87440010 100644
--- a/c/src/lib/libbsp/powerpc/ep1a/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/ep1a/ChangeLog
@@ -1,5 +1,10 @@
2011-08-23 Jennifer Averett <Jennifer.Averett@OARcorp.com>
+ * Makefile.am, console/config.c: Resolved printk issues.
+ * console/printk_support.c: New file.
+
+2011-08-23 Jennifer Averett <Jennifer.Averett@OARcorp.com>
+
* Makefile.am: Removed console.c and linked to the shared console.c.
Note: This change was verified through compilation only.
* console/console.c: Removed.
diff --git a/c/src/lib/libbsp/powerpc/ep1a/Makefile.am b/c/src/lib/libbsp/powerpc/ep1a/Makefile.am
index beb4454400..85cb9b11a8 100644
--- a/c/src/lib/libbsp/powerpc/ep1a/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/ep1a/Makefile.am
@@ -52,7 +52,8 @@ include_bsp_HEADERS = ../../powerpc/shared/console/uart.h \
# console
libbsp_a_SOURCES += ../../shared/console.c console/ns16550cfg.c \
console/mc68360_scc.c console/rsPMCQ1.c console/alloc360.c \
- console/init68360.c
+ console/init68360.c console/config.c console/printk_support.c \
+ console/config.c
include_bsp_HEADERS += ../../powerpc/shared/openpic/openpic.h
# openpic
diff --git a/c/src/lib/libbsp/powerpc/ep1a/console/config.c b/c/src/lib/libbsp/powerpc/ep1a/console/config.c
index a2f390b431..6a47c7b764 100644
--- a/c/src/lib/libbsp/powerpc/ep1a/console/config.c
+++ b/c/src/lib/libbsp/powerpc/ep1a/console/config.c
@@ -12,6 +12,7 @@
*/
#include <libchip/serial.h>
+#include <libchip/ns16550.h>
#include "ns16550cfg.h"
#include <bsp.h>
#include <libcpu/io.h>
@@ -362,6 +363,13 @@ console_tbl Console_Port_Tbl[] = {
}
};
+/* rtems console uses the following minor number */
+rtems_device_minor_number Console_Port_Minor = 0;
+
+#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl))
+unsigned long Console_Port_Count = NUM_CONSOLE_PORTS;
+console_data Console_Port_Data[NUM_CONSOLE_PORTS];
+
static bool config_68360_scc_base_probe(int minor, unsigned long busNo, unsigned long slotNo, int channel)
{
M68360_t chip = M68360_chips;
diff --git a/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c b/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c
new file mode 100644
index 0000000000..97ba1d6c68
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c
@@ -0,0 +1,51 @@
+/*
+ * This file contains the ep1a printk support routines
+ *
+ * COPYRIGHT (c) 2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * 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.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <rtems/libio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <termios.h>
+
+#include "console.h"
+#include <rtems/bspIo.h>
+
+/* const char arg to be compatible with BSP_output_char decl. */
+void
+debug_putc_onlcr(const char c)
+{
+ volatile int i;
+
+ /*
+ * Note: Hack to get printk to work. Depends upon bit
+ * and silverchip to initialize the port and just
+ * forces a character to be polled out of com1
+ * regardless of where the console is.
+ */
+
+ volatile unsigned char *ptr = (void *)0xff800000;
+
+ if ('\n'==c){
+ *ptr = '\r';
+ __asm__ volatile("sync");
+ for (i=0;i<0x0fff;i++);
+ }
+
+ *ptr = c;
+ __asm__ volatile("sync");
+ for (i=0;i<0x0fff;i++);
+}
+
+BSP_output_char_function_type BSP_output_char = debug_putc_onlcr;
+BSP_polling_getchar_function_type BSP_poll_char = NULL;
+