xref: /rk3399_ARM-atf/include/drivers/arm/sp805.h (revision 82cb2c1ad9897473743f08437d0a3995bed561b9)
138041973SJuan Castillo /*
238041973SJuan Castillo  * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
338041973SJuan Castillo  *
4*82cb2c1aSdp-arm  * SPDX-License-Identifier: BSD-3-Clause
538041973SJuan Castillo  */
638041973SJuan Castillo 
738041973SJuan Castillo #ifndef __SP805_H__
838041973SJuan Castillo #define __SP805_H__
938041973SJuan Castillo 
1038041973SJuan Castillo /* SP805 register offset */
1138041973SJuan Castillo #define SP805_WDOG_LOAD_OFF		0x000
1238041973SJuan Castillo #define SP805_WDOG_CTR_OFF		0x008
1338041973SJuan Castillo #define SP805_WDOG_LOCK_OFF		0xc00
1438041973SJuan Castillo 
1538041973SJuan Castillo /* Magic word to unlock the wd registers */
1638041973SJuan Castillo #define WDOG_UNLOCK_KEY			0x1ACCE551
1738041973SJuan Castillo 
1838041973SJuan Castillo /* Register field definitions */
1938041973SJuan Castillo #define SP805_CTR_RESEN			(1 << 1)
2038041973SJuan Castillo #define SP805_CTR_INTEN			(1 << 0)
2138041973SJuan Castillo 
2238041973SJuan Castillo #ifndef __ASSEMBLY__
2338041973SJuan Castillo 
2438041973SJuan Castillo #include <stdint.h>
2538041973SJuan Castillo 
2638041973SJuan Castillo /* Public high level API */
2738041973SJuan Castillo 
2838041973SJuan Castillo void sp805_start(uintptr_t base, unsigned long ticks);
2938041973SJuan Castillo void sp805_stop(uintptr_t base);
3038041973SJuan Castillo void sp805_refresh(uintptr_t base, unsigned long ticks);
3138041973SJuan Castillo 
3238041973SJuan Castillo #endif /* __ASSEMBLY__ */
3338041973SJuan Castillo 
3438041973SJuan Castillo #endif /* __SP805_H__ */
35