From 00991a3100d89e75935b82df4da2704085179206 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Tue, 18 Oct 2011 18:33:04 +0000 Subject: 2011-10-18 Jennifer Averett PR 1917/bsps * Makefile.am, preinstall.am, console/config.c, console/mc68360_scc.c, console/ns16550cfg.c, console/printk_support.c: Modifications to add dynamic tables for libchip serial drivers. --- c/src/lib/libbsp/powerpc/ep1a/ChangeLog | 7 +++++++ c/src/lib/libbsp/powerpc/ep1a/Makefile.am | 12 ++++++++---- c/src/lib/libbsp/powerpc/ep1a/console/config.c | 16 ++++++++-------- c/src/lib/libbsp/powerpc/ep1a/console/mc68360_scc.c | 16 ++++++++-------- c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c | 3 ++- c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c | 4 ++-- c/src/lib/libbsp/powerpc/ep1a/preinstall.am | 4 ++++ 7 files changed, 39 insertions(+), 23 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/powerpc/ep1a/ChangeLog b/c/src/lib/libbsp/powerpc/ep1a/ChangeLog index f371026004..eaf8e544c4 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/ChangeLog +++ b/c/src/lib/libbsp/powerpc/ep1a/ChangeLog @@ -1,3 +1,10 @@ +2011-10-18 Jennifer Averett + + PR 1917/bsps + * Makefile.am, preinstall.am, console/config.c, console/mc68360_scc.c, + console/ns16550cfg.c, console/printk_support.c: Modifications to add + dynamic tables for libchip serial drivers. + 2011-08-24 Sebastian Huber * console/polled_io.c: Update due to API changes. diff --git a/c/src/lib/libbsp/powerpc/ep1a/Makefile.am b/c/src/lib/libbsp/powerpc/ep1a/Makefile.am index 85cb9b11a8..94fca63057 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/Makefile.am +++ b/c/src/lib/libbsp/powerpc/ep1a/Makefile.am @@ -48,13 +48,17 @@ include_bsp_HEADERS = ../../powerpc/shared/console/uart.h \ ../../powerpc/shared/motorola/motorola.h \ ../../powerpc/shared/residual/residual.h \ ../../powerpc/shared/residual/pnp.h \ - ../../powerpc/shared/console/consoleIo.h console/rsPMCQ1.h + ../../powerpc/shared/console/consoleIo.h console/rsPMCQ1.h \ + ../../shared/console_private.h + # console -libbsp_a_SOURCES += ../../shared/console.c console/ns16550cfg.c \ +libbsp_a_SOURCES += console/ns16550cfg.c \ console/mc68360_scc.c console/rsPMCQ1.c console/alloc360.c \ console/init68360.c console/config.c console/printk_support.c \ - console/config.c - + ../../shared/console.c ../../shared/console_select.c \ + ../../shared/console_read.c ../../shared/console_write.c \ + ../../shared/console_control.c + include_bsp_HEADERS += ../../powerpc/shared/openpic/openpic.h # openpic libbsp_a_SOURCES += ../../powerpc/shared/openpic/openpic.h \ diff --git a/c/src/lib/libbsp/powerpc/ep1a/console/config.c b/c/src/lib/libbsp/powerpc/ep1a/console/config.c index 6a47c7b764..57066b7121 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/console/config.c +++ b/c/src/lib/libbsp/powerpc/ep1a/console/config.c @@ -81,7 +81,7 @@ extern console_fns mc68360_scc_fns; * ulIntVector This encodes the interrupt vector of the device. * */ -console_tbl Console_Port_Tbl[] = { +console_tbl Console_Configuration_Ports[] = { /* * NS16550 Chips provide first COM1 and COM2 Ports. */ @@ -363,12 +363,12 @@ 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]; +/* + * Define a variable that contains the number of statically configured + * console devices. + */ +unsigned long Console_Configuration_Count = \ + (sizeof(Console_Configuration_Ports)/sizeof(console_tbl)); static bool config_68360_scc_base_probe(int minor, unsigned long busNo, unsigned long slotNo, int channel) { @@ -386,7 +386,7 @@ static bool config_68360_scc_base_probe(int minor, unsigned long busNo, unsigned if (!chip) return false; - Console_Port_Tbl[minor].pDeviceParams = &chip->port[ channel-1 ]; + Console_Port_Tbl[minor]->pDeviceParams = &chip->port[ channel-1 ]; chip->port[ channel-1 ].minor = minor; return true; } diff --git a/c/src/lib/libbsp/powerpc/ep1a/console/mc68360_scc.c b/c/src/lib/libbsp/powerpc/ep1a/console/mc68360_scc.c index e9f07a6a50..7fc8eb2f81 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/console/mc68360_scc.c +++ b/c/src/lib/libbsp/powerpc/ep1a/console/mc68360_scc.c @@ -48,7 +48,7 @@ void mc68360_Show_length_array(void) { M68360_t M68360_chips = NULL; #define SYNC eieio -#define mc68360_scc_Is_422( _minor ) (Console_Port_Tbl[minor].sDeviceName[7] == '4' ) +#define mc68360_scc_Is_422( _minor ) (Console_Port_Tbl[minor]->sDeviceName[7] == '4' ) void mc68360_scc_nullFunc(void) {} @@ -147,7 +147,7 @@ void scc_write32( void mc68360_sccShow_Regs(int minor){ M68360_serial_ports_t ptr; - ptr = Console_Port_Tbl[minor].pDeviceParams; + ptr = Console_Port_Tbl[minor]->pDeviceParams; printk( "scce 0x%08x", &ptr->pSCCR->scce ); printk( " 0x%04x\n", ptr->pSCCR->scce ); @@ -343,7 +343,7 @@ int mc68360_scc_open( #endif - ptr = Console_Port_Tbl[minor].pDeviceParams; + ptr = Console_Port_Tbl[minor]->pDeviceParams; m360 = ptr->chip->m360; /* @@ -402,11 +402,11 @@ void mc68360_scc_initialize_interrupts(int minor) #ifdef DEBUG_360 printk("mc68360_scc_initialize_interrupts: minor %d\n", minor ); - printk("Console_Port_Tbl[minor].pDeviceParams 0x%08x\n", - Console_Port_Tbl[minor].pDeviceParams ); + printk("Console_Port_Tbl[minor]->pDeviceParams 0x%08x\n", + Console_Port_Tbl[minor]->pDeviceParams ); #endif - ptr = Console_Port_Tbl[minor].pDeviceParams; + ptr = Console_Port_Tbl[minor]->pDeviceParams; m360 = ptr->chip->m360; #ifdef DEBUG_360 @@ -671,7 +671,7 @@ int mc68360_scc_write_support_int( mc68360_length_count=0; #endif - ptr = Console_Port_Tbl[minor].pDeviceParams; + ptr = Console_Port_Tbl[minor]->pDeviceParams; /* * We are using interrupt driven output and termios only sends us @@ -744,7 +744,7 @@ int mc68360_scc_set_attributes( printk("mc68360_scc_set_attributes\n"); #endif - ptr = Console_Port_Tbl[minor].pDeviceParams; + ptr = Console_Port_Tbl[minor]->pDeviceParams; m360 = ptr->chip->m360; switch (t->c_cflag & CBAUD) diff --git a/c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c b/c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c index f34c6f7aac..378d291981 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c +++ b/c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c @@ -12,8 +12,9 @@ */ #include +#include +#include #include -#include "console.h" typedef struct uart_reg { diff --git a/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c b/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c index 97ba1d6c68..441fa19a07 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c +++ b/c/src/lib/libbsp/powerpc/ep1a/console/printk_support.c @@ -16,10 +16,10 @@ #include #include #include - -#include "console.h" #include +rtems_device_minor_number BSPPrintkPort = 0; + /* const char arg to be compatible with BSP_output_char decl. */ void debug_putc_onlcr(const char c) diff --git a/c/src/lib/libbsp/powerpc/ep1a/preinstall.am b/c/src/lib/libbsp/powerpc/ep1a/preinstall.am index 247c63a3a1..3680071fde 100644 --- a/c/src/lib/libbsp/powerpc/ep1a/preinstall.am +++ b/c/src/lib/libbsp/powerpc/ep1a/preinstall.am @@ -93,6 +93,10 @@ $(PROJECT_INCLUDE)/bsp/rsPMCQ1.h: console/rsPMCQ1.h $(PROJECT_INCLUDE)/bsp/$(dir $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/rsPMCQ1.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/rsPMCQ1.h +$(PROJECT_INCLUDE)/bsp/console_private.h: ../../shared/console_private.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console_private.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console_private.h + $(PROJECT_INCLUDE)/bsp/openpic.h: ../../powerpc/shared/openpic/openpic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/openpic.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/openpic.h -- cgit v1.2.3