vfio-ccw: Refactor cleanup of regions
[qemu/ar7.git] / include / hw / arm / bcm2836.h
blob024af8aae4f307c6577f1c78e370b4d7c61010cb
1 /*
2 * Raspberry Pi emulation (c) 2012 Gregory Estrade
3 * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
5 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
6 * Written by Andrew Baumann
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.
12 #ifndef BCM2836_H
13 #define BCM2836_H
15 #include "hw/arm/bcm2835_peripherals.h"
16 #include "hw/intc/bcm2836_control.h"
17 #include "target/arm/cpu.h"
19 #define TYPE_BCM283X "bcm283x"
20 #define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)
22 #define BCM283X_NCPUS 4
24 /* These type names are for specific SoCs; other than instantiating
25 * them, code using these devices should always handle them via the
26 * BCM283x base class, so they have no BCM2836(obj) etc macros.
28 #define TYPE_BCM2836 "bcm2836"
29 #define TYPE_BCM2837 "bcm2837"
31 typedef struct BCM283XState {
32 /*< private >*/
33 DeviceState parent_obj;
34 /*< public >*/
36 char *cpu_type;
37 uint32_t enabled_cpus;
39 struct {
40 ARMCPU core;
41 } cpu[BCM283X_NCPUS];
42 BCM2836ControlState control;
43 BCM2835PeripheralState peripherals;
44 } BCM283XState;
46 typedef struct BCM283XInfo BCM283XInfo;
48 typedef struct BCM283XClass {
49 DeviceClass parent_class;
50 const BCM283XInfo *info;
51 } BCM283XClass;
53 #define BCM283X_CLASS(klass) \
54 OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
55 #define BCM283X_GET_CLASS(obj) \
56 OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
58 #endif /* BCM2836_H */