From patchwork Thu Apr 27 20:45:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2871 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BE8173F334 for ; Thu, 27 Apr 2023 22:45:47 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-50a14564599sf7618493a12.0 for ; Thu, 27 Apr 2023 13:45:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682628347; cv=pass; d=google.com; s=arc-20160816; b=tcPRRz2cXnl/iOCTGE7+Go6+JipZehsTUGJGp3in5tsV3iWtcgMubbKe/QUllTLYe/ TElqvlI9/SRJFJLLgL8hUee1BibDL4VZ5lvhiNRalS5GjFEiC5JB4x5etg6ytm/vyteD PNUJmhyCHvJoSTXl5oQbZoPmeT1bmRt1QhYN3bhgN0ncKaJdeL5ElevpPO6ZRtVNrDEv bSRLmDLIEXBK6FmPeDx2ZbwNwSas5luebE6z3dHSF9eFVIQIlVCp2AmgHWyZyW10dxLR DFdTnpSxxXE0T13udgsWuy7vcIlto1KEkfkvFjkAql+zoGAmPB1W3cHVxm4yfKiG/om8 /78A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=6drvMIC6H5iVhbJh1AxymOpvOFVm88+g96rihXZvNGE=; b=oZb2UwXbckhAg3KiI+jJdeMAr53PoFD2FO01LiEtxpCi6swew1yH3ifcweKUpv0XOu K+IRBGwbOez3p6U43i9cg1Ji1KbTpCVWI0salmKHv9D4JfqMDgy1eQMgDIL4GBI9WXcj M5Go0mBNwq5fKnjzs82PcGBt5pyfQeb1FGO21WMtJ+w9lkrg9T2dyLtK5phJWppxP9c8 8y6gXEWi6JRQgyZaHXS1qzf2o6WS7loS5lgc5nwLyztIwLf3qyenJXHY5VuSy5YDFIQS cmdRBEN/d0EKRsu4spNiDiLqvR7al6nH0IqciNwl3zWxv2UcAHzHK2PnQA/Jknavk5vq jUMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NQgjyC4x; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1682628347; x=1685220347; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=6drvMIC6H5iVhbJh1AxymOpvOFVm88+g96rihXZvNGE=; b=bjw6uLqGRJ+7Yr1x85SPoiTGyGAqvjvahhUoVS4OcazGD45a0LVLoBV05yS4SRV6zq TtTNJm6W5R+aONsbjMaFQQuNQkPvroOD275Rp7jxb7ARwP9LhCAeqiEE8uCHhCDadChR 9JIngTTr3qydX6RA1KGNGHhY/JIhMaGJ6DwG4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682628347; x=1685220347; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6drvMIC6H5iVhbJh1AxymOpvOFVm88+g96rihXZvNGE=; b=La6mImOxWkJJt8qTrIR7aLkw7zAHejmidbYdbVsqioEhY7kBzloQ+tqcE45X3J+SGg uxVzLgEWnPV/mcvte8IEw97GfkwkaB1csqqWdwWDU2wePTDSeJ8YWLY9p2p0g4g/AhdQ qQehOusisgO6qtLZe7RTajUtt53VQ3CUZvYTkhf/Q/BK3Ikyd8lZMpJEpy3CtfpAUBdN B2NZf1y0ChxI+C8ZwSfsp2y8/lzC7X+i5yASQuoPEZ/szr85TsBaGjlrCmLUJmt7+0HQ H3liEHSZzVWe8NXHWWUGX6iF3CqXEdnqc+8o0EacT9h5jfnxQouyOPHlL+CDlSTGACtq 3SBQ== X-Gm-Message-State: AC+VfDynOG2pQMzmkYKv7TA5lhKqpqlGffMHIl7AKB1R4uvHdGfoDskY e5qFjCbAsKcWY6et60HymEARXhCC+t9c9XD9 X-Google-Smtp-Source: ACHHUZ71NVbaz2x6cNlT5V8IEoa9vguZlH/S5w1Nd/YexBChOag/4lNQ9dJoAJjqFP72ehgI0nAoBw== X-Received: by 2002:a50:cdd8:0:b0:4af:70a5:5609 with SMTP id h24-20020a50cdd8000000b004af70a55609mr1233502edj.1.1682628347166; Thu, 27 Apr 2023 13:45:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:d08:b0:957:4017:48f3 with SMTP id gn8-20020a1709070d0800b00957401748f3ls1414757ejc.3.-pod-prod-gmail; Thu, 27 Apr 2023 13:45:46 -0700 (PDT) X-Received: by 2002:a17:906:db0d:b0:94e:baaf:3c30 with SMTP id xj13-20020a170906db0d00b0094ebaaf3c30mr3230023ejb.14.1682628344616; Thu, 27 Apr 2023 13:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682628344; cv=none; d=google.com; s=arc-20160816; b=y0y6voH/BOUez8CjXzyetqd85/w25fIwAKIypwn39rqJcswhR4utcwlI5c3zSmw4hT yvey9v21Mp8K930NB6xJyJDLZlOqIXdYlTZlAb/1U3bJq7T8mo5g0/cl5Co9t7b8jyd/ 1NYXe1qJN7EpmRzBGJ/yD5uz5Li+86PTc8BOEjBEcjoDSihNRWSk0sCpacd8edgXkuLZ E58pdF2BU3vb/ewCm3Lz04abJfo5Y9j18RiOFia6rSFgKZ5mfyNo2xPyZXKr/UpGMYqF 5zQ3G73AP35vckE9W+6Uttn4xCnLjAT3TYjuWus7pwT4FP68MxhMQ3c6MQv7XWHt8FpL vyKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=5k9dCctWANQe/yEgS6tS+0M8nlHpydDuo0y2/2pb4aE=; b=Ve+AfkH4Q0UtN0LwPc/Ve+TjcKakJvTMGnGxubxeExz9sgv91Eap3lZm8XiQlIZnIz 9CyBHx/BQg26DMj59EvGWDYURsMlNY/gLg/hMQ2frdjGFq7XiD4oewDWMXqVM/aGlSDO lULhAYD/352hyIQDpR419Ndj6poS81mcEMGGUgCnfoh2w1s4cm0n/+mLrsKWfyC7bHCI DiwXp2o/a3TiOipx3FfTKHVWPCz3qAV96IopwWK7Wyjiv241Kj6LD7dEdksRZXQXOXj7 aO57vGTF9RPrlLRUNt41oVdrkxqYvQRyqDoQstt+7h0kJ9AGW0T99zRvwa+mKE0HldCf ProA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NQgjyC4x; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id lu10-20020a170906faca00b009600ce520e3sor1430759ejb.44.2023.04.27.13.45.44 for (Google Transport Security); Thu, 27 Apr 2023 13:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:7fa1:b0:94e:fe77:3f47 with SMTP id qk33-20020a1709077fa100b0094efe773f47mr4225933ejc.67.1682628344213; Thu, 27 Apr 2023 13:45:44 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-5-99-194.retail.telecomitalia.it. [87.5.99.194]) by smtp.gmail.com with ESMTPSA id s12-20020a170906bc4c00b00947ed087a2csm10171360ejv.154.2023.04.27.13.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 13:45:43 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: michael@amarulasolutions.com, Amarula patchwork , Dario Binacchi , Alexandre Torgue , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Krzysztof Kozlowski , Marc Kleine-Budde , 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 v2 0/5] can: bxcan: add support for single peripheral configuration Date: Thu, 27 Apr 2023 22:45:35 +0200 Message-Id: <20230427204540.3126234-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NQgjyC4x; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The series adds support for managing bxCAN controllers in single peripheral configuration. Unlike stm32f4 SOCs, where bxCAN controllers are only in dual peripheral configuration, stm32f7 SOCs contain three CAN peripherals, CAN1 and CAN2 in dual peripheral configuration and CAN3 in single peripheral configuration: - Dual CAN peripheral configuration: * CAN1: Primary bxCAN for managing the communication between a secondary bxCAN and the 512-byte SRAM memory. * CAN2: Secondary bxCAN with no direct access to the SRAM memory. This means that the two bxCAN cells share the 512-byte SRAM memory and CAN2 can't be used without enabling CAN1. - Single CAN peripheral configuration: * CAN3: Primary bxCAN with dedicated Memory Access Controller unit and 512-byte SRAM memory. The driver has been tested on the stm32f769i-discovery board with a kernel version 5.19.0-rc2 in loopback + silent mode: ip link set can[0-2] type can bitrate 125000 loopback on listen-only on ip link set up can[0-2] candump can[0-2] -L & cansend can[0-2] 300#AC.AB.AD.AE.75.49.AD.D1 Changes in v2: - s/fiter/filter/ in the commit message - Replace struct bxcan_mb::primary with struct bxcan_mb::cfg. - Move after the patch "can: bxcan: add support for single peripheral configuration". - Add node gcan3. - Rename gcan as gcan1. - Add property "st,can-secondary" to can2 node. - Drop patch "dt-bindings: mfd: stm32f7: add binding definition for CAN3" because it has been accepted. - Add patch "ARM: dts: stm32f429: put can2 in secondary mode". - Add patch "dt-bindings: net: can: add "st,can-secondary" property". Dario Binacchi (5): dt-bindings: net: can: add "st,can-secondary" property ARM: dts: stm32f429: put can2 in secondary mode ARM: dts: stm32: add pin map for CAN controller on stm32f7 can: bxcan: add support for single peripheral configuration ARM: dts: stm32: add CAN support on stm32f746 .../bindings/net/can/st,stm32-bxcan.yaml | 19 ++++- arch/arm/boot/dts/stm32f429.dtsi | 1 + arch/arm/boot/dts/stm32f7-pinctrl.dtsi | 82 +++++++++++++++++++ arch/arm/boot/dts/stm32f746.dtsi | 47 +++++++++++ drivers/net/can/bxcan.c | 34 +++++--- 5 files changed, 168 insertions(+), 15 deletions(-)