From patchwork Tue Feb 7 11:29:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 53845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2796356wrn; Tue, 7 Feb 2023 03:34:57 -0800 (PST) X-Google-Smtp-Source: AK7set80h/kH8yf3iVKoIK8l4LD+p9WPN8tvR6dYYvFvvWVezeMH6rnF5EJRQNiYGX/9BhImfSzA X-Received: by 2002:a50:d610:0:b0:491:6897:c5cb with SMTP id x16-20020a50d610000000b004916897c5cbmr2981514edi.41.1675769697427; Tue, 07 Feb 2023 03:34:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675769697; cv=none; d=google.com; s=arc-20160816; b=0USF2n0TRlh+K9PKfs2Vf128Ttg2iZd99zLD9mVppseXG8IUHTPiLnbreLR3bln7KA 9/LUMPHUHbLr7twFKFJz5H4AdM2MntdUJPSIr09ldyM//Uo3NKwleg70Wys1yz4PGfS7 1fSMM8CaX/+sqvj0nQOpEE7h0+qWWLTVGf1u1j3Yi+PdN0UqfQiweegEqymSms5zxnRW 3UOj/zGYlEZ+YldWnAiMOXu1LQKMQN2pk2HsGqWfbCU3dVAevRBwNRGKrHn7f3BWpead cJj7sOumwRVDRZ/6H/2rn3w0GAc/s3n8QdroG/bd39pFPECzaIRblsCPdZ9AysO4j1dP cCUw== 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=UmprEK92YN3tHbARksEEwpOqvJTx8xD9nS0fAsmQi+WzxwEwaDcWMgUrvzw1o95Ksg 3qGqLgkTrYbalV7Ngq95V3zBObqAWKeNokBeUZy+NlcZOfm0VJdkyaKqBr8ayOLPszhL UU3dhKZsfa1Rqoh7L3zNC/KLRZSyCUGABIvocgZ9qIZNxGb8Uj1+pF6P0W3eLLtSQKUh dNOx4qiufQn1kmUt5iZ5Gy2HEeR1ZJoOnDMZM2b9x/iMPuJH6sjXphpZ5EE3p1wOskCj ZJRO63JZgkNISslvHaDOnc5DQ00kVqZs/50MIiTEKpkD2Za6zvNzEWRSxqpxRP+e1hpV 8dww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F53MYSdQ; 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 l16-20020a056402255000b0046fbd084ea6si13570924edb.142.2023.02.07.03.34.34; Tue, 07 Feb 2023 03:34:57 -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=F53MYSdQ; 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 S231449AbjBGLa1 (ORCPT + 99 others); Tue, 7 Feb 2023 06:30:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231628AbjBGLaR (ORCPT ); Tue, 7 Feb 2023 06:30:17 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2C6196A9 for ; Tue, 7 Feb 2023 03:29:59 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id m16-20020a05600c3b1000b003dc4050c94aso11186968wms.4 for ; Tue, 07 Feb 2023 03:29:59 -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=F53MYSdQGFwuQHwkO5WV+1wcfNZhAYR0Mgx05MgQpZTFg4zELN8qqtKL/z+PCMIGZE oJ0+NQpmeY9MXS7hNiG6lQIpxHj+vO6TmMRr286fPuV70OfOjxaZ38XnZed6+EPoNY7o tRrb9ct+ekHsFiuITt6LmCbKxczlG+x55NPX0= 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=ey5MYDZumngNehnprAlIVwyWI4c5xmH1W54QFxiJKRrukt6AT6zrdfKW7CcVkj41wo WZWz9RTyVpi+CTX+LdIqqVypHUB2D0zjteWdF1vk1s1NaT/eD+5xrJaAzYkKOr4f0AZc Q+vrmVVJ6ItKrkAc1zb4fz/Ucf69AbmdV9u2jjmv3Ao/Pks0KIKSrWjvmTs49B0A8naE RIPO4cv3cphAWY/0xOEsmPAyH7J4H8Z7ucCT5ENsq+vnT0q9uZz8x2whhk0bhqMowdPE s6d3YBSo71gAct2E7ILpt+WS5Goj5+MQGzFGOMtSpWoQE3fBiCcAlVxbzHb3dzrf66+r bIxw== X-Gm-Message-State: AO0yUKVgo54MkMhyoU/zhniciC1mLb1zHJjRsgrkX3rGmES+00ZCp4DU Oxwo/BAnQaMBlU5kgIEBtkwKlSsaOVozNzWcrFg= X-Received: by 2002:a05:600c:1887:b0:3dc:4318:d00d with SMTP id x7-20020a05600c188700b003dc4318d00dmr2720115wmp.11.1675769399083; Tue, 07 Feb 2023 03:29:59 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com (mob-5-90-193-20.net.vodafone.it. [5.90.193.20]) by smtp.gmail.com with ESMTPSA id bi5-20020a05600c3d8500b003db012d49b7sm2020827wmb.2.2023.02.07.03.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 03:29:58 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Marc Kleine-Budde , Alexandre Torgue , michael@amarulasolutions.com, Krzysztof Kozlowski , Vincent Mailhol , Rob Herring , Amarula patchwork , 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 PATCH v7 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Tue, 7 Feb 2023 12:29:24 +0100 Message-Id: <20230207112926.664773-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230207112926.664773-1-dario.binacchi@amarulasolutions.com> References: <20230207112926.664773-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?1757171886110387580?= X-GMAIL-MSGID: =?utf-8?q?1757171886110387580?= 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>;