xref: /openbmc/qemu/include/hw/arm/bcm2836.h (revision 6111a0c0)
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  *
8*6111a0c0SPhilippe Mathieu-Daudé  * This work is licensed under the terms of the GNU GPL, version 2 or later.
9*6111a0c0SPhilippe 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"
18bad56236SAndrew Baumann 
19926dcdf0SPeter Maydell #define TYPE_BCM283X "bcm283x"
20926dcdf0SPeter Maydell #define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)
21bad56236SAndrew Baumann 
22926dcdf0SPeter Maydell #define BCM283X_NCPUS 4
23bad56236SAndrew Baumann 
240fd74f03SPeter Maydell /* These type names are for specific SoCs; other than instantiating
250fd74f03SPeter Maydell  * them, code using these devices should always handle them via the
260fd74f03SPeter Maydell  * BCM283x base class, so they have no BCM2836(obj) etc macros.
270fd74f03SPeter Maydell  */
280fd74f03SPeter Maydell #define TYPE_BCM2836 "bcm2836"
290fd74f03SPeter Maydell #define TYPE_BCM2837 "bcm2837"
300fd74f03SPeter Maydell 
31926dcdf0SPeter Maydell typedef struct BCM283XState {
32bad56236SAndrew Baumann     /*< private >*/
33bad56236SAndrew Baumann     DeviceState parent_obj;
34bad56236SAndrew Baumann     /*< public >*/
35bad56236SAndrew Baumann 
36d9f8bbd8SPekka Enberg     char *cpu_type;
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;
44926dcdf0SPeter Maydell } BCM283XState;
45bad56236SAndrew Baumann 
460fd74f03SPeter Maydell typedef struct BCM283XInfo BCM283XInfo;
470fd74f03SPeter Maydell 
480fd74f03SPeter Maydell typedef struct BCM283XClass {
490fd74f03SPeter Maydell     DeviceClass parent_class;
500fd74f03SPeter Maydell     const BCM283XInfo *info;
510fd74f03SPeter Maydell } BCM283XClass;
520fd74f03SPeter Maydell 
530fd74f03SPeter Maydell #define BCM283X_CLASS(klass) \
540fd74f03SPeter Maydell     OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
550fd74f03SPeter Maydell #define BCM283X_GET_CLASS(obj) \
560fd74f03SPeter Maydell     OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
570fd74f03SPeter Maydell 
58bad56236SAndrew Baumann #endif /* BCM2836_H */
59