From patchwork Wed Sep 24 14:37:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 37838 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 498FB204FF for ; Wed, 24 Sep 2014 14:38:51 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id w62sf2916428wes.3 for ; Wed, 24 Sep 2014 07:38:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=Y2/epC3U35AoeJz5HKUr1cB22UwpSSQdMK2QkM/fHpM=; b=anSO4SjBZGZ6HNPGavYGmachg4XJAOjuQF7Bjn5SNzUlRQdVR/s2dWuItKs8ipkhJS a2iY/xKW+u32TDkp/Taexn2meSSLeKiAZPLyMo6RAl+Ja+/4h7OUgWiGY6rMK67okQSl bqNeTYKZxKFfrP8+68UU9gCiUIsiszFdEOMGUnVMnhz1UTqHHgkIR5aBLeaCYNG7jd2/ pQYdmQ2Io3blrzYtU+OXJ8ioCiKxmrBQBOYSyQ7dxUcCNKLyDcXdq9L8WYEUIV//EWXH E1o0b00asLdBVJV7EdW5klSjZ6u9q17hWIr3RxYXbfhTuiY4JZCaJTcms8o5KjsJr1KT 9p+w== X-Gm-Message-State: ALoCoQkFZLuTNEsGKo0ZTv6RQbVVwCWjgOElvm7LR2DAGqoM6rfGxhZSFRCcYS3Ym8cljgIT4B8X X-Received: by 10.152.29.130 with SMTP id k2mr230406lah.3.1411569530361; Wed, 24 Sep 2014 07:38:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.41 with SMTP id o9ls169865laa.52.gmail; Wed, 24 Sep 2014 07:38:50 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr6876758lae.41.1411569530210; Wed, 24 Sep 2014 07:38:50 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx.google.com with ESMTPS id su1si12190817lbb.33.2014.09.24.07.38.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 07:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id s18so10845862lam.14 for ; Wed, 24 Sep 2014 07:38:50 -0700 (PDT) X-Received: by 10.112.200.134 with SMTP id js6mr6617847lbc.0.1411569530125; Wed, 24 Sep 2014 07:38:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp592911lbb; Wed, 24 Sep 2014 07:38:49 -0700 (PDT) X-Received: by 10.68.68.207 with SMTP id y15mr9011026pbt.94.1411569528419; Wed, 24 Sep 2014 07:38:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id te6si26422245pbc.227.2014.09.24.07.38.47 for ; Wed, 24 Sep 2014 07:38:48 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752894AbaIXOil (ORCPT + 27 others); Wed, 24 Sep 2014 10:38:41 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:54460 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbaIXOii (ORCPT ); Wed, 24 Sep 2014 10:38:38 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s8OEbpBt006881; Wed, 24 Sep 2014 09:37:51 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s8OEbasB014457; Wed, 24 Sep 2014 09:37:36 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Wed, 24 Sep 2014 09:37:36 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s8OEbZR8001502; Wed, 24 Sep 2014 09:37:35 -0500 From: Grygorii Strashko To: , Rob Herring CC: , , , , Arnd Bergmann , Grant Likely , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grygorii Strashko Subject: [RESEND PATCH v2] dt/documentation: add specification of dma bus information Date: Wed, 24 Sep 2014 17:37:24 +0300 Message-ID: <1411569444-7567-1-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Santosh Shilimkar Recently we introduced the generic device tree infrastructure for couple of DMA bus parameter, dma-ranges and dma-coherent. Update the documentation so that its useful for future users. The "dma-ranges" property is intended to be used for describing the configuration of DMA bus RAM addresses and its offset w.r.t CPU addresses. The "dma-coherent" property is intended to be used for identifying devices supported coherent DMA operations. Cc: Arnd Bergmann Cc: Grant Likely Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala Acked-by: Shawn Guo Signed-off-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar --- Hi Rob, Seems, this patch has not been merged accidentally, so I've rebased it on top of Linux 3.17-rc5. Link on v1: https://lkml.org/lkml/2014/6/5/558 Documentation/devicetree/booting-without-of.txt | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Documentation/devicetree/booting-without-of.txt b/Documentation/devicetree/booting-without-of.txt index 1f013bd..7768518 100644 --- a/Documentation/devicetree/booting-without-of.txt +++ b/Documentation/devicetree/booting-without-of.txt @@ -51,6 +51,8 @@ Table of Contents VIII - Specifying device power management information (sleep property) + IX - Specifying dma bus information + Appendix A - Sample SOC node for MPC8540 @@ -1332,6 +1334,57 @@ reasonably grouped in this manner, then create a virtual sleep controller (similar to an interrupt nexus, except that defining a standardized sleep-map should wait until its necessity is demonstrated). +IX - Specifying dma bus information + +Some devices may have DMA memory range shifted relatively to the beginning of +RAM, or even placed outside of kernel RAM. For example, the Keystone 2 SoC +worked in LPAE mode with 4G memory has: +- RAM range: [0x8 0000 0000, 0x8 FFFF FFFF] +- DMA range: [ 0x8000 0000, 0xFFFF FFFF] +and DMA range is aliased into first 2G of RAM in HW. + +In such cases, DMA addresses translation should be performed between CPU phys +and DMA addresses. The "dma-ranges" property is intended to be used +for describing the configuration of such system in DT. + +In addition, each DMA master device on the DMA bus may or may not support +coherent DMA operations. The "dma-coherent" property is intended to be used +for identifying devices supported coherent DMA operations in DT. + +* DMA Bus master +Optional property: +- dma-ranges: encoded as arbitrary number of triplets of + (child-bus-address, parent-bus-address, length). Each triplet specified + describes a contiguous DMA address range. + The dma-ranges property is used to describe the direct memory access (DMA) + structure of a memory-mapped bus whose device tree parent can be accessed + from DMA operations originating from the bus. It provides a means of + defining a mapping or translation between the physical address space of + the bus and the physical address space of the parent of the bus. + (for more information see ePAPR specification) + +* DMA Bus child +Optional property: +- dma-ranges: value. if present - It means that DMA addresses + translation has to be enabled for this device. +- dma-coherent: Present if dma operations are coherent + +Example: +soc { + compatible = "ti,keystone","simple-bus"; + ranges = <0x0 0x0 0x0 0xc0000000>; + dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>; + + [...] + + usb: usb@2680000 { + compatible = "ti,keystone-dwc3"; + + [...] + dma-coherent; + }; +}; + Appendix A - Sample SOC node for MPC8540 ========================================