xref: /openbmc/qemu/include/hw/riscv/spike.h (revision 26cd0362)
15b4beba1SMichael Clark /*
25b4beba1SMichael Clark  * Spike machine interface
35b4beba1SMichael Clark  *
45b4beba1SMichael Clark  * Copyright (c) 2017 SiFive, Inc.
55b4beba1SMichael Clark  *
65b4beba1SMichael Clark  * This program is free software; you can redistribute it and/or modify it
75b4beba1SMichael Clark  * under the terms and conditions of the GNU General Public License,
85b4beba1SMichael Clark  * version 2 or later, as published by the Free Software Foundation.
95b4beba1SMichael Clark  *
105b4beba1SMichael Clark  * This program is distributed in the hope it will be useful, but WITHOUT
115b4beba1SMichael Clark  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
125b4beba1SMichael Clark  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
135b4beba1SMichael Clark  * more details.
145b4beba1SMichael Clark  *
155b4beba1SMichael Clark  * You should have received a copy of the GNU General Public License along with
165b4beba1SMichael Clark  * this program.  If not, see <http://www.gnu.org/licenses/>.
175b4beba1SMichael Clark  */
185b4beba1SMichael Clark 
194996b128SMichael Clark #ifndef HW_RISCV_SPIKE_H
204996b128SMichael Clark #define HW_RISCV_SPIKE_H
215b4beba1SMichael Clark 
22ec150c7eSMarkus Armbruster #include "hw/riscv/riscv_hart.h"
23ec150c7eSMarkus Armbruster #include "hw/sysbus.h"
24ec150c7eSMarkus Armbruster 
255b4beba1SMichael Clark typedef struct {
265b4beba1SMichael Clark     /*< private >*/
275b4beba1SMichael Clark     SysBusDevice parent_obj;
285b4beba1SMichael Clark 
295b4beba1SMichael Clark     /*< public >*/
305b4beba1SMichael Clark     RISCVHartArrayState soc;
315b4beba1SMichael Clark     void *fdt;
325b4beba1SMichael Clark     int fdt_size;
335b4beba1SMichael Clark } SpikeState;
345b4beba1SMichael Clark 
355b4beba1SMichael Clark enum {
365b4beba1SMichael Clark     SPIKE_MROM,
375b4beba1SMichael Clark     SPIKE_CLINT,
385b4beba1SMichael Clark     SPIKE_DRAM
395b4beba1SMichael Clark };
405b4beba1SMichael Clark 
415b4beba1SMichael Clark #if defined(TARGET_RISCV32)
42*26cd0362SAlistair Francis #define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_BASE32
435b4beba1SMichael Clark #elif defined(TARGET_RISCV64)
44*26cd0362SAlistair Francis #define SPIKE_V1_10_0_CPU TYPE_RISCV_CPU_BASE64
455b4beba1SMichael Clark #endif
465b4beba1SMichael Clark 
475b4beba1SMichael Clark #endif
48