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

Patrick Gauvin pggauvin at gmail.com
Thu Apr 20 21:59:25 UTC 2017


Thank you, that does simplify things quite a bit.

-Patrick

On Thu, Apr 20, 2017 at 5:50 PM, Chris Johns <chrisj at rtems.org> wrote:

> 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_INITIALIZ
> ER("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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170420/651e3f31/attachment-0002.html>


More information about the devel mailing list