From patchwork Sun Nov 13 18:13:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 19399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1782506wru; Sun, 13 Nov 2022 10:14:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf51Qv5HM2Mu8IKACLVMtJcQI8Fvd+oZsO2QgfSww975hIbNz+Bq+GgTsMyrnDiCN9K1KfSv X-Received: by 2002:a17:902:d191:b0:186:c483:f017 with SMTP id m17-20020a170902d19100b00186c483f017mr10931892plb.136.1668363262773; Sun, 13 Nov 2022 10:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668363262; cv=none; d=google.com; s=arc-20160816; b=IkPV2BR0fQb9l+KEpMCH3M/OxefmIW6dONJPeYqzo/Oh5mG6mKPXkOlZBa4UpcvvyW 9jCJsgl/Gxkokp3smIauGy6d1o4iJKmU1FF6xN/EVHLsprOgpM1ezQgfHMGMHXnObH8W cXDtEyikE21ApditH2BQ4LYMiPGfuq4UchLjrb2vb0LFg8lFJLISz7NGMgyGJWR3pcwc FujKWXLRhKFuKDLKhvcS0b3tFK1pMuxSZJNw22pNupRdl7WGK9Xh0ZVApA/JJWl4jBZu ngPPkJALmMaWPQAfPZTYCe2SzX3deb9ObZmKIb8JQgwrBKWvJG06N7C0qKcaxY4IPNiS sRWw== 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=D8/Md0NYJHUSKcz4MJWTxhKaskWW/ctRpyjjxqRRhnc=; b=d6OS6WUL2fwiXTRcirY9S2/QeT3+kHR7U1WLGld9lBqE6yCfIIf1zQNUmgiiPir8Sy 5BBjGCXI3nAckK8+bAORRmxs4+QWOEhS/nA32LtSBaoewKPiAtUjVx88mkjaGxgtzOzw 2Nrr0+tphuoScY4lwWPiYFQXx7BIuu1zbgz3DDBnJ9zx3fQAAWd75fM/OOaw4en89WeW 9qg4O50HJGFs7ephJnuTPH0AATFTnr5Ug2/JMdOWoE7/huPbi4xRxlipskhkvIvKtuaY turJKdC1UwQyQOcYqEVoA95wmPnDsRpRgUzSqcxDjQlk/vgtr0S04LDFumFbyXXbdv0L GElA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZOmYYgrE; 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 c18-20020a170902c1d200b00179c921918esi7705782plc.17.2022.11.13.10.14.09; Sun, 13 Nov 2022 10:14:22 -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=ZOmYYgrE; 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 S235521AbiKMSNt (ORCPT + 99 others); Sun, 13 Nov 2022 13:13:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235483AbiKMSNh (ORCPT ); Sun, 13 Nov 2022 13:13:37 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6731A64DA for ; Sun, 13 Nov 2022 10:13:35 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id f5so23420315ejc.5 for ; Sun, 13 Nov 2022 10:13:35 -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=D8/Md0NYJHUSKcz4MJWTxhKaskWW/ctRpyjjxqRRhnc=; b=ZOmYYgrEGoVimA2TEfidyVQgl7KwexHNHm+svvev3mYj94RrJx9jxXLI+SRn2X05S6 Q99YX4bhsALtW3GQZdqYRzwitFsbhTXlF8jNOePfnjudIoVPFDFqwv/2Zm30AvuJ4MlQ qhjfB8i4c9xMAR13TW0wLXDJqheW2bM+CLRUo= 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=D8/Md0NYJHUSKcz4MJWTxhKaskWW/ctRpyjjxqRRhnc=; b=Kfho56f/p/259ACTtVD5QCZnuCo0TwA2qxBqAySc2rHmNq9dS0GckdGYFolKI/NIhj vk5+QsuGXNNI20Rz0QnyZSNLjP1wGnuRsq06etKPKVyEtPIB4B6LAgEbDmieCkO4K2qS xo31SGLRhX1gf4RyY2a7Qkc2vaNYPwW2h6U7JrDNm/zMbZ9ClsubyrTo2HEes/khIIm9 rZa8VORnHhmanB45xf7zZmruTSBGbRyOuf2l28ZxHOmprw3AFEJrYm+7Au7Hro7jWtsX K20ao6p2zdmX13Xh1mTuUtWUlSF82RoGAL8xVdDqfLOAVDuL77CrzpnBso6WSOVNoIJZ SUww== X-Gm-Message-State: ANoB5pn0fSc9edanYX2dW0NxVHykDXX895x+Ae5xHQFTjXDkKzFLMdqG V0wSabpKMIvs5uZAKCfqfG13KFl3AOm1jw== X-Received: by 2002:a17:906:b855:b0:7ac:f8e3:d547 with SMTP id ga21-20020a170906b85500b007acf8e3d547mr8089231ejb.53.1668363213667; Sun, 13 Nov 2022 10:13:33 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-40-103-33.business.telecomitalia.it. [79.40.103.33]) by smtp.gmail.com with ESMTPSA id iy6-20020a170907818600b0078de26f66b9sm3225487ejc.114.2022.11.13.10.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 10:13:33 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Marc Kleine-Budde , Rob Herring , Amarula patchwork , 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: [RESEND RFC PATCH v5 2/5] dt-bindings: net: can: add STM32 bxcan DT bindings Date: Sun, 13 Nov 2022 19:13:19 +0100 Message-Id: <20221113181322.1627084-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20221113181322.1627084-1-dario.binacchi@amarulasolutions.com> References: <20221113181322.1627084-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?1749405676353909306?= X-GMAIL-MSGID: =?utf-8?q?1749405676353909306?= Add documentation of device tree bindings for the STM32 basic extended CAN (bxcan) controller. Signed-off-by: Dario Binacchi Reviewed-by: Rob Herring --- 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>; + };