hwspinlock: add sun6i hardware spinlock support
Adds the sun6i_hwspinlock driver for the hardware spinlock unit found in most of the sun6i compatible SoCs. This unit provides at least 32 spinlocks in hardware. The implementation supports 32, 64, 128 or 256 32bit registers. A lock can be taken by reading a register and released by writing a 0 to it. This driver supports all 4 spinlock setups, but for now only the first setup (32 locks) seem to exist in available devices. This spinlock unit is shared between all ARM cores and the embedded companion core. All of them can take/release a lock with a single cycle operation. It can be used to sync access to devices shared by the ARM cores and the companion core. There are two ways to check if a lock is taken. The first way is to read a lock. If a 0 is returned, the lock was free and is taken now. If an 1 is returned, the caller has to try again. Which means the lock is taken. The second way is to read a 32bit wide status register where every bit represents one...
Showing
- MAINTAINERS 6 additions, 0 deletionsMAINTAINERS
- drivers/hwspinlock/Kconfig 9 additions, 0 deletionsdrivers/hwspinlock/Kconfig
- drivers/hwspinlock/Makefile 1 addition, 0 deletionsdrivers/hwspinlock/Makefile
- drivers/hwspinlock/sun6i_hwspinlock.c 210 additions, 0 deletionsdrivers/hwspinlock/sun6i_hwspinlock.c
Please register or sign in to comment