xref: /openbmc/qemu/include/hw/arm/bcm2836.h (revision a489d1951cd9cc91c5954214fcf6ae0f9d2d4292)
1bad56236SAndrew Baumann /*
2bad56236SAndrew Baumann  * Raspberry Pi emulation (c) 2012 Gregory Estrade
3bad56236SAndrew Baumann  * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
4bad56236SAndrew Baumann  *
5bad56236SAndrew Baumann  * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
6bad56236SAndrew Baumann  * Written by Andrew Baumann
7bad56236SAndrew Baumann  *
86111a0c0SPhilippe Mathieu-Daudé  * This work is licensed under the terms of the GNU GPL, version 2 or later.
96111a0c0SPhilippe Mathieu-Daudé  * See the COPYING file in the top-level directory.
10bad56236SAndrew Baumann  */
11bad56236SAndrew Baumann 
12bad56236SAndrew Baumann #ifndef BCM2836_H
13bad56236SAndrew Baumann #define BCM2836_H
14bad56236SAndrew Baumann 
15bad56236SAndrew Baumann #include "hw/arm/bcm2835_peripherals.h"
16bad56236SAndrew Baumann #include "hw/intc/bcm2836_control.h"
17ec150c7eSMarkus Armbruster #include "target/arm/cpu.h"
18db1015e9SEduardo Habkost #include "qom/object.h"
19bad56236SAndrew Baumann 
20926dcdf0SPeter Maydell #define TYPE_BCM283X "bcm283x"
21*a489d195SEduardo Habkost OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X)
22bad56236SAndrew Baumann 
23926dcdf0SPeter Maydell #define BCM283X_NCPUS 4
24bad56236SAndrew Baumann 
250fd74f03SPeter Maydell /* These type names are for specific SoCs; other than instantiating
260fd74f03SPeter Maydell  * them, code using these devices should always handle them via the
270fd74f03SPeter Maydell  * BCM283x base class, so they have no BCM2836(obj) etc macros.
280fd74f03SPeter Maydell  */
290fd74f03SPeter Maydell #define TYPE_BCM2836 "bcm2836"
300fd74f03SPeter Maydell #define TYPE_BCM2837 "bcm2837"
310fd74f03SPeter Maydell 
32db1015e9SEduardo Habkost struct BCM283XState {
33bad56236SAndrew Baumann     /*< private >*/
34bad56236SAndrew Baumann     DeviceState parent_obj;
35bad56236SAndrew Baumann     /*< public >*/
36bad56236SAndrew Baumann 
37bad56236SAndrew Baumann     uint32_t enabled_cpus;
38bad56236SAndrew Baumann 
395e5e9ed6SPhilippe Mathieu-Daudé     struct {
405e5e9ed6SPhilippe Mathieu-Daudé         ARMCPU core;
415e5e9ed6SPhilippe Mathieu-Daudé     } cpu[BCM283X_NCPUS];
42bad56236SAndrew Baumann     BCM2836ControlState control;
43bad56236SAndrew Baumann     BCM2835PeripheralState peripherals;
44db1015e9SEduardo Habkost };
45bad56236SAndrew Baumann 
460fd74f03SPeter Maydell typedef struct BCM283XInfo BCM283XInfo;
470fd74f03SPeter Maydell 
48db1015e9SEduardo Habkost struct BCM283XClass {
490fd74f03SPeter Maydell     DeviceClass parent_class;
500fd74f03SPeter Maydell     const BCM283XInfo *info;
51db1015e9SEduardo Habkost };
520fd74f03SPeter Maydell 
530fd74f03SPeter Maydell 
54bad56236SAndrew Baumann #endif /* BCM2836_H */
55