From patchwork Fri Sep 8 17:05:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 720840 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp883987wrp; Fri, 8 Sep 2023 10:08:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFX7qGAz6QYzYzWRSDEuM2BFdP6EaXCWTc7rcipCleZb4Y0/Yxtx6p2Ba7HGSxezS+Ro8Ob X-Received: by 2002:a05:622a:389:b0:40f:efce:dcf with SMTP id j9-20020a05622a038900b0040fefce0dcfmr3285703qtx.16.1694192883363; Fri, 08 Sep 2023 10:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694192883; cv=none; d=google.com; s=arc-20160816; b=JJ7JVLfHORgC3I6gkNUrtx85Hv2CuYk88TfUxyEdX0BuWMR0udZTYvZkIihc16W66L sqNNdzgpDzx01mT2RND/0XaztcTY0vC2m8Xp7iQe7dYzh09WikJLDtmXaXae2yxi2qpI /qNKJMIlKzrofFxBmRwX9SaymXoYsGKDS8qx6wlMnog6jf8w2I81qSBfxHFC5MWtiLrL 1rERJCbxsBhIZulCX/kxXXRVKOxFTehQlXceamE08fSuJL1AOuUPz/0yP4/1QZ5vdzqo aWQISWztzH8dGZA0H7N9eLX7FnztU/S8UdMn4MVe/vg6iJTwvVRN3/qmo9z9B1XTwzlo /ZWQ== 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:to:from :dkim-signature; bh=Zq/Xlrf/IOJj6h04N8OXZ/q/RCC8epF+d2GRuUewdWM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=p7xyqrT4yDJdXZ+ZFFMwa7elTEU2tNFBPma2/ow/4V5BX063A/+uWx5ERwmO18WbG+ onSYd5PzAq8gICfIiLFGZTZHp+ysisZEY5wt3sSDuTgtbMyefdDzYM6UjvQyHJC/0CYy pqdLEMmOJzOz+y9eK/BV6LYvuSauZOqAcNALOx2paaRepAdA5I0L1E1jnUAoERrIFesF lf+ZECQm4eO7oQLIcSCRQ2jfa7qZLoYt9RcrupUvwfK4ssnZ0JO92QR2PXyeylybKOtr v/j5Z9IvuvWcyaAxxXVezcDYoQZ5k5CziMUuKj/yr9u5C0+5yL9Cfu8cm5piNUEyGNv/ BjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Qo3q/pO8"; 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 o15-20020ac87c4f000000b004120bfe05fasi1394986qtv.407.2023.09.08.10.08.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Sep 2023 10:08:03 -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="Qo3q/pO8"; 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 1qeew6-0005WB-1i; Fri, 08 Sep 2023 13:06:26 -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 1qeew4-0005VJ-NR for qemu-devel@nongnu.org; Fri, 08 Sep 2023 13:06:24 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeevq-000192-N8 for qemu-devel@nongnu.org; Fri, 08 Sep 2023 13:06:24 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31dca134c83so2174888f8f.3 for ; Fri, 08 Sep 2023 10:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694192768; x=1694797568; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Zq/Xlrf/IOJj6h04N8OXZ/q/RCC8epF+d2GRuUewdWM=; b=Qo3q/pO8SMw/ggJQfxqxqRZOGX/Yla8w1tqXYu28QWpKak5KM9mWTQWTm5XYhWy0nZ lDmPOZwePSFPUqHknzq5RoBYE8Z9GUBnOdyAu0WoWY2ZlbIX11E+lv6cWCfnOndvzVqH IzIBu5bqFECBla3s8iDGhoNit4raGz3QuJQ56ZkA9G8h7c6YO/xdQ25Lcexfv+sRP+Qq Nca+v5/9kZzsYTMfa3CPqewBZFc8KjCfgmO8h5h9oPPcPIMadtLlV32z80DWMoavk31q n22Hl8xiWCfC9z4Po4+NtH8PEFlLhaJkgSWEUPCqh65Cg1RoSPACXo8+IkNq8Mb3Vuma tjNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694192768; x=1694797568; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zq/Xlrf/IOJj6h04N8OXZ/q/RCC8epF+d2GRuUewdWM=; b=ieG2taI/oJrIWJ0/+3pAqxI0ANIi0en2LuEOnT9LgSxkoipUjTThm0hHG/oRAMN8aQ /Lx3Vf8sbf7uVPzkPf5uoFWQK4IY1QBKT3a20yh7+DJ5R4QQDlF1yPzAQ07dUCeNCGv1 YOaxQqqqBkSeA8T5E8Fq8iDJ5FL+v8l4DQUxTWxKL+P3JPXVCTvjl5FJAno1/LuNyF7B irPDZceRLYytCadhLmwIpmiuUnoNinJAMgScGIK5ecRRFSAkiiURPaA5X9yVtj067006 jBSQEqEpVf+HGIhhqTzH+q65r+fxXu11q63srjTNG2wAh/yGJSljjDybCCCOdh6P5WpQ So3Q== X-Gm-Message-State: AOJu0YzmapRBK7yTiJVqZ54dXkeDc3jb/44mDqITn/XB60CfFAJOUGTs kIi2eqPBeTmO3unPf9AqD00wlUQh37VcqgJcDFY= X-Received: by 2002:adf:fa51:0:b0:319:6896:6e8e with SMTP id y17-20020adffa51000000b0031968966e8emr2792405wrr.62.1694192768213; Fri, 08 Sep 2023 10:06:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id d21-20020a1c7315000000b00400268671c6sm2427152wmb.13.2023.09.08.10.06.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 10:06:07 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/26] hw/arm/xlnx-versal: Connect the CFU_APB, CFU_FDRO and CFU_SFR Date: Fri, 8 Sep 2023 18:05:48 +0100 Message-Id: <20230908170557.773048-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230908170557.773048-1-peter.maydell@linaro.org> References: <20230908170557.773048-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Francisco Iglesias Connect the Configuration Frame Unit (CFU_APB, CFU_FDRO and CFU_SFR) to the Versal machine. Signed-off-by: Francisco Iglesias Acked-by: Edgar E. Iglesias Reviewed-by: Peter Maydell Message-id: 20230831165701.2016397-8-francisco.iglesias@amd.com Signed-off-by: Peter Maydell --- include/hw/arm/xlnx-versal.h | 16 ++++++++++++++ hw/arm/xlnx-versal.c | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 39ee31185c3..29b9c603010 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -32,6 +32,7 @@ #include "hw/misc/xlnx-versal-crl.h" #include "hw/misc/xlnx-versal-pmc-iou-slcr.h" #include "hw/net/xlnx-versal-canfd.h" +#include "hw/misc/xlnx-versal-cfu.h" #define TYPE_XLNX_VERSAL "xlnx-versal" OBJECT_DECLARE_SIMPLE_TYPE(Versal, XLNX_VERSAL) @@ -117,6 +118,9 @@ struct Versal { XlnxEFuse efuse; XlnxVersalEFuseCtrl efuse_ctrl; XlnxVersalEFuseCache efuse_cache; + XlnxVersalCFUAPB cfu_apb; + XlnxVersalCFUFDRO cfu_fdro; + XlnxVersalCFUSFR cfu_sfr; OrIRQState apb_irq_orgate; } pmc; @@ -147,6 +151,7 @@ struct Versal { #define VERSAL_GEM1_WAKE_IRQ_0 59 #define VERSAL_ADMA_IRQ_0 60 #define VERSAL_XRAM_IRQ_0 79 +#define VERSAL_CFU_IRQ_0 120 #define VERSAL_PMC_APB_IRQ 121 #define VERSAL_OSPI_IRQ 124 #define VERSAL_SD0_IRQ_0 126 @@ -240,6 +245,17 @@ struct Versal { #define MM_PMC_EFUSE_CACHE 0xf1250000 #define MM_PMC_EFUSE_CACHE_SIZE 0x00C00 +#define MM_PMC_CFU_APB 0xf12b0000 +#define MM_PMC_CFU_APB_SIZE 0x10000 +#define MM_PMC_CFU_STREAM 0xf12c0000 +#define MM_PMC_CFU_STREAM_SIZE 0x1000 +#define MM_PMC_CFU_SFR 0xf12c1000 +#define MM_PMC_CFU_SFR_SIZE 0x1000 +#define MM_PMC_CFU_FDRO 0xf12c2000 +#define MM_PMC_CFU_FDRO_SIZE 0x1000 +#define MM_PMC_CFU_STREAM_2 0xf1f80000 +#define MM_PMC_CFU_STREAM_2_SIZE 0x40000 + #define MM_PMC_CRP 0xf1260000U #define MM_PMC_CRP_SIZE 0x10000 #define MM_PMC_RTC 0xf12a0000 diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 60bf5fe657f..3f4b4b15600 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -570,6 +570,47 @@ static void versal_create_ospi(Versal *s, qemu_irq *pic) qdev_connect_gpio_out(orgate, 0, pic[VERSAL_OSPI_IRQ]); } +static void versal_create_cfu(Versal *s, qemu_irq *pic) +{ + SysBusDevice *sbd; + + /* CFU FDRO */ + object_initialize_child(OBJECT(s), "cfu-fdro", &s->pmc.cfu_fdro, + TYPE_XLNX_VERSAL_CFU_FDRO); + sbd = SYS_BUS_DEVICE(&s->pmc.cfu_fdro); + + sysbus_realize(sbd, &error_fatal); + memory_region_add_subregion(&s->mr_ps, MM_PMC_CFU_FDRO, + sysbus_mmio_get_region(sbd, 0)); + + /* CFU APB */ + object_initialize_child(OBJECT(s), "cfu-apb", &s->pmc.cfu_apb, + TYPE_XLNX_VERSAL_CFU_APB); + sbd = SYS_BUS_DEVICE(&s->pmc.cfu_apb); + + sysbus_realize(sbd, &error_fatal); + memory_region_add_subregion(&s->mr_ps, MM_PMC_CFU_APB, + sysbus_mmio_get_region(sbd, 0)); + memory_region_add_subregion(&s->mr_ps, MM_PMC_CFU_STREAM, + sysbus_mmio_get_region(sbd, 1)); + memory_region_add_subregion(&s->mr_ps, MM_PMC_CFU_STREAM_2, + sysbus_mmio_get_region(sbd, 2)); + sysbus_connect_irq(sbd, 0, pic[VERSAL_CFU_IRQ_0]); + + /* CFU SFR */ + object_initialize_child(OBJECT(s), "cfu-sfr", &s->pmc.cfu_sfr, + TYPE_XLNX_VERSAL_CFU_SFR); + + sbd = SYS_BUS_DEVICE(&s->pmc.cfu_sfr); + + object_property_set_link(OBJECT(&s->pmc.cfu_sfr), + "cfu", OBJECT(&s->pmc.cfu_apb), &error_abort); + + sysbus_realize(sbd, &error_fatal); + memory_region_add_subregion(&s->mr_ps, MM_PMC_CFU_SFR, + sysbus_mmio_get_region(sbd, 0)); +} + static void versal_create_crl(Versal *s, qemu_irq *pic) { SysBusDevice *sbd; @@ -763,6 +804,7 @@ static void versal_realize(DeviceState *dev, Error **errp) versal_create_pmc_iou_slcr(s, pic); versal_create_ospi(s, pic); versal_create_crl(s, pic); + versal_create_cfu(s, pic); versal_map_ddr(s); versal_unimp(s);