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 AspeedMachineState AspeedMachineState; 15 16 #define TYPE_ASPEED_MACHINE MACHINE_TYPE_NAME("aspeed") 17 #define ASPEED_MACHINE(obj) \ 18 OBJECT_CHECK(AspeedMachineState, (obj), TYPE_ASPEED_MACHINE) 19 20 #define ASPEED_MAC0_ON (1 << 0) 21 #define ASPEED_MAC1_ON (1 << 1) 22 #define ASPEED_MAC2_ON (1 << 2) 23 #define ASPEED_MAC3_ON (1 << 3) 24 25 #define ASPEED_MACHINE_CLASS(klass) \ 26 OBJECT_CLASS_CHECK(AspeedMachineClass, (klass), TYPE_ASPEED_MACHINE) 27 #define ASPEED_MACHINE_GET_CLASS(obj) \ 28 OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE) 29 30 typedef struct AspeedMachineClass { 31 MachineClass parent_obj; 32 33 const char *name; 34 const char *desc; 35 const char *soc_name; 36 uint32_t hw_strap1; 37 uint32_t hw_strap2; 38 const char *fmc_model; 39 const char *spi_model; 40 uint32_t num_cs; 41 uint32_t macs_mask; 42 void (*i2c_init)(AspeedMachineState *bmc); 43 } AspeedMachineClass; 44 45 46 #endif 47