2 * SiFive HiFive1 AON (Always On Domain) interface.
4 * Copyright (c) 2022 SiFive, Inc. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2 or later, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef HW_SIFIVE_AON_H
20 #define HW_SIFIVE_AON_H
22 #include "hw/sysbus.h"
23 #include "qom/object.h"
25 #define TYPE_SIFIVE_E_AON "riscv.sifive.e.aon"
26 OBJECT_DECLARE_SIMPLE_TYPE(SiFiveEAONState
, SIFIVE_E_AON
)
28 #define SIFIVE_E_AON_WDOGKEY (0x51F15E)
29 #define SIFIVE_E_AON_WDOGFEED (0xD09F00D)
30 #define SIFIVE_E_LFCLK_DEFAULT_FREQ (32768)
33 SIFIVE_E_AON_WDT
= 0x0,
34 SIFIVE_E_AON_RTC
= 0x40,
35 SIFIVE_E_AON_LFROSC
= 0x70,
36 SIFIVE_E_AON_BACKUP
= 0x80,
37 SIFIVE_E_AON_PMU
= 0x100,
38 SIFIVE_E_AON_MAX
= 0x150
41 struct SiFiveEAONState
{
43 SysBusDevice parent_obj
;
48 /*< watchdog timer >*/
49 QEMUTimer
*wdog_timer
;
51 uint64_t wdog_restart_time
;
52 uint64_t wdogclk_freq
;