From patchwork Thu Apr 1 02:41:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shashi Mallela X-Patchwork-Id: 413543 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp179440jai; Wed, 31 Mar 2021 19:44:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJzCw76aP1KQNnaSJuj2HGAwXasS2Fl3RzNR4vwEqvBUtZNo5W4disfuBoSb4zR/QqGcby X-Received: by 2002:a05:6830:c1:: with SMTP id x1mr5186381oto.87.1617245096060; Wed, 31 Mar 2021 19:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617245096; cv=none; d=google.com; s=arc-20160816; b=j1vXdOBKrQyrPrFDDA74y8ltwJ+KK3PoknulwRuyiTJ8wM8lZIrTI72UOzpBataRUh XahGJ6xeZAtkNpKrG8yO6lDouc4wx5DCJaONmgswmpb+byvcn7v2hJiy26os6ebWQIsg X3j6s5/jURYTwQL9YJBk2XOa7ieF6CtagPSeeyZPgqH9MzCDI2vc6D3njXdjE1krp7Rh onTqqQDUj5Ymsc69k/1OCVBqQbPbjOmgkUmtfYEzKBnjP9VCSq4xzNQfVDesZtJqLU7H vwowABH3ODivp2P3FYstFhbk9Z5/9HwVI2gGyw1XNE7IJOWH4fYD543BHuMernFUlNag Eu1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=dDFLsvyLe8lLl4nZKmWov7o0SG/Q1sJrDdZtdR5zH+8=; b=0drvOZvP3l0eg8QF5QcFuniyfCH0n9/XUVdK8kohpsHBMIUSvt9gAQ1+PfN+ANHiIm js0ZkeXyOP0FjD9kcvp9SVCesGT0W1J4dyv/dSUMV5PQLx9vZig1fuGmO8uUG/kc0rxQ lZx8nXH+0k7IOhHGWXhp5/kVp75OU0gy1twXhq4uakoxd54prtQpT4GEafSKiQFLEBzV Ea6sDdI0GsAMkcvLzZhIBO0GC1fo3hBylzKIs4Q+qdpCyH+UqR0YWyceKb7pVJs/1oJW pDUL5UwrYJaoQ2u0DGn5B7bGpe5B/MiLXpn7jGZ/WuIpU3Qsv6PLSAiQnDKBeCGzeu4+ nKRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=InR1Q00O; 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 t128si3476077oib.68.2021.03.31.19.44.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Mar 2021 19:44:56 -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=InR1Q00O; 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]:48130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRnKJ-0006IC-BX for patch@linaro.org; Wed, 31 Mar 2021 22:44:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRnHZ-0002p3-J5 for qemu-devel@nongnu.org; Wed, 31 Mar 2021 22:42:05 -0400 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:35367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRnHU-0003BZ-C2 for qemu-devel@nongnu.org; Wed, 31 Mar 2021 22:42:05 -0400 Received: by mail-qk1-x730.google.com with SMTP id i9so924218qka.2 for ; Wed, 31 Mar 2021 19:41:59 -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=InR1Q00OkWFeCk7332+QyLnJG2pqndgyUXZKQX3bQF4ied5UYxs8QQXyVXrItiF4KX ezO2oGXXuQpobrKdtJqq9FhKi6pG9BzQohxy6qMQatauVPRexlTb6lkBAadD6tQt69Cd uKEfHjFqnb4Ol/Tp5uL/MCmglgxrhMK79bRMF/jiFLvVw88gqlg88d/NrtltyqLejYuf SBUi4PqqQUqO/0OUx4F9n1qJrxgEo4CZSMcH1RKZg11JVXKZDTU+tNAADYRNsAzaTwaP hNTqRPVcA5dDrXstxtXW7cJueAdWvleNmk1yG9mh4FPHHuwBNQan6yALfYz0I0JUi7co ZMkQ== 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=kEXmzMTyjIKgtgwqTHuk4GVtWYhrezkKTg7cgzvh9ZBSHMIJbgZGcXetAZIx5ZHRon 4INp0YfT3FkuAlez0eVkpqLmyZsB4cBjpyqkjFaAJyYS946Ipxhl2INcH7pe0mX0MBJW sPR1uqyTabgsxiJWezUBxJQrlFRpEyb0ikdob3FglP3Sow9wXn6qF3BQshlnNq3yqMai wVOdeIE1aJfMn3dh8J0RZxEa6ByuLBtncCUuNUvQb4WuKHvLg3fZIgdLmSxqJ/xLX8iG ACFcymow+F4sgK/q1LdkCnTvVvvAJzWmSpxR2Nkla8l5WYB+Vz/OC0sgv4y/JnUUg2hc 7IKg== X-Gm-Message-State: AOAM531xELPdYnNEA7dks6Ts60Z4Rj3cxAlaAXO/QA6unUmSIbhSUfsK IJYp2OWS+e7Jh+E+9fBFyEUvWg== X-Received: by 2002:a37:a211:: with SMTP id l17mr6439009qke.195.1617244919306; Wed, 31 Mar 2021 19:41:59 -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 a8sm2525707qtx.9.2021.03.31.19.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 19:41:59 -0700 (PDT) From: Shashi Mallela To: peter.maydell@linaro.org, leif@nuviainc.com, rad@semihalf.com Subject: [PATCH v2 7/8] hw/arm/sbsa-ref: add ITS support in SBSA GIC Date: Wed, 31 Mar 2021 22:41:51 -0400 Message-Id: <20210401024152.203896-8-shashi.mallela@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210401024152.203896-1-shashi.mallela@linaro.org> References: <20210401024152.203896-1-shashi.mallela@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::730; envelope-from=shashi.mallela@linaro.org; helo=mail-qk1-x730.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.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Included creation of ITS as part of SBSA platform GIC initialization. Signed-off-by: Shashi Mallela --- hw/arm/sbsa-ref.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) -- 2.27.0 Reviewed-by: Peter Maydell 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[] = { [SBSA_CPUPERIPHS] = { 0x40000000, 0x00040000 }, [SBSA_GIC_DIST] = { 0x40060000, 0x00010000 }, [SBSA_GIC_REDIST] = { 0x40080000, 0x04000000 }, + [SBSA_GIC_ITS] = { 0x44090000, 0x00020000 }, [SBSA_SECURE_EC] = { 0x50000000, 0x00001000 }, [SBSA_GWDT_REFRESH] = { 0x50010000, 0x00001000 }, [SBSA_GWDT_CONTROL] = { 0x50011000, 0x00001000 }, @@ -378,7 +380,20 @@ static void create_secure_ram(SBSAMachineState *sms, memory_region_add_subregion(secure_sysmem, base, secram); } -static void create_gic(SBSAMachineState *sms) +static void create_its(SBSAMachineState *sms) +{ + DeviceState *dev; + + dev = qdev_new(TYPE_ARM_GICV3_ITS); + SysBusDevice *s = 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 = 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); + object_property_set_link(OBJECT(sms->gic), "sysmem", OBJECT(mem), + &error_fatal); + qdev_prop_set_bit(sms->gic, "has-lpi", true); + gicbusdev = 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); } static void create_uart(const SBSAMachineState *sms, int uart, @@ -763,7 +783,7 @@ static void sbsa_ref_init(MachineState *machine) create_secure_ram(sms, secure_sysmem); - create_gic(sms); + create_gic(sms, sysmem); create_uart(sms, SBSA_UART, sysmem, serial_hd(0)); create_uart(sms, SBSA_SECURE_UART, secure_sysmem, serial_hd(1));