xref: /openbmc/qemu/include/hw/arm/bcm2836.h (revision 200dbf37)
1 /*
2  * Raspberry Pi emulation (c) 2012 Gregory Estrade
3  * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
4  *
5  * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
6  * Written by Andrew Baumann
7  *
8  * This code is licensed under the GNU GPLv2 and later.
9  */
10 
11 #ifndef BCM2836_H
12 #define BCM2836_H
13 
14 #include "hw/arm/bcm2835_peripherals.h"
15 #include "hw/intc/bcm2836_control.h"
16 
17 #define TYPE_BCM283X "bcm283x"
18 #define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)
19 
20 #define BCM283X_NCPUS 4
21 
22 /* These type names are for specific SoCs; other than instantiating
23  * them, code using these devices should always handle them via the
24  * BCM283x base class, so they have no BCM2836(obj) etc macros.
25  */
26 #define TYPE_BCM2836 "bcm2836"
27 #define TYPE_BCM2837 "bcm2837"
28 
29 typedef struct BCM283XState {
30     /*< private >*/
31     DeviceState parent_obj;
32     /*< public >*/
33 
34     char *cpu_type;
35     uint32_t enabled_cpus;
36 
37     ARMCPU cpus[BCM283X_NCPUS];
38     BCM2836ControlState control;
39     BCM2835PeripheralState peripherals;
40 } BCM283XState;
41 
42 typedef struct BCM283XInfo BCM283XInfo;
43 
44 typedef struct BCM283XClass {
45     DeviceClass parent_class;
46     const BCM283XInfo *info;
47 } BCM283XClass;
48 
49 #define BCM283X_CLASS(klass) \
50     OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
51 #define BCM283X_GET_CLASS(obj) \
52     OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
53 
54 #endif /* BCM2836_H */
55