From patchwork Thu Jan 18 18:38:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 863090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XpMFQtzx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMtLv51Gdz9sDB for ; Fri, 19 Jan 2018 05:50:31 +1100 (AEDT) Received: from localhost ([::1]:47481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecFGf-0005Fb-JE for incoming@patchwork.ozlabs.org; Thu, 18 Jan 2018 13:50:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecF94-0007lK-Kz for qemu-devel@nongnu.org; Thu, 18 Jan 2018 13:42:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecF93-0003BI-AQ for qemu-devel@nongnu.org; Thu, 18 Jan 2018 13:42:38 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:35166) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecF93-0003Ax-4L; Thu, 18 Jan 2018 13:42:37 -0500 Received: by mail-pg0-x243.google.com with SMTP id d6so15007839pgv.2; Thu, 18 Jan 2018 10:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=706p23CmGXJmutKggO3aTbK3IIdxugDxcZunYN4pOjg=; b=XpMFQtzxOW8J1XoH42qVIcYws1EIf0AhyDuzz4DGZV5SzIgSQh8wnUOXda9W/dK9b5 EsY+yH7IhFoWdLYroK79gRvIwODzyuGpvWJTSFXGTqkequNfC1wMd1QNecNMCo/G4GFT lO1R1UJMffIoZN3vwQudg26m/peDSJKzhJAZxxizhMd36iLP1Yl/SlhL1bd6FLVLKRW+ AIR/pDqBCSjvIH5AdocGVnL43DUSUFAjApa96Lmp2U92u8+l2v4XwZcpsquTXnOF8wEK eu5zx3u/m5DSNHOLfWNiWN6AYkqx3ACRSgdtbfPXMNr2GfNkKFoaqTSNK37ew4DMyN0e pqrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=706p23CmGXJmutKggO3aTbK3IIdxugDxcZunYN4pOjg=; b=n88Av1pw0KBZQBHr4cRfU9ucR+aHMy2jIlfOf11hsd6aQPR6WOLsFGDxY+4ajzDUZl GG5s5oWqkLjepI/EyJyKsyOAsf/Z4NzCVOOJAriHgZAWtPwQFv1tLJ21A9lycHHOOpYn 2eUQ+Vr6PvHLsSOJ4vTVR7c+ZW1MKdixUdeKYMZTBpoWCprtZFgfrXZnEKwZfC7fShZK Gf/MpC3ROCJvzq/x0tNxs7NUrL+01d9ffCDyj7YEpn4q+XgoqcuXdN343QzTKIsxk9pw DjorvOIaR7wtrDuRekebwb8FRkK/PYGv1ZJQExux9vLoyNDDq2NKEPoO2wKbGqW3olkM B9dg== X-Gm-Message-State: AKwxyteiRN4jRA/7s1tyCa/e2BHPtd92Wh/7fzW9Ze0VZJTfMgrI3em0 e7O4tiBhLU8JYntXunEbe1rNCHJJ1Jc= X-Google-Smtp-Source: ACJfBosVSNrqnoOlyIyWrWrc9r6T3XBoNe4alBuMe9rsMWwKa6z903rGfBm8Vny7acGWLRUlqsBdqQ== X-Received: by 2002:a17:902:8f8b:: with SMTP id z11-v6mr242270plo.43.1516300955901; Thu, 18 Jan 2018 10:42:35 -0800 (PST) Received: from localhost ([149.199.62.254]) by smtp.gmail.com with ESMTPSA id v9sm15790836pfj.88.2018.01.18.10.42.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 10:42:34 -0800 (PST) From: Alistair Francis To: qemu-devel@nongnu.org, edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com Date: Thu, 18 Jan 2018 10:38:10 -0800 Message-Id: <01de185b273b999f1a4df07cb0e4b2e8216689f0.1516300623.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH v6 6/9] xlnx-zynqmp-pmu: Connect the PMU interrupt controller 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: alistair23@gmail.com, qemu-arm@nongnu.org, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé --- hw/microblaze/xlnx-zynqmp-pmu.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c index 145837b372..7312bfe23e 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -24,6 +24,8 @@ #include "cpu.h" #include "boot.h" +#include "hw/intc/xlnx-pmu-iomod-intc.h" + /* Define the PMU device */ #define TYPE_XLNX_ZYNQMP_PMU_SOC "xlnx,zynqmp-pmu-soc" @@ -34,14 +36,18 @@ #define XLNX_ZYNQMP_PMU_ROM_ADDR 0xFFD00000 #define XLNX_ZYNQMP_PMU_RAM_ADDR 0xFFDC0000 +#define XLNX_ZYNQMP_PMU_INTC_ADDR 0xFFD40000 + typedef struct XlnxZynqMPPMUSoCState { /*< private >*/ DeviceState parent_obj; /*< public >*/ MicroBlazeCPU cpu; + XlnxPMUIOIntc intc; } XlnxZynqMPPMUSoCState; + static void xlnx_zynqmp_pmu_soc_init(Object *obj) { XlnxZynqMPPMUSoCState *s = XLNX_ZYNQMP_PMU_SOC(obj); @@ -50,6 +56,9 @@ static void xlnx_zynqmp_pmu_soc_init(Object *obj) TYPE_MICROBLAZE_CPU); object_property_add_child(obj, "pmu-cpu", OBJECT(&s->cpu), &error_abort); + + object_initialize(&s->intc, sizeof(s->intc), TYPE_XLNX_PMU_IO_INTC); + qdev_set_parent_bus(DEVICE(&s->intc), sysbus_get_default()); } static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp) @@ -80,6 +89,21 @@ static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } + + object_property_set_uint(OBJECT(&s->intc), 0x10, "intc-intr-size", + &error_abort); + object_property_set_uint(OBJECT(&s->intc), 0x0, "intc-level-edge", + &error_abort); + object_property_set_uint(OBJECT(&s->intc), 0xffff, "intc-positive", + &error_abort); + object_property_set_bool(OBJECT(&s->intc), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + sysbus_mmio_map(SYS_BUS_DEVICE(&s->intc), 0, XLNX_ZYNQMP_PMU_INTC_ADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->intc), 0, + qdev_get_gpio_in(DEVICE(&s->cpu), MB_CPU_IRQ)); } static void xlnx_zynqmp_pmu_soc_class_init(ObjectClass *oc, void *data)