mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
SiFive RISC-V GPIO Device
QEMU model of the GPIO device on the SiFive E300 series SOCs. The pins are not used by a board definition yet, however this implementation can already be used to trigger GPIO interrupts from the software by configuring a pin as both output and input. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
a7b21f6762
commit
30efbf330a
7 changed files with 501 additions and 4 deletions
|
@ -19,6 +19,8 @@
|
|||
#ifndef HW_SIFIVE_E_H
|
||||
#define HW_SIFIVE_E_H
|
||||
|
||||
#include "hw/riscv/sifive_gpio.h"
|
||||
|
||||
#define TYPE_RISCV_E_SOC "riscv.sifive.e.soc"
|
||||
#define RISCV_E_SOC(obj) \
|
||||
OBJECT_CHECK(SiFiveESoCState, (obj), TYPE_RISCV_E_SOC)
|
||||
|
@ -30,6 +32,7 @@ typedef struct SiFiveESoCState {
|
|||
/*< public >*/
|
||||
RISCVHartArrayState cpus;
|
||||
DeviceState *plic;
|
||||
SIFIVEGPIOState gpio;
|
||||
} SiFiveESoCState;
|
||||
|
||||
typedef struct SiFiveEState {
|
||||
|
@ -63,8 +66,9 @@ enum {
|
|||
};
|
||||
|
||||
enum {
|
||||
SIFIVE_E_UART0_IRQ = 3,
|
||||
SIFIVE_E_UART1_IRQ = 4
|
||||
SIFIVE_E_UART0_IRQ = 3,
|
||||
SIFIVE_E_UART1_IRQ = 4,
|
||||
SIFIVE_E_GPIO0_IRQ0 = 8
|
||||
};
|
||||
|
||||
#define SIFIVE_E_PLIC_HART_CONFIG "M"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue