public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* Patch for CYGPKG_IO_SERIAL_ARM_LPC2XXX
@ 2008-11-22 16:06 Martin Laabs
  2008-11-22 19:12 ` Andrew Lunn
  2008-11-23 13:53 ` Andrew Lunn
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Laabs @ 2008-11-22 16:06 UTC (permalink / raw)
  To: ecos-devel

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

Hi,

the CYGPKG_IO_SERIAL_ARM_LPC2XXX package support up to two serial
devices. Therefore it uses the VIC (vectored interrupt controller)
of the LPC devices. If both channels are enables in the configtool
both will also get the same interrupt priority. This is not possible
with the LPC VIC and causes, that only the last interrupt is
enables and the first one generates "spurious interrupts" (from eCos
point of view) that leads to data fetch and illegal instruction 
exeptions.

I added support to assign the priority in the configtool/driver.

Greetings,
 Martin

PS: Is it possible to avoid assignment of equal priorities
to different IRQs at same time in configtool/cdl.



[-- Attachment #2: prio.patch --]
[-- Type: application/octet-stream, Size: 2938 bytes --]

diff -urp /tmp/lpc2xxx/current/cdl/ser_arm_lpc2xxx.cdl lpc2xxx/current/cdl/ser_arm_lpc2xxx.cdl
--- /tmp/lpc2xxx/current/cdl/ser_arm_lpc2xxx.cdl	2008-11-13 20:49:42.000000000 +0100
+++ lpc2xxx/current/cdl/ser_arm_lpc2xxx.cdl	2008-11-22 12:19:58.000000000 +0100
@@ -53,6 +53,8 @@ cdl_package CYGPKG_IO_SERIAL_ARM_LPC2XXX
     parent        CYGPKG_IO_SERIAL_DEVICES
     active_if     CYGPKG_IO_SERIAL
     active_if     CYGPKG_HAL_ARM_LPC2XXX
+    implements    CYGINT_IO_SERIAL_GENERIC_16X5X_CHAN_INTPRIO                   
+
 
     requires      CYGPKG_ERROR
     include_dir   cyg/io
@@ -121,6 +123,19 @@ cdl_package CYGPKG_IO_SERIAL_ARM_LPC2XXX
                 This option specifies the size of the internal buffers
                 used for the ARM LPC2XXX port 0."
         }
+	
+	cdl_option CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO {
+	     display "Interrupt priority of the serial port 0 ISR"
+	     flavor  data
+	     legal_values 0 to 15
+	     default_value 14
+	     description "
+	         This option specifies the interrupt priority of the
+		 ISR of the serial port 0 interrupt in the VIC.
+		 Slot 0 has the highest priority and slot 15 the lowest."
+	}
+
+
     }
 
     cdl_component CYGPKG_IO_SERIAL_ARM_LPC2XXX_SERIAL1 {
@@ -166,6 +181,18 @@ cdl_package CYGPKG_IO_SERIAL_ARM_LPC2XXX
                  This option specifies the size of the internal
                  buffers used for the ARM LPC2XXX port 1."
          }
+
+	
+	cdl_option CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL1_INTPRIO {
+	     display "Interrupt priority of the serial port 1 ISR"
+	     flavor  data
+	     legal_values 0 to 15
+	     default_value 15
+	     description "
+	         This option specifies the interrupt priority of the
+		 ISR of the serial port 1 interrupt in the VIC.
+		 Slot 0 has the highest priority and slot 15 the lowest."
+	}
     }
 
     cdl_component CYGPKG_IO_SERIAL_ARM_LPC2XXX_TESTING {

diff -urp /tmp/lpc2xxx/current/include/arm_lpc2xxx_ser.inl lpc2xxx/current/include/arm_lpc2xxx_ser.inl
--- /tmp/lpc2xxx/current/include/arm_lpc2xxx_ser.inl	2008-11-13 20:49:42.000000000 +0100
+++ lpc2xxx/current/include/arm_lpc2xxx_ser.inl	2008-11-22 12:20:24.000000000 +0100
@@ -87,7 +87,8 @@ static unsigned int select_baud[] = {
 #ifdef CYGPKG_IO_SERIAL_ARM_LPC2XXX_SERIAL0
 static pc_serial_info lpc2xxx_serial_info0 = 
   { CYGARC_HAL_LPC2XXX_REG_UART0_BASE,
-    CYGNUM_HAL_INTERRUPT_UART0
+    CYGNUM_HAL_INTERRUPT_UART0,
+    CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO
   };
 
 #if CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_BUFSIZE > 0
@@ -135,7 +136,8 @@ DEVTAB_ENTRY(lpc2xxx_serial_io0, 
 #ifdef CYGPKG_IO_SERIAL_ARM_LPC2XXX_SERIAL1
 static pc_serial_info lpc2xxx_serial_info1 = 
   { CYGARC_HAL_LPC2XXX_REG_UART1_BASE,
-    CYGNUM_HAL_INTERRUPT_UART1
+    CYGNUM_HAL_INTERRUPT_UART1,
+    CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL1_INTPRIO
   };
 #if CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL1_BUFSIZE > 0
 static unsigned char 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-23 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-22 16:06 Patch for CYGPKG_IO_SERIAL_ARM_LPC2XXX Martin Laabs
2008-11-22 19:12 ` Andrew Lunn
2008-11-23 22:20   ` Bart Veer
2008-11-23 13:53 ` Andrew Lunn
2008-11-23 14:52   ` Martin Laabs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).