From patchwork Sun Mar 26 16:03:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 75117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1014604vqo; Sun, 26 Mar 2023 09:08:57 -0700 (PDT) X-Google-Smtp-Source: AKy350atki58qRE6B1vpC9e7p0Q1fz7x466coGWDusaiDxHM6IL6m6EYv1qS/Oqu8rSrLCrgGb+f X-Received: by 2002:a17:902:fa48:b0:1a2:1513:44bf with SMTP id lb8-20020a170902fa4800b001a2151344bfmr8174006plb.1.1679846936937; Sun, 26 Mar 2023 09:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679846936; cv=none; d=google.com; s=arc-20160816; b=iZX/bW9mmEgCqiNkBUnCGI8D3tLUZAS+wEZuWQaDZnGj8/d0IuX6Th3/OE4hlVMBLT Xz5vil0waKxt5CJYNhZ7fCQ/l3oGVXnPRN5sXU9LpUbGhdKDhu2HZd09ua7cwvmYQl+b 8aDsQJ6NEKOdlx+XCbbhhNHgSWL8NxIXg9GfaFcQr7aqiSLyrVUwOfy09G2Ey+KnKtlu AqRZGshOkIkINFhQIRiT4t1zA3kcQOQHaHBjReinOnMteDTHRsRgeTVG6hRF8PTBlsgE Ql4uBxCydY97At3hNor8kW+dskmCUj7EgUDmIkaBdZMG5rSOJSrZ6AcRQubH1G8dOVkt xF+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kod5siM2bcM+dDVpz/GqL4BGUBIqfHoecSZkZ5xWujI=; b=kM14b+36fng0yo7ae73p6QAYCzGpIh+ZQVUnJanD0Bmu8sdF4uL8BUCeYa15mWFhJk ctjNA4KOmS6RjGOiQQ105fUnTAl0lwXFQT3G74QiQP185yv6S9CKl3zroWwLQ0VUQRqe hP6eWC8BpcQiVawRSbJgjbQXF7W2gW3xiRai5cG3cMi88Jt+bTZ2lWdfwOAEx7qXRj5k m5x3tMUpSSh4styW8FJA+kBdhhCzFEwhlj7LmweQGCxpmf7lC41BVEgGWucaKQ+X9UTi 2DgFS/wDo5WzyKbphnXxiZ5uh4CuG6CQDM1Gqc7txAhgRKDOMkXJR9U6zvGu4daRoL2h ZLDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gye0T3mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kx3-20020a170902f94300b001a1d9808392si15453523plb.465.2023.03.26.09.08.44; Sun, 26 Mar 2023 09:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gye0T3mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbjCZQDn (ORCPT + 99 others); Sun, 26 Mar 2023 12:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbjCZQDh (ORCPT ); Sun, 26 Mar 2023 12:03:37 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD8C4218 for ; Sun, 26 Mar 2023 09:03:35 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id w9so26317081edc.3 for ; Sun, 26 Mar 2023 09:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1679846613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kod5siM2bcM+dDVpz/GqL4BGUBIqfHoecSZkZ5xWujI=; b=Gye0T3mSAKu/KCA7d5RgF9fsYyJyVd7lXQsidrgXH1Eqo9gF2PE/PPbrxMmlQInLqC iKPHp+t5NVovkxeF0juFb89cE3w/SDzS4Oo2nzAnebcqo231WqHli0FKbvnYde0hGgvA jf9xgfbPJWb6+txtWcg/cbaOJN3qd5uYt1wYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679846613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kod5siM2bcM+dDVpz/GqL4BGUBIqfHoecSZkZ5xWujI=; b=3XgEYvnWkwj8tRRXvCsObaLRDg3Z4AgRBQBuyuTNVaBPcwwonmP31SOO/DpZ+w70+U It9m92MgU12+rQHVodidopIKbe/cnJ5IantD1LJOnY8pkhIx6Bb1cJ667Dn0MzvIrJMW EvMv16FqlGuEvXME7UF+cKq78GUwvw+jIvIyXFg6VrXx2xe1575S7VYtLLIhbQKsiwyz qQk9uyiroOjLEVPMK5mfNxM0gOtmfE4HobxD4B7kuSn4ZkASX40Yr9HXPS5yP8t7aYvx 8dgZGVlBzZbe8YAVmAmBrffwDaAJBmGVAXpQwJXyRWxI7MacjgUBXDj03Y2iT3IFAIsH GXjQ== X-Gm-Message-State: AAQBX9cTwkhzTetFPZwyUf6quCCM88yopYOxJXKy/uJrUE/E/pyaEyCf dihZN/K8+gR1SA2D5Vjo+rKeF1qwQagTv3lo+zYwKw== X-Received: by 2002:aa7:cd8d:0:b0:4fe:1b62:4741 with SMTP id x13-20020aa7cd8d000000b004fe1b624741mr8976237edv.28.1679846613613; Sun, 26 Mar 2023 09:03:33 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-0-102-254.retail.telecomitalia.it. [87.0.102.254]) by smtp.gmail.com with ESMTPSA id m2-20020a50d7c2000000b00501fc87352fsm6869333edj.13.2023.03.26.09.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 09:03:33 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , Rob Herring , Krzysztof Kozlowski , Marc Kleine-Budde , michael@amarulasolutions.com, Vincent Mailhol , Alexandre Torgue , Dario Binacchi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Krzysztof Kozlowski , Maxime Coquelin , Paolo Abeni , Rob Herring , Wolfgang Grandegger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-can@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org Subject: [PATCH v8 2/5] dt-bindings: net: can: add STM32 bxcan DT bindings Date: Sun, 26 Mar 2023 18:03:22 +0200 Message-Id: <20230326160325.3771891-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230326160325.3771891-1-dario.binacchi@amarulasolutions.com> References: <20230326160325.3771891-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761447181590188043?= X-GMAIL-MSGID: =?utf-8?q?1761447181590188043?= Add documentation of device tree bindings for the STM32 basic extended CAN (bxcan) controller. Signed-off-by: Dario Binacchi Reviewed-by: Rob Herring --- (no changes since v5) Changes in v5: - Add Rob Herring's Reviewed-by tag. Changes in v4: - Remove "st,stm32f4-bxcan-core" compatible. In this way the can nodes (compatible "st,stm32f4-bxcan") are no longer children of a parent node with compatible "st,stm32f4-bxcan-core". - Add the "st,gcan" property (global can memory) to can nodes which references a "syscon" node containing the shared clock and memory addresses. Changes in v3: - Remove 'Dario Binacchi ' SOB. - Add description to the parent of the two child nodes. - Move "patterProperties:" after "properties: in top level before "required". - Add "clocks" to the "required:" list of the child nodes. Changes in v2: - Change the file name into 'st,stm32-bxcan-core.yaml'. - Rename compatibles: - st,stm32-bxcan-core -> st,stm32f4-bxcan-core - st,stm32-bxcan -> st,stm32f4-bxcan - Rename master property to st,can-master. - Remove the status property from the example. - Put the node child properties as required. .../bindings/net/can/st,stm32-bxcan.yaml | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml diff --git a/Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml b/Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml new file mode 100644 index 000000000000..c9194345d202 --- /dev/null +++ b/Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/can/st,stm32-bxcan.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics bxCAN controller + +description: STMicroelectronics BxCAN controller for CAN bus + +maintainers: + - Dario Binacchi + +allOf: + - $ref: can-controller.yaml# + +properties: + compatible: + enum: + - st,stm32f4-bxcan + + st,can-master: + description: + Master and slave mode of the bxCAN peripheral is only relevant + if the chip has two CAN peripherals. In that case they share + some of the required logic. + type: boolean + + reg: + maxItems: 1 + + interrupts: + items: + - description: transmit interrupt + - description: FIFO 0 receive interrupt + - description: FIFO 1 receive interrupt + - description: status change error interrupt + + interrupt-names: + items: + - const: tx + - const: rx0 + - const: rx1 + - const: sce + + resets: + maxItems: 1 + + clocks: + maxItems: 1 + + st,gcan: + $ref: "/schemas/types.yaml#/definitions/phandle-array" + description: + The phandle to the gcan node which allows to access the 512-bytes + SRAM memory shared by the two bxCAN cells (CAN1 master and CAN2 + slave) in dual CAN peripheral configuration. + +required: + - compatible + - reg + - interrupts + - resets + - clocks + - st,gcan + +additionalProperties: false + +examples: + - | + #include + #include + + can1: can@40006400 { + compatible = "st,stm32f4-bxcan"; + reg = <0x40006400 0x200>; + interrupts = <19>, <20>, <21>, <22>; + interrupt-names = "tx", "rx0", "rx1", "sce"; + resets = <&rcc STM32F4_APB1_RESET(CAN1)>; + clocks = <&rcc 0 STM32F4_APB1_CLOCK(CAN1)>; + st,can-master; + st,gcan = <&gcan>; + };