From nobody Fri Apr 4 06:10:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1742304887; cv=none; d=zohomail.com; s=zohoarc; b=VQiTB3qDK7Ul4cbkODd5JoMnlI8dN/kZkQTmYDd1duno35tHFYc4moXQhAhZCKqIXWdC+22WNF/JvK2eIJsraNZXfx8vHkdSZQpkjSZXrXv3TIiEfK64SzjlT4wRZ5E5GXx0QEQu1P5uOxnKdE3vUtUw9QNRSnXneQYeqiQF0hU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742304887; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uXgguamS/88zT4sb5yhR3Coxq4Lng1O5rbRFwYp/Un8=; b=bhiizJ8ly8TIpvazF1VFLwMVGP420MXeZASCr1w7Qd9TP5Y7AHbN6ArLZZtnD6F/gpXLefXZkHPO1xyYUz7Zi0OpxgFSnKPsp+fXJCx4DsRBJwKK1Jja9NNDkK7Y6HFlQ15iavX+0ItPEIUg13uEHyOyr5LZfLQSXeACuHtDE2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1742304887731683.7720502627001; Tue, 18 Mar 2025 06:34:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tuWhw-0007T6-PM; Tue, 18 Mar 2025 09:10:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tuWhn-00077R-2H; Tue, 18 Mar 2025 09:10:05 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tuWhk-0003KR-GZ; Tue, 18 Mar 2025 09:10:01 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-ac25d2b2354so956375166b.1; Tue, 18 Mar 2025 06:09:58 -0700 (PDT) Received: from corvink-nb.beckhoff.com ([195.226.174.194]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3147f3101sm850678066b.69.2025.03.18.06.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Mar 2025 06:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742303397; x=1742908197; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uXgguamS/88zT4sb5yhR3Coxq4Lng1O5rbRFwYp/Un8=; b=R9o6ebsbhkP9cLWOYzX4g5UNnY3sYBbKu4KAB7bK/mZb+rq2AmFjfNlYhk4r4S99cq bMqtYa5ok/mKEsMIS3Au/Nu/wfejOMYvX2mXEhD1TVkCWK5DzjiP3m42HTipFrmIM6SK ZOac1/cuFaz3hXmoLT5297owLVoxT7ws84mN9Ltj2+d3HwHBUt6M4OO4Bzz+fhGb0mEU uxqCNEkO9IoYDz31TPFZwwG+XpLnnHYbrLqE5boeFGGYLbZaU+Dif7M41kh4eMZ/MEQ4 zMTdxJTQYyzGP2jJ/eszVZo5zYhzk93MO1uvl1/BvFIOhRhVG9M2+IvLIxC/4qqTD+aS zpVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742303397; x=1742908197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uXgguamS/88zT4sb5yhR3Coxq4Lng1O5rbRFwYp/Un8=; b=unfc83ZhUBBaqJzZsMEqYFzlMULN7MzUPSBdtLX4vAIszfRuJxlk1cefDVMd1p2/Ag DL27nwrxyLc580+Y68OjK5pgn7SJSjJFa3gnfytEcZXEWMc/fHsINsxW2XODO1c/wbfp kOaDmcUeItqN8atnIcZDFKO8iOVS6aEQPtichnxOAgxAu4/Pa3pZK0II+2yp6W66sGjq It6LLmbD2O3DpXIXGqPRK9L3+Kv2fwYvQ6dM0s16iQvoXWomPoVvWyfrXPnLXIbRdQ+G qa6wg2rz0g+NCHOCA/3BsgGOv3CrCUv38dbF41upJHQ+z2tiZKbBMgxSYXPjY2KIroPR 1OfQ== X-Forwarded-Encrypted: i=1; AJvYcCUT9nRpbhCCvekZQvyCdgYXJAWKKX/v6myOfrXOjy7w0fzYgw8V3iKfSqJ0ln/kbwUy/NOfuP4yWA==@nongnu.org X-Gm-Message-State: AOJu0Yxrn8J9vAdR5PYClOI6+pQN3MuDcEfBCqrweSLGcUpg3RxfpbOU jO+pFvg44iHCXD9nhnTslh0MMbcYlMzYu/C6NeyWl8qhx/+v55EyknOxDzql X-Gm-Gg: ASbGncvCeKe5DSWQzbh1nt2wg8MzMGPTHeTiQOlBFzgQQkCfPOq3+j4MxYJtxiURJHH U+U4Gd+h11ChbOoCtBmF7cgm7GF2ukQdRWbXrs/nVj3Y09049Awrx2Uef8lqp/3BFwUXb5bn8Z0 5C1+v2EvDxi2du6l5sirEMx/bmnCM9NwpJqlOuKfpo86Ybe4T8k2YiMFHFsMBejcotnAplhDb63 TZKBg7QLD+h3DrAg4C9XrnX+qPzsqcx9xluurh/l3beRyv6pTWxVdEvOB6F6FkAnuKasgcpBZ0V i410SlNddAjCQKyyLfAaiGEA7V8GlBGn3VQ29+nD1IFxjiU5HxP3fdjmzLxoGTkw479C2nDSkIQ pbA== X-Google-Smtp-Source: AGHT+IEUHCao1moDe4xUw1JRQqtzI2KYGrcDyrTPXHrOUnbQQlbrcxN18uKXc08Ao4MDif8gNNFUhQ== X-Received: by 2002:a17:907:2d89:b0:abf:6cc9:7ef5 with SMTP id a640c23a62f3a-ac3304d6079mr1804692866b.47.1742303393389; Tue, 18 Mar 2025 06:09:53 -0700 (PDT) From: =?UTF-8?q?Corvin=20K=C3=B6hne?= To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: =?UTF-8?q?Yannick=20Vo=C3=9Fen?= , "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , =?UTF-8?q?Corvin=20K=C3=B6hne?= , Paolo Bonzini , YannickV Subject: [PATCH 03/21] hw/dma/zynq-devcfg: Handle bitstream loading via DMA to 0xffffffff Date: Tue, 18 Mar 2025 14:07:54 +0100 Message-ID: <20250318130817.119636-4-corvin.koehne@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250318130817.119636-1-corvin.koehne@gmail.com> References: <20250318130817.119636-1-corvin.koehne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=corvin.koehne@gmail.com; helo=mail-ej1-x630.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1742304889323019000 From: YannickV A DMA transfer to destination address `0xffffffff` should trigger a bitstream load via the PCAP interface. Currently, this case is not intercepted, causing loaders to enter an infinite loop when polling the status register. This commit adds a check for `0xffffffff` as the destination address. If detected, the relevant status register bits (`DMA_DONE`, `DMA_P_DONE`, and `PCFG_DONE`) are set to indicate a successful bitstream load. If the address is different, the DMA transfer proceeds as usual. A successful load is indicated but nothing is actually done. Guests relying on FPGA functions are still known to fail. This feature is required for the integration of the Beckhoff CX7200 model. Signed-off-by: Yannick Vo=C3=9Fen --- hw/dma/xlnx-zynq-devcfg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/dma/xlnx-zynq-devcfg.c b/hw/dma/xlnx-zynq-devcfg.c index 0fd0d23f57..b838c1c0d0 100644 --- a/hw/dma/xlnx-zynq-devcfg.c +++ b/hw/dma/xlnx-zynq-devcfg.c @@ -247,7 +247,14 @@ static uint64_t r_lock_pre_write(RegisterInfo *reg, ui= nt64_t val) static void r_dma_dst_len_post_write(RegisterInfo *reg, uint64_t val) { XlnxZynqDevcfg *s =3D XLNX_ZYNQ_DEVCFG(reg->opaque); - + if ((s->regs[R_DMA_DST_ADDR]) =3D=3D 0xffffffff) { + DB_PRINT("bitstream loading detected\n"); + s->regs[R_INT_STS] |=3D R_INT_STS_DMA_DONE_MASK | + R_INT_STS_DMA_P_DONE_MASK | + R_INT_STS_PCFG_DONE_MASK; + xlnx_zynq_devcfg_update_ixr(s); + return; + } s->dma_cmd_fifo[s->dma_cmd_fifo_num] =3D (XlnxZynqDevcfgDMACmd) { .src_addr =3D s->regs[R_DMA_SRC_ADDR] & ~0x3UL, .dest_addr =3D s->regs[R_DMA_DST_ADDR] & ~0x3UL, --=20 2.49.0