From patchwork Mon Oct 14 17:02:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Karan Sanghavi X-Patchwork-Id: 13835325 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 B2507D18130 for ; Mon, 14 Oct 2024 17:05:38 +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:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=bxg86KR6sOyXP7avilmE6FsFPoosRZPYDwPpN3nt2Uc=; b=LJsdP1F74K3piV4BTOzUJxJIAE JlqS6OEnA44q4rWIkoHq8/zvZG15PloyEksU8K4YQD3kj0j4xEOw7/mMn/WroVHVJ6xn/oyHw8pKH RUn4xLmUc5GTebCwdUOusYeEYjvV0h4LlxO7dziROyk22rpas5G1l2FagEoVrVLoEXW3mz5YM0Qai FeGYK4UMFBg+GYbDjMiLfqx9ASW0LDkDlyWXb8T14NqAQl2LttvBXn/xk6RsnSMYvUGk4TSov/yUz PeH+0AkHG5Vg62nOj5LV3vWfY4UkLmbNUfTl0/MvEifoOY8Z2fJ14qYdIrLXftNmq1KJHJ5F0HZfQ QmNGWlKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0OVb-00000005yCw-2poG; Mon, 14 Oct 2024 17:05:27 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0OSS-00000005xU7-3Ewh; Mon, 14 Oct 2024 17:02:14 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-20cb89a4e4cso16672995ad.3; Mon, 14 Oct 2024 10:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728925330; x=1729530130; darn=lists.infradead.org; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=bxg86KR6sOyXP7avilmE6FsFPoosRZPYDwPpN3nt2Uc=; b=jev/AdMZGn6YdeIMT5qbXOFvDLJUoFA7w6JMa5eYxeBlIa74Z3BqD1nIBxqWVPtSxG wIFpi7TFZbLh1yJ6w9+4L293UcGipunRjiZ/i+jIiXUKy2Bk6XJTkpwDmbs5IEeBlhCV 2E7rWgejxdfjbVxCt9e7cnPR7ZJOtWMSDjs7GhNtH2P+o8QX4E1Lgnl+kDtKQbU5+ypT qfwVt9JwKUftlYFXfqLJFcyoxOxgEFklW+6dAGoK4bi9hQmunJKccLzZkw0yOqnvW9TF 6SnmDq8hME8HTeH/Zl6Ms2njE1TvpSgC3nGZ4UyugQ3Je0pFwQyYKZNaTtuqDWY83h0b Ckeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728925330; x=1729530130; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bxg86KR6sOyXP7avilmE6FsFPoosRZPYDwPpN3nt2Uc=; b=F05ggVGKZpFjSx9kz6f4viMYn0Ws8O6rMd3kJGGgUpBrFxTTqcUlk3Q868dTCKeblc A2CJpQWdUotdwlTZb6j8VYwdA0ILnOW4uAu0eyPtTfVaKI94AyFhV8SAEGDs2bI2dGzC adr4QbrqQnV68FwSjCz/hVvmIR2LwlqLhRo7YljsmYShYu5asI57G5WZH0ZZbrQnS+ly Bytlc6wN2a1yohlr+LRPdgornHvp4W6ptj6aBq85lV9DQmy7iEK8ogvmK+W0fcdliA09 qVG9Y9/v6L4cCnhxEXOfzkVZ6qQt0qNKmyJ6+tHnVyJw+6n4zKLED2uLGjTe/jYEfpr+ NeeA== X-Forwarded-Encrypted: i=1; AJvYcCU37+ixvRLLxh36bEiJNWaTF2xLVrA1cQjkf0yuhTqFstjaICCDWF45wVTy++VRe18ahP02nHgYsOqLTa54x0uL@lists.infradead.org, AJvYcCUIB0ecs5Mdqri5ArPIU+IReRfMtaJcoZy7jZoe1U6FovuIrVanbpa6TMxJFvDOy4DfUHTRbE0YpQzK5vUYZgnvuw==@lists.infradead.org X-Gm-Message-State: AOJu0Yy7bhACLhKVaVSzXE0DcIT8MAnDtlVOIviU7O4h836uyK+CZwEU D6jjwlBkeKwfkBM3FBeH+V3F31oouk7TXdjwVX+rstZ1Vj1wcymb X-Google-Smtp-Source: AGHT+IGrNaPDXhQd14eA9GwXNdIBi1lCohPeL2NTT8DoIcvH3Sksioy2sSVKcUB2GhWas7pIiNADfg== X-Received: by 2002:a17:902:ccc6:b0:20c:9eb3:c1ff with SMTP id d9443c01a7336-20ca170f318mr153969845ad.59.1728925330247; Mon, 14 Oct 2024 10:02:10 -0700 (PDT) Received: from Emma ([2401:4900:1c96:4540:5054:ff:fe53:2787]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c34aaaasm68567345ad.290.2024.10.14.10.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 10:02:09 -0700 (PDT) Date: Mon, 14 Oct 2024 17:02:07 +0000 From: Karan Sanghavi To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Shuah Khan , Karan Sanghavi Subject: [PATCH] dt-bindings: spi: Add bcm2835-aux-spi.yaml file. Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_100212_868415_AD816802 X-CRM114-Status: GOOD ( 21.42 ) 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 Converted the brcm,bcm2835-aux-spi.txt file to its respective yaml file format. Signed-off-by: Karan Sanghavi --- While running make CHECK_DTBS=y broadcom/bcm2711-rpi-4-b.dtb, I encountered an error related to the compatible property for brcm,bcm2835-aux-spi. To resolve this, I converted the text file to a YAML binding file and checked it with make dt_binding_check DT_SCHEMA_FILES=brcm,bcm2835-aux-spi.yaml and make CHECK_DTBS=y broadcom/bcm2711-rpi-4-b.dtb and generates no error. However, I have a question regarding the cs-gpios property. The BCM2711 datasheet mentions that each Universal SPI Master has 3 independent chip selects. I’m wondering if this means these chip select (CS) pins are native, or if we still need to attach GPIOs to them. If GPIOs are required for these 3 CS pins, does that mean we also need to include them in the device tree schema? and also as arequired property in binding? .../bindings/spi/brcm,bcm2835-aux-spi.txt | 38 ----------- .../bindings/spi/brcm,bcm2835-aux-spi.yaml | 66 +++++++++++++++++++ 2 files changed, 66 insertions(+), 38 deletions(-) delete mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt create mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.yaml diff --git a/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt b/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt deleted file mode 100644 index d7668f41b03b..000000000000 --- a/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt +++ /dev/null @@ -1,38 +0,0 @@ -Broadcom BCM2835 auxiliary SPI1/2 controller - -The BCM2835 contains two forms of SPI master controller, one known simply as -SPI0, and the other known as the "Universal SPI Master"; part of the -auxiliary block. This binding applies to the SPI1/2 controller. - -Required properties: -- compatible: Should be "brcm,bcm2835-aux-spi". -- reg: Should contain register location and length for the spi block -- interrupts: Should contain shared interrupt of the aux block -- clocks: The clock feeding the SPI controller - needs to - point to the auxiliary clock driver of the bcm2835, - as this clock will enable the output gate for the specific - clock. -- cs-gpios: the cs-gpios (native cs is NOT supported) - see also spi-bus.txt - -Example: - -spi1@7e215080 { - compatible = "brcm,bcm2835-aux-spi"; - reg = <0x7e215080 0x40>; - interrupts = <1 29>; - clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI1>; - #address-cells = <1>; - #size-cells = <0>; - cs-gpios = <&gpio 18>, <&gpio 17>, <&gpio 16>; -}; - -spi2@7e2150c0 { - compatible = "brcm,bcm2835-aux-spi"; - reg = <0x7e2150c0 0x40>; - interrupts = <1 29>; - clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI2>; - #address-cells = <1>; - #size-cells = <0>; - cs-gpios = <&gpio 43>, <&gpio 44>, <&gpio 45>; -}; diff --git a/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.yaml b/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.yaml new file mode 100644 index 000000000000..4c24cf2fe214 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/brcm,bcm2835-aux-spi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Broadcom BCM2835 Auxiliary SPI1/2 Controller + +maintainers: + - Karan Sanghavi + +description: | + The BCM2835 contains two forms of SPI master controller. One is known simply as + SPI0, and the other as the "Universal SPI Master," part of the auxiliary block. + This binding applies to the SPI1 and SPI2 auxiliary controllers. + +allOf: + - $ref: spi-controller.yaml# + +properties: + compatible: + enum: + - brcm,bcm2835-aux-spi + description: Broadcom BCM2835 Auxiliary SPI controller for SPI1 and SPI2. + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Reference to the auxiliary clock driver for the BCM2835. + +required: + - compatible + - reg + - interrupts + - clocks + +unevaluatedProperties: false + +examples: + - | + #include + spi@7e215080 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e215080 0x40>; + interrupts = <1 29>; + clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + - | + #include + spi@7e2150c0 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e2150c0 0x40>; + interrupts = <1 29>; + clocks = <&aux_clocks BCM2835_AUX_CLOCK_SPI2>; + #address-cells = <1>; + #size-cells = <0>; + }; +