From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Dikshita Agarwal <dikshita@codeaurora.org>,
linux-media@vger.kernel.org, stanimir.varbanov@linaro.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
vgarodia@codeaurora.org
Subject: Re: [PATCH v2 1/7] venus: firmware: enable no tz fw loading for sc7280
Date: Mon, 5 Jul 2021 12:38:27 +0300 [thread overview]
Message-ID: <512298bd-f357-d2e6-9b1b-3a8b674cd3f4@linaro.org> (raw)
In-Reply-To: <1625126736-16266-2-git-send-email-dikshita@codeaurora.org>
On 7/1/21 11:05 AM, Dikshita Agarwal wrote:
> - Enable no tz FW loading.
> - add routine to reset XTSS.
>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
> drivers/media/platform/qcom/venus/firmware.c | 41 ++++++++++++++++++------
> drivers/media/platform/qcom/venus/hfi_venus_io.h | 2 ++
> 2 files changed, 33 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
> index 227bd3b..d5a4674 100644
> --- a/drivers/media/platform/qcom/venus/firmware.c
> +++ b/drivers/media/platform/qcom/venus/firmware.c
> @@ -27,7 +27,12 @@
> static void venus_reset_cpu(struct venus_core *core)
> {
> u32 fw_size = core->fw.mapped_mem_size;
> - void __iomem *wrapper_base = core->wrapper_base;
> + void __iomem *wrapper_base;
> +
> + if (IS_V6(core))
> + wrapper_base = core->wrapper_tz_base;
> + else
> + wrapper_base = core->wrapper_base;
>
> writel(0, wrapper_base + WRAPPER_FW_START_ADDR);
> writel(fw_size, wrapper_base + WRAPPER_FW_END_ADDR);
> @@ -35,11 +40,18 @@ static void venus_reset_cpu(struct venus_core *core)
> writel(fw_size, wrapper_base + WRAPPER_CPA_END_ADDR);
> writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR);
> writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR);
> - writel(0x0, wrapper_base + WRAPPER_CPU_CGC_DIS);
> - writel(0x0, wrapper_base + WRAPPER_CPU_CLOCK_CONFIG);
>
> - /* Bring ARM9 out of reset */
> - writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET);
> + if (IS_V6(core)) {
> + /* Bring XTSS out of reset */
> + writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET);
> + }
> + else {
} else {
...
}
> + writel(0x0, wrapper_base + WRAPPER_CPU_CGC_DIS);
> + writel(0x0, wrapper_base + WRAPPER_CPU_CLOCK_CONFIG);
> +
> + /* Bring ARM9 out of reset */
> + writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET);
> + }
> }
>
> int venus_set_hw_state(struct venus_core *core, bool resume)
> @@ -56,7 +68,9 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
> if (resume) {
> venus_reset_cpu(core);
> } else {
> - if (!IS_V6(core))
> + if (IS_V6(core))
> + writel(1, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
> + else
> writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);
> }
>
> @@ -162,12 +176,19 @@ static int venus_shutdown_no_tz(struct venus_core *core)
> u32 reg;
> struct device *dev = core->fw.dev;
> void __iomem *wrapper_base = core->wrapper_base;
> + void __iomem *wrapper_tz_base = core->wrapper_tz_base;
>
> + if (IS_V6(core)) {
> + /* Assert the reset to XTSS */
insert one tab before comment
> + reg = readl_relaxed(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
> + reg |= WRAPPER_XTSS_SW_RESET_BIT;
> + writel_relaxed(reg, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
> + } else {
> /* Assert the reset to ARM9 */
insert one tab before comment
> - reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
> - reg |= WRAPPER_A9SS_SW_RESET_BIT;
> - writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
> -
> + reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
> + reg |= WRAPPER_A9SS_SW_RESET_BIT;
> + writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
> + }
> /* Make sure reset is asserted before the mapping is removed */
> mb();
>
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h
> index 300c6e47..9735a24 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h
> +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h
> @@ -149,6 +149,8 @@
> /* Wrapper TZ 6xx */
> #define WRAPPER_TZ_BASE_V6 0x000c0000
> #define WRAPPER_TZ_CPU_STATUS_V6 0x10
> +#define WRAPPER_TZ_XTSS_SW_RESET 0x1000
> +#define WRAPPER_XTSS_SW_RESET_BIT BIT(0)
>
> /* Venus AON */
> #define AON_BASE_V6 0x000e0000
>
--
regards,
Stan
next prev parent reply other threads:[~2021-07-05 9:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 8:05 [PATCH v2 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
2021-07-01 8:05 ` [PATCH v2 1/7] venus: firmware: enable no tz fw loading for sc7280 Dikshita Agarwal
2021-07-05 9:38 ` Stanimir Varbanov [this message]
2021-07-01 8:05 ` [PATCH v2 2/7] media: venus: core: Add sc7280 DT compatible and resource data Dikshita Agarwal
2021-07-01 8:05 ` [PATCH v2 3/7] media: venus: Add num_vpp_pipes to resource structure Dikshita Agarwal
2021-07-01 8:05 ` [PATCH v2 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe Dikshita Agarwal
2021-07-01 8:05 ` [PATCH v2 5/7] venus: vdec: set work route to fw Dikshita Agarwal
2021-07-01 8:05 ` [PATCH v2 6/7] media: venus: helpers: update NUM_MBS macro calculation Dikshita Agarwal
2021-07-01 8:05 ` [PATCH v2 7/7] media: venus: Set buffer to FW based on FW min count requirement Dikshita Agarwal
2021-07-05 9:43 ` Stanimir Varbanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=512298bd-f357-d2e6-9b1b-3a8b674cd3f4@linaro.org \
--to=stanimir.varbanov@linaro.org \
--cc=dikshita@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=vgarodia@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).