xref: /freebsd/usr.sbin/bhyve/rtc_pl031.h (revision 014d7082a2398ec39e76b5f7b1f842fc9be6c51e)
1*014d7082SJessica Clarke /*-
2*014d7082SJessica Clarke  * SPDX-License-Identifier: BSD-2-Clause
3*014d7082SJessica Clarke  *
4*014d7082SJessica Clarke  * Copyright (c) 2024 Jessica Clarke <jrtc27@FreeBSD.org>
5*014d7082SJessica Clarke  *
6*014d7082SJessica Clarke  * Redistribution and use in source and binary forms, with or without
7*014d7082SJessica Clarke  * modification, are permitted provided that the following conditions
8*014d7082SJessica Clarke  * are met:
9*014d7082SJessica Clarke  * 1. Redistributions of source code must retain the above copyright
10*014d7082SJessica Clarke  *    notice, this list of conditions and the following disclaimer.
11*014d7082SJessica Clarke  * 2. Redistributions in binary form must reproduce the above copyright
12*014d7082SJessica Clarke  *    notice, this list of conditions and the following disclaimer in the
13*014d7082SJessica Clarke  *    documentation and/or other materials provided with the distribution.
14*014d7082SJessica Clarke  *
15*014d7082SJessica Clarke  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*014d7082SJessica Clarke  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*014d7082SJessica Clarke  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*014d7082SJessica Clarke  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*014d7082SJessica Clarke  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*014d7082SJessica Clarke  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*014d7082SJessica Clarke  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*014d7082SJessica Clarke  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*014d7082SJessica Clarke  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*014d7082SJessica Clarke  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*014d7082SJessica Clarke  * SUCH DAMAGE.
26*014d7082SJessica Clarke  */
27*014d7082SJessica Clarke 
28*014d7082SJessica Clarke #ifndef _RTC_PL031_H_
29*014d7082SJessica Clarke #define	_RTC_PL031_H_
30*014d7082SJessica Clarke 
31*014d7082SJessica Clarke struct rtc_pl031_softc;
32*014d7082SJessica Clarke typedef void (*rtc_pl031_intr_func_t)(void *arg);
33*014d7082SJessica Clarke 
34*014d7082SJessica Clarke struct rtc_pl031_softc *rtc_pl031_init(rtc_pl031_intr_func_t intr_assert,
35*014d7082SJessica Clarke 	    rtc_pl031_intr_func_t intr_deassert, void *arg);
36*014d7082SJessica Clarke void	rtc_pl031_write(struct rtc_pl031_softc *sc, int offset,
37*014d7082SJessica Clarke 	    uint32_t value);
38*014d7082SJessica Clarke uint32_t rtc_pl031_read(struct rtc_pl031_softc *sc, int offset);
39*014d7082SJessica Clarke 
40*014d7082SJessica Clarke #endif /* _RTC_PL031_H_ */
41