Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp774965imm; Wed, 6 Jun 2018 05:54:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLdYR9Z1VMI7koN7wc6XB0mmsS2tFPtfj/fvW5kVv7DbTdYYg4BttYzhR/SEIs6r1o4RzyD X-Received: by 2002:a63:12:: with SMTP id 18-v6mr2542392pga.121.1528289691894; Wed, 06 Jun 2018 05:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528289691; cv=none; d=google.com; s=arc-20160816; b=i64b8rjZJPqo452uxz+iDyAILHT4+dWdC3iEX7V9MmBXDiyPcruyhROR5xP5jPtqxd l8HClrcu9uyNxRZEyjdCGeWNL1E+y9tuw9bZzP0bTWJvvuLbC6WDeAYs/8ppS4+HoWK8 2ex/LvtSykuqwIDWnSbuT2IElQTko+7qyjxxr8H6wC/fiRIt1cU6kWFn08W1KI1gI+7m Ip+RhtKvlOzTTBk8FrUHr2Ml/UE6DoM/vlw2/yOtecQTOcB55gvOMDJeoR5hfnU/onD2 xbQnob76cEIjIcouhpmXPF04FHrbIVadtXSkHawGGvrPS/0W2DCPS3x7Ykwq92/kIwjG S80g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ejh5Fghn/8+XRAv5H3b4rg8g0JlV/6HO+KHOdxKy4sg=; b=w+CJ+4PXdTQn+j7iEmRh+dp4+ION0sTwH8kO0EdRBtu14TyvKaucdtshmkDoFJtTDw VI6RqIiKyW/ZugQR479Sn4XwG1mS4JrMt+lYwfu/164WxuhDyVsyR72ciTtXUkZXDzGM tKqiH2gkhSNE2U3lLM65WbGH/9CV/OLB6psKCr2YMEzGr7w3rf5KyLDnYujn8S03nJZI M3lPVHM8xNTNiJWEbA8T3tJsRu4OdNI2exU4BA9Lo6UdKSZQ+SBZE7HXvyM9PUbDhcnY LGPfQ4JCCj1aCAhv0TNbaPS1MZ/lSrOL8Z0LfSKXBUFy1g9XP5WiIg0OGVspEUq5Paaa osTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CtRHchKf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si7259103pgt.642.2018.06.06.05.54.37; Wed, 06 Jun 2018 05:54:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CtRHchKf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbeFFMyK (ORCPT + 99 others); Wed, 6 Jun 2018 08:54:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:54292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914AbeFFMyH (ORCPT ); Wed, 6 Jun 2018 08:54:07 -0400 Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0854B2087E; Wed, 6 Jun 2018 12:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528289647; bh=MdPfexgCuBKwUO7Z5R/qjlyzZ7vSYrL4ngQKjZg0o+0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=CtRHchKfFc8iK6NHIeU8nX5cBGVp8LhgFBcliRdoUc1qKKJvg+XQciN+xZhIVraRG iAPP4vvS8RkaRg3xPVszhC4gI5/sCYX0n3AA+iVBIH6/SdzkcI2iYYkRsm/D14tVt+ cgCtK3k+smq9CyKRAguIPfpsyyxrxnHgcVFGffrw= Received: by mail-it0-f42.google.com with SMTP id e20-v6so7819921itc.1; Wed, 06 Jun 2018 05:54:07 -0700 (PDT) X-Gm-Message-State: APt69E1VRQVgUd97xlSWBU5ZL9bkiV+1XPHHH74Jm8Bbuu8cyOPTbo7v GHD8Upi+it6dveEMjfKe7KNgPQ52yG//ZDAPDQ== X-Received: by 2002:a24:4fd3:: with SMTP id c202-v6mr2416133itb.37.1528289646353; Wed, 06 Jun 2018 05:54:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:5505:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 05:53:45 -0700 (PDT) In-Reply-To: References: <1527884768-22392-1-git-send-email-vgarodia@codeaurora.org> <1527884768-22392-6-git-send-email-vgarodia@codeaurora.org> <20180605210758.GA19888@rob-hp-laptop> From: Rob Herring Date: Wed, 6 Jun 2018 07:53:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 5/5] venus: register separate driver for firmware device To: Tomasz Figa Cc: Vikash Garodia , Hans Verkuil , Mauro Carvalho Chehab , Mark Rutland , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , "open list:ARM/QUALCOMM SUPPORT" , devicetree@vger.kernel.org, Alexandre Courbot Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 5, 2018 at 11:46 PM, Tomasz Figa wrote: > Hi Rob, > > On Wed, Jun 6, 2018 at 6:08 AM Rob Herring wrote: >> >> On Sat, Jun 02, 2018 at 01:56:08AM +0530, Vikash Garodia wrote: >> > A separate child device is added for video firmware. >> > This is needed to >> > [1] configure the firmware context bank with the desired SID. >> > [2] ensure that the iova for firmware region is from 0x0. >> > >> > Signed-off-by: Vikash Garodia >> > --- >> > .../devicetree/bindings/media/qcom,venus.txt | 8 +++- >> > drivers/media/platform/qcom/venus/core.c | 48 +++++++++++++++++++--- >> > drivers/media/platform/qcom/venus/firmware.c | 20 ++++++++- >> > drivers/media/platform/qcom/venus/firmware.h | 2 + >> > 4 files changed, 71 insertions(+), 7 deletions(-) >> > >> > diff --git a/Documentation/devicetree/bindings/media/qcom,venus.txt b/Documentation/devicetree/bindings/media/qcom,venus.txt >> > index 00d0d1b..701cbe8 100644 >> > --- a/Documentation/devicetree/bindings/media/qcom,venus.txt >> > +++ b/Documentation/devicetree/bindings/media/qcom,venus.txt >> > @@ -53,7 +53,7 @@ >> > >> > * Subnodes >> > The Venus video-codec node must contain two subnodes representing >> > -video-decoder and video-encoder. >> > +video-decoder and video-encoder, one optional firmware subnode. >> > >> > Every of video-encoder or video-decoder subnode should have: >> > >> > @@ -79,6 +79,8 @@ Every of video-encoder or video-decoder subnode should have: >> > power domain which is responsible for collapsing >> > and restoring power to the subcore. >> > >> > +The firmware sub node must contain the iommus specifiers for ARM9. >> > + >> > * An Example >> > video-codec@1d00000 { >> > compatible = "qcom,msm8916-venus"; >> > @@ -105,4 +107,8 @@ Every of video-encoder or video-decoder subnode should have: >> > clock-names = "core"; >> > power-domains = <&mmcc VENUS_CORE1_GDSC>; >> > }; >> > + venus-firmware { >> > + compatible = "qcom,venus-firmware-no-tz"; >> > + iommus = <&apps_smmu 0x10b2 0x0>; >> >> This mostly looks like you are adding a node in order to create a >> platform device. DT is not the only way to create platform devices and >> shouldn't be used when the device is not really a separate h/w device. >> Plus it seems like it is debatable that you even need a driver. >> >> For iommus, just move it up to the parent (or add to existing prop). > > As far as I understood the issue from reading this series and also > talking a bit with Stanimir, there are multiple (physical?) ports from > the Venus hardware block and that includes one dedicated for firmware > loading, which has IOVA range restrictions up to 6 MiBs or something > like that. > > If we add the firmware port to the iommus property of the main node, > we would bind it to the same IOVA address space as the other ports and > so it would be part of the main full 32-bit IOMMU domain. Sounds like an OS limitation, not a DT problem. That being said, I suppose we can live with having this sub-node if we can't fix or work-around this limitation. Rob