xref: /openbmc/qemu/include/hw/arm/bcm2836.h (revision ec150c7e)
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  *
8bad56236SAndrew Baumann  * This code is licensed under the GNU GPLv2 and later.
9bad56236SAndrew Baumann  */
10bad56236SAndrew Baumann 
11bad56236SAndrew Baumann #ifndef BCM2836_H
12bad56236SAndrew Baumann #define BCM2836_H
13bad56236SAndrew Baumann 
14bad56236SAndrew Baumann #include "hw/arm/bcm2835_peripherals.h"
15bad56236SAndrew Baumann #include "hw/intc/bcm2836_control.h"
16*ec150c7eSMarkus Armbruster #include "target/arm/cpu.h"
17bad56236SAndrew Baumann 
18926dcdf0SPeter Maydell #define TYPE_BCM283X "bcm283x"
19926dcdf0SPeter Maydell #define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)
20bad56236SAndrew Baumann 
21926dcdf0SPeter Maydell #define BCM283X_NCPUS 4
22bad56236SAndrew Baumann 
230fd74f03SPeter Maydell /* These type names are for specific SoCs; other than instantiating
240fd74f03SPeter Maydell  * them, code using these devices should always handle them via the
250fd74f03SPeter Maydell  * BCM283x base class, so they have no BCM2836(obj) etc macros.
260fd74f03SPeter Maydell  */
270fd74f03SPeter Maydell #define TYPE_BCM2836 "bcm2836"
280fd74f03SPeter Maydell #define TYPE_BCM2837 "bcm2837"
290fd74f03SPeter Maydell 
30926dcdf0SPeter Maydell typedef struct BCM283XState {
31bad56236SAndrew Baumann     /*< private >*/
32bad56236SAndrew Baumann     DeviceState parent_obj;
33bad56236SAndrew Baumann     /*< public >*/
34bad56236SAndrew Baumann 
35d9f8bbd8SPekka Enberg     char *cpu_type;
36bad56236SAndrew Baumann     uint32_t enabled_cpus;
37bad56236SAndrew Baumann 
38926dcdf0SPeter Maydell     ARMCPU cpus[BCM283X_NCPUS];
39bad56236SAndrew Baumann     BCM2836ControlState control;
40bad56236SAndrew Baumann     BCM2835PeripheralState peripherals;
41926dcdf0SPeter Maydell } BCM283XState;
42bad56236SAndrew Baumann 
430fd74f03SPeter Maydell typedef struct BCM283XInfo BCM283XInfo;
440fd74f03SPeter Maydell 
450fd74f03SPeter Maydell typedef struct BCM283XClass {
460fd74f03SPeter Maydell     DeviceClass parent_class;
470fd74f03SPeter Maydell     const BCM283XInfo *info;
480fd74f03SPeter Maydell } BCM283XClass;
490fd74f03SPeter Maydell 
500fd74f03SPeter Maydell #define BCM283X_CLASS(klass) \
510fd74f03SPeter Maydell     OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
520fd74f03SPeter Maydell #define BCM283X_GET_CLASS(obj) \
530fd74f03SPeter Maydell     OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
540fd74f03SPeter Maydell 
55bad56236SAndrew Baumann #endif /* BCM2836_H */
56