From patchwork Thu Dec 3 09:19:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11948281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F479C63777 for ; Thu, 3 Dec 2020 09:21:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B304206A4 for ; Thu, 3 Dec 2020 09:21:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B304206A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=AWOXcOwwiCy0F24LEBcJoo9JRV8WK5ZEt4N+fXiElPM=; b=lRgh8Zv8JGcUsedJlhlr/HyCTA kILLhPcBvIyKvgTGV8Tiq8C6pfffpazBmcvLwN1nYyWxeDpW/XNyX7qqEs+RZxHxnvY0ra/U6rppW TTk4YMwglQ8EuVWRU2waJ9x3iMNuDonDsPHe8jOoUmjmqdHNpunqfzcg4B8BMe1INot+04yq3SV6z cA6+p5yTnqKmktBMOGQu8v7TIkaYAInC19zNaf2TomsnhN3oy2hE3E/265zl9wI+9iau6t+4vtU/+ ul3cCaDX3XJsXliL0oVy/s2GYxpa/bvhc6VFARlI63yeVJ8uKhginTqqM+k57NO52B8oAXD7gZg4t PUS0F2Ew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkkmY-0003hq-HO; Thu, 03 Dec 2020 09:20:11 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkkmV-0003gT-8k for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 09:20:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606987207; x=1638523207; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cEtZG8CzappP1JMZACxHlWy5D0g972poZlbDDstlN+M=; b=JJPJp3/jsCAVnp46krgeqNoV/jmByb5tIQOR2TB09mZlNm2GbGKkL49W 8MZgEyqb75aLfN2YoHqYa3QcOCXYj8oS0UWRUHd3B+bdEHIoOdpjleT9s vylNZxrTfQYV3Ts845LKRtmWT0rdLw84f5f5441m1Xgj7KFz7QOjMkxEZ r/Q5a5U7iTNPCg2SMc3rSYGAkGiCqLRuzrtRCTf+5TINzWxgtq9lnLFWO oV+jmJLxG9LrQekY7+0aZEsxqIL1DZzzFh45QYh1cd77xBOAl8I/p/foI BFnH18IWrm+/DhAGsDUe0ShRa4n0bWjkSqEyIhF5fkxlhHnV4YGsRremp A==; IronPort-SDR: GRX9KEdt50jeDyuZjGYMEpOWe7Nr8rTP3+o059LFntscDJOUGIqWA/SulD4EME081M4J2ZSYA7 gXV5vOSjqA7ejzl2Jux+w1gxjbXjOmPj5T+x60/JJ0rLI7+/8A9VsV1MlYsGe3MEGDJHn/XXAj uLBU7T3xe4K2IW3LinMpwZ38GVE4+tZfwE205Npg7CjYHrGjeZaom9Av+gzInE4JN+o14Ow0Zo etxxPwP+si5k53hGw6nkxLi/soYTgIG1jJ0s4hlDCqjsoAzrbTjdDwKzeLWEzLSRKizB+7GGA3 KBc= X-IronPort-AV: E=Sophos;i="5.78,389,1599548400"; d="scan'208";a="101252675" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Dec 2020 02:20:04 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 3 Dec 2020 02:20:04 -0700 Received: from ness.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 3 Dec 2020 02:20:01 -0700 From: To: Alexandre Belloni , Ludovic Desroches Subject: [PATCH] ARM: dts: at91: sama5d2: fix CAN message ram offset and size Date: Thu, 3 Dec 2020 10:19:49 +0100 Message-ID: <20201203091949.9015-1-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_042007_458467_01E191D6 X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Dan Sneddon , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Nicolas Ferre CAN0 and CAN1 instances share the same message ram configured at 0x210000 on sama5d2 Linux systems. According to current configuration of CAN0, we need 0x1c00 bytes so that the CAN1 don't overlap its message ram: 64 x RX FIFO0 elements => 64 x 72 bytes 32 x TXE (TX Event FIFO) elements => 32 x 8 bytes 32 x TXB (TX Buffer) elements => 32 x 72 bytes So a total of 7168 bytes (0x1C00). Fix offset to match this needed size. Make the CAN0 message ram ioremap match exactly this size so that is easily understandable. Adapt CAN1 size accordingly. Reported-by: Dan Sneddon Signed-off-by: Nicolas Ferre Tested-by: Cristian Birsan Fixes: bc6d5d7666b7 ("ARM: dts: at91: sama5d2: add m_can nodes") Cc: stable@vger.kernel.org # v4.13+ --- arch/arm/boot/dts/sama5d2.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi index 2ddc85dff8ce..8f3c40e5b7ca 100644 --- a/arch/arm/boot/dts/sama5d2.dtsi +++ b/arch/arm/boot/dts/sama5d2.dtsi @@ -724,7 +724,7 @@ AT91_XDMAC_DT_PERID(31))>, can0: can@f8054000 { compatible = "bosch,m_can"; - reg = <0xf8054000 0x4000>, <0x210000 0x4000>; + reg = <0xf8054000 0x4000>, <0x210000 0x1c00>; reg-names = "m_can", "message_ram"; interrupts = <56 IRQ_TYPE_LEVEL_HIGH 7>, <64 IRQ_TYPE_LEVEL_HIGH 7>; @@ -1130,7 +1130,7 @@ AT91_XDMAC_DT_PERID(33))>, can1: can@fc050000 { compatible = "bosch,m_can"; - reg = <0xfc050000 0x4000>, <0x210000 0x4000>; + reg = <0xfc050000 0x4000>, <0x210000 0x3800>; reg-names = "m_can", "message_ram"; interrupts = <57 IRQ_TYPE_LEVEL_HIGH 7>, <65 IRQ_TYPE_LEVEL_HIGH 7>; @@ -1140,7 +1140,7 @@ can1: can@fc050000 { assigned-clocks = <&pmc PMC_TYPE_GCK 57>; assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>; assigned-clock-rates = <40000000>; - bosch,mram-cfg = <0x1100 0 0 64 0 0 32 32>; + bosch,mram-cfg = <0x1c00 0 0 64 0 0 32 32>; status = "disabled"; };