From patchwork Mon Sep 17 08:22:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Elwell X-Patchwork-Id: 10602191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7113314DA for ; Mon, 17 Sep 2018 08:32:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61F5B296BE for ; Mon, 17 Sep 2018 08:32:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FE7F296CC; Mon, 17 Sep 2018 08:32:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D76C8296C2 for ; Mon, 17 Sep 2018 08:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bUvgWI2taorImqLwUMbpdLG+xrovZ+wlUp65sV086ZQ=; b=bMbLqr5FzAa/0f gQEYkmUuTFKkPVSsoIZ3koAYdT3HWXlxQOaqdxNheV0h0za7bvYiT1nBrOB+Kg1z6FCRE/d6tP6U5 7DLe2+frFKCOOBNaHDftirUBWcbsej+Rd6+kgGzyFS/epced3GO4Dxl+kI51MbzjBBfsR7uNIzf1A BexP6eAUmzoIgxwgQlBDe/082mCMcpxLwDxKnNSwasdAZRaOwTMZUU+iPHNqxn+js+sXcnfr2xZc4 E71IPGoskAH9CnDLMU06Cw+TOBfGNanKzNrBV02WAt2nES4krvXCravRB5g/CjFMymbR7MANR2gea 8d0t1ZHk43NQO6/NU+mA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1oxU-0001l8-PF; Mon, 17 Sep 2018 08:32:40 +0000 Received: from mx07-00252a01.pphosted.com ([62.209.51.214]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1oo3-0005JQ-M3 for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2018 08:24:54 +0000 Received: from pps.filterd (m0102628.ppops.net [127.0.0.1]) by mx07-00252a01.pphosted.com (8.16.0.23/8.16.0.23) with SMTP id w8H8MU07024133 for ; Mon, 17 Sep 2018 09:22:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; h=from : to : subject : date : message-id; s=pp; bh=Z5lizYVnNUCa3CXYD8dtxP9npeeubcSxEUUhyqVzXFo=; b=7PtFR3BMfh9Z21XYov4Bsl8nHwVcJHFf8ihvoKL2Tj9ZUXS3g1kOZhUJQzcw3h9SnMt+ 5m2msUZGqWKhJjbow+XxddjjEMhrVd/HNjBafj+IJExNFI8L5r9LogSrWzUMekZVId/p 6okUmJsnLm6SA/3hikvLmZn9NqKd/UimEGAyDra1o64PEiH2+gbxIRbgagzoN1PVeXXQ AGReqKJ0NcHNfPEgmUo1oDaed6MtdDkYaSdxYTmarukhxTryitA84No1TvtLtq5s4nRh stwKttso1tCS9RP++pjV+UjoG0DwkTcKR5P1ypu3f2tyOUNRhBMrOvg/SLpCUmr6ou2B pA== Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by mx07-00252a01.pphosted.com with ESMTP id 2mgw8f0v9f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Mon, 17 Sep 2018 09:22:40 +0100 Received: by mail-wm1-f70.google.com with SMTP id t79-v6so1856472wmt.3 for ; Mon, 17 Sep 2018 01:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; s=google; h=from:to:subject:date:message-id; bh=Z5lizYVnNUCa3CXYD8dtxP9npeeubcSxEUUhyqVzXFo=; b=C+LMVru0lujbpJT8M/Ebq8aIjs2rPnkzrXjtIG2MBu7iR60F5iZaoNRYxCSNAHdCK8 6rdbQgnEE3fne2JKfqJHM1gC/wfawJCZ63Fsv6eAeS0wDSYr3yUig2PkBChXDbFtMlku 8K6/6s0Ahh9R4yBlgl5vfVmb3PCQafTUbaMw7IapNhxDicJ7lEgw5OncgYZimthdYWtY eqy2ozWPB+wW0grDC5skGhHkDUfo11lO0AOjbzcjy4pJEuKf7H5KOJfNR/7hU/IyTZt7 qu2gT3dr2nWC/HV3veBR9A6JiACc4J0ufCxf8o8dctuFTDFqGOgst9633sKuXw3cePck DlBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Z5lizYVnNUCa3CXYD8dtxP9npeeubcSxEUUhyqVzXFo=; b=hZx7IS6Vx3BAq7VHBRYLJk3qUCoersFevcT21FPVuqzWnPC67w5EJcfj4GWqvmeYDG uQzLsbu96rlOHgvP+suOUnLwpbfrnZg8czpdC5eAYcWOixjTDuiZS4iu339eEPXThdw7 s4dvRX+ToJNbOF13nfgU0CWGbmcpWZIA4x3vs07Z/RrZr5N1sdo6Hf3gFng1gs9NXBqu PKwIxhBV8P6fGPtPHozIVWUsHMbFqKCOLv3L2mIAUL6M0CjRsplIXfZyDEED91ukaOSn kCWYc/EikNBbJMPvDiJd+c1QqU3p1oXUvrRvX4yVwBoUaeWN39raT/mnwmJqRbtKEubS 3xbw== X-Gm-Message-State: APzg51CNYp/HrrumejqjKYqpPg8eHVJSnWWsswZiGdmLi/wXaidIY4n4 sgRK/L8wookZDMZACwMpTpqoLI9hsoRXXSov8yNhHAbNoqKAaodIuIaH7+dL0ro377xskdykfqA jTJBIVfip1OuxdFhIXavq01iY0ZNXYAbNqPw= X-Received: by 2002:a5d:62c2:: with SMTP id o2-v6mr18819723wrv.83.1537172559766; Mon, 17 Sep 2018 01:22:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaL3yTDCMJ8c1Co9gISsqLZKpbU/kL5KO7WX1DOTLSzGfhLJ21ybETsAXs5VTMiR5krJ28qMQ== X-Received: by 2002:a5d:62c2:: with SMTP id o2-v6mr18819701wrv.83.1537172559449; Mon, 17 Sep 2018 01:22:39 -0700 (PDT) Received: from buildbot.pitowers.org ([2a00:2381:fdf7:14:14e2:e2a0:5538:c448]) by smtp.gmail.com with ESMTPSA id 198-v6sm7938315wmm.0.2018.09.17.01.22.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 01:22:38 -0700 (PDT) From: Phil Elwell To: Rob Herring , Stefan Wahren , Greg Kroah-Hartman , Phil Elwell , devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, devel@driverdev.osuosl.org Subject: [PATCH v3 0/4] Improve VCHIQ cache line size handling Date: Mon, 17 Sep 2018 09:22:20 +0100 Message-Id: <1537172544-104852-1-git-send-email-phil@raspberrypi.org> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-09-17_04:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180917_012256_138937_1EAB0F3F X-CRM114-Status: GOOD ( 20.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Both sides of the VCHIQ communications mechanism need to agree on the cache line size. Using an incorrect value can lead to data corruption, but having the two sides using different values is usually worse. In the absence of an obvious convenient run-time method to determine the correct value in the ARCH=arm world, the downstream Raspberry Pi trees used a Device Tree property, written by the firmware, to configure the kernel driver. This method was vetoed during the upstreaming process, so a fixed value of 32 was used instead, and some corruptions ensued. This is take 2 at arriving at the correct value. Add a new compatible string - "brcm,bcm2836-vchiq" - to indicate an SoC with a 64-byte cache line. Document the new string in the binding, and use it on the appropriate platforms. The final patch is a (seemingly cosmetic) correction of the Device Tree "reg" declaration for the device node, but it doubles as an indication to the Raspberry Pi firmware that the kernel driver is running a recent kernel driver that chooses the correct value. As such it would help if the DT patches are not merged before the driver patch. v3: Builds without errors, tested on multiple Raspberry Pi models. v2: Replaced ARM-specific logic used to determine cache line size with a new compatible string for BCM2836 and BCM2837. Phil Elwell (4): staging/vc04_services: Use correct cache line size dt-bindings: soc: Document "brcm,bcm2836-vchiq" ARM: dts: bcm283x: Correct vchiq compatible string ARM: dts: bcm283x: Correct mailbox register sizes .../bindings/soc/bcm/brcm,bcm2835-vchiq.txt | 3 +- arch/arm/boot/dts/bcm2835-rpi.dtsi | 4 +-- arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 2 +- arch/arm/boot/dts/bcm2836-rpi.dtsi | 6 ++++ arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts | 2 +- arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 2 +- arch/arm/boot/dts/bcm2837-rpi-cm3.dtsi | 2 +- .../interface/vchiq_arm/vchiq_2835_arm.c | 4 ++- .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 35 +++++++++++++++------- .../vc04_services/interface/vchiq_arm/vchiq_arm.h | 5 ++++ 10 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 arch/arm/boot/dts/bcm2836-rpi.dtsi