From patchwork Thu Oct 19 21:18:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 735621 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1731355wro; Thu, 19 Oct 2023 14:24:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbe6i4zOChxmmBJcASRQMgcWGzWFQ5F5MCZa2j/dybdlGML/8dr3BQcjACke+3Hv9ghWJM X-Received: by 2002:a9d:73d2:0:b0:6c0:9e24:6eab with SMTP id m18-20020a9d73d2000000b006c09e246eabmr3996925otk.33.1697750658591; Thu, 19 Oct 2023 14:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697750658; cv=none; d=google.com; s=arc-20160816; b=X8D+lFwesdnH7ioim8up1f9jzMrVJEG0ZrKuYfxQ7hTJqTW6LsavJB/tZGqN+vJbUP l3ruD4oZbOf+p8vM0kA3I60JtK3mEetkgmj92HdTw2z7SKAs1RXamhFwkpyt0mdYAZRg t/3UTRTXsdxEbCY7DD2KER39Vv30NLX4p0/eAAvGVLgJ84rLCps5ofMLswYJh9ykhEJH 9m3Yhc+FbGNMvCFMkcAi/rBDLg0JSR+pPr+YvSuODxlWB9go/OSi30pbGB0M2Ktv60QW sqvc5f46AyGI5VwJFr7LivgpNkHRCjI9QxNoHRBX38pWEprZ9eC9jO23Kn2nQhIW7nkw 6X3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e1KVZlIcRQGW0XDbXXS/PkAkK9AJc9io1ITINi4/pEc=; fh=em90avnwZxAZh3y74ofYEsa5+N2lx1xWbpCcLvXEFo0=; b=hvidLMyaLdNlC0nPtrtmFewZzi+/USGEK56W70E9t1RarNKGm06T4oG8tXQJgCSvsl 7VZPV5ya6GzMfCKOe2XsXJxPeTNbXYjSwPxe9FWYosYR2ia8urFBs022QwkrAfaMy/52 BHGNbRi/hpKQ0b6VuhO0ARntct5SQGuRJHz+zN1bcS6xkdO24TUSySqk7XioaKG8MJC+ v7qXyCAspG1aMNMymTG0CQQ58we+Nyh1ByGSwAV7UD5gUGb9RAuL7Xv4KfKcymBE9V1R NcM2o67As7TkgzE7RK7/Hk99VeGm+bWtMnPPjDtS7nVakNRUh+Y4f+TB+xg5ksLE17LG RsKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlyfPiR7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id pg2-20020a0562144a0200b0066cfc2c8139si381746qvb.377.2023.10.19.14.24.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 14:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlyfPiR7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtaU8-0007CR-R1; Thu, 19 Oct 2023 17:23:16 -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 1qtaU6-00073y-Id for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:23:14 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtaU3-0001gG-JI for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:23:14 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-406609df1a6so970445e9.3 for ; Thu, 19 Oct 2023 14:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697750589; x=1698355389; 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=e1KVZlIcRQGW0XDbXXS/PkAkK9AJc9io1ITINi4/pEc=; b=PlyfPiR73/l+jcLWpe2OTLzyWqY4ayVQxyCkR2aPsQCahvDUgqwbQuxQhe0nvSNSaN yp+eRb35uJWdzyn4NV0g8VvV2oxdtrV4h1CqKjYy/5dYH4cipUaVJq9nRebKhHUvZg// CLBGNOOyZUI8GiRN8d09iJ17FUQX0Wk3GOaTlTyHJDjwRjo7QsnxJHI90uRLERH/TWg/ 6uuYWWc7zoduTeSqDil1pRXYeOtGbh3gh8vP1Tb5Z08nYXTKWMurgSHIGrrrmDSEbbq/ lAJhIWRPpYJlHjmQg3CSM5dyv04P+Ul/MSZXrZicInrHUGSuPTauS8CqVBMtRtxRPFhm t6Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697750589; x=1698355389; 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=e1KVZlIcRQGW0XDbXXS/PkAkK9AJc9io1ITINi4/pEc=; b=Kx0jeYZos50CCoM+C7Kn+o95Oz49U08cvTMCKPHKNMpU3BLiOEhWkvIm/LjQXH7hbH WgLRzxYHDkKrEzjH4m15bKDr2aiTJUUJ9GD+4BBsUShIEwYdP+Bq7Pc6+4H3gNFOodQ6 GCLPDP3bCAuxCdutPowWQdrPntVppMPVr1UVfG/9dWyw/9wwXaSjyQYO/5bnjNSuR0EO zGqjQHEDmfD5ZL/eveiEy5nEL3EwIWzneLn5FSmcLYVO8IaMwno8zciK+OlJXJ9Kbae5 e1pjt5XbGhpp3aVDD+q4WlaNR5QQuYVHpO6uPIlhGmIS+l+16uNtTN1+DW1/R0JxEWxn JHaQ== X-Gm-Message-State: AOJu0YyDLCyDCxzTd0zTzpBuqyyUBChUAVSkrJpiWSPdtF/2GO8GE/IM INCHKShxquU6oErkMrHUG6Jg+0vVjlvUVcL3gOp+hA== X-Received: by 2002:a05:600c:4446:b0:407:7e5f:ffb9 with SMTP id v6-20020a05600c444600b004077e5fffb9mr34692wmn.9.1697750589715; Thu, 19 Oct 2023 14:23:09 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id o12-20020a05600c4fcc00b0040775501256sm530184wmq.16.2023.10.19.14.23.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 14:23:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , "Edgar E. Iglesias" , Alistair Francis , Peter Maydell Subject: [PULL 44/46] hw/dma: Declare link using static DEFINE_PROP_LINK() macro Date: Thu, 19 Oct 2023 23:18:09 +0200 Message-ID: <20231019211814.30576-45-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019211814.30576-1-philmd@linaro.org> References: <20231019211814.30576-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Declare link statically using DEFINE_PROP_LINK(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Message-Id: <20231017140150.44995-6-philmd@linaro.org> --- hw/dma/xilinx_axidma.c | 6 ++---- hw/dma/xlnx-zdma.c | 7 ++----- hw/dma/xlnx_csu_dma.c | 13 ++++--------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 12c90267df..0ae056ed06 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -577,10 +577,6 @@ static void xilinx_axidma_init(Object *obj) object_initialize_child(OBJECT(s), "axistream-control-connected-target", &s->rx_control_dev, TYPE_XILINX_AXI_DMA_CONTROL_STREAM); - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); sysbus_init_irq(sbd, &s->streams[0].irq); sysbus_init_irq(sbd, &s->streams[1].irq); @@ -596,6 +592,8 @@ static Property axidma_properties[] = { tx_data_dev, TYPE_STREAM_SINK, StreamSink *), DEFINE_PROP_LINK("axistream-control-connected", XilinxAXIDMA, tx_control_dev, TYPE_STREAM_SINK, StreamSink *), + DEFINE_PROP_LINK("dma", XilinxAXIDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c index 4eb7f66e9f..84c0083013 100644 --- a/hw/dma/xlnx-zdma.c +++ b/hw/dma/xlnx-zdma.c @@ -795,11 +795,6 @@ static void zdma_init(Object *obj) TYPE_XLNX_ZDMA, ZDMA_R_MAX * 4); sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq_zdma_ch_imr); - - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); } static const VMStateDescription vmstate_zdma = { @@ -817,6 +812,8 @@ static const VMStateDescription vmstate_zdma = { static Property zdma_props[] = { DEFINE_PROP_UINT32("bus-width", XlnxZDMA, cfg.bus_width, 64), + DEFINE_PROP_LINK("dma", XlnxZDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 88002698a1..e89089821a 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -702,6 +702,10 @@ static Property xlnx_csu_dma_properties[] = { * which channel the device is connected to. */ DEFINE_PROP_BOOL("is-dst", XlnxCSUDMA, is_dst, true), + DEFINE_PROP_LINK("stream-connected-dma", XlnxCSUDMA, tx_dev, + TYPE_STREAM_SINK, StreamSink *), + DEFINE_PROP_LINK("dma", XlnxCSUDMA, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), }; @@ -728,15 +732,6 @@ static void xlnx_csu_dma_init(Object *obj) memory_region_init(&s->iomem, obj, TYPE_XLNX_CSU_DMA, XLNX_CSU_DMA_R_MAX * 4); - - object_property_add_link(obj, "stream-connected-dma", TYPE_STREAM_SINK, - (Object **)&s->tx_dev, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); - object_property_add_link(obj, "dma", TYPE_MEMORY_REGION, - (Object **)&s->dma_mr, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_STRONG); } static const TypeInfo xlnx_csu_dma_info = {