/* * Copyright (c) 2007-2017 Allwinnertech Co., Ltd. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _MEM_HWSPINLOCK_H #define _MEM_HWSPINLOCK_H /*#if defined CONFIG_ARCH_SUN9IW1P1*/ #include "pm_config.h" #define MEM_MSG_HWSPINLOCK (0) #define MEM_AUDIO_HWSPINLOCK (1) #define MEM_RTC_REG_HWSPINLOCK (2) /*state of spinlock: taken or not taken.*/ #define MEM_SPINLOCK_NOTTAKEN (0) #define MEM_SPINLOCK_TAKEN (1) /**/ /*hardware spinlock register list*/ #define MEM_SPINLOCK_SYS_STATUS_REG (AW_SPINLOCK_BASE + 0x0000) #define MEM_SPINLOCK_STATUS_REG (AW_SPINLOCK_BASE + 0x0010) #define MEM_SPINLOCK_IRQ_EN_REG (AW_SPINLOCK_BASE + 0x0020) #define MEM_SPINLOCK_IRQ_PEND_REG (AW_SPINLOCK_BASE + 0x0040) #define MEM_SPINLOCK_LOCK_REG(id) (AW_SPINLOCK_BASE + 0x0100 + id * 4) __s32 hwspinlock_init(__u32 mmu_flag); __s32 hwspin_lock_timeout_nommu(__u32 hwid, __u32 timeout); __s32 hwspin_unlock_nommu(__u32 hwid); __s32 hwspin_lock_timeout(__u32 hwid, __u32 timeout); __s32 hwspin_unlock(__u32 hwid); #endif /*_MEM_HWSPINLOCK_H*/