summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-26 13:43:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-26 13:43:58 +0000
commitbaef9d91b561daf6e7eb31148e7d804c5c0154e8 (patch)
tree2062a511afe666051946db55f1096ae25c2611ec
parent2001-10-26 Alexandra Kossovsky <sasha@oktet.ru> (diff)
downloadrtems-baef9d91b561daf6e7eb31148e7d804c5c0154e8.tar.bz2
2001-10-26 Alexandra Kossovsky <sasha@oktet.ru>
* include/sh/sh4uart.h, sci/sh4uart.c: Minor fixes post merge.
-rw-r--r--c/src/lib/libcpu/sh/sh7750/ChangeLog4
-rw-r--r--c/src/lib/libcpu/sh/sh7750/include/sh/sh4uart.h2
-rw-r--r--c/src/lib/libcpu/sh/sh7750/sci/sh4uart.c22
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 <sasha@oktet.ru>
+
+ * include/sh/sh4uart.h, sci/sh4uart.c: Minor fixes post merge.
+
2001-10-15 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* 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 <rtems.h>
#include <termios.h>
#include <rtems/libio.h>
-#include <sh/sh4uart.h>
+#include <bsp.h>
+#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
+
+