From nobody Tue Feb 10 21:59:20 2026 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1619740630; cv=none; d=zohomail.com; s=zohoarc; b=bP9AbEwN3OezH5sqpQsQpn1eOVLsOwF37OP/LEDvyWviOJC1GzvBo9xFbZeP2mrWtlF9OWwOURNGjlztflrLd9vmO2NkC2hHcnd9Otz21d8QzDp6TqjVowiIBzpdFYeZ+anQn3l9CKevDThvPYmqBo6zH/YtEPWzKVp8WykkJfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619740630; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dDFLsvyLe8lLl4nZKmWov7o0SG/Q1sJrDdZtdR5zH+8=; b=MVNVANwOK3Sdxeq07mywQ3UYFLle+W7Ws65NcKj/3F9QzqqWxmbfsL3MszV1AC+AtgxLBHF3v9AB6JHbNGpVDADoD5GGCxpBdVV7CbgdvYmdfzMpawS+NpeGW0Nb2xRYzfRxc4WNXJH/mQCHCmRQ51lzvFIPaNBEje4HOdQC0+o= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619740630505240.80691500770376; Thu, 29 Apr 2021 16:57:10 -0700 (PDT) Received: from localhost ([::1]:59158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcGWr-0004Mc-BE for importer@patchew.org; Thu, 29 Apr 2021 19:57:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcGIX-0005oo-J3 for qemu-devel@nongnu.org; Thu, 29 Apr 2021 19:42:21 -0400 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:35394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcGIJ-0004Lo-W3 for qemu-devel@nongnu.org; Thu, 29 Apr 2021 19:42:21 -0400 Received: by mail-qv1-xf2f.google.com with SMTP id x27so33562240qvd.2 for ; Thu, 29 Apr 2021 16:42:07 -0700 (PDT) Received: from localhost.localdomain (bras-base-stsvon1503w-grc-23-174-92-28-28.dsl.bell.ca. [174.92.28.28]) by smtp.googlemail.com with ESMTPSA id i2sm1093229qtg.0.2021.04.29.16.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 16:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dDFLsvyLe8lLl4nZKmWov7o0SG/Q1sJrDdZtdR5zH+8=; b=cnaujSaPfcR1GI6Z8zxIMCM+SUW1m97SeIXz6RV6Hr0/Lf5TnpzTsGVBTxQ28XlQtE cxCmPTiMzGoonzV7dGn8PjevamThtuTmsLenG+mJnaoKJ+0sKomL1x6eLZ2SvHJK/TGy Ui26wbb2jDxb+EOsLkU7aU+Da4u2mL1IGUDSuS/0Xq945IJkxJby9ZLNoCa1zKWqQT18 S/txKArZ+dFa3IJJ1TZ2h6FN4zionv2QInHZ+9R+xiH3EZp3l0R/TIpBKrhMLgH2RoUI kB3/WpVr9QISkTiV21pVOloto3ADW5CXUmX3AptJTYCSJBel3OKWrh8Id4yLm+r5QBvP 59Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dDFLsvyLe8lLl4nZKmWov7o0SG/Q1sJrDdZtdR5zH+8=; b=DsUH53lc+BYodAZ3krCC8vr5iEmkflTI4T5FnM3n7HTEzNv6WWTIwIypiZVUwGefWj Y2B1E8BBZXPlnr1is/BioC75ndH0xp6bRMCUuiO/zpBYnyTSj4/iiU6sHV+GYoOvyvu4 p39Kjyqj/R+MG3y0CLPR5yt9zFroPf/T4k7qUmSIVsONsYrOwL1Aslh52kipFDi5xh2b QKCac9sKvJqsLhy6fo5BDEVvHibaAHpUPptqBpJbCwurBtgAp/QcuswwxlT9qN8ymDSB ch5myVWEcHIt38MTvGwDZB50W3y2Mum68oiw7PkriIm10kMSH5kfnqhrHX7Zomi3aZvm +x1A== X-Gm-Message-State: AOAM531xWmgOph+8XtI7xD95cc7ALX1xSJJFH+0lN8gFPO+wKeYqIXRh VLLZ1aNARy98DLdAZlAM+RGOlQ== X-Google-Smtp-Source: ABdhPJz7GFWh7vpI6T0fALzvtJH8kQOxk9gOrGvXYpcBjEpwJL5WsH1M5FuaRlg06l+KECSD18QZ3w== X-Received: by 2002:ad4:41c6:: with SMTP id a6mr2314549qvq.56.1619739727073; Thu, 29 Apr 2021 16:42:07 -0700 (PDT) From: Shashi Mallela To: peter.maydell@linaro.org, leif@nuviainc.com, rad@semihalf.com Subject: [PATCH v3 7/8] hw/arm/sbsa-ref: add ITS support in SBSA GIC Date: Thu, 29 Apr 2021 19:42:00 -0400 Message-Id: <20210429234201.125565-8-shashi.mallela@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210429234201.125565-1-shashi.mallela@linaro.org> References: <20210429234201.125565-1-shashi.mallela@linaro.org> MIME-Version: 1.0 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=2607:f8b0:4864:20::f2f; envelope-from=shashi.mallela@linaro.org; helo=mail-qv1-xf2f.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Included creation of ITS as part of SBSA platform GIC initialization. Signed-off-by: Shashi Mallela Reviewed-by: Peter Maydell --- hw/arm/sbsa-ref.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 88dfb2284c..d05cbcae48 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -35,7 +35,7 @@ #include "hw/boards.h" #include "hw/ide/internal.h" #include "hw/ide/ahci_internal.h" -#include "hw/intc/arm_gicv3_common.h" +#include "hw/intc/arm_gicv3_its_common.h" #include "hw/loader.h" #include "hw/pci-host/gpex.h" #include "hw/qdev-properties.h" @@ -65,6 +65,7 @@ enum { SBSA_CPUPERIPHS, SBSA_GIC_DIST, SBSA_GIC_REDIST, + SBSA_GIC_ITS, SBSA_SECURE_EC, SBSA_GWDT, SBSA_GWDT_REFRESH, @@ -108,6 +109,7 @@ static const MemMapEntry sbsa_ref_memmap[] =3D { [SBSA_CPUPERIPHS] =3D { 0x40000000, 0x00040000 }, [SBSA_GIC_DIST] =3D { 0x40060000, 0x00010000 }, [SBSA_GIC_REDIST] =3D { 0x40080000, 0x04000000 }, + [SBSA_GIC_ITS] =3D { 0x44090000, 0x00020000 }, [SBSA_SECURE_EC] =3D { 0x50000000, 0x00001000 }, [SBSA_GWDT_REFRESH] =3D { 0x50010000, 0x00001000 }, [SBSA_GWDT_CONTROL] =3D { 0x50011000, 0x00001000 }, @@ -378,7 +380,20 @@ static void create_secure_ram(SBSAMachineState *sms, memory_region_add_subregion(secure_sysmem, base, secram); } =20 -static void create_gic(SBSAMachineState *sms) +static void create_its(SBSAMachineState *sms) +{ + DeviceState *dev; + + dev =3D qdev_new(TYPE_ARM_GICV3_ITS); + SysBusDevice *s =3D SYS_BUS_DEVICE(dev); + + object_property_set_link(OBJECT(dev), "parent-gicv3", OBJECT(sms->gic), + &error_abort); + sysbus_realize_and_unref(s, &error_fatal); + sysbus_mmio_map(s, 0, sbsa_ref_memmap[SBSA_GIC_ITS].base); +} + +static void create_gic(SBSAMachineState *sms, MemoryRegion *mem) { unsigned int smp_cpus =3D MACHINE(sms)->smp.cpus; SysBusDevice *gicbusdev; @@ -405,6 +420,10 @@ static void create_gic(SBSAMachineState *sms) qdev_prop_set_uint32(sms->gic, "len-redist-region-count", 1); qdev_prop_set_uint32(sms->gic, "redist-region-count[0]", redist0_count= ); =20 + object_property_set_link(OBJECT(sms->gic), "sysmem", OBJECT(mem), + &error_fatal); + qdev_prop_set_bit(sms->gic, "has-lpi", true); + gicbusdev =3D SYS_BUS_DEVICE(sms->gic); sysbus_realize_and_unref(gicbusdev, &error_fatal); sysbus_mmio_map(gicbusdev, 0, sbsa_ref_memmap[SBSA_GIC_DIST].base); @@ -451,6 +470,7 @@ static void create_gic(SBSAMachineState *sms) sysbus_connect_irq(gicbusdev, i + 3 * smp_cpus, qdev_get_gpio_in(cpudev, ARM_CPU_VFIQ)); } + create_its(sms); } =20 static void create_uart(const SBSAMachineState *sms, int uart, @@ -763,7 +783,7 @@ static void sbsa_ref_init(MachineState *machine) =20 create_secure_ram(sms, secure_sysmem); =20 - create_gic(sms); + create_gic(sms, sysmem); =20 create_uart(sms, SBSA_UART, sysmem, serial_hd(0)); create_uart(sms, SBSA_SECURE_UART, secure_sysmem, serial_hd(1)); --=20 2.27.0