From patchwork Thu May 2 14:13:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Tyshchenko X-Patchwork-Id: 10926925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E30D13AD for ; Thu, 2 May 2019 14:16:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CB672223E for ; Thu, 2 May 2019 14:16:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60EDF223B3; Thu, 2 May 2019 14:16:28 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E835A24BFE for ; Thu, 2 May 2019 14:16:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hMCTw-0001VA-5r; Thu, 02 May 2019 14:14:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hMCTv-0001V0-AR for xen-devel@lists.xenproject.org; Thu, 02 May 2019 14:14:39 +0000 X-Inumbo-ID: 9de6f2ee-6ce4-11e9-843c-bc764e045a96 Received: from mail-lf1-x143.google.com (unknown [2a00:1450:4864:20::143]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9de6f2ee-6ce4-11e9-843c-bc764e045a96; Thu, 02 May 2019 14:14:37 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id j11so2030425lfm.0 for ; Thu, 02 May 2019 07:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=1urTjbYAyxY1VAWVmEF113vhEpT7fj7fWJxqvM0TVuk=; b=IOAfsLSQSJ3gr93/M6P+LOaCrLtU6ZSsf3M6GVbKhvxXNWij2xZ9WluAajXRbOnpPz ug+UuHtiNnNIdfZ+OAm9uUKNgWffjDrdz/EswEC+Q+rcJ+0pc9mC953qDBbiWgRhBAY8 IwhyKX9NId8HuEGie/roNTpNz75Dy5k8/M36jhO25W63UYbVjcYRkSUBKeDFR0pYZ41F EH/5K7ATeSPIFxAlxjzgatWCPlwk6RxYei4R/HN4N1v+ztR/bMqiOj8coogJ4E3xbhrl TjBRLamJrqgdnzECf/mT5p7w1Hx0Yvs/O0lwGN0oaX9wDBMdjmLzH5IbSH9cCFdOadkY NgSg== 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; bh=1urTjbYAyxY1VAWVmEF113vhEpT7fj7fWJxqvM0TVuk=; b=CKqz3Fc0f8pG6GxnW5uRkfj/RbXCSfH3F9NKup7kaHAoV6Mrn+iUu53LP5izQLDcNW MB41TU9v513sxyu3RqzOoX+3ez55SBhKVhD+NEyJ5196K1MdNiQC/xjsNNRGrDQEaAhY 1pUOS9egO6qwW2X+sP0E0J3eOf9Xr+gq0cdCuCqq6aqhM5rLfk0Fb96puRQL4zDup6Nh CzhtuZOwzuqkoH9d+NlIWrqeBj0UlfQY4BF8SwPgFqb7fC7pkM9suYfz4nOk71PAPESh GaSAoKJSMd9S28OjoFTKSv75iwYVIzOq8VQTr4CmOrl/wyIKA0ErbRII6bBtg/PAJ4CO V/rQ== X-Gm-Message-State: APjAAAXdOB1WBY4NuUoldaCZYw9codPkvPy3y2GUQ42woQi4gf/gah3w 8Q+0rzfTNZj6Ywk0nDc4UUMVJbaIEKY= X-Google-Smtp-Source: APXvYqz+1eI0prlS9JWq2/zVPY4gpd7oclRWXskBl+TXoJ84/+JRwh0T6nEh4P0J4NbV6pP/vsdX4g== X-Received: by 2002:ac2:5686:: with SMTP id 6mr2163305lfr.34.1556806476106; Thu, 02 May 2019 07:14:36 -0700 (PDT) Received: from otyshchenko.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id v11sm9447761lfb.68.2019.05.02.07.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 May 2019 07:14:35 -0700 (PDT) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org Date: Thu, 2 May 2019 17:13:54 +0300 Message-Id: <1556806436-26283-1-git-send-email-olekstysh@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [RFC PATCH 0/2] Add ability to handle nodes with interrupts-extended property X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Oleksandr Tyshchenko , julien.grall@arm.com, sstabellini@kernel.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Oleksandr Tyshchenko Hello, all. The purpose of this small series is to add minimal required support for Xen to be able to handle device-tree nodes with "interrupts-extended" property [1]. The reason: Xen expects to see "interrupts" property when parsing host device-tree. But, there are cases when some device nodes contain "interrupts-extended" property instead. The good example here is arch timer node for R-Car Gen3/Gen2 family [2], which is mandatory device for Xen usage on ARM. And without ability to handle such nodes, Xen fails to operate: (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Timer: Unable to retrieve IRQ 0 from the device tree (XEN) **************************************** ---------- Preliminary tested on R-Car Gen3 based board. Log (with debug enabled) shows that Xen recognized arch timer interrupts represented with "interrupts-extended" property: timer { compatible = "arm,armv8-timer"; interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>; }; ... (XEN) dt_device_get_raw_irq: dev=/timer, index=0 (XEN) intspec=1 intsize=3 (XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 0x0000000d...],ointsize=3 (XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3 (XEN) -> addrsize=0 (XEN) -> got it ! (XEN) dt_device_get_raw_irq: dev=/timer, index=1 (XEN) intspec=1 intsize=3 (XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 0x0000000e...],ointsize=3 (XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3 (XEN) -> addrsize=0 (XEN) -> got it ! (XEN) dt_device_get_raw_irq: dev=/timer, index=2 (XEN) intspec=1 intsize=3 (XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 0x0000000b...],ointsize=3 (XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3 (XEN) -> addrsize=0 (XEN) -> got it ! (XEN) dt_device_get_raw_irq: dev=/timer, index=3 (XEN) intspec=1 intsize=3 (XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1010000,intspec=[0x00000001 0x0000000a...],ointsize=3 (XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1010000, size=3 (XEN) -> addrsize=0 (XEN) -> got it ! (XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8333 KHz ... ---------- The first patch had Julien's R-B some time ago, but I dropped it. [1] https://elixir.bootlin.com/linux/v5.1-rc7/source/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt [2] https://elixir.bootlin.com/linux/v5.1-rc7/source/arch/arm64/boot/dts/renesas/r8a7795.dtsi#L3185 https://elixir.bootlin.com/linux/v5.1-rc7/source/arch/arm/boot/dts/r8a7790.dtsi#L1856 Oleksandr Tyshchenko (2): xen/device-tree: Add dt_count_phandle_with_args helper xen/device-tree: Add ability to handle nodes with interrupts-extended prop xen/common/device_tree.c | 39 ++++++++++++++++++++++++++++++++++++--- xen/include/xen/device_tree.h | 19 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-)