Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2599111imm; Fri, 24 Aug 2018 01:59:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZpY58nc4vmQ92s/p9h47eMQlE3NEeyr0Mg0NHYi5M8SkrhDmo8fR8V4ujLe+JD74SL3kjO X-Received: by 2002:a63:a053:: with SMTP id u19-v6mr812363pgn.394.1535101161256; Fri, 24 Aug 2018 01:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535101161; cv=none; d=google.com; s=arc-20160816; b=ANBiVl6iUr9COm3NBuP1AynYaibrUkjUD/3Rx2saUeAP7GE1PswTbLP3wb8MDIioBN 6HKe5GmmSmPGxmkyp21CflgWEAycCEMU7oLqBieTRnM/kbfbeidWVAkPVfsQ5PkV9kQ4 S46DrL7GeKPImIU2FhgCq/tjtT+T23BaSwmYuxWqqc5V3GzDmCWXEoebwbneam1SnzYx afKFTukMyYDJJ4i+cMVtghtNoV3JW2Y6XDzsKvvpNvp+ZD1YjkosTAGcUUJ9PcSYFKGX 8LDVQmxLTpk6X5i44b1aXoHSj4UvTTU1ifIyvKomhglgQrUbfIMifvOuCD5KI4UV1fh1 3U+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=D31WSED4rLHFwWsEwfBBfCULhVmUX1cp69t3tvz3U6Q=; b=eWwLA0H94zNTAePMPo+NjyI/0vg1v/mSTMjpH36KFqeYmQ8+6YI5CUBhOEuUR37oFJ RRIQh3iZw4alLrLrWMsB4h5PB/pjORZA4l5OZ0/UuHoq3xNNrp7/wd2zzTHvbxHKEba8 Gku/60OcwBJGq2QNGQXILVHZD9FP/38+shNVXAlYv+EX4eEgfh0qlpp1kNge3uUSqifh pRooB+nhtDvcHu0/W0S0EBbZA1zn5ocjedI5MqXI5nQlI3PbCK9ookcjIF92ksPFHyAb 5c9wNcEJkCA4NXsg9x3St+FfZj+h6M1ketYm8RmNwwD8Ls4hI19v7f9pNKBwGNBJwOEx 3krg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TvrBvvOd; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10-v6si6661853pgf.649.2018.08.24.01.59.05; Fri, 24 Aug 2018 01:59:21 -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=@linaro.org header.s=google header.b=TvrBvvOd; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbeHXMbh (ORCPT + 99 others); Fri, 24 Aug 2018 08:31:37 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38167 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbeHXMbh (ORCPT ); Fri, 24 Aug 2018 08:31:37 -0400 Received: by mail-wm0-f68.google.com with SMTP id t25-v6so891571wmi.3 for ; Fri, 24 Aug 2018 01:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=D31WSED4rLHFwWsEwfBBfCULhVmUX1cp69t3tvz3U6Q=; b=TvrBvvOdLKOuJyTf4l+DFUNnjnIaySd931plb3xEcCoqpmeVYMPkphy23FwhuuZYt4 XrRY6OsaZ3mlTEUwF+uXtKM2y+s5iw9/XpgXOHmw8i1OmY95LGkr+MYoLuLEh/3+T+qT 3o1mVEJokh+6KZnIEOBkJaoQwtzHblzckbK1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=D31WSED4rLHFwWsEwfBBfCULhVmUX1cp69t3tvz3U6Q=; b=A7iVtQa6ykFmnUQq1Ohb9t6O5w6zfy0lkSSpozEwy4Rg4FEcECYTdIh/Fs0ohnjtXa HoWPU4Ysd2mcAg+rozAwW3fcQf4xkPk3gQcFoPDeB9XGKo9ZoBSJPfCm8vclEy2NflDT jznJ+sNBmYyXQzj9W/ZiRdG4Ed+8QSKtvxV122jfG4V3BiFUny9tYtbhCYckB8RgHqZz 4FS8eSi2Gx6TqpAhq5xUVNMhffIWq7PdelmRGwst2PJOGvwtCjkt+3VhD0/hFckrpSsn zPbX7gmMDl5REIOntP4rR/0noNFa9opVSyW1Qr91iHPq89BjeevlpufD7rBYNsLKFIPH nGEA== X-Gm-Message-State: APzg51BS+U1KrBhp6DPNn0Rzq3K6FK0ZucqN0sb4sE6jejm015113cfK MbybV8LiNm0dKwDCrbZWtWuNBA== X-Received: by 2002:a1c:8682:: with SMTP id i124-v6mr829546wmd.77.1535101075650; Fri, 24 Aug 2018 01:57:55 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id c3-v6sm8574391wrm.56.2018.08.24.01.57.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 01:57:55 -0700 (PDT) Subject: Re: [PATCH v6 1/4] venus: firmware: add routine to reset ARM9 To: Alexandre Courbot , 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 References: <1535034528-11590-1-git-send-email-vgarodia@codeaurora.org> <1535034528-11590-2-git-send-email-vgarodia@codeaurora.org> From: Stanimir Varbanov Message-ID: <51cc9d6b-0483-76a6-d413-3f5cc63f3f56@linaro.org> Date: Fri, 24 Aug 2018 11:57:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 08/24/2018 10:38 AM, Alexandre Courbot wrote: > 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 Why you reduced to 5MB? Is there an issue with 6MB or you don't want to waste reserved memory? > 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. > The size is 6MB by historical reasons and they are no more valid, so I think we could safely decrease to 5MB. I could prepare a patch for that. -- regards, Stan