bcm2835_peripherals.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Raspberry Pi emulation (c) 2012 Gregory Estrade
  3. * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
  4. *
  5. * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
  6. * Written by Andrew Baumann
  7. *
  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.
  10. */
  11. #ifndef BCM2835_PERIPHERALS_H
  12. #define BCM2835_PERIPHERALS_H
  13. #include "hw/sysbus.h"
  14. #include "hw/char/pl011.h"
  15. #include "hw/char/bcm2835_aux.h"
  16. #include "hw/display/bcm2835_fb.h"
  17. #include "hw/dma/bcm2835_dma.h"
  18. #include "hw/or-irq.h"
  19. #include "hw/intc/bcm2835_ic.h"
  20. #include "hw/misc/bcm2835_property.h"
  21. #include "hw/misc/bcm2835_rng.h"
  22. #include "hw/misc/bcm2835_mbox.h"
  23. #include "hw/misc/bcm2835_mphi.h"
  24. #include "hw/misc/bcm2835_thermal.h"
  25. #include "hw/misc/bcm2835_cprman.h"
  26. #include "hw/misc/bcm2835_powermgt.h"
  27. #include "hw/sd/sdhci.h"
  28. #include "hw/sd/bcm2835_sdhost.h"
  29. #include "hw/gpio/bcm2835_gpio.h"
  30. #include "hw/timer/bcm2835_systmr.h"
  31. #include "hw/usb/hcd-dwc2.h"
  32. #include "hw/ssi/bcm2835_spi.h"
  33. #include "hw/i2c/bcm2835_i2c.h"
  34. #include "hw/nvram/bcm2835_otp.h"
  35. #include "hw/misc/unimp.h"
  36. #include "qom/object.h"
  37. #define TYPE_BCM_SOC_PERIPHERALS_BASE "bcm-soc-peripherals-base"
  38. OBJECT_DECLARE_TYPE(BCMSocPeripheralBaseState, BCMSocPeripheralBaseClass,
  39. BCM_SOC_PERIPHERALS_BASE)
  40. #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals"
  41. OBJECT_DECLARE_SIMPLE_TYPE(BCM2835PeripheralState, BCM2835_PERIPHERALS)
  42. struct BCMSocPeripheralBaseState {
  43. /*< private >*/
  44. SysBusDevice parent_obj;
  45. /*< public >*/
  46. MemoryRegion peri_mr, peri_mr_alias, gpu_bus_mr, mbox_mr;
  47. MemoryRegion ram_alias[4];
  48. qemu_irq irq, fiq;
  49. BCM2835SystemTimerState systmr;
  50. BCM2835MphiState mphi;
  51. UnimplementedDeviceState txp;
  52. UnimplementedDeviceState armtmr;
  53. BCM2835PowerMgtState powermgt;
  54. BCM2835CprmanState cprman;
  55. PL011State uart0;
  56. BCM2835AuxState aux;
  57. BCM2835FBState fb;
  58. BCM2835DMAState dma;
  59. OrIRQState orgated_dma_irq;
  60. BCM2835ICState ic;
  61. BCM2835PropertyState property;
  62. BCM2835MboxState mboxes;
  63. SDHCIState sdhci;
  64. BCM2835SDHostState sdhost;
  65. UnimplementedDeviceState i2s;
  66. BCM2835SPIState spi[1];
  67. BCM2835I2CState i2c[3];
  68. OrIRQState orgated_i2c_irq;
  69. BCM2835OTPState otp;
  70. UnimplementedDeviceState dbus;
  71. UnimplementedDeviceState ave0;
  72. UnimplementedDeviceState v3d;
  73. UnimplementedDeviceState bscsl;
  74. UnimplementedDeviceState smi;
  75. DWC2State dwc2;
  76. UnimplementedDeviceState sdramc;
  77. };
  78. struct BCMSocPeripheralBaseClass {
  79. /*< private >*/
  80. SysBusDeviceClass parent_class;
  81. /*< public >*/
  82. uint64_t peri_size; /* Peripheral range size */
  83. };
  84. struct BCM2835PeripheralState {
  85. /*< private >*/
  86. BCMSocPeripheralBaseState parent_obj;
  87. /*< public >*/
  88. BCM2835RngState rng;
  89. Bcm2835ThermalState thermal;
  90. BCM2835GpioState gpio;
  91. };
  92. void create_unimp(BCMSocPeripheralBaseState *ps,
  93. UnimplementedDeviceState *uds,
  94. const char *name, hwaddr ofs, hwaddr size);
  95. void bcm_soc_peripherals_common_realize(DeviceState *dev, Error **errp);
  96. #endif /* BCM2835_PERIPHERALS_H */