From patchwork Mon Jan 9 18:23:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13094102 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 13D54C5479D for ; Mon, 9 Jan 2023 18:38:03 +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=wsAEFEIfRLKmIWyUy9KJOtgffGH3hV++/4Hp34s4L1E=; b=FxEPAwpD9Qn3M0 rBTEc8nL7sroIkdsST1mpqO7GktLdmxJo/u/7rfsTEQi9UT2tB3kkq6opDxN56COhVAOv/l8d3Bob nO1Y6ysxoY+XuW92XUO2mXFfJIOgqAh7Rcso6IidpyDC863nJBjQkdhm1fF4KeBrNF3wvi0EvfI/S LKBygMd19k+yZfsSemryPUazPmeiH0ZLNLIjsyhq1fvPeoDex2OpbkL2vROowwpipSobNWKKcox5R TNkhtwj03hru8EPteODU52rIQBh/n2TO9NdWvmKpkFaidKqgEpyf+/JgPo4W/0sK8KMKgreMALKiY 34XyFxqhgVIfs5AVm++Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEx0f-003LTu-Tl; Mon, 09 Jan 2023 18:36:45 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEwoa-003FsS-U2 for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2023 18:24:12 +0000 Received: by mail-ej1-x635.google.com with SMTP id gh17so22360337ejb.6 for ; Mon, 09 Jan 2023 10:24:06 -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=IyvoS4lwvIpyEoyklIwrERImFtUVOqbD9XwAm5ABwfM=; b=Em2qQJ7rFEjYkZdoCry2iyVJCDZzqkWRMTzhgGNjO+cpHZb1MqFbrE3G8pZC7dkfKh xQjLkDRJr04LNOnP3omQC1x0RLQclqRc/G13V4NXXA446J5edO08vTeBMC9IbS1F1Rwu Dvg0X6VxJH9iChHXi5Bnr1oSSfI2gOpxEbOcU= 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=IyvoS4lwvIpyEoyklIwrERImFtUVOqbD9XwAm5ABwfM=; b=vrmmW/YxfX9aypePEUDr91YG6/1bzMhletviBTZvmdtXuXdV+6aHFQn6YVBje4fZ5r oL1eTFwwtOV6fBD66E3Ta7WQ9q9l3gbBMKwAgym6YkXzlQXv0uYraCmYSJi77402Clvv 9Vvxo+fR9HTNvi0mm223O2mCAktDFuY+v05OvMLwVA6kyTb8fZikF6u0LAdhTrYBAphG FfU147N90vGuWPZ7KtLJ2/T3++Fm7h3oSC3y+3mk7A09ytV44w5xfKZpBRJU1GaRvsnz JzZTtyGWdsCNA/RIScM2sL5ykI1gJjJgnrrXBr8h2izGlUoin3TOehg3MhtvzKCDJrIq P5Dw== X-Gm-Message-State: AFqh2kpkMAdQjVHAkwROpFGCsFh8ye+1wHabOlyUOKXVI1i2oHTzcpuw 8SGdTEnu/ILUrYAV2DufE4PfFQ== X-Google-Smtp-Source: AMrXdXuAWf3obP0O2U9Of1B+8WU1d8adQ+eaAjxTYDRZkG9FzhsZfn5BB6FfOrkaxBgYFCusBIeDWw== X-Received: by 2002:a17:907:2388:b0:7c0:e0d9:d20d with SMTP id vf8-20020a170907238800b007c0e0d9d20dmr53677519ejb.37.1673288645715; Mon, 09 Jan 2023 10:24:05 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (host-80-180-23-57.retail.telecomitalia.it. [80.180.23.57]) by smtp.gmail.com with ESMTPSA id kz22-20020a17090777d600b007c1633cea13sm4093653ejc.12.2023.01.09.10.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 10:24:05 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Vincent Mailhol , Amarula patchwork , Marc Kleine-Budde , Alexandre Torgue , michael@amarulasolutions.com, Krzysztof Kozlowski , Rob Herring , 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 v6 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Mon, 9 Jan 2023 19:23:53 +0100 Message-Id: <20230109182356.141849-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230109182356.141849-1-dario.binacchi@amarulasolutions.com> References: <20230109182356.141849-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-20230109_102410_170927_C9F081AA X-CRM114-Status: GOOD ( 13.71 ) 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 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>;