qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	f4bug@amsat.org, "Andrew Baumann" <Andrew.Baumann@microsoft.com>
Subject: [PATCH  v1 6/7] hw/arm/bcm2838: Map the PCIe memory space
Date: Mon,  4 Oct 2021 14:47:40 +0100	[thread overview]
Message-ID: <20211004134742.2044280-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org>

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(+)

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)
-- 
2.30.2



  parent reply	other threads:[~2021-10-04 13:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 13:47 [PATCH v1 0/7] enabling RasperryPi 4 emulation - WIP state Alex Bennée
2021-10-04 13:47 ` [PATCH v1 1/7] hw/misc/bcm2835_property: Add FIXME comment for uninitialized memory Alex Bennée
2021-10-04 13:47 ` [PATCH v1 2/7] hw/misc/bcm2835_property: Handle the 'domain state' property Alex Bennée
2021-10-04 13:47 ` [PATCH v1 3/7] hw/arm: fix the position of vcram for raspi Alex Bennée
2021-10-04 13:47 ` [PATCH v1 4/7] hw/arm/bcm2835_peripherals: Map various BCM2711 blocks Alex Bennée
2021-10-04 13:47 ` [PATCH v1 5/7] hw/arm/bcm2836: Add the BCM2711 which uses a GICv2 Alex Bennée
2021-10-04 15:43   ` Alex Bennée
2021-10-04 13:47 ` Alex Bennée [this message]
2021-10-04 13:47 ` [PATCH v1 7/7] hw/arm/raspi: Add the Raspberry Pi 4B board Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211004134742.2044280-7-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).