[PATCH 1/2] bsp/xilinx-zynq: Add SLCR driver

Chris Johns chrisj at rtems.org
Thu Apr 20 21:50:16 UTC 2017


On 21/04/2017 07:22, Patrick Gauvin wrote:
>
>     I so not like the reset value being written to like this. I know you
>     need to set the lower 4 bits to 1 when loading the fabric via PCAP
>     but there are 4 independent resets and I have applications that have
>     individual control once loaded. What about a mask be provided and
>     only the bits we are interested in are set or cleared depending on
>     the mask?
>
>     Note adding mask support will require a lock to be SMP safe.
>
>
> I see, masking sounds good. Since the lock will need to be initialized
> before the SLCR functions are called, should I turn this into a full
> driver like device config, or is it acceptable to call an SLCR init
> function during BSP startup?

I suggest you take the simple approach first and create a static 
initialised lock:

static rtems_interrupt_lock slcr_lock = 
RTEMS_INTERRUPT_LOCK_INITIALIZER("zynq_slcr");

To use:

  void foo(void)
  {
    rtems_interrupt_lock_context lcontext;
    rtems_interrupt_lock_acquire(&slcr_lock, &lcontext);

    blah_blah = ho_hum;

    rtems_interrupt_lock_release(&slcr_lock, &lcontext);
}

Chris



More information about the devel mailing list