From patchwork Wed Oct 5 08:37:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12999048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1CE6C433FE for ; Wed, 5 Oct 2022 08:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiJEIiC (ORCPT ); Wed, 5 Oct 2022 04:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbiJEIh7 (ORCPT ); Wed, 5 Oct 2022 04:37:59 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B070673902 for ; Wed, 5 Oct 2022 01:37:58 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id u10so24721776wrq.2 for ; Wed, 05 Oct 2022 01:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=q9iQElDOirbdVJ/B2wLi7+yO3Wyao1noVf51AiDgJFo=; b=OlZtr53AiAqaCEsScp6R2DjaV8/Fb58pybt1lgbnH1EgriiP6LztWPIzooExFSAD76 Z8j6s0Ka7MEt0NlNVNhmVGUxKgK386YUGGF8uTLnV4/TU6kklTCpZakSoMJ6xZGc7Jvl DiDAsgfgSZcKMovt4bsYV/+0fIPNy0UJjhFZ1kJFz+IhxB8mGC0iI97bCC7qZZ+Vodx8 3+TCboQO0Cty3kxXJA4GkLspQVRi8+fw/Gw1xWf42w/W92nYWuTVvvJ50BPwKl/0dxXD BIr6W8R2U1z0BXDEllV+CUVSoBPXzBBcxb1VJfV1Zr9r9OYjEm9InX5qKdpNZId3ncRo GP6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=q9iQElDOirbdVJ/B2wLi7+yO3Wyao1noVf51AiDgJFo=; b=xrLBErViYVvjVFo1EGgvoG+Nab78gWfU3w74AY0iuaqw5WnQhi90zDzuKr8y6lcZO0 VG2IO+fIVK5IVu2mlpaM+HmXClZAns8yhFIlHWwjPrZ3DLQxj9Fmw1BxeOUMC/lrVfua LkgdrwYNY6EHKGOK0EWTYYrudEv3z4ZX8QOJPcp0/8wTEFInZq32ZZx+5h6+JO2ZaG6k 0QAkZV4XUbRoFMreRhEnDCVDroA4LaXIy96jfsQ0gPV3i//X7w2QlHezNDugwWFTB6ny kFBLiEiiaeZoPfybQim3hrWFPQwub58Cn5ktBPQwBPf95a3Dk314IQCQO9X2TnXCXinC D0iw== X-Gm-Message-State: ACrzQf2OPPXU2phdwf2VYw+u3N87dSVK6fglO5ZnFYue+OSj8bJAwdXZ PNN+pyGNrwCARTYYxjeUKMj+RWSp62K7GA== X-Google-Smtp-Source: AMsMyM67V0zhQ5v9XoNEOaJtjEfK70k66EnzjM1HriUB1ZeCiVO06hT9kkF9RIZKg2KyVjhY5zxbMw== X-Received: by 2002:a05:6000:1acf:b0:22b:36ad:28e with SMTP id i15-20020a0560001acf00b0022b36ad028emr18582345wry.314.1664959077080; Wed, 05 Oct 2022 01:37:57 -0700 (PDT) Received: from localhost.localdomain (hst-221-6.medicom.bg. [84.238.221.6]) by smtp.gmail.com with ESMTPSA id g6-20020a05600c310600b003b47e75b401sm1318171wmo.37.2022.10.05.01.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 01:37:56 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Stanimir Varbanov Subject: [PATCH 1/3] venus: firmware: Correct reset bit Date: Wed, 5 Oct 2022 11:37:28 +0300 Message-Id: <20221005083730.963322-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221005083730.963322-1-stanimir.varbanov@linaro.org> References: <20221005083730.963322-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The reset bit for A9SS reset register is BIT(4) and for XTSS_SW_RESET it is BIT(0). Use the defines for those reset bits. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/firmware.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 14b6f1d05991..3851cedc3329 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -68,9 +68,11 @@ int venus_set_hw_state(struct venus_core *core, bool resume) venus_reset_cpu(core); } else { if (IS_V6(core)) - writel(1, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); + writel(WRAPPER_XTSS_SW_RESET_BIT, + core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else - writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET); + writel(WRAPPER_A9SS_SW_RESET_BIT, + core->wrapper_base + WRAPPER_A9SS_SW_RESET); } return 0; From patchwork Wed Oct 5 08:37:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12999049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74350C4332F for ; Wed, 5 Oct 2022 08:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230105AbiJEIiD (ORCPT ); Wed, 5 Oct 2022 04:38:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbiJEIiB (ORCPT ); Wed, 5 Oct 2022 04:38:01 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C44D77390A for ; Wed, 5 Oct 2022 01:37:59 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id b4so17891322wrs.1 for ; Wed, 05 Oct 2022 01:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Yu39gQJp1k9p/w40T6pLSbtngQhYyXde8HjMY4LOfK0=; b=qEKt61Bke3+xQbNG1E187MayG/wBQjR4qOaY9k5l4hyXa6E0Q+u4VMmOlxth7VdEH+ PBD07mVqinGn7kJBdBIcK3PrsPkMcnK/Ef135fh/KgioWDGArbeUvt0bw9ZaZQpa8nGY 6+fV9en+9JbqPohuRKClB5yArccZhSTw+b4PyNhw+MCHr+jQdCaw8/IEAeqWRT7ANXDK cTkcEazbs/3fX/xmoIrGK31prxTO/qYYxuGk82OMQT4YVteAmfl3rlxjxf8I7lra3yRz +0TpImK1k2MGo5+PAwji5VcBVvlec36+AmJ2z9RM7MRZs/PrzOUxWKY4CgGERhV2ApFJ 7g6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yu39gQJp1k9p/w40T6pLSbtngQhYyXde8HjMY4LOfK0=; b=1yNr5Tp4ZJu2t9YGKrqSTWLUVhpO7kAtYIqJBD7yRmeoEM4q0fbPbTmYNXDkYQ/P+t sOQQr6hU5K76y2ehtlWPpt7b+PVTFyMnZgFPJ5vBEEoMjs2rg04r0hOi+9x6WmPA73Gj G8vkpLjE5X9krvqGy+0Ew/XDmeLxATCJ5RQG9HvjRSLoPc4Vwf28Kflpjj6S0jet6xe6 CeR2soZBRiOG8ANXS9YYQ88wneLPOLN/ZHL1CIF1UALN618ppZOmVCtRUOsIkRNtoqD3 Yf49sWiUKf5K55cooMRKVl5lYN48BvDGIN8Z2bKuyBmItwhsMxFKgK92U3yMSeUPZm2l xGwA== X-Gm-Message-State: ACrzQf18evBk+f23/ADhNC7kNc11G/Se+rwJVkSHEb4L7EUFk44LlTgA VD33UaDfTWvxtT8r/4FSQAQuLaU6R0ZkEQ== X-Google-Smtp-Source: AMsMyM7bNw76EJwbBZTKLxZ9P0hHEG9rg8kcZtgbyMG2YuuMWFvu+NAhqM0/fCThCSJczwBJ2r+YvQ== X-Received: by 2002:a5d:4882:0:b0:22e:3c67:75ef with SMTP id g2-20020a5d4882000000b0022e3c6775efmr9327565wrq.6.1664959078181; Wed, 05 Oct 2022 01:37:58 -0700 (PDT) Received: from localhost.localdomain (hst-221-6.medicom.bg. [84.238.221.6]) by smtp.gmail.com with ESMTPSA id g6-20020a05600c310600b003b47e75b401sm1318171wmo.37.2022.10.05.01.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 01:37:57 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Stanimir Varbanov Subject: [PATCH 2/3] venus: firmware: Correct non-pix start and end addresses Date: Wed, 5 Oct 2022 11:37:29 +0300 Message-Id: <20221005083730.963322-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221005083730.963322-1-stanimir.varbanov@linaro.org> References: <20221005083730.963322-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The default values for those registers are zero. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/firmware.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 3851cedc3329..71e43611d1cf 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -38,8 +38,8 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_FW_END_ADDR); writel(0, wrapper_base + WRAPPER_CPA_START_ADDR); 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(0, wrapper_base + WRAPPER_NONPIX_START_ADDR); + writel(0, wrapper_base + WRAPPER_NONPIX_END_ADDR); if (IS_V6(core)) { /* Bring XTSS out of reset */ From patchwork Wed Oct 5 08:37:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12999050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22822C43217 for ; Wed, 5 Oct 2022 08:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbiJEIiF (ORCPT ); Wed, 5 Oct 2022 04:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbiJEIiD (ORCPT ); Wed, 5 Oct 2022 04:38:03 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70CFC733F3 for ; Wed, 5 Oct 2022 01:38:01 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id u10so24721952wrq.2 for ; Wed, 05 Oct 2022 01:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=EeAiRegJpB0iE5xwNj8sJLpx3MJbnRtOGu7e95kFXvI=; b=AMyMDquDAGH4PLFHdv82M1yeUIpUEh7Pw3mVXe81db3GeQKFHmKDaovL/L/wnL+jSU k1TU1NwEMmzrkDyDk5IJqgNxDDQzQJGYtKPLa3dqP83Hj6h0Z4lmeNqWjSnd2+wY5hxl /yRWoUzpGULLorPTOnLrRxe0FwpSE0E9GgvqGgzAERlu/VwnY4biHVKx2Gp0jfFCUtq4 U1yRZRv2ooce6vBNyZkVS1Jn81+7XEM19x4mvgXv6y54jp4lmJIDqwcb1G6brTZvQa9I 6GjWWz0TYC0ADz6L61JCFAfUkgeVgqAzl2x6I9RROcvgAfjU+5+V3MesIySeJ+PbEO8B JlCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=EeAiRegJpB0iE5xwNj8sJLpx3MJbnRtOGu7e95kFXvI=; b=tI/e5QnddxDcqIasTuDdDDzT63VpzdKnWfOWaWd7ewfstZZ0Vhy/bR9r7Rym98D7nA lejhbzqBEkWWPL+24xZC5vsvQLNOqFSvQTNkRTqN8+im9fztszwGi2X6yQVwZJs9ZR9P q9x7NVO6qFUPlrYyRdX0wLSqKNwRWf9ioYs/YVc8V9oCbXcrjD4aChE99YXNepVHYOTe NkXi4wpGa5XtvczhsIqHRKaylVYzONqKXZvgrxIY2YhQZATlvD/J9Yj2L1KP7ZIT8QJL 9cvGKtjJvg5RwLkqMplelYS2BfStyb56558c6dTxoFgrZS/NbCWQhrjlFXgBkvitp7I8 WeFA== X-Gm-Message-State: ACrzQf2KTnjKz1lWCZKDFZ4eTJOcPSPNncIS9IucQt8ak/rk4nlswmQH +pQ91MoTIje8Nbi/0W3GUXHtudVqIM199Q== X-Google-Smtp-Source: AMsMyM5ocPfLtUnWEnDkVlnPSjEZYeLkAp3Fm9mx+gat6KnREHhBZ4rWurWwGgu7VcFvjREmKsr3XQ== X-Received: by 2002:adf:e60d:0:b0:22c:d483:5ee1 with SMTP id p13-20020adfe60d000000b0022cd4835ee1mr18175649wrm.641.1664959079391; Wed, 05 Oct 2022 01:37:59 -0700 (PDT) Received: from localhost.localdomain (hst-221-6.medicom.bg. [84.238.221.6]) by smtp.gmail.com with ESMTPSA id g6-20020a05600c310600b003b47e75b401sm1318171wmo.37.2022.10.05.01.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 01:37:58 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Stanimir Varbanov Subject: [PATCH 3/3] venus: firmware: Correct assertion of reset bit on remote processor Date: Wed, 5 Oct 2022 11:37:30 +0300 Message-Id: <20221005083730.963322-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221005083730.963322-1-stanimir.varbanov@linaro.org> References: <20221005083730.963322-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Currently we use read/write_relaxed in combination with mb() to assert reset. This looks wrong because mb() after write_relaxed() will not order correctly load-update-store sequence. Correct this by use readl/writel which include memory barriers. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/firmware.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 71e43611d1cf..142d4c74017c 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -181,17 +181,15 @@ static int venus_shutdown_no_tz(struct venus_core *core) if (IS_V6(core)) { /* Assert the reset to XTSS */ - reg = readl_relaxed(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); + reg = readl(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); + writel(reg, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); } else { /* Assert the reset to ARM9 */ - reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET); + reg = readl(wrapper_base + WRAPPER_A9SS_SW_RESET); reg |= WRAPPER_A9SS_SW_RESET_BIT; - writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET); + writel(reg, wrapper_base + WRAPPER_A9SS_SW_RESET); } - /* Make sure reset is asserted before the mapping is removed */ - mb(); iommu = core->fw.iommu_domain;