blob: b00ede1d6db67f7bcf9265ea691d17b06246b3ec [file] [log] [blame]
Juan Castillo5f64eff2014-07-08 17:20:41 +01001/*
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +01002 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
Juan Castillo5f64eff2014-07-08 17:20:41 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Juan Castillo5f64eff2014-07-08 17:20:41 +01005 */
6
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +01007#ifndef SP805_H
8#define SP805_H
9
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/utils_def.h>
Juan Castillo5f64eff2014-07-08 17:20:41 +010011
12/* SP805 register offset */
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +010013#define SP805_WDOG_LOAD_OFF UL(0x000)
14#define SP805_WDOG_CTR_OFF UL(0x008)
15#define SP805_WDOG_LOCK_OFF UL(0xc00)
Juan Castillo5f64eff2014-07-08 17:20:41 +010016
17/* Magic word to unlock the wd registers */
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +010018#define WDOG_UNLOCK_KEY U(0x1ACCE551)
Juan Castillo5f64eff2014-07-08 17:20:41 +010019
20/* Register field definitions */
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +010021#define SP805_CTR_RESEN (U(1) << 1)
22#define SP805_CTR_INTEN (U(1) << 0)
Juan Castillo5f64eff2014-07-08 17:20:41 +010023
Julius Werner53456fc2019-07-09 13:49:11 -070024#ifndef __ASSEMBLER__
Juan Castillo5f64eff2014-07-08 17:20:41 +010025
26#include <stdint.h>
27
28/* Public high level API */
29
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +010030void sp805_start(uintptr_t base, unsigned int ticks);
Juan Castillo5f64eff2014-07-08 17:20:41 +010031void sp805_stop(uintptr_t base);
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +010032void sp805_refresh(uintptr_t base, unsigned int ticks);
Juan Castillo5f64eff2014-07-08 17:20:41 +010033
Julius Werner53456fc2019-07-09 13:49:11 -070034#endif /* __ASSEMBLER__ */
Juan Castillo5f64eff2014-07-08 17:20:41 +010035
Antonio Nino Diaz045b6fd2018-07-24 11:27:52 +010036#endif /* SP805_H */