From df49c60c9671e4a28e636964d744c1f59fb6cb68 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 12 Jun 2000 15:00:15 +0000 Subject: Merged from 4.5.0-beta3a --- c/src/lib/libcpu/sh/sh7045/Makefile.am | 4 ++-- c/src/lib/libcpu/sh/sh7045/clock/Makefile.am | 6 ++---- c/src/lib/libcpu/sh/sh7045/include/Makefile.am | 6 +++--- c/src/lib/libcpu/sh/sh7045/null/Makefile.am | 4 ++-- c/src/lib/libcpu/sh/sh7045/sci/Makefile.am | 4 ++-- c/src/lib/libcpu/sh/sh7045/sci/sci.c | 27 ++++++++++++++++---------- c/src/lib/libcpu/sh/sh7045/timer/Makefile.am | 4 ++-- 7 files changed, 30 insertions(+), 25 deletions(-) (limited to 'c/src/lib/libcpu/sh/sh7045') diff --git a/c/src/lib/libcpu/sh/sh7045/Makefile.am b/c/src/lib/libcpu/sh/sh7045/Makefile.am index 77c3665b87..5452a07131 100644 --- a/c/src/lib/libcpu/sh/sh7045/Makefile.am +++ b/c/src/lib/libcpu/sh/sh7045/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 diff --git a/c/src/lib/libcpu/sh/sh7045/clock/Makefile.am b/c/src/lib/libcpu/sh/sh7045/clock/Makefile.am index 0f3042d757..10ae91df8f 100644 --- a/c/src/lib/libcpu/sh/sh7045/clock/Makefile.am +++ b/c/src/lib/libcpu/sh/sh7045/clock/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 @@ -18,8 +18,6 @@ include $(top_srcdir)/../../../../../automake/lib.am # (OPTIONAL) Add local stuff here using += # -AM_CFLAGS += $(CFLAGS_OS_V) - $(PGM): $(OBJS) $(make-rel) diff --git a/c/src/lib/libcpu/sh/sh7045/include/Makefile.am b/c/src/lib/libcpu/sh/sh7045/include/Makefile.am index 7fb244b465..8a424d634f 100644 --- a/c/src/lib/libcpu/sh/sh7045/include/Makefile.am +++ b/c/src/lib/libcpu/sh/sh7045/include/Makefile.am @@ -1,12 +1,12 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 H_FILES = io_types.h null.h sci.h sh7_pfc.h sh7_sci.h -# NOTE: Unlike other CPUS, we install into a subdirectory to avoid +# NOTE: Unlike other CPUS, we install into a subdirectory to avoid # file name conflicts $(PROJECT_INCLUDE)/sh: diff --git a/c/src/lib/libcpu/sh/sh7045/null/Makefile.am b/c/src/lib/libcpu/sh/sh7045/null/Makefile.am index 67862acb20..2e6baea4a3 100644 --- a/c/src/lib/libcpu/sh/sh7045/null/Makefile.am +++ b/c/src/lib/libcpu/sh/sh7045/null/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 diff --git a/c/src/lib/libcpu/sh/sh7045/sci/Makefile.am b/c/src/lib/libcpu/sh/sh7045/sci/Makefile.am index d28034d8a8..aef7e13b3b 100644 --- a/c/src/lib/libcpu/sh/sh7045/sci/Makefile.am +++ b/c/src/lib/libcpu/sh/sh7045/sci/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci.c b/c/src/lib/libcpu/sh/sh7045/sci/sci.c index 9acddbde9b..5cfef8a585 100644 --- a/c/src/lib/libcpu/sh/sh7045/sci/sci.c +++ b/c/src/lib/libcpu/sh/sh7045/sci/sci.c @@ -51,7 +51,7 @@ #include #include #include -/* #include */ + #include #ifndef STANDALONE_EVB @@ -330,18 +330,18 @@ rtems_device_driver sh_sci_open( return RTEMS_SUCCESSFUL ; } - /* enable I/O pins */ + /* set PFC registers to enable I/O pins */ if ((minor == 0) && (STANDALONE_EVB == 1)) { - temp16 = read16(PFC_PACRL2) & /* disable SCK0, Tx0, Rx0 */ - ~(PA2MD1 | PA2MD0 | PA1MD0 | PA0MD0); - temp16 |= (PA_TXD0 | PA_RXD0); /* assign pins for Tx0, Rx0 */ + temp16 = read16(PFC_PACRL2); /* disable SCK0, DMA, IRQ */ + temp16 &= ~(PA2MD1 | PA2MD0); + temp16 |= (PA_TXD0 | PA_RXD0); /* enable pins for Tx0, Rx0 */ write16(temp16, PFC_PACRL2); } else if (minor == 1) { - temp16 = read16(PFC_PACRL2) & /* disable SCK1, Tx1, Rx1 */ - ~(PA5MD1 | PA5MD0 | PA4MD0 | PA3MD0); - temp16 |= (PA_TXD1 | PA_RXD1); /* assign pins for Tx1, Rx1 */ + temp16 = read16(PFC_PACRL2); /* disable SCK1, DMA, IRQ */ + temp16 &= ~(PA5MD1 | PA5MD0); + temp16 |= (PA_TXD1 | PA_RXD1); /* enable pins for Tx1, Rx1 */ write16(temp16, PFC_PACRL2); } /* add other devices and pins as req'd. */ @@ -349,16 +349,23 @@ rtems_device_driver sh_sci_open( /* set up SCI registers */ if ((minor != 0) || (STANDALONE_EVB == 1)) { write8(0x00, sci_device[minor].addr + SCI_SCR); /* Clear SCR */ - /* set SCR and BRR */ + /* set SMR and BRR */ _sci_set_cflags( &sci_device[minor], sci_device[minor].cflags ); - for(a=0; a < 10000L; a++) { /* One-bit delay */ + for(a=0; a < 10000L; a++) { /* Delay */ asm volatile ("nop"); } write8((SCI_RE | SCI_TE), /* enable async. Tx and Rx */ sci_device[minor].addr + SCI_SCR); temp8 = read8(sci_device[minor].addr + SCI_RDR); /* flush input */ + /* Clear RDRF flag */ + temp8= read8(sci_device[minor].addr + SCI_SSR) & ~SCI_RDRF; + write8(temp8, sci_device[minor].addr + SCI_SSR); + write8(0x00, sci_device[minor].addr + SCI_TDR); /* force output */ + /* Clear the TDRE bit */ + temp8 = read8(sci_device[minor].addr + SCI_SSR) & ~SCI_TDRE; + write8(temp8, sci_device[minor].addr + SCI_SSR); /* add interrupt setup if required */ diff --git a/c/src/lib/libcpu/sh/sh7045/timer/Makefile.am b/c/src/lib/libcpu/sh/sh7045/timer/Makefile.am index b72f9ca03b..5a164c0d4c 100644 --- a/c/src/lib/libcpu/sh/sh7045/timer/Makefile.am +++ b/c/src/lib/libcpu/sh/sh7045/timer/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 -- cgit v1.2.3