Merge remote-tracking branch 'qemu-project/master'
[qemu/ar7.git] / include / hw / arm / bcm2835_peripherals.h
blob538cbe568373a01a3c975a9f96cb95054ac9d422
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 BCM2835_PERIPHERALS_H
13 #define BCM2835_PERIPHERALS_H
15 #include "hw/sysbus.h"
16 #include "hw/char/pl011.h"
17 #include "hw/char/bcm2835_aux.h"
18 #include "hw/display/bcm2835_fb.h"
19 #include "hw/dma/bcm2835_dma.h"
20 #include "hw/or-irq.h"
21 #include "hw/intc/bcm2835_ic.h"
22 #include "hw/misc/bcm2835_power.h"
23 #include "hw/misc/bcm2835_property.h"
24 #include "hw/misc/bcm2835_rng.h"
25 #include "hw/misc/bcm2835_mbox.h"
26 #include "hw/misc/bcm2835_mphi.h"
27 #include "hw/misc/bcm2835_thermal.h"
28 #include "hw/misc/bcm2835_cprman.h"
29 #include "hw/misc/bcm2835_powermgt.h"
30 #include "hw/sd/sdhci.h"
31 #include "hw/sd/bcm2835_sdhost.h"
32 #include "hw/gpio/bcm2835_gpio.h"
33 #include "hw/timer/bcm2835_st.h"
34 #include "hw/timer/bcm2835_timer.h"
35 #include "hw/usb/bcm2835_usb.h"
36 #include "hw/timer/bcm2835_systmr.h"
37 #include "hw/usb/hcd-dwc2.h"
38 #include "hw/ssi/bcm2835_spi.h"
39 #include "hw/i2c/bcm2835_i2c.h"
40 #include "hw/nvram/bcm2835_otp.h"
41 #include "hw/misc/unimp.h"
42 #include "qom/object.h"
44 #define TYPE_BCM_SOC_PERIPHERALS_BASE "bcm-soc-peripherals-base"
45 OBJECT_DECLARE_TYPE(BCMSocPeripheralBaseState, BCMSocPeripheralBaseClass,
46 BCM_SOC_PERIPHERALS_BASE)
47 #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals"
48 OBJECT_DECLARE_SIMPLE_TYPE(BCM2835PeripheralState, BCM2835_PERIPHERALS)
50 struct BCMSocPeripheralBaseState {
51 /*< private >*/
52 SysBusDevice parent_obj;
53 /*< public >*/
55 MemoryRegion peri_mr, peri_mr_alias, gpu_bus_mr, mbox_mr;
56 MemoryRegion ram_alias[4];
57 qemu_irq irq, fiq;
59 BCM2835SystemTimerState systmr;
60 BCM2835MphiState mphi;
61 UnimplementedDeviceState txp;
62 UnimplementedDeviceState armtmr;
63 BCM2835PowerMgtState powermgt;
64 BCM2835CprmanState cprman;
65 PL011State uart0;
66 BCM2835AuxState aux;
67 BCM2835FBState fb;
68 BCM2835DMAState dma;
69 OrIRQState orgated_dma_irq;
70 BCM2835ICState ic;
71 BCM2835PowerState power;
72 BCM2835PropertyState property;
73 BCM2835MboxState mboxes;
74 SDHCIState sdhci;
75 BCM2835SDHostState sdhost;
76 BCM2835GpioState gpio;
77 BCM2835StState st;
78 BCM2835TimerState timer;
79 Bcm2835ThermalState thermal;
80 BCM2835UsbState usb;
81 UnimplementedDeviceState i2s;
82 BCM2835SPIState spi[1];
83 BCM2835I2CState i2c[3];
84 OrIRQState orgated_i2c_irq;
85 BCM2835OTPState otp;
86 UnimplementedDeviceState dbus;
87 UnimplementedDeviceState ave0;
88 UnimplementedDeviceState v3d;
89 UnimplementedDeviceState bscsl;
90 UnimplementedDeviceState smi;
91 DWC2State dwc2;
92 UnimplementedDeviceState sdramc;
95 struct BCMSocPeripheralBaseClass {
96 /*< private >*/
97 SysBusDeviceClass parent_class;
98 /*< public >*/
99 uint64_t peri_size; /* Peripheral range size */
102 struct BCM2835PeripheralState {
103 /*< private >*/
104 BCMSocPeripheralBaseState parent_obj;
105 /*< public >*/
106 BCM2835RngState rng;
107 Bcm2835ThermalState thermal;
108 BCM2835GpioState gpio;
111 void create_unimp(BCMSocPeripheralBaseState *ps,
112 UnimplementedDeviceState *uds,
113 const char *name, hwaddr ofs, hwaddr size);
114 void bcm_soc_peripherals_common_realize(DeviceState *dev, Error **errp);
116 #endif /* BCM2835_PERIPHERALS_H */