From patchwork Sun Nov 13 18:13:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 19400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1789201wru; Sun, 13 Nov 2022 10:37:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf6EbMiHPYqa9md7X49j8GH7FYicWoJO29FYJ0bf2Vn8NVauO6dVeRb46I5SobMz80JhpT6e X-Received: by 2002:a63:3343:0:b0:46f:c182:b658 with SMTP id z64-20020a633343000000b0046fc182b658mr8832408pgz.182.1668364634264; Sun, 13 Nov 2022 10:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668364634; cv=none; d=google.com; s=arc-20160816; b=mb+bGE417nyZjHMIXTjgJr5ix9NiTQTnfpP+C7ZXSHL3ZuXeUc/ypsRWocwB9csRhp dVsDLzi5chU/lnz/LK/D9qGoztQp6W1kZqIs6UFMVKPzz0rECESzsM4zRMfJzGFzhb0P 7MTEhHa+AXAkCsocqIXZDozc4d/JfGKz4p9UTxgpk4p/1xE83d5OPCexjRGGJ0SVO2Yq W1/bb9Wejl5U5FTS6IE/5jNK3/nmLLRObsU+4g/kywgI/+OqqVao5gzqxsF4yGHurksk oSK/3r8y1KiG3P9CRz5izAMqM85YDTYOBq0SwJaZuv2veFyTB5EK+b0FfVfIA2LIsPW1 tvGA== 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=ytjq+5ZqtJJOKrYEaXmPKz3aw/q9ijl/XXCtqz4EuF4=; b=qW+vhs8ahXTXPSHjlt5qLatAWtLm5gvJRfC4jz4Ram+PDsDdbLH6tCm1pfI7EIl6wI PypBQiYQcXYtss11NNf21sszFQvKNZpt+flxuP84kvMud2qEKkUzeGx4+oLxRVjmgjrG K3d3EM9yBjkAl/SstFZ8l3EJSl73Pvl4aaHdUaEREOSvEiKhFumryXMTvbOI4gIQj1Q0 m0iZq0L86Z6m/uWQMVkWylDWWxBDSuq1GQNnmJake6KYSZKqtsrplH15ALQqKUlGNC/0 jLVdlo8rUlhynfyAoNmlsqARXrz9cyw2uRGN5lClqZbrJ4B4Er7FFpInNz53Q/LPs+dM ByoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LcgO6u9a; 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 l191-20020a6391c8000000b004703fc2ac2fsi7888550pge.877.2022.11.13.10.36.42; Sun, 13 Nov 2022 10:37:14 -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=LcgO6u9a; 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 S235529AbiKMSNz (ORCPT + 99 others); Sun, 13 Nov 2022 13:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235467AbiKMSNh (ORCPT ); Sun, 13 Nov 2022 13:13:37 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945616352 for ; Sun, 13 Nov 2022 10:13:36 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id x2so14321405edd.2 for ; Sun, 13 Nov 2022 10:13:36 -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=ytjq+5ZqtJJOKrYEaXmPKz3aw/q9ijl/XXCtqz4EuF4=; b=LcgO6u9aDFX7W4e8I8fmr7EsdAQ0E8Uj9NyZCEZC5m8WQeZEPixbQydwqSxn6eMXlz 96Gyr9JqWxyZ7oJyQpZgyZqHm4kxNd+GsnWlDOtRWIlEqyHjtRNwdl0vpIP5Xmp0qMTV 2gwe1DAQVJOB12fCoDNE0xvMCTlWE0mcYV+nU= 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=ytjq+5ZqtJJOKrYEaXmPKz3aw/q9ijl/XXCtqz4EuF4=; b=GklNctGyA42kBZLmaXhnRStmP/LRoTi+oop9RUXS2HL0GwvtIw99mx9zK1L+LTCS45 TrJc6Lm3v7OJ2LhzGFLL+Bbff8Va/YiSTD8sFppz0Ap3nkYqSiL7QMKAu7xbj4n3rGhB ZN5tfQaM4E70p8qh5pT0RIPIs2PM84OZ87tVIM1gdkTXMyM3u78sIZ6LZec7RzBGDhpS kJh9N+outNEiA8STi9eZn9Zm6POBgPPkZdGp74Sm3/Td0x5w1yyAWgsPDKDZE+oVe/x4 L6KdsfpQm+cllQqoKQNoTMSIyJI58wpsC131c8xdecJikxrvOJtjDMCwol4feaZrRUQA uASQ== X-Gm-Message-State: ANoB5plCFZvqqTU1CORM3bTkfbY+Uv/24zcko4isdPBY/Hg0uv6iM5F7 T5SLSM+BfFi8SKbMr4xa59SIRusWuq3Jjg== X-Received: by 2002:aa7:cd13:0:b0:45d:2a5:2db8 with SMTP id b19-20020aa7cd13000000b0045d02a52db8mr8700763edw.105.1668363214952; Sun, 13 Nov 2022 10:13:34 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-40-103-33.business.telecomitalia.it. [79.40.103.33]) by smtp.gmail.com with ESMTPSA id iy6-20020a170907818600b0078de26f66b9sm3225487ejc.114.2022.11.13.10.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 10:13:34 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Marc Kleine-Budde , Rob Herring , Amarula patchwork , michael@amarulasolutions.com, Vincent Mailhol , 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: [RESEND RFC PATCH v5 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Sun, 13 Nov 2022 19:13:20 +0100 Message-Id: <20221113181322.1627084-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20221113181322.1627084-1-dario.binacchi@amarulasolutions.com> References: <20221113181322.1627084-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?1749407114751629498?= X-GMAIL-MSGID: =?utf-8?q?1749407114751629498?= 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 v4) 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>;