From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83640D1CDCF for ; Tue, 22 Oct 2024 09:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:Date:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hwMxl0HS+/hroXw7dMiyhKlhruRtZ/PIjrJLLm0t+HQ=; b=GTmGgInkulIu3/epVmcLxso89/ cmZml6lBxJRWWAkpF0aIPvFCgUP2TtfcM70MRf7J8kYBm6o5g+UCXNuIXc29bqBepDQkeDr+57NRS HPYdYUUQHKM2DmUmHdFUjbEAAjlba9SChpywVSIA28grLopRqEm6af4xxEMLyZXqw2LDg+SUc0Eyp 08JMANMVeVS6or5fpgCLAPOwPtItdgAj16/18G5sXV4szhwo6v7qGt464ULTQ9ubTkhegx1dacZJc w8qoH/T6MGC3nr6SGNw/9RKwDyGnwUnx6JSpH+wFY4rU6UvAakO+gagjZy2dLVf9K33i46GeJYBlQ SjE181WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3BfI-0000000ASEr-3VY0; Tue, 22 Oct 2024 09:59:00 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3BDq-0000000AMHF-2QCv for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 09:30:40 +0000 Received: by mail-ej1-x643.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso797154566b.3 for ; Tue, 22 Oct 2024 02:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1729589437; x=1730194237; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=hwMxl0HS+/hroXw7dMiyhKlhruRtZ/PIjrJLLm0t+HQ=; b=W2TwctIG5uA8KgzvvZUPoLrc5Seof3eF/5CKZr2Eej5bvKP1DBg0K6Sf5+Ak2C8CZH ubZowq8JhJPQfOvnZtYOSBh6OYBHYQFY5JiRTLzphzt48cD4IQUjwQwfEDCD+zhNjf07 H6KZc3qFP0Ye6rNL7xsx3HIzr60aznSjZJaBaDoOwYnTaNkE1wlbWJyJmbtFoBhhDS/g o2sTl5RYiqEairjk6jmjpgSAp6z0D09Q3L4nMli0d0Nmi5NezMl2Q7Ik7MWxrevGzFxF rjrIPU5BVgZZocYhMDRzI+MAb3W3bucGk3eDZtuDMPN8Ut8ePTZ8FNYVuHouf02UKNZl U2tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729589437; x=1730194237; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hwMxl0HS+/hroXw7dMiyhKlhruRtZ/PIjrJLLm0t+HQ=; b=Ei+LTbJ1PcOgcVbrRJKXekXBN/RIoRdWHbY2a2sEXCfp2t8Bm6e7OKstZ46AmvNWw9 utI1TmRlc+65zt6k5bsUYRkeU27MJJKxB6IEW99LJQQWyMiJqrC83i5R/nAKKUhJBZl1 9yOG/OmVUeADy5TINBfPvBUhsEQbYE8QfONwr3dpOyfysPs9G69PzBxK0WNU13EGbCL7 8u6uFOX6Hfz/7j8jWx7VJ0O/45BOiE6s/YbDBUUFwVmcGYxf2JOO5SCPDsjebD177f3p 4oiJ/wPnzCCYNf8JTX7VpgMQiEDlRKXPmttQHGA1MTkSlcLZ2EtPmOGy0zi2oWpZ56XW TMdA== X-Forwarded-Encrypted: i=1; AJvYcCULUgmWJZpMjjEFqSG/nENrdfe1csj3YJDoObp03RSqdaiOhr5T+3DkJGldv8ximzasRI4vgD20yLXlhFzoiG0W@lists.infradead.org X-Gm-Message-State: AOJu0YxVeV0Yvma+x0nczun6NIF9RcFdKKy3GgWKPoz6AwlGBSVhQ6SE 4Xma0FuYMI74zK2bQAiP4QB3XoR9PLqhv2e/DVeSCgAj5w5SpbKGINJwwtnpa+w= X-Google-Smtp-Source: AGHT+IEGyEQRCYQDtCFWizlbuy0GBX1uROrJVtmMFsgIeXcmwJ6NJZHdXYYpYRzJfgP5yt6o3uI6gA== X-Received: by 2002:a17:907:2d8c:b0:a80:f840:9004 with SMTP id a640c23a62f3a-a9a69a63c0fmr1587260866b.12.1729589436425; Tue, 22 Oct 2024 02:30:36 -0700 (PDT) Received: from localhost (host-95-239-0-46.retail.telecomitalia.it. [95.239.0.46]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d6234sm312304466b.24.2024.10.22.02.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 02:30:36 -0700 (PDT) From: Andrea della Porta X-Google-Original-From: Andrea della Porta Date: Tue, 22 Oct 2024 11:30:57 +0200 To: Rob Herring Cc: Andrea della Porta , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Linus Walleij , Catalin Marinas , Will Deacon , Bartosz Golaszewski , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Saravana Kannan , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org, Masahiro Yamada , Stefan Wahren , Herve Codina , Luca Ceresoli , Thomas Petazzoni , Andrew Lunn Subject: Re: [PATCH v2 04/14] dt-bindings: misc: Add device specific bindings for RaspberryPi RP1 Message-ID: References: <3141e3e7898c1538ea658487923d3446b3d7fd0c.1728300189.git.andrea.porta@suse.com> <20241010025244.GB978628-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241010025244.GB978628-robh@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_023038_678994_0B3458A6 X-CRM114-Status: GOOD ( 35.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Rob, On 21:52 Wed 09 Oct , Rob Herring wrote: > On Mon, Oct 07, 2024 at 02:39:47PM +0200, Andrea della Porta wrote: > > The RP1 is a MFD that exposes its peripherals through PCI BARs. This > > schema is intended as minimal support for the clock generator and > > gpio controller peripherals which are accessible through BAR1. > > > > Signed-off-by: Andrea della Porta > > --- > > .../devicetree/bindings/misc/pci1de4,1.yaml | 110 ++++++++++++++++++ > > MAINTAINERS | 1 + > > 2 files changed, 111 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/misc/pci1de4,1.yaml > > > > diff --git a/Documentation/devicetree/bindings/misc/pci1de4,1.yaml b/Documentation/devicetree/bindings/misc/pci1de4,1.yaml > > new file mode 100644 > > index 000000000000..3f099b16e672 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/misc/pci1de4,1.yaml > > @@ -0,0 +1,110 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/misc/pci1de4,1.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: RaspberryPi RP1 MFD PCI device > > + > > +maintainers: > > + - Andrea della Porta > > + > > +description: > > + The RaspberryPi RP1 is a PCI multi function device containing > > + peripherals ranging from Ethernet to USB controller, I2C, SPI > > + and others. > > + The peripherals are accessed by addressing the PCI BAR1 region. > > + > > +allOf: > > + - $ref: /schemas/pci/pci-ep-bus.yaml > > + > > +properties: > > + compatible: > > + additionalItems: true > > + maxItems: 3 > > + items: > > + - const: pci1de4,1 > > + > > +patternProperties: > > + "^pci-ep-bus@[0-2]$": > > + $ref: '#/$defs/bar-bus' > > + description: > > + The bus on which the peripherals are attached, which is addressable > > + through the BAR. > > No need for this because pci-ep-bus.yaml already has a schema for the > child nodes. Hmmm... my intention here was to constrain the BARs from 0 to 2, since there are only 3 BARs on RP1 (of which only 1 is currently interesting for peripherals). Also, that bus should have the peripherals on it, hence I've added the clock, ethernet and pinctrl nodes. Do you think it's not reasonable to define all the peripherals on it, or if it's reasonable, is there any other way to accomplish this in a more elegant way than what I proposed in this patch? See also below. > > > + > > +unevaluatedProperties: false > > + > > +$defs: > > + bar-bus: > > + $ref: /schemas/pci/pci-ep-bus.yaml#/$defs/pci-ep-bus > > + unevaluatedProperties: false > > + > > + properties: > > + "#interrupt-cells": > > + const: 2 > > + description: > > + Specifies respectively the interrupt number and flags as defined > > + in include/dt-bindings/interrupt-controller/irq.h. > > + > > + interrupt-controller: true > > + > > + interrupt-parent: > > + description: > > + Must be the phandle of this 'pci-ep-bus' node. It will trigger > > + PCI interrupts on behalf of peripheral generated interrupts. > > > Do you have an interrupt controller per bus? These should be in the > parent node I think. Ack. > > > > + > > + patternProperties: > > + "^clocks(@[0-9a-f]+)?$": > > + type: object > > + $ref: /schemas/clock/raspberrypi,rp1-clocks.yaml > > + > > + "^ethernet(@[0-9a-f]+)?$": > > + type: object > > + $ref: /schemas/net/cdns,macb.yaml > > + > > + "^pinctrl(@[0-9a-f]+)?$": > > + type: object > > + $ref: /schemas/pinctrl/raspberrypi,rp1-gpio.yaml > > IMO, these child nodes can be omitted. We generally don't define all the > child nodes in an SoC. > > If you do want to define them, then just do: > > additionalProperties: true > properties: > compatible: > contains: the-child-compatible > Right, but since you proposed above to get rid of the pci-ep-bus redeclaration (being it alredy defined in pci-ep-bus.yaml) I'm not sure where to place this. Should I just get rid af it all as you suggest? Many thanks, Andrea > > + > > + required: > > + - interrupt-parent > > + - interrupt-controller > > + > > +examples: > > + - | > > + pci { > > + #address-cells = <3>; > > + #size-cells = <2>; > > + > > + rp1@0,0 { > > + compatible = "pci1de4,1"; > > + ranges = <0x01 0x00 0x00000000 > > + 0x82010000 0x00 0x00 > > + 0x00 0x400000>; > > + #address-cells = <3>; > > + #size-cells = <2>; > > + > > + pci_ep_bus: pci-ep-bus@1 { > > + compatible = "simple-bus"; > > + ranges = <0xc0 0x40000000 > > + 0x01 0x00 0x00000000 > > + 0x00 0x00400000>; > > + dma-ranges = <0x10 0x00000000 > > + 0x43000000 0x10 0x00000000 > > + 0x10 0x00000000>; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + interrupt-controller; > > + interrupt-parent = <&pci_ep_bus>; > > + #interrupt-cells = <2>; > > + > > + rp1_clocks: clocks@c040018000 { > > + compatible = "raspberrypi,rp1-clocks"; > > + reg = <0xc0 0x40018000 0x0 0x10038>; > > + #clock-cells = <1>; > > + clocks = <&clk_rp1_xosc>; > > + clock-names = "rp1-xosc"; > > + }; > > + }; > > + }; > > + }; > > diff --git a/MAINTAINERS b/MAINTAINERS > > index ccf123b805c8..2aea5a6166bd 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -19384,6 +19384,7 @@ RASPBERRY PI RP1 PCI DRIVER > > M: Andrea della Porta > > S: Maintained > > F: Documentation/devicetree/bindings/clock/raspberrypi,rp1-clocks.yaml > > +F: Documentation/devicetree/bindings/misc/pci1de4,1.yaml > > F: Documentation/devicetree/bindings/pci/pci-ep-bus.yaml > > F: Documentation/devicetree/bindings/pinctrl/raspberrypi,rp1-gpio.yaml > > F: include/dt-bindings/clock/rp1.h > > -- > > 2.35.3 > >