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