diff mbox series

[v1,6/7] hw/arm/bcm2838: Map the PCIe memory space

Message ID 20211004134742.2044280-7-alex.bennee@linaro.org
State New
Headers show
Series enabling RasperryPi 4 emulation - WIP state | expand

Commit Message

Alex Bennée Oct. 4, 2021, 1:47 p.m. UTC
From: Philippe Mathieu-Daudé <f4bug@amsat.org>


The BCM2711 has a BCM54213 Gigabit Ethernet block mapped in the PCIe
range.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


---
FIXME: create the bcm54213-geth in raspi.c?
vAJB:
  - fix for move of gic_base to bc
---
 hw/arm/bcm2836.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.30.2
diff mbox series

Patch

diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 99dc15e6e4..ff62e741ce 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -15,6 +15,7 @@ 
 #include "hw/arm/bcm2836.h"
 #include "hw/arm/raspi_platform.h"
 #include "hw/sysbus.h"
+#include "hw/misc/unimp.h"
 
 typedef struct BCM283XClass {
     /*< private >*/
@@ -46,6 +47,8 @@  static Property bcm2836_enabled_cores_property =
 #define GIC_VIFACE_OTHER_OFS(cpu)  (0x5000 + (cpu) * 0x200)
 #define GIC_VCPU_OFS                0x6000
 
+#define PCIE_BASE                   0x7d500000
+
 static void bcm2836_init(Object *obj)
 {
     BCM283XState *s = BCM283X(obj);
@@ -227,6 +230,13 @@  static void bcm2836_realize(DeviceState *dev, Error **errp)
         qdev_connect_gpio_out(DEVICE(&s->cpu[n].core), GTIMER_SEC,
                 qdev_get_gpio_in_named(DEVICE(&s->control), "cntpsirq", n));
     }
+
+    /* bcm2838 kludge to easily create PCIe */
+    if (bc->gic_base) {
+        create_unimplemented_device("bcm2838-pcie", PCIE_BASE, 0x100000);
+        create_unimplemented_device("bcm54213-geth",
+                                    PCIE_BASE + 0x80000, 0x10000);
+    }
 }
 
 static void bcm283x_class_init(ObjectClass *oc, void *data)