From patchwork Mon Mar 27 20:16:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13190070 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 D951BC6FD1D for ; Mon, 27 Mar 2023 20:17:55 +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=II68tE8RZlCrOdJriFSOTuT4yQaFwhKubfXEWFWP8xU=; b=VEOhvl8r4kq+iE HZ/IUUZ+7xc86cJg1RKrnE/1M/lGYRmBlXwyytdvUW8jg5q+321MbuAfBoPfill5q3osByiMKhfkI 2TQ2WSz9IrmlcnnZOvWd4N+8wZngbqQQnzExefVcDaQhWP+W54KN+iGjkXTuOjKyr94ZqcGAQj5C8 qpJf8hspn4R6yD+fgd7nq8Ev83jF5we+Cnzvfvq2fTUwXd2M7bq5PXJu00FlCx0KEC1zX27IewuqL TLM6hI2x6sRCeHTu6erhKCMFTZFMzRMeaHHXMW+CqSdEcr45eyNO7DL9TWTBihghb2xzD2/TOzN3/ tCdiwSLyUuDl9iTFx34A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgtH8-00CIwZ-1s; Mon, 27 Mar 2023 20:17:06 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgtH1-00CIuT-0E for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 20:17:00 +0000 Received: by mail-il1-x132.google.com with SMTP id j6so5252265ilr.7 for ; Mon, 27 Mar 2023 13:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1679948217; 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=PQBAqyGpgtibuEQ07wkfyoJFQhHr9Hz8PDMB/KLLeHM=; b=JTjIYf+c214XaxQnu0kKEL9Eo7jLRGqw+K7R8lqR0oNNC8MVwOVZPZ2fxTrYbvC1Ri CCAZZSSlnBkr3Coou+GNmEyPu1mNmlpeThmdRoKJGRmCh3COBylHJZ4SR5LNWhhRZ4xe x6jcC2+eZ77HFwsra4tlZUWwIsLlZBi1Q4Qto= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679948217; 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=PQBAqyGpgtibuEQ07wkfyoJFQhHr9Hz8PDMB/KLLeHM=; b=4vcBNRU+EHb03j7eyJYxnhrJEngdvCcGIoAvvUtLqiPFciVLP9WtbBtPypZanMFIel 5DMSSamq/gS8KN4grgn8L84Dy5CxMhOZpDBbmUsTtLtziEfGINIhSAB9N2IgFH5UOy18 qB8zuB6DMed8X1Bs6KSeaizWh4HGBxrAEp/0mKexhaN+SHU4COyqFnTF/npU7q7jHyPS QioWqf5sKP8MXtM7x9k9Eq84bNsp8djs1RuhTOq0q2JU77N90yLM2pEAuca/ovbQ6iaO itdWim6m1PMTVQsDImrNsYbOck74HNuHQgxsgkZH8klNvM+jwcZrE8tsr9l9RJds0fga QmIQ== X-Gm-Message-State: AAQBX9cy9TdpN1s/6QxCF40WxWvV6S/LbNVwRDHhuUhrvE7Gbsd8PhRh 9YOqOXXEpZb8cpBN9BqwXuowjg== X-Google-Smtp-Source: AKy350adLi+OaoxxRwg4JjV3hshajTUMAPaxd6bf7+Kdg4CU5S3sd2AFjyNuz2UKvfj6cTH0OVf8Uw== X-Received: by 2002:a05:6e02:1212:b0:325:dc0c:73f5 with SMTP id a18-20020a056e02121200b00325dc0c73f5mr8544921ilq.14.1679948216966; Mon, 27 Mar 2023 13:16:56 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (host-87-0-102-254.retail.telecomitalia.it. [87.0.102.254]) by smtp.gmail.com with ESMTPSA id u26-20020a02b1da000000b003a958f51423sm5594759jah.167.2023.03.27.13.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 13:16:56 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Marc Kleine-Budde , Alexandre Torgue , Rob Herring , Amarula patchwork , Vincent Mailhol , michael@amarulasolutions.com, Krzysztof Kozlowski , 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 v9 3/5] ARM: dts: stm32: add CAN support on stm32f429 Date: Mon, 27 Mar 2023 22:16:28 +0200 Message-Id: <20230327201630.3874028-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230327201630.3874028-1-dario.binacchi@amarulasolutions.com> References: <20230327201630.3874028-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-20230327_131659_110836_0AEF87BE X-CRM114-Status: GOOD ( 13.54 ) 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 primary and CAN2 the secondary, that share some of the required logic like clock and filters. This means that the secondary CAN can't be used without the primary CAN. Signed-off-by: Dario Binacchi --- Changes in v9: - Replace master/slave terms with primary/secondary. 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..c9e05e3540d6 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-primary; + 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>;