From patchwork Mon Mar 27 20:16:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2812 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D25104147B for ; Mon, 27 Mar 2023 22:16:58 +0200 (CEST) Received: by mail-io1-f72.google.com with SMTP id z65-20020a6bc944000000b007584beb0e28sf6155170iof.21 for ; Mon, 27 Mar 2023 13:16:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679948218; cv=pass; d=google.com; s=arc-20160816; b=SgcIvYrF4EEZZaDiaoMrO50bHTH7djm9QjKjP2Q7wh7kVJPWlbBQyQGlResF62w2Hn sAfnescupW+F62sx56LJt2F6R6IRDcY2cMbFk92RkcAVQUFy9fG83DDO1UE1jerUtF7o Tz25duJtzqpQwNgMBvhCxUatAD2QkfxgXfTNMxoL/ApMBYYpXfwJbOcpUcf/5EmlYht3 xwedKC0D9vW2emvvc1h5yQHdux2p9xwqWfYfrOYtBZdpfKf30bU2XuhfotnADn4Lvcri sTKcnvHt9GVavWJAG/k/bHK0cP+OjkJFJTxnfILAALw6z9S9wGZ75bINx7uvVqYznZ/Z pSUQ== 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=qVqFuwC+I0afHiAsbHLiU8Gg1EcbyTSQZggc8TkFR0k=; b=PnePfZA/xcFu6qJyCDBTrkAHrK8qFQ3AyahOu6F+SVr1I1KP/Ghl6w0pfETfk1F37o XU5dHGKbEuT31D1iKwLqFPyvYwUjem4qW3LeKXVSOS38CTvHdv0MaGU+10v9LqlrYG0K 4iTBdk1U19e6nOBOc4crr3WkPe2IJ0Jl21lxONfaA6Bs3f7Q02qLOvk4ojb7BxI/KqEq 1tbULIBQpOfh3CQd+HfI2gR1w8C6b8cYrhWUitAWEWE69RzoJa4eM44SEPO6npq4btTd XW4aDlmUnEuSM5lR/F8pKNjvEttskY8z17oWLgPUssR9n2Y3I6z+N/SQyT+/rnK9rc13 9MWg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JTjIYf+c; 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=1679948218; 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:message-id:reply-to; bh=qVqFuwC+I0afHiAsbHLiU8Gg1EcbyTSQZggc8TkFR0k=; b=euA7tX1t7psp2j/G+ljoA8gezarNurH31DVOZXrkxIeVY4IfwxnO3lOhxTt1HiFBu6 kiS3rqBDKcGakrDmXFVrDMpdEzoPR5mVyruxItdz+6od4x80XwWqQXN3Sv6p6yYvUkqR M2vNdRRHyM6WBDkEN3SteOXwBbyXcXuT6FepY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679948218; 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:message-id:reply-to; bh=qVqFuwC+I0afHiAsbHLiU8Gg1EcbyTSQZggc8TkFR0k=; b=vmM5/Mp73gAa2TLGhiTtT1A7TbZuszz/m5jSl/RAQufd4XAj1vvi9pDluc9w/XP9E0 gqwaHlkwavsU+ADrsGR7TwllfkUy6tLjUmgI9RhCqB8jXxOsrepV4GkAd26l2REl/D19 3SIQXye1xGXk7So0sf4+OuMt1Upwk8WpSSxp3yzAxv89lbfwpy494DJ9A3aUF3+dz7wk OD7W+cc0xvUlXt6nEL8DwTRhHmj95vx5kthegjwnM1Xnfd4WTjZOUuaIrQLmMiwfM9kq K0KKF/l/uc8Pc6ALQE+N/dovRHZgerzEUz3jNnX3ADvSmnDZU5SUujXHmNOxdgVk1/w3 W+ng== X-Gm-Message-State: AO0yUKXoquOZuhl5q8e+icP7mgBLIyKfmN9RahZDZfSVcFHMR7f0sPYT oBM+u8NNiYbCTYp0mb/A8/w582E4 X-Google-Smtp-Source: AK7set+hgfkI6j0MjwrJ7H57CehWT2l9DsMftDOwMK8v+Csr4LpXsjpEgPKM//nuaSttM2qQaRkVWg== X-Received: by 2002:a05:6602:228a:b0:74c:8243:9290 with SMTP id d10-20020a056602228a00b0074c82439290mr4835150iod.4.1679948217831; Mon, 27 Mar 2023 13:16:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6e02:128e:b0:317:979d:93b3 with SMTP id y14-20020a056e02128e00b00317979d93b3ls2819371ilq.9.-pod-prod-gmail; Mon, 27 Mar 2023 13:16:57 -0700 (PDT) X-Received: by 2002:a92:d08d:0:b0:315:9891:85d7 with SMTP id h13-20020a92d08d000000b00315989185d7mr9157634ilh.16.1679948217233; Mon, 27 Mar 2023 13:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679948217; cv=none; d=google.com; s=arc-20160816; b=zsDcy/955wuY8oB9gFJ35SnEvrHo/v96aL/K9OA9pglXYJJZnrDXdo7W04GA/5et1j A3cV0p1K0yJp06C0qYXTEQCODye+IbD40wRekLdKe/WTgcg6ROOMSl9rhB7bsF0nAwIk sVOM0S3x5MkWboy/R+KGo5qgvDMSWS6VUY84zWizPkXQpv3EEoI2Z+fQBpYXkqGWuEWL 9mlFjmwSRsv8COW7l/2mvurL2bMSbyyUhkASpwfaLhjBVkUh6CIb5GA6ul5iexTVmdE6 uoXwXgdQeimuDJbYdDjFAsAssBlaqHAWsE7pFiXPiwXaBc3dfminDjy8r2ZCUDEt18jL 2vsQ== 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=PQBAqyGpgtibuEQ07wkfyoJFQhHr9Hz8PDMB/KLLeHM=; b=o5NAMaL7L/tcUu+nbNM9hPxk9hrBUWsWoGyCk3FFYAJhQkD/cWDXlAEOlvIoRrhmou GSmNeTvfCjWCNzZ02uDJeaiRb8sBhhTfmNa9ElfcQVgnJwIi+FE3hEP9E6fu8ywxfddz b7SOi117lFSErQz6ujwVWaV4acFLTTEdrrlZcV4pjV6dGQGGcSoZoo+DQLjO7rFXfeJN swgdp44EHNtaQu9aGNPkFY6eDg+VzenN9xHWVXICdeyWQhNezdbZHY6JGa1Z0zpxObfr cU3s47jIzoYXJIcUiVPFFMOYanW3z7t+EifPLGCQSMUQhTkg7X8QXVHegcRYzydgdl6C y6bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JTjIYf+c; 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 f17-20020a056e020c7100b0032611f430a4sor820022ilj.158.2023.03.27.13.16.57 for (Google Transport Security); Mon, 27 Mar 2023 13:16:57 -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:a05:6e02:1212:b0:325:dc0c:73f5 with SMTP id a18-20020a056e02121200b00325dc0c73f5mr8544921ilq.14.1679948216966; Mon, 27 Mar 2023 13:16:56 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (host-87-0-102-254.retail.telecomitalia.it. [87.0.102.254]) by smtp.gmail.com with ESMTPSA id u26-20020a02b1da000000b003a958f51423sm5594759jah.167.2023.03.27.13.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 13:16:56 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Marc Kleine-Budde , Alexandre Torgue , Rob Herring , Amarula patchwork , Vincent Mailhol , michael@amarulasolutions.com, Krzysztof Kozlowski , 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: [PATCH v9 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Mon, 27 Mar 2023 22:16:28 +0200 Message-Id: <20230327201630.3874028-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230327201630.3874028-1-dario.binacchi@amarulasolutions.com> References: <20230327201630.3874028-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=JTjIYf+c; 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 primary and CAN2 the secondary, that share some of the required logic like clock and filters. This means that the secondary CAN can't be used without the primary CAN. Signed-off-by: Dario Binacchi --- Changes in v9: - Replace master/slave terms with primary/secondary. Changes in v6: - move can1 node before gcan to keep ordering by address. 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..c9e05e3540d6 100644 --- a/arch/arm/boot/dts/stm32f429.dtsi +++ b/arch/arm/boot/dts/stm32f429.dtsi @@ -362,6 +362,35 @@ i2c3: i2c@40005c00 { status = "disabled"; }; + 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-primary; + st,gcan = <&gcan>; + status = "disabled"; + }; + + gcan: gcan@40006600 { + compatible = "st,stm32f4-gcan", "syscon"; + reg = <0x40006600 0x200>; + clocks = <&rcc 0 STM32F4_APB1_CLOCK(CAN1)>; + }; + + 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>;