hw/riscv/sifive_u: Create a SiFive U SoC object

Create a SiFive Unleashed U54 SoC and use that in the sifive_u machine.

We leave the SoC, RAM, device tree and reset/fdt loading as part of the
machine. All the other device creation has been moved to the SoC.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
This commit is contained in:
Alistair Francis 2018-04-26 11:15:24 -07:00
parent cee35138b5
commit 2308092b2b
2 changed files with 79 additions and 24 deletions

View file

@ -19,13 +19,25 @@
#ifndef HW_SIFIVE_U_H
#define HW_SIFIVE_U_H
#define TYPE_RISCV_U_SOC "riscv.sifive.u.soc"
#define RISCV_U_SOC(obj) \
OBJECT_CHECK(SiFiveUSoCState, (obj), TYPE_RISCV_U_SOC)
typedef struct SiFiveUSoCState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
RISCVHartArrayState cpus;
DeviceState *plic;
} SiFiveUSoCState;
typedef struct SiFiveUState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
RISCVHartArrayState soc;
DeviceState *plic;
SiFiveUSoCState soc;
void *fdt;
int fdt_size;
} SiFiveUState;