Commit 79cdc56c authored by Stanislaw Gruszka's avatar Stanislaw Gruszka

accel/ivpu: Add initial support for VPU 4

Add support VPU 4 - new generation of VPU IP with various
hardware design improvements. From driver point of view, it differs
in register set, initialization process and MMU memory ranges.
Co-developed-by: default avatarAndrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: default avatarAndrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Co-developed-by: default avatarKrystian Pradzynski <krystian.pradzynski@linux.intel.com>
Signed-off-by: default avatarKrystian Pradzynski <krystian.pradzynski@linux.intel.com>
Co-developed-by: default avatarKarol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: default avatarKarol Wachowski <karol.wachowski@linux.intel.com>
Reviewed-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230731161258.2987564-7-stanislaw.gruszka@linux.intel.com
parent 162f17b2
...@@ -8,6 +8,7 @@ intel_vpu-y := \ ...@@ -8,6 +8,7 @@ intel_vpu-y := \
ivpu_fw_log.o \ ivpu_fw_log.o \
ivpu_gem.o \ ivpu_gem.o \
ivpu_hw_37xx.o \ ivpu_hw_37xx.o \
ivpu_hw_40xx.o \
ivpu_ipc.o \ ivpu_ipc.o \
ivpu_job.o \ ivpu_job.o \
ivpu_jsm_msg.o \ ivpu_jsm_msg.o \
......
...@@ -501,8 +501,13 @@ static int ivpu_dev_init(struct ivpu_device *vdev) ...@@ -501,8 +501,13 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
if (!vdev->pm) if (!vdev->pm)
return -ENOMEM; return -ENOMEM;
vdev->hw->ops = &ivpu_hw_37xx_ops; if (ivpu_hw_gen(vdev) >= IVPU_HW_40XX) {
vdev->hw->dma_bits = 38; vdev->hw->ops = &ivpu_hw_40xx_ops;
vdev->hw->dma_bits = 48;
} else {
vdev->hw->ops = &ivpu_hw_37xx_ops;
vdev->hw->dma_bits = 38;
}
vdev->platform = IVPU_PLATFORM_INVALID; vdev->platform = IVPU_PLATFORM_INVALID;
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID; vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
...@@ -629,6 +634,7 @@ static void ivpu_dev_fini(struct ivpu_device *vdev) ...@@ -629,6 +634,7 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)
static struct pci_device_id ivpu_pci_ids[] = { static struct pci_device_id ivpu_pci_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_MTL) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_MTL) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_LNL) },
{ } { }
}; };
MODULE_DEVICE_TABLE(pci, ivpu_pci_ids); MODULE_DEVICE_TABLE(pci, ivpu_pci_ids);
......
...@@ -23,8 +23,10 @@ ...@@ -23,8 +23,10 @@
#define DRIVER_DATE "20230117" #define DRIVER_DATE "20230117"
#define PCI_DEVICE_ID_MTL 0x7d1d #define PCI_DEVICE_ID_MTL 0x7d1d
#define PCI_DEVICE_ID_LNL 0x643e
#define IVPU_HW_37XX 37 #define IVPU_HW_37XX 37
#define IVPU_HW_40XX 40
#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0 #define IVPU_GLOBAL_CONTEXT_MMU_SSID 0
/* SSID 1 is used by the VPU to represent invalid context */ /* SSID 1 is used by the VPU to represent invalid context */
...@@ -78,6 +80,7 @@ struct ivpu_wa_table { ...@@ -78,6 +80,7 @@ struct ivpu_wa_table {
bool clear_runtime_mem; bool clear_runtime_mem;
bool d3hot_after_power_off; bool d3hot_after_power_off;
bool interrupt_clear_with_0; bool interrupt_clear_with_0;
bool disable_clock_relinquish;
}; };
struct ivpu_hw_info; struct ivpu_hw_info;
...@@ -163,6 +166,8 @@ static inline int ivpu_hw_gen(struct ivpu_device *vdev) ...@@ -163,6 +166,8 @@ static inline int ivpu_hw_gen(struct ivpu_device *vdev)
switch (ivpu_device_id(vdev)) { switch (ivpu_device_id(vdev)) {
case PCI_DEVICE_ID_MTL: case PCI_DEVICE_ID_MTL:
return IVPU_HW_37XX; return IVPU_HW_37XX;
case PCI_DEVICE_ID_LNL:
return IVPU_HW_40XX;
default: default:
ivpu_err(vdev, "Unknown VPU device\n"); ivpu_err(vdev, "Unknown VPU device\n");
return 0; return 0;
......
...@@ -51,6 +51,8 @@ static struct { ...@@ -51,6 +51,8 @@ static struct {
{ IVPU_HW_37XX, "vpu_37xx.bin" }, { IVPU_HW_37XX, "vpu_37xx.bin" },
{ IVPU_HW_37XX, "mtl_vpu.bin" }, { IVPU_HW_37XX, "mtl_vpu.bin" },
{ IVPU_HW_37XX, "intel/vpu/vpu_37xx_v0.0.bin" }, { IVPU_HW_37XX, "intel/vpu/vpu_37xx_v0.0.bin" },
{ IVPU_HW_40XX, "vpu_40xx.bin" },
{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
}; };
static int ivpu_fw_request(struct ivpu_device *vdev) static int ivpu_fw_request(struct ivpu_device *vdev)
......
...@@ -60,6 +60,7 @@ struct ivpu_hw_info { ...@@ -60,6 +60,7 @@ struct ivpu_hw_info {
}; };
extern const struct ivpu_hw_ops ivpu_hw_37xx_ops; extern const struct ivpu_hw_ops ivpu_hw_37xx_ops;
extern const struct ivpu_hw_ops ivpu_hw_40xx_ops;
static inline int ivpu_hw_info_init(struct ivpu_device *vdev) static inline int ivpu_hw_info_init(struct ivpu_device *vdev)
{ {
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment