From patchwork Mon Jan 22 19:43:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10179113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D639602B7 for ; Mon, 22 Jan 2018 19:49:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC1C20453 for ; Mon, 22 Jan 2018 19:49:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E58128438; Mon, 22 Jan 2018 19:49:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C50A20453 for ; Mon, 22 Jan 2018 19:49:46 +0000 (UTC) Received: from localhost ([::1]:33705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edi6D-0008Mu-5L for patchwork-qemu-devel@patchwork.kernel.org; Mon, 22 Jan 2018 14:49:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edi4b-00073O-LU for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:48:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edi4a-00064k-PL for qemu-devel@nongnu.org; Mon, 22 Jan 2018 14:48:05 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edi4a-00064S-Iv; Mon, 22 Jan 2018 14:48:04 -0500 Received: by mail-pf0-x242.google.com with SMTP id 23so7885369pfp.3; Mon, 22 Jan 2018 11:48:04 -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 :mime-version:content-transfer-encoding; bh=k0KmNmMODx5Ym5kXsMD6qEv83KQfi2d6Ux1hffjiIqM=; b=fxhsj3730G3yTgvLACETPixumJmZCpfeB7YhznhToRjcR5zZ75bYPb+eEIOcQuN2yn iENdyJzvJupa2FrpFj7/C9vj2voMuzOuwgiD3L3NXtpxB9uY9KoBwXq3uV50k24PQNFY hLRw4zXq4MjvyfOy6pZryzQrsNpRV3SGxNxfmMFWL831pw7pqR/D2IHDNLDPs0QnxD5X Z7fPGKm8uHOqgVA3184xIW0PoUSRK/9CiKPIV7LOtKNcSoN/wo8LILxsA/gHcUHheaXX SjF9hX7uGM65Iu1+gUqdOAiZMCvdWOkwfGFdrajRo47FqPOhJmo7chSmyUFClIzYjrWs C/Mw== 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:mime-version:content-transfer-encoding; bh=k0KmNmMODx5Ym5kXsMD6qEv83KQfi2d6Ux1hffjiIqM=; b=Poimv4aUuRfQaw1o3Uf0ElJBEXzni4QU85qoRSiGYRoRdZAVLFjboffFvHDOecBKmL 1pUs/uenBJbb+q5FCLY31EHZvxaOGXsQafIYrJA/wA4J1Xgdits3T16QItnFKajzwDnj uxWgsACD/efiWTVBz4F1Xnq4A8jk6xeZRdM9EasLrQVbKaqL91hgtJQFrkc1xAc+z1dd ZuxHws27P54XWolhVJunU5yFU3QUTqbCxa8O1xGBXCsPLKriS8QlnWsfbFPIlkP6byd8 CB3yjbwJJgWLRd8if4/+FgYPT1fAc2ZOoe7GwZOn8/EIIn1Os7UUklFya8l+/+dKPeba Wm8Q== X-Gm-Message-State: AKwxyteNf+QOXn3IEPl5ZgF/6B+4bahRsJMB6hZAxCiTP1HLEHZNqWme lHnVqiVUZhxX4dCOjjRmAAwsFhcr X-Google-Smtp-Source: AH8x226zDr8OJfQuQnROHJqexfWTTTrsb0q99TwWjBPEi+bCZd2e9UK3W9tikExhzIvT4NoKJrOzEg== X-Received: by 10.98.228.5 with SMTP id r5mr9154922pfh.193.1516650483306; Mon, 22 Jan 2018 11:48:03 -0800 (PST) Received: from localhost ([149.199.62.254]) by smtp.gmail.com with ESMTPSA id b6sm1726868pfe.85.2018.01.22.11.48.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 11:48:02 -0800 (PST) From: Alistair Francis To: qemu-devel@nongnu.org, edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com Date: Mon, 22 Jan 2018 11:43:38 -0800 Message-Id: <3bea46b94313557c66c45b2400ca10cec0480fec.1516650109.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PATCH v7 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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)