xref: /qemu/include/hw/arm/bcm2836.h (revision e3a6e0da)
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 work is licensed under the terms of the GNU GPL, version 2 or later.
9  * See the COPYING file in the top-level directory.
10  */
11 
12 #ifndef BCM2836_H
13 #define BCM2836_H
14 
15 #include "hw/arm/bcm2835_peripherals.h"
16 #include "hw/intc/bcm2836_control.h"
17 #include "target/arm/cpu.h"
18 #include "qom/object.h"
19 
20 #define TYPE_BCM283X "bcm283x"
21 typedef struct BCM283XClass BCM283XClass;
22 typedef struct BCM283XState BCM283XState;
23 DECLARE_OBJ_CHECKERS(BCM283XState, BCM283XClass,
24                      BCM283X, TYPE_BCM283X)
25 
26 #define BCM283X_NCPUS 4
27 
28 /* These type names are for specific SoCs; other than instantiating
29  * them, code using these devices should always handle them via the
30  * BCM283x base class, so they have no BCM2836(obj) etc macros.
31  */
32 #define TYPE_BCM2836 "bcm2836"
33 #define TYPE_BCM2837 "bcm2837"
34 
35 struct BCM283XState {
36     /*< private >*/
37     DeviceState parent_obj;
38     /*< public >*/
39 
40     uint32_t enabled_cpus;
41 
42     struct {
43         ARMCPU core;
44     } cpu[BCM283X_NCPUS];
45     BCM2836ControlState control;
46     BCM2835PeripheralState peripherals;
47 };
48 
49 typedef struct BCM283XInfo BCM283XInfo;
50 
51 struct BCM283XClass {
52     DeviceClass parent_class;
53     const BCM283XInfo *info;
54 };
55 
56 
57 #endif /* BCM2836_H */
58