When we lock an hwspinlock, we must write the CPU identifier to
the hwspinlock register. If we want to unlock the locked hwspinlock,
we have to rewrite the same CPU identifier.
To define the CPU identifier, we use affinity 1 and affinity 2 fields
of the MPIDR register.
Signed-off-by: Aziz Idomar <aidomar@sequans.com>
The intention of hardware spinlock is to allow two processors,
that have no alternative mechanism for accomplish synchronization
and mutual exclusion operations, to share resources (such as
memory and/or any other element).
Here, we add the hwspinlock framework, that makes possible to use
those hwspinlock devices and stay platform-independent. Each
platform wishing to support hardware spinlock must describe a
driver using this framework.
Signed-off-by: Aziz Idomar <aidomar@sequans.com>