xref: /openbmc/qemu/include/hw/arm/aspeed.h (revision 612b219a)
1fca9ca1bSCédric Le Goater /*
2fca9ca1bSCédric Le Goater  * Aspeed Machines
3fca9ca1bSCédric Le Goater  *
4fca9ca1bSCédric Le Goater  * Copyright 2018 IBM Corp.
5fca9ca1bSCédric Le Goater  *
6fca9ca1bSCédric Le Goater  * This code is licensed under the GPL version 2 or later.  See
7fca9ca1bSCédric Le Goater  * the COPYING file in the top-level directory.
8fca9ca1bSCédric Le Goater  */
9fca9ca1bSCédric Le Goater #ifndef ARM_ASPEED_H
10fca9ca1bSCédric Le Goater #define ARM_ASPEED_H
11fca9ca1bSCédric Le Goater 
12fca9ca1bSCédric Le Goater #include "hw/boards.h"
13fca9ca1bSCédric Le Goater 
14*612b219aSPhilippe Mathieu-Daudé typedef struct AspeedMachineState AspeedMachineState;
15fca9ca1bSCédric Le Goater 
16fca9ca1bSCédric Le Goater #define TYPE_ASPEED_MACHINE       MACHINE_TYPE_NAME("aspeed")
17fca9ca1bSCédric Le Goater #define ASPEED_MACHINE(obj) \
18fca9ca1bSCédric Le Goater     OBJECT_CHECK(AspeedMachine, (obj), TYPE_ASPEED_MACHINE)
19fca9ca1bSCédric Le Goater 
20fca9ca1bSCédric Le Goater typedef struct AspeedMachine {
21fca9ca1bSCédric Le Goater     MachineState parent_obj;
221a15311aSCédric Le Goater 
231a15311aSCédric Le Goater     bool mmio_exec;
24fca9ca1bSCédric Le Goater } AspeedMachine;
25fca9ca1bSCédric Le Goater 
26d3bad7e7SCédric Le Goater #define ASPEED_MAC0_ON   (1 << 0)
27d3bad7e7SCédric Le Goater #define ASPEED_MAC1_ON   (1 << 1)
28d3bad7e7SCédric Le Goater #define ASPEED_MAC2_ON   (1 << 2)
29d3bad7e7SCédric Le Goater #define ASPEED_MAC3_ON   (1 << 3)
30d3bad7e7SCédric Le Goater 
31fca9ca1bSCédric Le Goater #define ASPEED_MACHINE_CLASS(klass) \
32fca9ca1bSCédric Le Goater      OBJECT_CLASS_CHECK(AspeedMachineClass, (klass), TYPE_ASPEED_MACHINE)
33fca9ca1bSCédric Le Goater #define ASPEED_MACHINE_GET_CLASS(obj) \
34fca9ca1bSCédric Le Goater      OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE)
35fca9ca1bSCédric Le Goater 
36fca9ca1bSCédric Le Goater typedef struct AspeedMachineClass {
37fca9ca1bSCédric Le Goater     MachineClass parent_obj;
38baa4732bSCédric Le Goater 
39baa4732bSCédric Le Goater     const char *name;
40baa4732bSCédric Le Goater     const char *desc;
41baa4732bSCédric Le Goater     const char *soc_name;
42baa4732bSCédric Le Goater     uint32_t hw_strap1;
43baa4732bSCédric Le Goater     uint32_t hw_strap2;
44baa4732bSCédric Le Goater     const char *fmc_model;
45baa4732bSCédric Le Goater     const char *spi_model;
46baa4732bSCédric Le Goater     uint32_t num_cs;
47d3bad7e7SCédric Le Goater     uint32_t macs_mask;
48*612b219aSPhilippe Mathieu-Daudé     void (*i2c_init)(AspeedMachineState *bmc);
49fca9ca1bSCédric Le Goater } AspeedMachineClass;
50fca9ca1bSCédric Le Goater 
51fca9ca1bSCédric Le Goater 
52fca9ca1bSCédric Le Goater #endif
53