Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2540204imm; Fri, 24 Aug 2018 00:40:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZJAPdbpcbBiCJ+ZeMzz4oCUKqId+o8cPFRC5f6kQf8WpOH70jF1PBruqqf2thJWGZ+lfBS X-Received: by 2002:a65:6398:: with SMTP id h24-v6mr543338pgv.245.1535096437852; Fri, 24 Aug 2018 00:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535096437; cv=none; d=google.com; s=arc-20160816; b=n4aW6hr/ZRPBidjJqt1NTjpu00MKp0oE18EAB3mwuQEqXmUjIob0ZQJ3doVeOggi9A PNzc1L2hhtluKli4jXuojxgXj2Cw2F2a4Z58wubNJrGZ4StIeEd4HP5KJbzNOkynUsCJ xzQhJNUXXzYEDZFxWfFXMtRynhDNhZCp8414tteB7EtaE12630bbLutRaoEeOi+/lg2y 02qlt2lHa6ndNO+6v0phMUAD7E+Sy4qP5TFBCsiNKuao7o5wgvNwqBPst+H9msNOpqly rrWg6nNEGRuhGyLzK2D602rmHVE9twl6aiApFskNm10eH4AY+AuHFEzBAQu36cezY7gF kE9g== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=7bKnUrXjVkETVXO0+d7RXxxVhP+jlDqw2ImLGT4m4qM=; b=0xIhhT9P/pPIYw3WCkaIntunS6bJBzC0xq9wvprblosFM6wlJJkTaK70YfPPkWiYGl 85EaR4BdHMwaPjHCzd4eN30lkm6TXKFZflXUDxemJI6o3+q95CWuc+zspMVWKkd2Lwo9 66xKdvPIhpJXTW6F2NnDgqw+8eUB5Y8cQEXnIKhXN3sYANBB3NTVENyGpgfeK+GaQpd1 kGY5N6wHzNoRm7aAWF8v+Coig86r/a+lUH8wgrLkmmQozP90KGU8atJnMfufk+YAjilf nfZXcnJGXscRnDSWhmfoHCrjg2cvPveqiL5AL0zFlEbEquD7BzFBFjIUY/ipacSim4f1 1OAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Hw/tV9iQ"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x30-v6si5887839pgk.508.2018.08.24.00.40.21; Fri, 24 Aug 2018 00:40:37 -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=@chromium.org header.s=google header.b="Hw/tV9iQ"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727599AbeHXLMi (ORCPT + 99 others); Fri, 24 Aug 2018 07:12:38 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:36105 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbeHXLMi (ORCPT ); Fri, 24 Aug 2018 07:12:38 -0400 Received: by mail-it0-f68.google.com with SMTP id p16-v6so951359itp.1 for ; Fri, 24 Aug 2018 00:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7bKnUrXjVkETVXO0+d7RXxxVhP+jlDqw2ImLGT4m4qM=; b=Hw/tV9iQdSo/3s8paY2U8aBiv0X/sghV+aqO3Yik5gmE/d8OcOfJ7BptTcGcayCPUC pRdT0D2cb6rl0WoJduLLFrHKdeX7w4eNGrj8BtnMCjOUB3N2V/GrQ5TVGdGhdMZeefgn DVLyhc3F1lqD059OLD8YE1cAyyc1VBAfNsrY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7bKnUrXjVkETVXO0+d7RXxxVhP+jlDqw2ImLGT4m4qM=; b=YniRHYUNDVbiOpTKBguXmMVK5FfgPvpzs3TGXXee8ipy/sI2xuF7Q6r7aifkK/AYxq 4yaNwlub8r5IGaLl/uc/ZUnHJUozmsq0cRg64G1lqBxEVh5TMYuzuIaw6AbTK99OESVF BMLvLZgP7pPgtAlKjCifBb0CsOwzT7eoT62CrkY9U2unJKaP2TIUq4tGPPE+RybbBlUs lcnK1hQSSkI76Q6RuleegxWZJu40v0XFKOHGtEflRt0WJmvTZbFQuPb20YAxuQOzJzqi EgVK5+d4CIfwBIaNSXqIU4D0JnmLZpcqfKjJ+exAJwAPwMb5uwuKaKY/S+GFMnyeJEUl tv+Q== X-Gm-Message-State: APzg51ARRV1zoCVIphDMSpb6hLFzZ9itOZfPRe2HX4V5Ym9/V4rWKF2R rTjMklUmvNBgPTNnLm174qrf4Ie3e2c= X-Received: by 2002:a02:8a05:: with SMTP id j5-v6mr366744jak.59.1535096353419; Fri, 24 Aug 2018 00:39:13 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id c141-v6sm304564itc.42.2018.08.24.00.39.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 00:39:12 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id e14-v6so979933itf.1 for ; Fri, 24 Aug 2018 00:39:12 -0700 (PDT) X-Received: by 2002:a02:579a:: with SMTP id b26-v6mr368997jad.107.1535096351882; Fri, 24 Aug 2018 00:39:11 -0700 (PDT) MIME-Version: 1.0 References: <1535034528-11590-1-git-send-email-vgarodia@codeaurora.org> <1535034528-11590-2-git-send-email-vgarodia@codeaurora.org> In-Reply-To: <1535034528-11590-2-git-send-email-vgarodia@codeaurora.org> From: Alexandre Courbot Date: Fri, 24 Aug 2018 16:38:59 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/4] venus: firmware: add routine to reset ARM9 To: vgarodia@codeaurora.org Cc: Stanimir Varbanov , Hans Verkuil , Mauro Carvalho Chehab , robh@kernel.org, mark.rutland@arm.com, Andy Gross , Arnd Bergmann , bjorn.andersson@linaro.org, Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org 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 Thu, Aug 23, 2018 at 11:29 PM Vikash Garodia wrote: > > Add routine to reset the ARM9 and brings it out of reset. Also > abstract the Venus CPU state handling with a new function. This > is in preparation to add PIL functionality in venus driver. > > Signed-off-by: Vikash Garodia > --- > drivers/media/platform/qcom/venus/core.h | 2 ++ > drivers/media/platform/qcom/venus/firmware.c | 33 ++++++++++++++++++++++++ > drivers/media/platform/qcom/venus/firmware.h | 11 ++++++++ > drivers/media/platform/qcom/venus/hfi_venus.c | 13 +++------- > drivers/media/platform/qcom/venus/hfi_venus_io.h | 7 +++++ > 5 files changed, 57 insertions(+), 9 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h > index 2f02365..dfd5c10 100644 > --- a/drivers/media/platform/qcom/venus/core.h > +++ b/drivers/media/platform/qcom/venus/core.h > @@ -98,6 +98,7 @@ struct venus_caps { > * @dev: convenience struct device pointer > * @dev_dec: convenience struct device pointer for decoder device > * @dev_enc: convenience struct device pointer for encoder device > + * @no_tz: a flag that suggests presence of trustzone > * @lock: a lock for this strucure > * @instances: a list_head of all instances > * @insts_count: num of instances > @@ -129,6 +130,7 @@ struct venus_core { > struct device *dev; > struct device *dev_dec; > struct device *dev_enc; > + bool no_tz; > struct mutex lock; > struct list_head instances; > atomic_t insts_count; > diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c > index c4a5778..a9d042e 100644 > --- a/drivers/media/platform/qcom/venus/firmware.c > +++ b/drivers/media/platform/qcom/venus/firmware.c > @@ -22,10 +22,43 @@ > #include > #include > > +#include "core.h" > #include "firmware.h" > +#include "hfi_venus_io.h" > > #define VENUS_PAS_ID 9 > #define VENUS_FW_MEM_SIZE (6 * SZ_1M) This is making a strong assumption about the size of the FW memory region, which in practice is not always true (I had to reduce it to 5MB). How about having this as a member of venus_core, which is initialized in venus_load_fw() from the actual size of the memory region? You could do this as an extra patch that comes before this one.