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: 12988076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FC6BC04A95 for ; Sun, 25 Sep 2022 17:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4m2ZviSPu0tCF6JtDSdvFcn1vCkYK86uws186rHb4lY=; b=TyjixlCRDpZySc 487XFv70qCnLvlKe4m6UcgVh1Pp7Bf7WreZby8DoUJh8UrYlMmtA7+iyEHzoNzhEyPAbbE3LSaJvD Sr0CveKsfw4FFjp1JED8O9D4jKE7jB5btVt4Q5fL/8Yw0K5k9A1nfsFkRCuuzcpKjDfQ8DRPE5PLJ vvQf/jmL01whWG+7elj13MRysbf+1mJG10pGToSbe2octsBwDJNHWg3yv0Pm16B7BaWvZb5riZCyk rB49XH0DCD/Yq75PAIpIjcolxJPaZScF85ESZASUOE8kHHjtLeEOgC9N7SVk7lrkATWmWsrRrxFNd AuiLREIqJOaaPoqLSpQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocVoR-00FSJu-Eg; Sun, 25 Sep 2022 17:53:07 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocVnj-00FRuZ-Cj for linux-arm-kernel@lists.infradead.org; Sun, 25 Sep 2022 17:52:24 +0000 Received: by mail-ej1-x629.google.com with SMTP id sd10so9903420ejc.2 for ; Sun, 25 Sep 2022 10:52:22 -0700 (PDT) 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; bh=dOPE1L7q5E7QdZRAYhm0K2Z1Q5vapQyABM0Y6Kwo/zE=; b=rpXllgi1ui0C+7mDAPG3UTMJMKX3GqJkXwVqkF+rT3uGpiGSLf62ihJPuG3CrAO29p cRw4A0eLtVJGfsdxFTl89+sNm9OMd/yJTYiqKk2U84orUKiBk2K4xlK7gzMbcEOTARY/ 56WOCSemX4jGl5BmH2khUUmFEpCsQmBUAM/ww= 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; bh=dOPE1L7q5E7QdZRAYhm0K2Z1Q5vapQyABM0Y6Kwo/zE=; b=1aGsfxVU6ov8B5xKuWf5tStOHU4ULNNmZFl6KcOcLTGe/emr4g6ldL143uTKzQ1fLe JoJAKBeRK6cwb0vcYqDz4DDgjjtStGuZRK+HjyBrp+W+Nn1pbKjdCdQfnsmLMGensbFi 1SVZ9fK6RJWglFb6msiWBenwYaPXO9QSI/fPhGZcYbxCAJlgEloRKLvEoWyswlpWUeYV eGaKa2yYKVKtSAODeAvTyx4AFwrB3VUeBwQn90pZChnhSYBXhR0e4+DdGtSMkiLdfe8/ Am7t/Bn0f/TmLJqfWIbJiwd9/dP6iJp4CaYDtdygn92PK3Oj4WZY63MpVKSoo5Cocd9B se/w== X-Gm-Message-State: ACrzQf1SHdwzn9Vp90ZoacPXKO3b3axWPizFeIA1/B0PRloWeshucnHB miQI8xzXQylrphGde5F5bgMmPQ== X-Google-Smtp-Source: AMsMyM7aJJDiFqfcUqHoW3X3EVzo65dZxU25xJIKTVawhR1ThjMIQqAHd5wMOFH5AhT+XV1BFlOEPw== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220925_105223_487505_101C095A X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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>;