This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: MPC555 serial exception fix


>Hi Steve
>
>This part does not compile:
>
>> +    if(scsr & MPC555_SERIAL_SCxSR_NF)
>> +    {
>> +      stat.which = CYGNUM_SERIAL_STATUS_NOISEERR;
>> +      (chan->callbacks->indicate_status)(chan, &stat);
>> +    }
>
>I guess you changed serialio.h as well? Please could you 
>submit that change as well?
>
>       Thanks
>           Andrew
>

Sorry, serialio.h slipped through the net.

I've rediffed the diff (including the previous changes).

Also I've received the assignment paperwork from GNU/FSF so I'll try and
get somebody with the legal clout to read through it and sign it off
asap.

Steve

Index: ecos/packages/devs/serial/powerpc/mpc555/current/ChangeLog
===================================================================
RCS file:
/cvs/ecos/ecos/packages/devs/serial/powerpc/mpc555/current/ChangeLog,v
retrieving revision 1.1
diff -u -r1.1 ChangeLog
--- ecos/packages/devs/serial/powerpc/mpc555/current/ChangeLog	6 May
2008 19:04:21 -0000	1.1
+++ ecos/packages/devs/serial/powerpc/mpc555/current/ChangeLog	22 May
2008 10:27:42 -0000
@@ -1,3 +1,9 @@
+2008-05-13  Steven Clugston  <steven.clugston@ncl.ac.uk>
+  * cdl/ser_powerpc_mpc555.cdl: Add line status
+  * src/mpc555_serial_with_ints.c: 
+    Fixed exception caused by attempt to clear scsr bits.
+    Add line status callbacks
+
 2008-04-06  Steven Clugston <steven.clugston@ncl.ac.uk>
 
 	* Refactored cme555 package to more generic mpc555
Index:
ecos/packages/devs/serial/powerpc/mpc555/current/cdl/ser_powerpc_mpc555.
cdl
===================================================================
RCS file:
/cvs/ecos/ecos/packages/devs/serial/powerpc/mpc555/current/cdl/ser_power
pc_mpc555.cdl,v
retrieving revision 1.1
diff -u -r1.1 ser_powerpc_mpc555.cdl
---
ecos/packages/devs/serial/powerpc/mpc555/current/cdl/ser_powerpc_mpc555.
cdl	6 May 2008 19:04:21 -0000	1.1
+++
ecos/packages/devs/serial/powerpc/mpc555/current/cdl/ser_powerpc_mpc555.
cdl	22 May 2008 10:27:42 -0000
@@ -32,6 +32,9 @@
 ##
 ## This exception does not invalidate any other reasons why a work
based on
 ## this file might be covered by the GNU General Public License.
+##
+## Alternative licenses for eCos may be arranged by contacting Red Hat,
Inc.
+## at http://sources.redhat.com/ecos/ecos-license/
 ## -------------------------------------------
 #####ECOSGPLCOPYRIGHTEND####
 # ====================================================================
@@ -72,6 +75,7 @@
     display       "mpc555 PowerPC serial port A driver"
     flavor        bool
     default_value 0
+    implements    CYGINT_IO_SERIAL_LINE_STATUS_HW
     description   "
         This option includes the serial device driver for the mpc555
         PowerPC port A."
@@ -110,6 +114,7 @@
     display       "mpc555 PowerPC serial port B driver"
     flavor        bool
     default_value 1
+    implements    CYGINT_IO_SERIAL_LINE_STATUS_HW
     description   "
         This option includes the serial device driver for the mpc555
         PowerPC port B."
Index:
ecos/packages/devs/serial/powerpc/mpc555/current/src/mpc555_serial_with_
ints.c
===================================================================
RCS file:
/cvs/ecos/ecos/packages/devs/serial/powerpc/mpc555/current/src/mpc555_se
rial_with_ints.c,v
retrieving revision 1.1
diff -u -r1.1 mpc555_serial_with_ints.c
---
ecos/packages/devs/serial/powerpc/mpc555/current/src/mpc555_serial_with_
ints.c	6 May 2008 19:04:21 -0000	1.1
+++
ecos/packages/devs/serial/powerpc/mpc555/current/src/mpc555_serial_with_
ints.c	22 May 2008 10:27:42 -0000
@@ -32,6 +32,9 @@
 //
 // This exception does not invalidate any other reasons why a work
based on
 // this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat,
Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
 // -------------------------------------------
 //####ECOSGPLCOPYRIGHTEND####
 
//======================================================================
====
@@ -609,14 +612,38 @@
   cyg_uint16 scdr;
   cyg_uint16 scsr;
 
-  // Allways read out the received character, in order to clear
receiver flags
-  HAL_READ_UINT16(port + MPC555_SERIAL_SCxDR, scdr);
+#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+  cyg_serial_line_status_t stat;
+#endif
 
   HAL_READ_UINT16(port + MPC555_SERIAL_SCxSR, scsr);
