xref: /openbmc/qemu/include/hw/arm/aspeed.h (revision ab9056ff)
1 /*
2  * Aspeed Machines
3  *
4  * Copyright 2018 IBM Corp.
5  *
6  * This code is licensed under the GPL version 2 or later.  See
7  * the COPYING file in the top-level directory.
8  */
9 #ifndef ARM_ASPEED_H
10 #define ARM_ASPEED_H
11 
12 #include "hw/boards.h"
13 
14 typedef struct AspeedBoardState AspeedBoardState;
15 
16 typedef struct AspeedBoardConfig {
17     const char *name;
18     const char *desc;
19     const char *soc_name;
20     uint32_t hw_strap1;
21     uint32_t hw_strap2;
22     const char *fmc_model;
23     const char *spi_model;
24     uint32_t num_cs;
25     void (*i2c_init)(AspeedBoardState *bmc);
26     uint32_t ram;
27 } AspeedBoardConfig;
28 
29 #define TYPE_ASPEED_MACHINE       MACHINE_TYPE_NAME("aspeed")
30 #define ASPEED_MACHINE(obj) \
31     OBJECT_CHECK(AspeedMachine, (obj), TYPE_ASPEED_MACHINE)
32 
33 typedef struct AspeedMachine {
34     MachineState parent_obj;
35 } AspeedMachine;
36 
37 #define ASPEED_MACHINE_CLASS(klass) \
38      OBJECT_CLASS_CHECK(AspeedMachineClass, (klass), TYPE_ASPEED_MACHINE)
39 #define ASPEED_MACHINE_GET_CLASS(obj) \
40      OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE)
41 
42 typedef struct AspeedMachineClass {
43     MachineClass parent_obj;
44     const AspeedBoardConfig *board;
45 } AspeedMachineClass;
46 
47 
48 #endif
49