Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp787876imm; Wed, 6 Jun 2018 06:04:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIHY0uYU562VZ2PSguQIP73vZT1m3fuLSv2eZwA9gfflBcu2JN8gJ4mO3yhsrs60ygh2pyi X-Received: by 2002:a65:4a04:: with SMTP id s4-v6mr2482972pgq.376.1528290299427; Wed, 06 Jun 2018 06:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528290299; cv=none; d=google.com; s=arc-20160816; b=0G1j43dH6cmigN7qYU3WXnqFpd44i+lmyqu64/akcV5HHN4NTA5Fmo9JpciDqei1J0 Z5/QffP3+FIiCVvqmXN+E6OrL0tTm6FaaGQNt1dmZ8tYLWyq0lsr8DmFM0LTBVVjf9dk zMkbVAZPz9ttslIPPya8oOWs3mNhUfJhPsXGmkgNcXjWtadstM1hItd/BHiMmNWp01yT bBb9H+CFlWs9u4pcabQqAegy4Ck51+cFgiApZHbhbNyFEj2zFjz6VT0Ag6eKuexmLe3+ XIel3AkNFZHpI0Zzh5xaGU748Pgx8eRdV1Z2DUVLd/YXo2rRHBj23gRxRI15YUBZjTUM P4Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=UWaVVI3OtiFk1Xs2Vhqe70/anXRtUqwTRs41uWHGKmA=; b=Z8S5DNUENaw0xA0MlVSzeLoLUnerMMpx3BsHaRzfZlOuJFU55ZAglM3PUeIFaGomnu ofIqYd6NZ/uDQLedZNf2i2610zjl7m8+dLUgmA6k/ERmwPTJ3fsEE1Huufk+NcCCXLhO xwKWqtPWtUf4qD3MqCaA8julPasksVfUEjONw9ukvdkD8icGDgIyq9PCqyqOsO16tBlh EP0Hh04khl7CLL3bV/ctbTQXDmo2l3V1D24x1lgeAzO4WkKnCdCO57ZVgHCVGmqH7Vwk YFlKRrl91fegbJ1MCewY2lWHA2Z35NFmwFliQNrDPrQNlNlK7nsHtnBTYwG6nPS98ukt 82lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=LOUeuWzI; dkim=pass header.i=@codeaurora.org header.s=default header.b=m75zf81c; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y187-v6si23700966pgb.120.2018.06.06.06.04.43; Wed, 06 Jun 2018 06:04:59 -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=@codeaurora.org header.s=default header.b=LOUeuWzI; dkim=pass header.i=@codeaurora.org header.s=default header.b=m75zf81c; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752149AbeFFNEA (ORCPT + 99 others); Wed, 6 Jun 2018 09:04:00 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33432 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbeFFND6 (ORCPT ); Wed, 6 Jun 2018 09:03:58 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B9481607E8; Wed, 6 Jun 2018 13:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528290237; bh=i7MDV10QJR38oeYNerldHUYdPjzaeH1BrrtF/DRQg+Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LOUeuWzI+YcPSgUrdx8+Wgzqlff/iFt7SvIvuIInRpnC5n7vQaXNsEypdlI36CpfE YWir3G3iEXVEd94wriH3i8fYn0N0Lf8JgWWcHHbaO0H1QYS9dQGpFJbillmQzUmqde Xam9hygyV3pjCs0y1OS7Ycrii2fULDDenG8lBr/o= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id CDE0160764; Wed, 6 Jun 2018 13:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528290236; bh=i7MDV10QJR38oeYNerldHUYdPjzaeH1BrrtF/DRQg+Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=m75zf81cI0Fx4dSAtz/OCMz5p2kl+H4fZGcFTmb7tvkKOo4vny8AnN/5gSuYIYZVf Hl+NYCEJY3vmcvmxdouqaIagvmdjInzOK5ca90SJyZb5/DZlmFBZpKg1S5ekxNhRHB dZH/qZfrqfaydy2VpXJcp9hUR5mmbv0b0s/adTS8= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 06 Jun 2018 18:33:56 +0530 From: Vikash Garodia To: Tomasz Figa Cc: Rob Herring , Hans Verkuil , Mauro Carvalho Chehab , Mark Rutland , Andy Gross , bjorn.andersson@linaro.org, Stanimir Varbanov , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , linux-soc@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Courbot , linux-media-owner@vger.kernel.org Subject: Re: [PATCH v2 5/5] venus: register separate driver for firmware device 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> Message-ID: X-Sender: vgarodia@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-06-06 10:16, 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. Not really port-wise, but the restriction part is right. Once the firmware is loaded, the ARM9 can only execute those firmware instructions if it is present in iova address 0x0. Merging it to parent device cannot guarantee that the firmware memory is mapped from 0x0. > Best regards, > Tomasz