This is the mail archive of the ecos-devel@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: Patch for CYGPKG_IO_SERIAL_ARM_LPC2XXX


>>>>> "Andrew" == Andrew Lunn <andrew@lunn.ch> writes:

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

    Andrew> You can use an implies statement in one of the options. eg
    Andrew> in CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO0 have


    Andrew>     requires { is_active(CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO1) 
    Andrew>                    implies { CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO0 != 
    Andrew>                              CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO1 }
    Andrew>              }

That works for the specific case of preventing the two serial devices
from sharing the same interrupt priority, but does not prevent a
serial device from being given the same priority as some other device
(which I assume is the limitation within the LPC VIC).

I have run into similar problems on some ColdFire processors.
Unfortunately right now there is no good way of imposing the
constraint in CDL. The syntax for that would look something like:

  cdl_option CYGDAT_HAL_ARM_LPC2XXX_INTPRIO(0 to 31) {
      flavor        data
      default_value "user"
  }

  cdl_option CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO {
      legal_values 0 to 31
      requires    { CYGDAT_HAL_ARM_LPC2XXX_INTPRIO($self) == "uart0" }
  }

As long as all relevant device drivers, and anything else that
installed an interrupt handler, had a config option like that per
interrupt source the "requires" constraints would prevent two devices
being given the same interrupt priority. Also, the application
developer could see which interrupt priorities were still available,
and could reserve certain ones by setting user values.

Unfortunately there are no plans at present to extend the CDL language
with facilities like that.

What I have done in the past is to add a testcase to the processor HAL
which walks through the interrupt vectors, reports the priority
associated with each one, and checks for any conflicts. You can then
run that testcase in your configuration. However that won't catch
clashes between priorities used by device drivers and ones used by
application code. Another approach is to have a debug version of the
interrupt SET_LEVEL() macro which does a run-time check.

Bart

-- 
Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.


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