From patchwork Mon Jan 9 18:23:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 41052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2307840wrt; Mon, 9 Jan 2023 10:27:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvUsrczowkEhy6T9emprl1GDEwRSeX3Qu9MntK4D77UtCeMUnfoCP+FM0xVNGUWl3RGAV1X X-Received: by 2002:a62:6102:0:b0:578:3bc0:57d7 with SMTP id v2-20020a626102000000b005783bc057d7mr62251664pfb.13.1673288852817; Mon, 09 Jan 2023 10:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673288852; cv=none; d=google.com; s=arc-20160816; b=ivgljYOSL5+K/Gqy8xf0OnIOo0DjA/Vf1WctsY6G1xTpHNRH01M/pPUg7l7c8O6Ak7 Lhrp1I+/TdnyICiRrmoN/8uD5bq6x1BzOSEhYrdldnM4KiXRXC4P7r0KxdRXbNJzVOD+ mSTBz6uL/Q6P3fpnpAIl3ReCaBbDMzh/lB30gAk/j8JnTD8QG915AcMTlbOw2xR1RjZu 4ZhiclXBtXlfm9/tLTznqT1BMb3WwE3KbW8xyTczWb2iZyoAIcfWidtR61GjyoXZeIPK 4YS8bverDwZ/oOnNzrVTr0Wf9xeicgjWlMt2lkZpdf8FyoKOcnXZta8JYag7ZaK1TPVu UW5A== 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=jqev4qn8vMJFaH1V5Ut+wkKoBur3LID/Y9IF3PP1lxlW93CZ0kh05bgik5FIfvEf7B Er6LHUi4Aht5Zl8mT7SfVBEp6qfeDOg8As6WtQcM1OSG7pqoJgKccl6s48Dzsdp/viT1 X4vKuZSRra+j4I/pDOCywqEuQExGeQspmyVzoiLXmg5Cl5cfIjNmrdmvzuFY/XPiG0GN iWg/wYTgbDoEcyQs2ck02AaGMlNEWbzr+UhJ97owjh5Pvu+1GQCUqashWw0rS9XsvcDx AiGQQFpBoK9y0GzjmCI7mB3xH+yXwULONSCJEqH5xroiq+vlVeZBvKXU6L/c8Er6iJbj 23gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GyE7ITR0; 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 u4-20020a056a00158400b005752602f950si10188781pfk.208.2023.01.09.10.27.20; Mon, 09 Jan 2023 10:27:32 -0800 (PST) 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=GyE7ITR0; 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 S237644AbjAIS1G (ORCPT + 99 others); Mon, 9 Jan 2023 13:27:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237448AbjAIS0c (ORCPT ); Mon, 9 Jan 2023 13:26:32 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A923F10F for ; Mon, 9 Jan 2023 10:24:06 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id vm8so22340977ejc.2 for ; Mon, 09 Jan 2023 10:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=GyE7ITR0+FnjT49DluItNpOqb76uJ7XVa5e1xXP+/66FXqVsYdkgibhh46ZUpObu98 vFZo2Z55wV+xE4w09jTCP6sR02CXie6cXWN/IEKYqC9AxLzsIalUbHwAorjhUIxK9gtB iuduJNnYOMOMaus9MOtoHjuqYc8NgnuTtqnH0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IL5zN1g8VR8g+AjxTuqPkjeqfgRsJz9H6HXu0BQc2lUGEDixVKymaeeJ1LG/d7Z2h5 GJGVFz9Zmc1RR9kXJvKq3Rxh0005sy+dEoYgseMzrfJ0QBLKJmQutWLU7gJLGahHLCPS piTJuA1znLxAgTs5C3mUgQEGAcqtr5GvpbYxdPVMelIlS/74XuZBf4cq4QzTb3Tqx3CF g+wVVN8pwDoMby4wWbI/lymQfZ86GTgxUseFPPVzBA1leb/JNYd/IBGDdGkEVOSga532 AvC6Wukg7bINIaSMCv6sOw6KTdslgjlJD45A1bvQ1loJv+GMH/NIxcJyBXk57lKetO4S 3wzA== X-Gm-Message-State: AFqh2kp50lIsCC/CdR+GAkpDvAUHI5ccFxvD9M9Vc4JTPFl4hOoBWjNu lL5LzwuX7IWBIrcTF4uvpIjG2c3C8QuVHrQS3G8= X-Received: by 2002:a17:907:c30a:b0:7c1:18b1:fd93 with SMTP id tl10-20020a170907c30a00b007c118b1fd93mr59827873ejc.44.1673288644393; Mon, 09 Jan 2023 10:24:04 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (host-80-180-23-57.retail.telecomitalia.it. [80.180.23.57]) by smtp.gmail.com with ESMTPSA id kz22-20020a17090777d600b007c1633cea13sm4093653ejc.12.2023.01.09.10.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 10:24:04 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Vincent Mailhol , Amarula patchwork , Marc Kleine-Budde , Alexandre Torgue , michael@amarulasolutions.com, Krzysztof Kozlowski , Rob Herring , 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 v6 2/5] dt-bindings: net: can: add STM32 bxcan DT bindings Date: Mon, 9 Jan 2023 19:23:52 +0100 Message-Id: <20230109182356.141849-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230109182356.141849-1-dario.binacchi@amarulasolutions.com> References: <20230109182356.141849-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,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?1754570532013420944?= X-GMAIL-MSGID: =?utf-8?q?1754570532013420944?= 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>; + };