+  // Always read out the received character, in order to clear receiver
flags
+  HAL_READ_UINT16(port + MPC555_SERIAL_SCxDR, scdr);
+  
   if(scsr & (cyg_uint16)MPC555_SERIAL_SCxSR_ERRORS)
   {
-    scsr &= ~((cyg_uint16)MPC555_SERIAL_SCxSR_ERRORS);
-    HAL_WRITE_UINT16(port + MPC555_SERIAL_SCxSR, scsr);
+#ifdef CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
+    if(scsr & MPC555_SERIAL_SCxSR_OR)
+    {
+      stat.which = CYGNUM_SERIAL_STATUS_OVERRUNERR;
+      (chan->callbacks->indicate_status)(chan, &stat);
+    } 
+    if(scsr & MPC555_SERIAL_SCxSR_NF)
+    {
+      stat.which = CYGNUM_SERIAL_STATUS_NOISEERR;
+      (chan->callbacks->indicate_status)(chan, &stat);
+    } 
+    if(scsr & MPC555_SERIAL_SCxSR_FE)
+    {
+      stat.which = CYGNUM_SERIAL_STATUS_FRAMEERR;
+      (chan->callbacks->indicate_status)(chan, &stat);
+    } 
+    if(scsr & MPC555_SERIAL_SCxSR_PF)
+    {
+      stat.which = CYGNUM_SERIAL_STATUS_PARITYERR;
+      (chan->callbacks->indicate_status)(chan, &stat);
+    }
+#endif
   }
   else
   {
Index: ecos/packages/io/serial/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/ChangeLog,v
retrieving revision 1.72
diff -u -r1.72 ChangeLog
--- ecos/packages/io/serial/current/ChangeLog	30 Jan 2008 18:39:11
-0000	1.72
+++ ecos/packages/io/serial/current/ChangeLog	22 May 2008 10:28:02
-0000
@@ -1,3 +1,8 @@
+2008-05-13  Steven Clugston  <steven.clugston@ncl.ac.uk>
+
+	* tests/ser_test_protocol.inl : Add mpc555 generic platform
+	* include/serialio.h : Add noise error define to line status
+  
 2008-01-30  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/common/termiostty.c (termios_lookup): Add missing set of
Index: ecos/packages/io/serial/current/include/serialio.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/include/serialio.h,v
retrieving revision 1.11
diff -u -r1.11 serialio.h
--- ecos/packages/io/serial/current/include/serialio.h	1 Sep 2006
11:15:01 -0000	1.11
+++ ecos/packages/io/serial/current/include/serialio.h	22 May 2008
10:28:02 -0000
@@ -174,6 +174,7 @@
 # define CYGNUM_SERIAL_STATUS_OVERRUNERR    4
 # define CYGNUM_SERIAL_STATUS_CARRIERDETECT 5
 # define CYGNUM_SERIAL_STATUS_RINGINDICATOR 6
+# define CYGNUM_SERIAL_STATUS_NOISEERR      7
 
 typedef struct {
     cyg_uint32 which;        // one of CYGNUM_SERIAL_STATUS_* above
Index: ecos/packages/io/serial/current/tests/ser_test_protocol.inl
===================================================================
RCS file:
/cvs/ecos/ecos/packages/io/serial/current/tests/ser_test_protocol.inl,v
retrieving revision 1.31
diff -u -r1.31 ser_test_protocol.inl
--- ecos/packages/io/serial/current/tests/ser_test_protocol.inl	3 Aug
2005 21:00:34 -0000	1.31
+++ ecos/packages/io/serial/current/tests/ser_test_protocol.inl	22 May
2008 10:28:02 -0000
@@ -113,6 +113,15 @@
 #  define TEST_TTY_DEV CYGDAT_IO_SERIAL_TTY_TTY0_DEV
 # endif
 #endif
+#if defined(CYGPKG_HAL_POWERPC_MPC5xx)                \
+    && defined(CYGPKG_IO_SERIAL_POWERPC_MPC555)                \
+    && defined(CYGPKG_IO_SERIAL_POWERPC_MPC555_SERIAL_A)
+# define TEST_CRASH_ID "mpc555"
+# define TEST_SER_DEV CYGDAT_IO_SERIAL_POWERPC_MPC555_SERIAL_A_NAME
+# if defined(CYGPKG_IO_SERIAL_TTY_TTY0)
+#  define TEST_TTY_DEV CYGDAT_IO_SERIAL_TTY_TTY0_DEV
+# endif
+#endif
 
 // We can't rely on haldiag for ser_filter detection - it may not
define
 // a working character reading function.

Attachment: mpc555_serial.diff
Description: mpc555_serial.diff

Attachment: ChangeLog
Description: ChangeLog

Attachment: serialio.h
Description: serialio.h


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]