From: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
To: Maciej Falkowski <maciej.falkowski@linux.intel.com>,
dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, quic_jhugo@quicinc.com,
Karol Wachowski <karol.wachowski@intel.com>
Subject: Re: [PATCH 13/14] accel/ivpu: Add platform detection for presilicon
Date: Thu, 9 Jan 2025 09:29:34 +0100 [thread overview]
Message-ID: <e9af1f9b-eb10-4e8b-8b24-93c94a962dcc@linux.intel.com> (raw)
In-Reply-To: <20250107173238.381120-14-maciej.falkowski@linux.intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
On 1/7/2025 6:32 PM, Maciej Falkowski wrote:
> From: Karol Wachowski <karol.wachowski@intel.com>
>
> Use highest buttress VPU_STATUS register bits(15:13) that encode
> platform type as follows:
> 0 - Silicon
> 2 - Simics
> 3 - FPGA
> 4 - Hybrid SLE
>
> Remove old DMI based method.
>
> Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
> Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
> ---
> drivers/accel/ivpu/ivpu_drv.h | 4 ++-
> drivers/accel/ivpu/ivpu_hw.c | 41 ++++++++++-------------
> drivers/accel/ivpu/ivpu_hw_btrs.c | 7 ++++
> drivers/accel/ivpu/ivpu_hw_btrs.h | 1 +
> drivers/accel/ivpu/ivpu_hw_btrs_lnl_reg.h | 1 +
> 5 files changed, 29 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/accel/ivpu/ivpu_drv.h b/drivers/accel/ivpu/ivpu_drv.h
> index d53902b34070..ca21102ca366 100644
> --- a/drivers/accel/ivpu/ivpu_drv.h
> +++ b/drivers/accel/ivpu/ivpu_drv.h
> @@ -58,6 +58,7 @@
> #define IVPU_PLATFORM_SILICON 0
> #define IVPU_PLATFORM_SIMICS 2
> #define IVPU_PLATFORM_FPGA 3
> +#define IVPU_PLATFORM_HSLE 4
> #define IVPU_PLATFORM_INVALID 8
>
> #define IVPU_SCHED_MODE_AUTO -1
> @@ -288,7 +289,8 @@ static inline bool ivpu_is_simics(struct ivpu_device *vdev)
>
> static inline bool ivpu_is_fpga(struct ivpu_device *vdev)
> {
> - return ivpu_get_platform(vdev) == IVPU_PLATFORM_FPGA;
> + return ivpu_get_platform(vdev) == IVPU_PLATFORM_FPGA ||
> + ivpu_get_platform(vdev) == IVPU_PLATFORM_HSLE;
> }
>
> static inline bool ivpu_is_force_snoop_enabled(struct ivpu_device *vdev)
> diff --git a/drivers/accel/ivpu/ivpu_hw.c b/drivers/accel/ivpu/ivpu_hw.c
> index 1b691375ee4d..e332f19ab51d 100644
> --- a/drivers/accel/ivpu/ivpu_hw.c
> +++ b/drivers/accel/ivpu/ivpu_hw.c
> @@ -19,38 +19,31 @@ static char *platform_to_str(u32 platform)
> return "SIMICS";
> case IVPU_PLATFORM_FPGA:
> return "FPGA";
> + case IVPU_PLATFORM_HSLE:
> + return "HSLE";
> default:
> return "Invalid platform";
> }
> }
>
> -static const struct dmi_system_id dmi_platform_simulation[] = {
> - {
> - .ident = "Intel Simics",
> - .matches = {
> - DMI_MATCH(DMI_BOARD_NAME, "lnlrvp"),
> - DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
> - DMI_MATCH(DMI_BOARD_SERIAL, "123456789"),
> - },
> - },
> - {
> - .ident = "Intel Simics",
> - .matches = {
> - DMI_MATCH(DMI_BOARD_NAME, "Simics"),
> - },
> - },
> - { }
> -};
> -
> static void platform_init(struct ivpu_device *vdev)
> {
> - if (dmi_check_system(dmi_platform_simulation))
> - vdev->platform = IVPU_PLATFORM_SIMICS;
> - else
> - vdev->platform = IVPU_PLATFORM_SILICON;
> + int platform = ivpu_hw_btrs_platform_read(vdev);
> +
> + ivpu_dbg(vdev, MISC, "Platform type: %s (%d)\n", platform_to_str(platform), platform);
> +
> + switch (platform) {
> + case IVPU_PLATFORM_SILICON:
> + case IVPU_PLATFORM_SIMICS:
> + case IVPU_PLATFORM_FPGA:
> + case IVPU_PLATFORM_HSLE:
> + vdev->platform = platform;
> + break;
>
> - ivpu_dbg(vdev, MISC, "Platform type: %s (%d)\n",
> - platform_to_str(vdev->platform), vdev->platform);
> + default:
> + ivpu_err(vdev, "Invalid platform type: %d\n", platform);
> + break;
> + }
> }
>
> static void wa_init(struct ivpu_device *vdev)
> diff --git a/drivers/accel/ivpu/ivpu_hw_btrs.c b/drivers/accel/ivpu/ivpu_hw_btrs.c
> index 3753b00ed2d6..56c56012b980 100644
> --- a/drivers/accel/ivpu/ivpu_hw_btrs.c
> +++ b/drivers/accel/ivpu/ivpu_hw_btrs.c
> @@ -887,3 +887,10 @@ void ivpu_hw_btrs_diagnose_failure(struct ivpu_device *vdev)
> else
> return diagnose_failure_lnl(vdev);
> }
> +
> +int ivpu_hw_btrs_platform_read(struct ivpu_device *vdev)
> +{
> + u32 reg = REGB_RD32(VPU_HW_BTRS_LNL_VPU_STATUS);
> +
> + return REG_GET_FLD(VPU_HW_BTRS_LNL_VPU_STATUS, PLATFORM, reg);
> +}
> diff --git a/drivers/accel/ivpu/ivpu_hw_btrs.h b/drivers/accel/ivpu/ivpu_hw_btrs.h
> index 04f14f50fed6..1fd71b4d4ab0 100644
> --- a/drivers/accel/ivpu/ivpu_hw_btrs.h
> +++ b/drivers/accel/ivpu/ivpu_hw_btrs.h
> @@ -46,5 +46,6 @@ void ivpu_hw_btrs_global_int_disable(struct ivpu_device *vdev);
> void ivpu_hw_btrs_irq_enable(struct ivpu_device *vdev);
> void ivpu_hw_btrs_irq_disable(struct ivpu_device *vdev);
> void ivpu_hw_btrs_diagnose_failure(struct ivpu_device *vdev);
> +int ivpu_hw_btrs_platform_read(struct ivpu_device *vdev);
>
> #endif /* __IVPU_HW_BTRS_H__ */
> diff --git a/drivers/accel/ivpu/ivpu_hw_btrs_lnl_reg.h b/drivers/accel/ivpu/ivpu_hw_btrs_lnl_reg.h
> index fc51f3098f97..fff2ef2cada6 100644
> --- a/drivers/accel/ivpu/ivpu_hw_btrs_lnl_reg.h
> +++ b/drivers/accel/ivpu/ivpu_hw_btrs_lnl_reg.h
> @@ -86,6 +86,7 @@
> #define VPU_HW_BTRS_LNL_VPU_STATUS_POWER_RESOURCE_OWN_ACK_MASK BIT_MASK(7)
> #define VPU_HW_BTRS_LNL_VPU_STATUS_PERF_CLK_MASK BIT_MASK(11)
> #define VPU_HW_BTRS_LNL_VPU_STATUS_DISABLE_CLK_RELINQUISH_MASK BIT_MASK(12)
> +#define VPU_HW_BTRS_LNL_VPU_STATUS_PLATFORM_MASK GENMASK(31, 29)
>
> #define VPU_HW_BTRS_LNL_IP_RESET 0x00000160u
> #define VPU_HW_BTRS_LNL_IP_RESET_TRIGGER_MASK BIT_MASK(0)
next prev parent reply other threads:[~2025-01-09 8:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 17:32 [PATCH 00/14] accel/ivpu: Changes for 6.14 Maciej Falkowski
2025-01-07 17:32 ` [PATCH 01/14] accel/ivpu: Separate DB ID and CMDQ ID allocations from CMDQ allocation Maciej Falkowski
2025-01-09 8:22 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 02/14] accel/ivpu: Add API for command queue create/destroy/submit Maciej Falkowski
2025-01-09 8:22 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 03/14] accel/ivpu: Abort all jobs after command queue unregister Maciej Falkowski
2025-01-09 8:23 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 04/14] accel/ivpu: Expose NPU memory utilization info in sysfs Maciej Falkowski
2025-01-08 19:53 ` Lizhi Hou
2025-01-09 8:19 ` Jacek Lawrynowicz
2025-01-09 8:24 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 05/14] accel/ivpu: Use workqueue for IRQ handling Maciej Falkowski
2025-01-09 8:26 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 06/14] accel/ivpu: Dump only first MMU fault from single context Maciej Falkowski
2025-01-09 8:26 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 07/14] accel/ivpu: Move parts of MMU event IRQ handling to thread handler Maciej Falkowski
2025-01-09 8:27 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 08/14] accel/ivpu: Fix missing MMU events from reserved SSID Maciej Falkowski
2025-01-09 8:27 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 09/14] accel/ivpu: Set command queue management capability based on HWS Maciej Falkowski
2025-01-09 8:28 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 10/14] accel/ivpu: Fix locking order in ivpu_cmdq_destroy_ioctl Maciej Falkowski
2025-01-09 8:28 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 11/14] accel/ivpu: Fix locking order in ivpu_job_submit Maciej Falkowski
2025-01-09 8:28 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 12/14] accel/ivpu: Add handling of VPU_JSM_STATUS_MVNCI_CONTEXT_VIOLATION_HW Maciej Falkowski
2025-01-09 8:29 ` Jacek Lawrynowicz
2025-01-07 17:32 ` [PATCH 13/14] accel/ivpu: Add platform detection for presilicon Maciej Falkowski
2025-01-09 8:29 ` Jacek Lawrynowicz [this message]
2025-01-07 17:32 ` [PATCH 14/14] accel/ivpu: Enable HWS by default on all platforms Maciej Falkowski
2025-01-08 18:19 ` [PATCH 00/14] accel/ivpu: Changes for 6.14 Simona Vetter
2025-01-09 8:14 ` Jacek Lawrynowicz
2025-01-09 8:43 ` Jacek Lawrynowicz
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=e9af1f9b-eb10-4e8b-8b24-93c94a962dcc@linux.intel.com \
--to=jacek.lawrynowicz@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=karol.wachowski@intel.com \
--cc=maciej.falkowski@linux.intel.com \
--cc=oded.gabbay@gmail.com \
--cc=quic_jhugo@quicinc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.