From baef9d91b561daf6e7eb31148e7d804c5c0154e8 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 26 Oct 2001 13:43:58 +0000 Subject: 2001-10-26 Alexandra Kossovsky * include/sh/sh4uart.h, sci/sh4uart.c: Minor fixes post merge. --- c/src/lib/libcpu/sh/sh7750/ChangeLog | 4 ++++ c/src/lib/libcpu/sh/sh7750/include/sh/sh4uart.h | 2 +- c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/c/src/lib/libcpu/sh/sh7750/ChangeLog b/c/src/lib/libcpu/sh/sh7750/ChangeLog index 14cb6259c0..22b3c4674f 100644 --- a/c/src/lib/libcpu/sh/sh7750/ChangeLog +++ b/c/src/lib/libcpu/sh/sh7750/ChangeLog @@ -1,3 +1,7 @@ +2001-10-26 Alexandra Kossovsky + + * include/sh/sh4uart.h, sci/sh4uart.c: Minor fixes post merge. + 2001-10-15 Ralf Corsepius * include/sh4uart.h: move to include/sh/sh4uart.h. diff --git a/c/src/lib/libcpu/sh/sh7750/include/sh/sh4uart.h b/c/src/lib/libcpu/sh/sh7750/include/sh/sh4uart.h index ff5263e841..e7db71903e 100644 --- a/c/src/lib/libcpu/sh/sh7750/include/sh/sh4uart.h +++ b/c/src/lib/libcpu/sh/sh7750/include/sh/sh4uart.h @@ -112,7 +112,7 @@ sh4uart_reset(sh4uart *uart); * controller */ rtems_status_code -sh4uart_disable(sh4uart *uart); +sh4uart_disable(sh4uart *uart, int disable_port); /* sh4uart_set_attributes -- * This function parse the termios attributes structure and perform diff --git a/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c b/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c index d7ce0cb54d..d3d377e2fb 100644 --- a/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c +++ b/c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c @@ -19,17 +19,13 @@ #include #include #include -#include +#include +#include "sh/sh4uart.h" #ifndef SH4_UART_INTERRUPT_LEVEL #define SH4_UART_INTERRUPT_LEVEL 4 #endif -/* FIXME: ??? -#define SH7750_SCSMR_CKS_S SH7750_SCSMR_CKS_DIV1 - */ -#define SH7750_SCSMR_CKS_S 0 - /* Forward function declarations */ static rtems_isr sh4uart1_interrupt_transmit(rtems_vector_number vec); @@ -78,8 +74,8 @@ sh4uart_init(sh4uart *uart, void *tty, int chn, int int_driven) * Get current peripheral module clock. * * PARAMETERS: none; - * Cpu clock is get from SH4_CPU_HZ_Frequency. - * This variable should be defined in bsp. + * Cpu clock is get from CPU_CLOCK_RATE_HZ marco + * (defined in bspopts.h, included from bsp.h) * * RETURNS: * peripheral module clock in Hz. @@ -88,7 +84,7 @@ rtems_unsigned32 sh4uart_get_Pph(void) { rtems_unsigned16 frqcr = *(volatile rtems_unsigned16 *)SH7750_FRQCR; - rtems_unsigned32 Pph = rtems_cpu_configuration_get_clicks_per_second() ; + rtems_unsigned32 Pph = CPU_CLOCK_RATE_HZ; switch (frqcr & SH7750_FRQCR_IFC) { @@ -312,17 +308,19 @@ sh4uart_reset(sh4uart *uart) * * PARAMETERS: * uart - pointer to UART channel descriptor structure + * disable_port - disable receive and transmit on the port * * RETURNS: * RTEMS_SUCCESSFUL if UART closed successfuly, or error code in * other case */ rtems_status_code -sh4uart_disable(sh4uart *uart) +sh4uart_disable(sh4uart *uart, int disable_port) { rtems_status_code rc; - SCSCR(uart->chn) &= ~(SH7750_SCSCR_TE | SH7750_SCSCR_RE); + if (disable_port) + SCSCR(uart->chn) &= ~(SH7750_SCSCR_TE | SH7750_SCSCR_RE); if (uart->int_driven) { @@ -944,3 +942,5 @@ ipl_console_poll_write(int minor, const char *buf, int len) return 0; } #endif + + -- cgit v1.2.3