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: 970434 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=raspberrypi.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=raspberrypi.org header.i=@raspberrypi.org header.b="7PtFR3BM"; dkim=pass (2048-bit key; secure) header.d=raspberrypi.org header.i=@raspberrypi.org header.b="C+LMVru0"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42DJyr4cgcz9sCS for ; Mon, 17 Sep 2018 18:22:44 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727858AbeIQNtD (ORCPT ); Mon, 17 Sep 2018 09:49:03 -0400 Received: from mx07-00252a01.pphosted.com ([62.209.51.214]:19917 "EHLO mx07-00252a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727185AbeIQNtD (ORCPT ); Mon, 17 Sep 2018 09:49:03 -0400 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 w8H8MTWh024128 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-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mx07-00252a01.pphosted.com with ESMTP id 2mgw8f0v9h-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-wr1-f69.google.com with SMTP id j22-v6so22020394wre.7 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=s+FbQLqOG6kS+MaeUi15TzFCd7rkDbEHxNRK4e5bC9KRYerpRjTKyhy9UVLII+tWKx VIMDGEG64ISvleEjpSlsJ0ncYxsWMf681Z7hlMuTqfw+bXcncwBiEtYMjlPbIABC+1LB PoVFuMFM0UqHQ2QhWsA+rd04wu6Z8iCKZ63XqjZd1B0BkDgIjE2RIe/dgHC7KGjFtFYB qgp9v7+R/984x7YYhaswMTUdja/KsIbS+SwGSjL9BWkyFzWqSM+ZPSRe0hGv9WjCgr4y 0xQ7mg3W0Zn4SS/Lk2WjYWu5yt3RUX/PzrxoJwa0phlY14h32yJ+G6DEpWYA8Er54PXP UvIQ== X-Gm-Message-State: APzg51Cb9tjRjCOmQIk0iv/Zmi4QIN1TlyDG3ojR3lf54ZWladN5R4I3 DvISWwAB6de5tzw7WYf5f8gE1Fu0a3kR8klv3q8P2mrLdBv3PC1w3Ql+BWHzFuYp3F4y93rIzOU jpvo63mGRvRpKEZeLBmpWuw== X-Received: by 2002:a5d:62c2:: with SMTP id o2-v6mr18819722wrv.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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 Tested-by: Stefan Wahren