From patchwork Sun Sep 25 17:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2382 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0A58A3F265 for ; Sun, 25 Sep 2022 19:52:23 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id h13-20020a056402280d00b004528c8400afsf3652626ede.6 for ; Sun, 25 Sep 2022 10:52:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664128342; cv=pass; d=google.com; s=arc-20160816; b=LQbF4psfG9xg2Mb56XzFCyhzNRCALzP+udbY6uCGcVyN+VWwtJivppeRGv2mMWzSFT HvXJffJ3wjch3flWdw+WYGcgPi9wQGd7CDs5MkHgwlHwHr+ve3+7g5vvyU0sy+phxzHL ZmcT4/kI99KVMGb2rS7Z+fqxWzkCgdJcUyRcoCJmSY/putziJip4DQ90r79YI4Nw3ITG vK4+Dt+CDBOdg15529oQOpTVY7EyLy1h5ImkKQh4MPtAUnQxCv9R2R8RTzuyClM/FdIO rKlJFEnOmT1tffyejnXs5W/APpzaZnGPCLYmgkHXrwX1qnFRH7eUzDonW6ERTOyHSSxi 78BQ== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=6lC0dfLWCQcxXOm08blEbHuJpSP/aj8LQocrdf7ddr4=; b=dv61uU9cQCb9o1azdNyI1CsaQGXldn80ilTvkXEY0i7zTMBXO7aHeVTaBFEo/ChQ1j OPmDqAuAlnTrH+CX/bmOvVKIZLfcTL++sruokMtAcCOsvLEPXtfvOYBJIRIwg3uTbPbT mqslY7p86/cLgLUUESHd9djQsV/VBPDQRYgxyuMHNaSBSiBJY0hboz51a2p0RkJop7FB FBkqA7JMHEFF4cRBG/gugucyEYEEdRud6GOyJkWZbbWIK2QcVSsrVu4aHw3A7byMuTjk PN2e0iKmnUPJSHxUcIHt4MlAA+1sf9TFvPZWSLZ87o1pGJBoZ9fjvqNt+BVzDCr1FROf GA3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rpXllgi1; 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; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=6lC0dfLWCQcxXOm08blEbHuJpSP/aj8LQocrdf7ddr4=; b=OLn0EKS3+sFKqEjFTPLYhb6SVQ5x7AnKbVX1hlARW9tjHJb7yalgxnm+MQGeFaKzQ1 +uafzJafpCLFbiBBUHHYVpStePeo9540puJ38UvXp5FpKvVtGAdymIyAsjWw1wPPkGe1 4rQNINafky7jE9RIKpYFweBnOhU1EqfcZiNdk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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 :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=6lC0dfLWCQcxXOm08blEbHuJpSP/aj8LQocrdf7ddr4=; b=lIDfEWJG6IgdbR/sD0C4rL55arr77Nof8/oWyVYPQGa6kVzipOw8jkzsBLypyO6tTm mXpaqdzig/5CTWYVAPR5DeRrqwIlDNQXgX9a8cfnORLV0YtRmDQKAhgVr/kILLLILWZ5 2NLItLakwRtMfqtXj5AZhiffQvGkNHs7cFZ4vbgtnV1xcL8vog9QwYjNsXxl/q81M/wr MnykSj/TGs/Tuvkm1mnEuQIdU9KSmsh4zL8eOco0Vyf2DbZjLlk0InNblUskSYBm1dTB onSDHRsVCyUzM9BQ4ErkA/I4SxrVhxRznjNeIe/hXn3upNZ3e3plPAiJ5RP9rJV7F5zS PACQ== X-Gm-Message-State: ACrzQf0U/NgB/6mo/12C8mv0qeFpF9GQtovOHoQdLWan/dptoc5JgeVI QJ8q4E9nWJqKVtgf0XdsT7q1MMCL X-Google-Smtp-Source: AMsMyM7hmff5mawBSvRLayjZYvkNUtA3qcUlGgo03eP4O4ZJKz8GbPPRVXXQI6QsVg3ERyEO7AcITg== X-Received: by 2002:a17:906:cc46:b0:782:f40b:11db with SMTP id mm6-20020a170906cc4600b00782f40b11dbmr6954322ejb.32.1664128342433; Sun, 25 Sep 2022 10:52:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:b845:b0:73d:afe3:ffd9 with SMTP id ga5-20020a170906b84500b0073dafe3ffd9ls5706714ejb.10.-pod-prod-gmail; Sun, 25 Sep 2022 10:52:21 -0700 (PDT) X-Received: by 2002:a17:907:7f07:b0:779:7f94:d259 with SMTP id qf7-20020a1709077f0700b007797f94d259mr15116824ejc.525.1664128341221; Sun, 25 Sep 2022 10:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664128341; cv=none; d=google.com; s=arc-20160816; b=bGz4MPDF09ypUxcjsPns1u/G9G72KVpTDuaZ3vjyXBc7VW8XflMcX9iyyClL8yBngQ zRIhYEPCe9ciSfls2W563xXQUyTkuTJNmhtL6uf3a6q4RqvIdLdWyXeS4iSLsQyfEYWm 7VQ9yEnh/IUGaqhNaV1lEqK90KEngyuCbf8jiCv6DBHLkdtaOxUv/OuZIsD3lWRu+h0i RAunk0REbwklhGoxJ5Gou4IDc13gle+7OAtOQAk0yeVpj0w84HMZOvcYd81unWCNeKZg 7SP4zyYliTQJrMxOC1twN8/GBfFKqvdSPzU1T2vswQ9SMttWcCUDJrlSOg7w69etSC0Y +quA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dOPE1L7q5E7QdZRAYhm0K2Z1Q5vapQyABM0Y6Kwo/zE=; b=zFurgxNa8G2mbUJbAdX4HV/36Dhumfics9Ig5+F5xdzmNbzTA4jx1I2QXDCY8Z4gPs TjyXPkUE1wgG46G6HG1OdvTEY6A6wtCEnDTAs2qcOM/f1P/U6Edk3DeuqjiJJl19EpvT gJ/BkqEoC+GGzQeMO/psa5UDGoKNLx7RJsyjdXy62mTT6PQvVkWqM+37iMeFx1bimd7R 3FQQd0uyJIyfDxnlN4ybN0sFaKFRNpud3VUmwEzkuqTCPA3Dloc0CjCYA5ozUsG16Hs+ A31hzDYIXjnhNVRplOYSoTt+tTYXn9+5yzPIdTh0SDSN9G8cxOJY6ogyEbFP2moiRgQL 3Z/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rpXllgi1; 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 mj15-20020a170906af8f00b0073d5ce58140sor5562134ejb.109.2022.09.25.10.52.21 for (Google Transport Security); Sun, 25 Sep 2022 10:52:21 -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:6e17:b0:783:7839:ff3f with SMTP id sd23-20020a1709076e1700b007837839ff3fmr1778971ejc.300.1664128341028; Sun, 25 Sep 2022 10:52:21 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id f23-20020a056402161700b0045703d699b9sm3252594edv.78.2022.09.25.10.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 10:52:20 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Marc Kleine-Budde , Vincent Mailhol , michael@amarulasolutions.com, Amarula patchwork , Alexandre Torgue , Dario Binacchi , Krzysztof Kozlowski , Maxime Coquelin , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [RFC PATCH v4 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Sun, 25 Sep 2022 19:52:07 +0200 Message-Id: <20220925175209.1528960-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220925175209.1528960-1-dario.binacchi@amarulasolutions.com> References: <20220925175209.1528960-1-dario.binacchi@amarulasolutions.com> 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=rpXllgi1; 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: , Add support for bxcan (Basic eXtended CAN controller) to STM32F429. The chip contains two CAN peripherals, CAN1 the master and CAN2 the slave, that share some of the required logic like clock and filters. This means that the slave CAN can't be used without the master CAN. Signed-off-by: Dario Binacchi --- Changes in v4: - Replace the node can@40006400 (compatible "st,stm32f4-bxcan-core") with the gcan@40006600 node ("sysnode" compatible). The gcan node contains clocks and memory addresses shared by the two can nodes of which it's no longer the parent. - Add to can nodes the "st,gcan" property (global can memory) which references the gcan@40006600 node ("sysnode compatibble). Changes in v3: - Remove 'Dario Binacchi ' SOB. - Add "clocks" to can@0 node. arch/arm/boot/dts/stm32f429.dtsi | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi index c31ceb821231..ce08872109b8 100644 --- a/arch/arm/boot/dts/stm32f429.dtsi +++ b/arch/arm/boot/dts/stm32f429.dtsi @@ -362,6 +362,35 @@ i2c3: i2c@40005c00 { status = "disabled"; }; + gcan: gcan@40006600 { + compatible = "st,stm32f4-gcan", "syscon"; + reg = <0x40006600 0x200>; + clocks = <&rcc 0 STM32F4_APB1_CLOCK(CAN1)>; + }; + + 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>; + status = "disabled"; + }; + + can2: can@40006800 { + compatible = "st,stm32f4-bxcan"; + reg = <0x40006800 0x200>; + interrupts = <63>, <64>, <65>, <66>; + interrupt-names = "tx", "rx0", "rx1", "sce"; + resets = <&rcc STM32F4_APB1_RESET(CAN2)>; + clocks = <&rcc 0 STM32F4_APB1_CLOCK(CAN2)>; + st,gcan = <&gcan>; + status = "disabled"; + }; + dac: dac@40007400 { compatible = "st,stm32f4-dac-core"; reg = <0x40007400 0x400>;