From nobody Mon Feb 9 18:18:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151699072635351.39017566522955; Fri, 26 Jan 2018 10:18:46 -0800 (PST) Received: from localhost ([::1]:43614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef8aJ-0008HD-Fy for importer@patchew.org; Fri, 26 Jan 2018 13:18:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef8Xt-00076c-PV for qemu-devel@nongnu.org; Fri, 26 Jan 2018 13:16:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ef8Xn-0006cR-Mi for qemu-devel@nongnu.org; Fri, 26 Jan 2018 13:16:13 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:33559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ef8Xn-0006au-Eo for qemu-devel@nongnu.org; Fri, 26 Jan 2018 13:16:07 -0500 Received: by mail-lf0-x244.google.com with SMTP id t139so1795317lff.0 for ; Fri, 26 Jan 2018 10:16:07 -0800 (PST) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id q16sm1389950lfq.66.2018.01.26.02.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 02:22:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hGJbuJnN7EUTLkfPLZ+oeYkG6rX309Nb5bAaN6j9h3w=; b=J3dY26cuh9Mg5GlH0WGzQWaDZlxc1OhlFHFoSp1JXA76SL74VTAbbMmPK+GRvuIJSp 92jBVVvOZYKFnDGfvmuJdgJv3OGivLBbP6vtXvI8iXTTFbaSjCyOMqoF0ticxfjtshjv QiVn0PTLcX8wMy7QlcBNU2YCrIqHCDUD3FxUeRpohJlDRSpTbLhtRg6yF78wjE1bGFkK mXJK/W+ipujnrK+8FQjDsvKvTDuhg3beqzJoFyXCYIq4MTkWEsrXwaUIRlxOpe9DWfz9 X9o7xVo/I0HUFjkgRd+QQ5UPh7QZrKkYsSnkfSgMNiOhX+2d6XBAtoHjXuaW52scChN0 xhoA== 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; bh=hGJbuJnN7EUTLkfPLZ+oeYkG6rX309Nb5bAaN6j9h3w=; b=p+juLwC+gFZFAlzRg2jRbSEV07yhjwDeu7bf6HlfkomyRgDl/5xrWHeLqCkiGalalO jlFxqW9pRKF+P5Ckmy84o1/LtbjioPBiw+QxDONupmvhnGsbyP8eJqvOsQkAPlZlWrTP s1oebkO89YrCss21aAuJDu2zvp5iJKxueSDmgmRcY/H7eFTZ6KoVGFbOhqeqC+RLjsap 6Djm+D7dytfTmf9RiTH5gNJ1OQlaV9ke0BEOnjm3AypYIoGdwjABsLXqWvOKU2MZgAD8 WlsSJqd0ClbOKnAMxnfrOgxm7RlDk+AwHZE69mhvPOAtZUaNhxVwZPmFMEHFaD0uKSPk RsDw== X-Gm-Message-State: AKwxytfuBliVZc6uMHZ9EQu6NZU8IqyTz5yEb8FiIWjxEOupI8pbpYlR QV2pIk8d6Gs18uGlgoVj8zfsSw== X-Google-Smtp-Source: AH8x227g0MFAE6x4SErfdCUNig7llFNPZKflJqxZ2I74dv9T2Gu3eq0FRMMDzRV7WbisDMlE6LOYig== X-Received: by 10.25.28.82 with SMTP id c79mr7369589lfc.44.1516962177440; Fri, 26 Jan 2018 02:22:57 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 26 Jan 2018 11:22:41 +0100 Message-Id: <1516962162-25680-9-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516962162-25680-1-git-send-email-edgar.iglesias@gmail.com> References: <1516962162-25680-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PULL v2 8/9] xlnx-zynqmp-pmu: Connect the IPI device to the PMU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sai.pavan.boddu@xilinx.com, edgar.iglesias@xilinx.com, alistai@xilinx.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Signed-off-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias --- hw/microblaze/xlnx-zynqmp-pmu.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pm= u.c index 7312bfe..999a565 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -24,6 +24,7 @@ #include "cpu.h" #include "boot.h" =20 +#include "hw/intc/xlnx-zynqmp-ipi.h" #include "hw/intc/xlnx-pmu-iomod-intc.h" =20 /* Define the PMU device */ @@ -38,6 +39,15 @@ =20 #define XLNX_ZYNQMP_PMU_INTC_ADDR 0xFFD40000 =20 +#define XLNX_ZYNQMP_PMU_NUM_IPIS 4 + +static const uint64_t ipi_addr[XLNX_ZYNQMP_PMU_NUM_IPIS] =3D { + 0xFF340000, 0xFF350000, 0xFF360000, 0xFF370000, +}; +static const uint64_t ipi_irq[XLNX_ZYNQMP_PMU_NUM_IPIS] =3D { + 19, 20, 21, 22, +}; + typedef struct XlnxZynqMPPMUSoCState { /*< private >*/ DeviceState parent_obj; @@ -136,6 +146,9 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine) MemoryRegion *address_space_mem =3D get_system_memory(); MemoryRegion *pmu_rom =3D g_new(MemoryRegion, 1); MemoryRegion *pmu_ram =3D g_new(MemoryRegion, 1); + XlnxZynqMPIPI *ipi[XLNX_ZYNQMP_PMU_NUM_IPIS]; + qemu_irq irq[32]; + int i; =20 /* Create the ROM */ memory_region_init_rom(pmu_rom, NULL, "xlnx-zynqmp-pmu.rom", @@ -155,6 +168,24 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine) &error_abort); object_property_set_bool(OBJECT(pmu), true, "realized", &error_fatal); =20 + for (i =3D 0; i < 32; i++) { + irq[i] =3D qdev_get_gpio_in(DEVICE(&pmu->intc), i); + } + + /* Create and connect the IPI device */ + for (i =3D 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) { + ipi[i] =3D g_new0(XlnxZynqMPIPI, 1); + object_initialize(ipi[i], sizeof(XlnxZynqMPIPI), TYPE_XLNX_ZYNQMP_= IPI); + qdev_set_parent_bus(DEVICE(ipi[i]), sysbus_get_default()); + } + + for (i =3D 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) { + object_property_set_bool(OBJECT(ipi[i]), true, "realized", + &error_abort); + sysbus_mmio_map(SYS_BUS_DEVICE(ipi[i]), 0, ipi_addr[i]); + sysbus_connect_irq(SYS_BUS_DEVICE(ipi[i]), 0, irq[ipi_irq[i]]); + } + /* Load the kernel */ microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR, machine->ram_size, --=20 2.7.4