xref: /openbmc/qemu/include/hw/misc/sifive_test.h (revision c122bca9)
1a4b84608SBin Meng /*
2a4b84608SBin Meng  * QEMU Test Finisher interface
3a4b84608SBin Meng  *
4a4b84608SBin Meng  * Copyright (c) 2018 SiFive, Inc.
5a4b84608SBin Meng  *
6a4b84608SBin Meng  * This program is free software; you can redistribute it and/or modify it
7a4b84608SBin Meng  * under the terms and conditions of the GNU General Public License,
8a4b84608SBin Meng  * version 2 or later, as published by the Free Software Foundation.
9a4b84608SBin Meng  *
10a4b84608SBin Meng  * This program is distributed in the hope it will be useful, but WITHOUT
11a4b84608SBin Meng  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12a4b84608SBin Meng  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13a4b84608SBin Meng  * more details.
14a4b84608SBin Meng  *
15a4b84608SBin Meng  * You should have received a copy of the GNU General Public License along with
16a4b84608SBin Meng  * this program.  If not, see <http://www.gnu.org/licenses/>.
17a4b84608SBin Meng  */
18a4b84608SBin Meng 
19a4b84608SBin Meng #ifndef HW_SIFIVE_TEST_H
20a4b84608SBin Meng #define HW_SIFIVE_TEST_H
21a4b84608SBin Meng 
22a4b84608SBin Meng #include "hw/sysbus.h"
23ac900edeSEduardo Habkost #include "qom/object.h"
24a4b84608SBin Meng 
25a4b84608SBin Meng #define TYPE_SIFIVE_TEST "riscv.sifive.test"
26a4b84608SBin Meng 
27ac900edeSEduardo Habkost typedef struct SiFiveTestState SiFiveTestState;
28*e38d3c5cSEduardo Habkost DECLARE_INSTANCE_CHECKER(SiFiveTestState, SIFIVE_TEST,
29*e38d3c5cSEduardo Habkost                          TYPE_SIFIVE_TEST)
30a4b84608SBin Meng 
31ac900edeSEduardo Habkost struct SiFiveTestState {
32a4b84608SBin Meng     /*< private >*/
33a4b84608SBin Meng     SysBusDevice parent_obj;
34a4b84608SBin Meng 
35a4b84608SBin Meng     /*< public >*/
36a4b84608SBin Meng     MemoryRegion mmio;
37ac900edeSEduardo Habkost };
38a4b84608SBin Meng 
39a4b84608SBin Meng enum {
40a4b84608SBin Meng     FINISHER_FAIL = 0x3333,
41a4b84608SBin Meng     FINISHER_PASS = 0x5555,
42a4b84608SBin Meng     FINISHER_RESET = 0x7777
43a4b84608SBin Meng };
44a4b84608SBin Meng 
45a4b84608SBin Meng DeviceState *sifive_test_create(hwaddr addr);
46a4b84608SBin Meng 
47a4b84608SBin Meng #endif
48