Skip to content

Commit 79cdc56

Browse files
committed
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: Andrzej Kacprowski <[email protected]> Signed-off-by: Andrzej Kacprowski <[email protected]> Co-developed-by: Krystian Pradzynski <[email protected]> Signed-off-by: Krystian Pradzynski <[email protected]> Co-developed-by: Karol Wachowski <[email protected]> Signed-off-by: Karol Wachowski <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 162f17b commit 79cdc56

File tree

7 files changed

+1462
-2
lines changed

7 files changed

+1462
-2
lines changed

drivers/accel/ivpu/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ intel_vpu-y := \
88
ivpu_fw_log.o \
99
ivpu_gem.o \
1010
ivpu_hw_37xx.o \
11+
ivpu_hw_40xx.o \
1112
ivpu_ipc.o \
1213
ivpu_job.o \
1314
ivpu_jsm_msg.o \

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,13 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
501501
if (!vdev->pm)
502502
return -ENOMEM;
503503

504-
vdev->hw->ops = &ivpu_hw_37xx_ops;
505-
vdev->hw->dma_bits = 38;
504+
if (ivpu_hw_gen(vdev) >= IVPU_HW_40XX) {
505+
vdev->hw->ops = &ivpu_hw_40xx_ops;
506+
vdev->hw->dma_bits = 48;
507+
} else {
508+
vdev->hw->ops = &ivpu_hw_37xx_ops;
509+
vdev->hw->dma_bits = 38;
510+
}
506511

507512
vdev->platform = IVPU_PLATFORM_INVALID;
508513
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
@@ -629,6 +634,7 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)
629634

630635
static struct pci_device_id ivpu_pci_ids[] = {
631636
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_MTL) },
637+
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_LNL) },
632638
{ }
633639
};
634640
MODULE_DEVICE_TABLE(pci, ivpu_pci_ids);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#define DRIVER_DATE "20230117"
2424

2525
#define PCI_DEVICE_ID_MTL 0x7d1d
26+
#define PCI_DEVICE_ID_LNL 0x643e
2627

2728
#define IVPU_HW_37XX 37
29+
#define IVPU_HW_40XX 40
2830

2931
#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0
3032
/* SSID 1 is used by the VPU to represent invalid context */
@@ -78,6 +80,7 @@ struct ivpu_wa_table {
7880
bool clear_runtime_mem;
7981
bool d3hot_after_power_off;
8082
bool interrupt_clear_with_0;
83+
bool disable_clock_relinquish;
8184
};
8285

8386
struct ivpu_hw_info;
@@ -163,6 +166,8 @@ static inline int ivpu_hw_gen(struct ivpu_device *vdev)
163166
switch (ivpu_device_id(vdev)) {
164167
case PCI_DEVICE_ID_MTL:
165168
return IVPU_HW_37XX;
169+
case PCI_DEVICE_ID_LNL:
170+
return IVPU_HW_40XX;
166171
default:
167172
ivpu_err(vdev, "Unknown VPU device\n");
168173
return 0;

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static struct {
5151
{ IVPU_HW_37XX, "vpu_37xx.bin" },
5252
{ IVPU_HW_37XX, "mtl_vpu.bin" },
5353
{ IVPU_HW_37XX, "intel/vpu/vpu_37xx_v0.0.bin" },
54+
{ IVPU_HW_40XX, "vpu_40xx.bin" },
55+
{ IVPU_HW_40XX, "intel/vpu/vpu_40xx_v0.0.bin" },
5456
};
5557

5658
static int ivpu_fw_request(struct ivpu_device *vdev)

drivers/accel/ivpu/ivpu_hw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct ivpu_hw_info {
6060
};
6161

6262
extern const struct ivpu_hw_ops ivpu_hw_37xx_ops;
63+
extern const struct ivpu_hw_ops ivpu_hw_40xx_ops;
6364

6465
static inline int ivpu_hw_info_init(struct ivpu_device *vdev)
6566
{

0 commit comments

Comments
 (0)