Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CB92CC6B38 for ; Thu, 15 Oct 2026 18:17:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xHPvN-0001GU-9M; Thu, 15 Oct 2026 14:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xHPvL-0001BP-Kd for qemu-arm@nongnu.org; Thu, 15 Oct 2026 14:11:27 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xHPvJ-0001Rl-Te for qemu-arm@nongnu.org; Thu, 15 Oct 2026 14:11:27 -0400 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-533972e0cccso63148761cf.0 for ; Thu, 15 Oct 2026 11:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792087885; x=1792692685; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=kDi6Ms4VOCBYgAFNYh2oj+riu0usSjF6z3/Qp8bt9l4=; b=ix+hFRZgc+JWYU+jUbXCf4CoeP+omyBwf4uwVM1l7R77RYzw8veeU+qCvbsxctCsD6 ADTy9VlVarBH9PTWoQ1vHTkEyeA4G92hB/Z+B/N4sS8h0WC8DsHAS2LhF1FPZVU9C9Ik L/hnURoI4pc29jbza7/ED66rFtXwZDqXNKlsNp8XyhG0CZAtk6wotyxRxoioAwvfmeEj Tz5pWeQKyDAKDcpjE7/rq8eUTE5p6TtA1xwdzYf3oKAp9PF3umtyAkpdKEM3avUDTCU3 6otVy6U8hoLHf5bXUQjUrQ5gQvM3NIpNmzEWDrVy9fUlCmIQfA1nrc0/slbagelv/4Aj Vszw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792087885; x=1792692685; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kDi6Ms4VOCBYgAFNYh2oj+riu0usSjF6z3/Qp8bt9l4=; b=NQsun41LRpnpOfOwtq8nRTUssZKf5WcFa6vIbaKGlhh55x1OkgZj/oa17wK1llff57 Xyppmm36ToMx6e74xq+oHvtHdVH+VibbQzoVPdRhlOaRE2u27Q67FfwSAqEKNVUdrQ3p +sHCX8jXPYd4WI78pvpBpWoc0UAor7sm8d3XfWpeXDwObMqljUwmurcwP/+9csVGDNT3 qlpxjh2a4DNygq73ZNv8hbD8g/GX7pIxbpAY1cXA2aBX5RdgwdPQSnfeCDrizzWvhG1W BKe3Uh7M0sflvkYvCXelP6o8pz4yB03Gaz+fIQG8Hwa75hKDxNFJ/b3Zsan/H+Ij2h9D zmmA== X-Forwarded-Encrypted: i=1; AKwUvBzvVANFHIMynMQJu1XVRqpgekHqm0pIwsSzTKIN/2TojADf7ezXDzR8G4WNtUGazxnChHVR8ni1sw==@nongnu.org X-Gm-Message-State: AFq9FYKvvTsRIgupqa6FDlMsBlsKs8quIu9YnlfGYOP6h0jVEjIEJ3oF R0vlzs25wuniSG+W16nGvvBsKIXAObRTU0bBYLx2OFZRhw8RRk+493rM X-Gm-Gg: AYBFou19HQIU1iwWdP+GSXFvcVGmuTis9FGaBQAhURTbeA7wWh94+YDecp8ZWmQNJT2 GH5mErwpjZFyY8GKMxC6YTcPfQqw6/b04u8xpYoxF4FD6765rwcPwKBypqfGG3ki1IRcsjEIN4r O972JwcmZSif+FRmUIxuMVmsOGM8EysLuidJBDeym1gdmynlaFle+f4AoYb4hN31RAMjUuWgIHu y9k2sII5R4vpmtFwqUQWvKUhvcd9fXHCZjMbRIezCkSROHjcVkGCKMY6YLdNshDjRwRfOHaIYho 8iiBHcuFHBJmmsnEXU+rYjGGC7vfeetijJGaVnaoj9e/aCGI3LxXW6/FdX8xxFBs5VR+pXFE0M4 e1+8o3lPfuyXGTBk4RgOAvUy9fJ4r0G+BOv6Emb9+JyoBQnFb7NcOAiE1e1HYC2imOoI8fhcgPf s+IdlZB83wfdvcfUT48AM6C1+0lJtaJzMMy0umGFXhdiEtdf39D81yFREwpWYhAX8B4iONGLYgb 3m9yHzbb+wHjMDsA3CBWgTJfaLKIwiQO36U++WKdUIng53lwrArvT9f3t7a/XWblBaR3Q== X-Received: by 2002:a05:622a:ab03:20b0:534:20b8:5d08 with SMTP id d75a77b69052e-53628350fa2mr7722071cf.45.1792087884680; Thu, 15 Oct 2026 11:11:24 -0700 (PDT) Received: from localhost.localdomain ([2606:6d00:159:2900:919:5388:4e10:5949]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-536127efe4asm32130611cf.19.2026.10.15.11.11.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Oct 2026 11:11:23 -0700 (PDT) From: Marcelo Manzo To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcelo Manzo Subject: [PATCH v3 00/16] hw/arm/raspi4b: working PCIe and GENET (real networking) Date: Thu, 15 Oct 2026 14:11:05 -0400 Message-ID: <20261015181122.60608-1-marcelomanzo@gmail.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=marcelomanzo@gmail.com; helo=mail-qt1-x82d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org This series gets raspi4b's PCIe root complex and GENET Ethernet controller working end to end: the PCIe link comes up and devices on it enumerate, and GENET passes real network traffic (DHCP, SSH, bulk downloads) under both older (Debian 11, 5.15) and newer (Debian 13, 6.18) guest kernels. Most of the GENET code is Sergey Kambalin's 2024 series (patchwork series 829638), carried forward with his authorship and Signed-off-by kept. v3: thanks to Peter for the review (and for running it under UBSan), and to Philippe. - Fix the UB Peter found by running "make check-functional" under clang's UBSan: bcm2838_genet_rdma() built the per-packet status block by casting the (misaligned) RX buffer to a C struct. It now fills the status block in with stl_le_p(), which is also correct on big-endian hosts. The functional tests now run clean under --enable-ubsan. - Fold the three bugfix patches that were in v2 (PHY autonegotiation restart, RX checksum reporting, TX ring activation check) into the patches that introduce the code they fix: the MDIO patch, the TX path patch and the RX path patch respectively. The series goes from 19 patches to 16. Philippe's Reviewed-by on the old "fix TX ring activation check" patch is not carried over, since that change now lives inside the TX path patch. - While in bcm2838_genet_rdma() I also found that the RX descriptor index and the DMA write length come from guest-programmed registers and were not checked against the size of the descriptor array / our packet buffer. Add those checks (in the RX path patch). - Rebased on current master (7e8d3c7fc4). This conflicts trivially (three files: raspi4b.c and bcm2838_peripherals.[ch]) with the RNG200/thermal sensor series ("[PATCH v2 0/5] hw/arm/raspi4b: RNG200 and thermal sensor"), which is posted separately. Whichever lands second, I will rebase. Tested: checkpatch.pl reports no errors; the series builds on current master and tests/functional/aarch64/test_raspi4.py passes, including under clang --enable-ubsan; and unmodified Raspberry Pi OS Bullseye and Trixie based images boot under raspi4b with a working network (DHCP, ping, 2MB downloads) and SSH. Marcelo Manzo (7): hw/arm/bcm2838_pcie: add BCM2838 PCIe Root Complex hw/arm/bcm2838_pcie: add BCM2838 PCIe host hw/arm/bcm2838: enable BCM2838 PCIe host bridge hw/net/bcm2838_genet: add GENET stub device hw/arm/bcm2838: enable BCM2838 GENET controller docs/system/arm/raspi: move PCIe/GENET from missing to implemented tests/functional/aarch64: add raspi4b GENET networking test Sergey Kambalin (9): hw/net/bcm2838_genet: add GENET register structs, part 1/4 hw/net/bcm2838_genet: add GENET register structs, part 2/4 hw/net/bcm2838_genet: add GENET register structs, part 3/4 hw/net/bcm2838_genet: add GENET register structs, part 4/4 hw/net/bcm2838_genet: add GENET register access macros hw/net/bcm2838_genet: implement GENET register ops hw/net/bcm2838_genet: implement GENET MDIO hw/net/bcm2838_genet: implement GENET TX path hw/net/bcm2838_genet: implement GENET RX path docs/system/arm/raspi.rst | 6 +- hw/arm/bcm2838.c | 15 + hw/arm/bcm2838_pcie.c | 308 ++++++ hw/arm/bcm2838_peripherals.c | 46 + hw/arm/meson.build | 4 +- hw/arm/raspi4b.c | 2 - hw/arm/trace-events | 4 + hw/net/bcm2838_genet.c | 1136 +++++++++++++++++++++++ hw/net/meson.build | 2 + hw/net/trace-events | 16 + include/hw/arm/bcm2838_pcie.h | 75 ++ include/hw/arm/bcm2838_peripherals.h | 7 + include/hw/net/bcm2838_genet.h | 428 +++++++++ tests/functional/aarch64/test_raspi4.py | 30 + 14 files changed, 2074 insertions(+), 5 deletions(-) create mode 100644 hw/arm/bcm2838_pcie.c create mode 100644 hw/net/bcm2838_genet.c create mode 100644 include/hw/arm/bcm2838_pcie.h create mode 100644 include/hw/net/bcm2838_genet.h -- 2.55.0