2011-08-23 Jennifer Averett <Jennifer.Averett@OARcorp.com>

* Makefile.am, console/config.c: Resolved printk issues.
	* console/printk_support.c: New file.
This commit is contained in:
Jennifer Averett
2011-08-23 18:06:08 +00:00
parent 41265b2397
commit 76c0fb0012
4 changed files with 66 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
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.

View File

@@ -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

View File

@@ -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;

View File

@@ -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;