From patchwork Mon Jan 16 17:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 44284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1328613wrn; Mon, 16 Jan 2023 10:08:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvvpZQeZaB3AvNQddU7nWmzu6hZrgXDwSSsCZmkyEp2ZMlYHnx1coa4Xw+8CjJfvwzRBd8 X-Received: by 2002:a17:907:6d97:b0:7c1:5ee1:4c56 with SMTP id sb23-20020a1709076d9700b007c15ee14c56mr102209208ejc.55.1673892519236; Mon, 16 Jan 2023 10:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673892519; cv=none; d=google.com; s=arc-20160816; b=IQG5PesNtwUeSP77n7GXekaHwisMsHnodn2HyHqPYAcXBA+t6fAWy9LBTjaBAJ+EId Eheuex3GRHG2xmS7D9KCWkBdI9I0O6cRH3qCiL9poaL4bk5obiMvJ+718yU6YbikvjpC KGbkhguCxIbr58hJhIJwNAupCtH0l9BmM0phaiE8PXMEteuVZiBsqGIF3bFkQ8Fx8kH0 m8Gtposfe4yVGBlYwq+3GlvIt/AZKEtwwrbfqDJdTK37Y7POZeObQCQxV7Tw7FaAi5Df DwE+64kUfo5tI3zB+9kHRebOCf36FoFI/G6T42TH51PkuWyv6HYdt6LWoPIB1qCj5bET z6XA== 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=90w47meUN1AAVQio6KlRg3XgdW53vJW4u/H89twTllI=; b=iMlE8XGeS733T1JDqWLERd7TGIVmQANuO35/VJLiFqUAcDCCzzvzYOhh9I6D4nRPrx ILfwRk2XcNhx1aq5dURDUMsQAR0swT3XEkjOQlAP2MRbhnVwjdBNl7rG8XvN/3g31T1C y01FxrTsxqOSh86PNaXBYj8Q4+kdvLHzca6P6+AwqAfxtRJ5+17lETzCei3SWPto1SYT J8NqR3WICT3/tTikuoWenq+aZkqsztQxDwlPnAucXM3cAg6TjBO1G98LBiGDeqTcH+Yu O+V554AlO1TXqbA1h/XNPaa9oYIMun4u85oj9PMcg9OM5V+4DT0xSBcILvQ9TGsPi6w5 7JkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=How2XRdb; 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 hd15-20020a170907968f00b0086a76383bb8si13178393ejc.673.2023.01.16.10.08.16; Mon, 16 Jan 2023 10:08:39 -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=How2XRdb; 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 S232546AbjAPSF7 (ORCPT + 99 others); Mon, 16 Jan 2023 13:05:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232793AbjAPSFX (ORCPT ); Mon, 16 Jan 2023 13:05:23 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971B22E0E4 for ; Mon, 16 Jan 2023 09:52:11 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id b4so22188805edf.0 for ; Mon, 16 Jan 2023 09:52:11 -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=90w47meUN1AAVQio6KlRg3XgdW53vJW4u/H89twTllI=; b=How2XRdbZenvgAgDDrGZ3FiFGN7XicMI8CK7CT+WcPv+zhkDqpFO0pv8WM97miGJba b/AgKl/u9xHbzb2Bj1XV58DKNSW0UfRKVj+iGEaBeohGSwMDTIhJfFfZrunvLYB8bAfI uULDDmDREOJel7THZ/PkRVinm1ERgd2qw55tQ= 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=90w47meUN1AAVQio6KlRg3XgdW53vJW4u/H89twTllI=; b=Kout5XZqtoWvlCyXkILGvbLJclwv9ZCq1oCjnBpypjRNeTDAy9nJSi9sZX8m0tv+im I0wFcJJ8hYrsdV5d67WKEJ6B5jITlJ/E4PGL+yjND8vEtp8tDxQjBWbnRQUogQVve+Jo fcXmXqJocUpBHFOZDmkEowt9YQlIcAPayhzrLzLmYyJBHe7KKZ66AOlz6rlTBf81SdXt phokRq7MJ1wAsdBPnKqyYQjIRW0X6Swqes/avO+vGt3MiJKDN582Sk1X233cxIrDni2F OSjWE0QHl+QmEi1pC5/s86KVIqo9J+MijMhP4ZSwlmfAT4FqICCtEp/FiPIKgduA4O5V Fgkg== X-Gm-Message-State: AFqh2kprKIKrCE2gQDRzPFOKGrljkwh1ah5+dufILw4Fqeqw4jUVZDkR yBVOtasMJ/48JnxwBWn4PUyL2qd4BTbB0hIf X-Received: by 2002:a50:ff17:0:b0:499:d208:e8f4 with SMTP id a23-20020a50ff17000000b00499d208e8f4mr127949edu.19.1673891530023; Mon, 16 Jan 2023 09:52:10 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.. (mob-5-90-75-145.net.vodafone.it. [5.90.75.145]) by smtp.gmail.com with ESMTPSA id fd7-20020a056402388700b00483dd234ac6sm11490723edb.96.2023.01.16.09.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 09:52:09 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Vincent Mailhol , Amarula patchwork , Krzysztof Kozlowski , michael@amarulasolutions.com, Rob Herring , Alexandre Torgue , Marc Kleine-Budde , 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 v7 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Mon, 16 Jan 2023 18:51:50 +0100 Message-Id: <20230116175152.2839455-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230116175152.2839455-1-dario.binacchi@amarulasolutions.com> References: <20230116175152.2839455-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?1755203522027756710?= X-GMAIL-MSGID: =?utf-8?q?1755203522027756710?= 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 --- (no changes since v6) 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..809b2842ded9 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-master; + 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>;