accel/ivpu: Update for -next 2023.08.25
v3 cover accel/ivpu: Update for -next 2023.08.25
Update for -next:
- various cleanups
- begin preparation for conversion to GEM SHMEM
- print information about used workarounds
v3:
- fix commit messages
- split patch 2 into separate patches
v2:
- fix compilation without CONFIG_PM
Jacek Lawrynowicz (4):
accel/ivpu: Remove duplicated error messages accel/ivpu: Move ivpu_fw_load() to ivpu_fw_init() accel/ivpu: Add ivpu_bo_vaddr() and ivpu_bo_size() accel/ivpu: Move MMU register definitions to ivpu_mmu.c
Karol Wachowski (1):
accel/ivpu: Initialize context with SSID = 1
Krystian Pradzynski (1):
accel/ivpu: Move set autosuspend delay to HW specific code
Stanislaw Gruszka (5):
accel/ivpu: Make ivpu_pm_init() void accel/ivpu: Add information about context on failure accel/ivpu: Print information about used workarounds accel/ivpu/37xx: Change register rename leftovers accel/ivpu/37xx: White space cleanup
drivers/accel/ivpu/ivpu_drv.c | 65 +++------ drivers/accel/ivpu/ivpu_drv.h | 18 ++- drivers/accel/ivpu/ivpu_fw.c | 26 ++-- drivers/accel/ivpu/ivpu_fw.h | 2 +- drivers/accel/ivpu/ivpu_fw_log.c | 6 +- drivers/accel/ivpu/ivpu_gem.c | 30 ++--- drivers/accel/ivpu/ivpu_gem.h | 22 ++- drivers/accel/ivpu/ivpu_hw_37xx.c | 75 ++++++----- drivers/accel/ivpu/ivpu_hw_37xx_reg.h | 187 +++++++++++--------------- drivers/accel/ivpu/ivpu_hw_40xx.c | 7 + drivers/accel/ivpu/ivpu_ipc.c | 19 ++- drivers/accel/ivpu/ivpu_job.c | 8 +- drivers/accel/ivpu/ivpu_mmu.c | 117 ++++++++++------ drivers/accel/ivpu/ivpu_mmu_context.c | 18 ++- drivers/accel/ivpu/ivpu_mmu_context.h | 2 + drivers/accel/ivpu/ivpu_pm.c | 18 +-- drivers/accel/ivpu/ivpu_pm.h | 2 +- 17 files changed, 324 insertions(+), 298 deletions(-)
Signature · 1 line
2.25.1
PATCH v3 1/11 accel/ivpu: Move set autosuspend delay to HW specific code
From: Krystian Pradzynski <[email protected]>
Configure autosuspend values per HW generation and per platform.
For non silicon platforms disable autosuspend for now, for silicon reduce it to 10 ms.
--- drivers/accel/ivpu/ivpu_drv.h | 1 + drivers/accel/ivpu/ivpu_hw_37xx.c | 2 ++ drivers/accel/ivpu/ivpu_hw_40xx.c | 3 +++ drivers/accel/ivpu/ivpu_pm.c | 14 ++++++++------ 4 files changed, 14 insertions(+), 6 deletions(-)
drivers/accel/ivpu/ivpu_drv.h +1 -0
@@ -117,6 +117,7 @@ struct ivpu_device {int jsm;int tdr;int reschedule_suspend; +int autosuspend; } timeout; };
drivers/accel/ivpu/ivpu_hw_37xx.c +2 -0
@@ -113,11 +113,13 @@ static void ivpu_hw_timeouts_init(struct ivpu_device *vdev) vdev->timeout.jsm =50000 ; vdev->timeout.tdr =2000000 ; vdev->timeout.reschedule_suspend =1000 ; + vdev->timeout.autosuspend =-1 ; }else { vdev->timeout.boot =1000 ; vdev->timeout.jsm =500 ; vdev->timeout.tdr =2000 ; vdev->timeout.reschedule_suspend =10 ; + vdev->timeout.autosuspend =10 ; } }
drivers/accel/ivpu/ivpu_hw_40xx.c +3 -0
@@ -135,16 +135,19 @@ static void ivpu_hw_timeouts_init(struct ivpu_device *vdev) vdev->timeout.jsm =50000 ; vdev->timeout.tdr =2000000 ; vdev->timeout.reschedule_suspend =1000 ; + vdev->timeout.autosuspend =-1 ; }else if (ivpu_is_simics (vdev)) { vdev->timeout.boot =50 ; vdev->timeout.jsm =500 ; vdev->timeout.tdr =10000 ; vdev->timeout.reschedule_suspend =10 ; + vdev->timeout.autosuspend =-1 ; }else { vdev->timeout.boot =1000 ; vdev->timeout.jsm =500 ; vdev->timeout.tdr =2000 ; vdev->timeout.reschedule_suspend =10 ; + vdev->timeout.autosuspend =10 ; } }
drivers/accel/ivpu/ivpu_pm.c +8 -6
@@ -286,6 +286,7 @@ int ivpu_pm_init(struct ivpu_device *vdev) {struct device *dev = vdev->drm.dev;struct ivpu_pm_info *pm = vdev->pm; +int delay; pm->vdev = vdev; pm->suspend_reschedule_counter =PM_RESCHEDULE_LIMIT ;
@@ -293,14 +294,15 @@ int ivpu_pm_init(struct ivpu_device *vdev)atomic_set (&pm->in_reset,0 );INIT_WORK (&pm->recovery_work, ivpu_pm_recovery_work); -pm_runtime_use_autosuspend (dev); -if (ivpu_disable_recovery) -pm_runtime_set_autosuspend_delay (dev,-1 ); -else if (ivpu_is_silicon (vdev)) -pm_runtime_set_autosuspend_delay (dev,100 ); + delay =-1 ;else -pm_runtime_set_autosuspend_delay (dev,60000 ); + delay = vdev->timeout.autosuspend; + +pm_runtime_use_autosuspend (dev); +pm_runtime_set_autosuspend_delay (dev, delay); + +ivpu_dbg (vdev,PM ,"Autosuspend delay = %d\n" , delay);return 0 ; }
Signature · 1 line
2.25.1
PATCH v3 2/11 accel/ivpu: Remove duplicated error messages
In reply to Stanislaw GruszkaFrom: Jacek Lawrynowicz <[email protected]>
Reduce the number of error messages per single failure in ivpu_dev_init() and ivpu_probe().
Most error messages are already printed by functions called from ivpu_dev_init(). Add missed error prints in ivpu_ipc_init() and ivpu_mmu_context_init().
--- drivers/accel/ivpu/ivpu_drv.c | 52 +++++++-------------------- drivers/accel/ivpu/ivpu_ipc.c | 13 ++++--- drivers/accel/ivpu/ivpu_mmu_context.c | 4 ++- 3 files changed, 25 insertions(+), 44 deletions(-)
drivers/accel/ivpu/ivpu_drv.c +13 -39
@@ -518,78 +518,54 @@ static int ivpu_dev_init(struct ivpu_device *vdev)lockdep_set_class (&vdev->submitted_jobs_xa.xa_lock, &submitted_jobs_xa_lock_class_key); ret =ivpu_pci_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize PCI device: %d\n" , ret); +if (ret) goto err_xa_destroy; - } ret =ivpu_irq_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize IRQs: %d\n" , ret); +if (ret) goto err_xa_destroy; - }/* Init basic HW info based on buttress registers which are accessible before power up */ ret =ivpu_hw_info_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize HW info: %d\n" , ret); +if (ret) goto err_xa_destroy; - }/* Power up early so the rest of init code can access VPU registers */ ret =ivpu_hw_power_up (vdev); -if (ret) { -ivpu_err (vdev,"Failed to power up HW: %d\n" , ret); +if (ret) goto err_xa_destroy; - } ret =ivpu_mmu_global_context_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize global MMU context: %d\n" , ret); +if (ret) goto err_power_down; - } ret =ivpu_mmu_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize MMU device: %d\n" , ret); +if (ret) goto err_mmu_gctx_fini; - } ret =ivpu_fw_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize firmware: %d\n" , ret); +if (ret) goto err_mmu_gctx_fini; - } ret =ivpu_ipc_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize IPC: %d\n" , ret); +if (ret) goto err_fw_fini; - } ret =ivpu_pm_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize PM: %d\n" , ret); +if (ret) goto err_ipc_fini; - } ret =ivpu_job_done_thread_init (vdev); -if (ret) { -ivpu_err (vdev,"Failed to initialize job done thread: %d\n" , ret); +if (ret) goto err_ipc_fini; - } ret =ivpu_fw_load (vdev); -if (ret) { -ivpu_err (vdev,"Failed to load firmware: %d\n" , ret); +if (ret) goto err_job_done_thread_fini; - } ret =ivpu_boot (vdev); -if (ret) { -ivpu_err (vdev,"Failed to boot: %d\n" , ret); +if (ret) goto err_job_done_thread_fini; - }ivpu_pm_enable (vdev);
@@ -651,10 +627,8 @@ static int ivpu_probe(struct pci_dev *pdev, const struct pci_device_id *id)pci_set_drvdata (pdev, vdev); ret =ivpu_dev_init (vdev); -if (ret) { -dev_err (&pdev->dev,"Failed to initialize VPU device: %d\n" , ret); +if (ret)return ret; - } ret =drm_dev_register (&vdev->drm,0 );if (ret) {
drivers/accel/ivpu/ivpu_ipc.c +9 -4
@@ -426,15 +426,20 @@ int ivpu_ipc_irq_handler(struct ivpu_device *vdev)int ivpu_ipc_init (struct ivpu_device *vdev) {struct ivpu_ipc_info *ipc = vdev->ipc; -int ret = -ENOMEM ; +int ret; ipc->mem_tx =ivpu_bo_alloc_internal (vdev,0 ,SZ_16K ,DRM_IVPU_BO_WC ); -if (!ipc->mem_tx) -return ret; +if (!ipc->mem_tx) { +ivpu_err (vdev,"Failed to allocate mem_tx\n" ); +return -ENOMEM ; + } ipc->mem_rx =ivpu_bo_alloc_internal (vdev,0 ,SZ_16K ,DRM_IVPU_BO_WC ); -if (!ipc->mem_rx) +if (!ipc->mem_rx) { +ivpu_err (vdev,"Failed to allocate mem_rx\n" ); + ret = -ENOMEM ; goto err_free_tx; + } ipc->mm_tx =devm_gen_pool_create (vdev->drm.dev,__ffs (IVPU_IPC_ALIGNMENT ),-1 ,"TX_IPC_JSM" );
drivers/accel/ivpu/ivpu_mmu_context.c +3 -1
@@ -427,8 +427,10 @@ ivpu_mmu_context_init(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx, u3INIT_LIST_HEAD (&ctx->bo_list); ret =ivpu_mmu_pgtable_init (vdev, &ctx->pgtable); -if (ret) +if (ret) { +ivpu_err (vdev,"Failed to initialize pgtable for ctx %u: %d\n" , context_id, ret);return ret; + }if (!context_id) { start = vdev->hw->ranges.global.start;
Signature · 1 line
2.25.1
Re: [PATCH v3 02/11] accel/ivpu: Remove duplicated error messages
Quoted 5 lines · Stanislaw Gruszka
From: Jacek Lawrynowicz <[email protected]>
Reduce the number of error messages per single failure in
ivpu_dev_init()andivpu_probe().
Quoted 7 lines
Most error messages are already printed by functions called from
ivpu_dev_init(). Add missed error prints inivpu_ipc_init()andivpu_mmu_context_init().Signed-off-by Jacek Lawrynowicz <[email protected]>Reviewed-by Stanislaw Gruszka <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>
PATCH v3 3/11 accel/ivpu: Make ivpu_pm_init() void
In reply to Stanislaw Gruszkaivpu_pm_init() does not return any error, make it void.
--- drivers/accel/ivpu/ivpu_drv.c | 4 +--- drivers/accel/ivpu/ivpu_fw.c | 2 +- drivers/accel/ivpu/ivpu_pm.c | 4 +--- drivers/accel/ivpu/ivpu_pm.h | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-)
drivers/accel/ivpu/ivpu_drv.c +1 -3
@@ -551,9 +551,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)if (ret) goto err_fw_fini; - ret =ivpu_pm_init (vdev); -if (ret) - goto err_ipc_fini; +ivpu_pm_init (vdev); ret =ivpu_job_done_thread_init (vdev);if (ret)
drivers/accel/ivpu/ivpu_fw.c +1 -1
@@ -78,7 +78,7 @@ static int ivpu_fw_request(struct ivpu_device *vdev) } } -ivpu_err (vdev,"Failed to request firmware: %d\n" , ret); +ivpu_err (vdev,"Failed to load firmware: %d\n" , ret);return ret; }
drivers/accel/ivpu/ivpu_pm.c +1 -3
@@ -282,7 +282,7 @@ void ivpu_pm_reset_done_cb(struct pci_dev *pdev)pm_runtime_put_autosuspend (vdev->drm.dev); } -int ivpu_pm_init (struct ivpu_device *vdev) +void ivpu_pm_init (struct ivpu_device *vdev) {struct device *dev = vdev->drm.dev;struct ivpu_pm_info *pm = vdev->pm;
@@ -303,8 +303,6 @@ int ivpu_pm_init(struct ivpu_device *vdev)pm_runtime_set_autosuspend_delay (dev, delay);ivpu_dbg (vdev,PM ,"Autosuspend delay = %d\n" , delay); - -return 0 ; }void ivpu_pm_cancel_recovery (struct ivpu_device *vdev)
drivers/accel/ivpu/ivpu_pm.h +1 -1
@@ -19,7 +19,7 @@ struct ivpu_pm_info {u32 suspend_reschedule_counter; }; -int ivpu_pm_init (struct ivpu_device *vdev); +void ivpu_pm_init (struct ivpu_device *vdev);void ivpu_pm_enable (struct ivpu_device *vdev);void ivpu_pm_disable (struct ivpu_device *vdev);void ivpu_pm_cancel_recovery (struct ivpu_device *vdev);
Signature · 1 line
2.25.1
Re: [PATCH v3 03/11] accel/ivpu: Make ivpu_pm_init() void
Quoted 31 lines · Stanislaw Gruszka
ivpu_pm_init()does not return any error, make it void.Reviewed-by Karol Wachowski <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>--- drivers/accel/ivpu/ivpu_drv.c | 4 +--- drivers/accel/ivpu/ivpu_fw.c | 2 +- drivers/accel/ivpu/ivpu_pm.c | 4 +--- drivers/accel/ivpu/ivpu_pm.h | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-)drivers/accel/ivpu/ivpu_drv.c +1
-3@@ -551,9 +551,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)if (ret) goto err_fw_fini; - ret =ivpu_pm_init (vdev); -if (ret) - goto err_ipc_fini; +ivpu_pm_init (vdev); ret =ivpu_job_done_thread_init (vdev);if (ret)drivers/accel/ivpu/ivpu_fw.c +0
-0
drivers/accel/ivpu/ivpu_fw.c static int ivpu_fw_request(struct ivpu_device *vdev) · line 81
Quoted 5 lines
drivers/accel/ivpu/ivpu_fw.c +1
-1@@ -78,7 +78,7 @@ static int ivpu_fw_request(struct ivpu_device *vdev) } } -ivpu_err (vdev,"Failed to request firmware: %d\n" , ret); +ivpu_err (vdev,"Failed to load firmware: %d\n" , ret);
I feel that this is unrelated to $SUBJECT. With this dropped or moved to where it fits -
Re: [PATCH v3 03/11] accel/ivpu: Make ivpu_pm_init() void
Quoted 37 lines · Jeffrey Hugo
Quoted 29 lines · Stanislaw Gruszka
ivpu_pm_init()does not return any error, make it void.Reviewed-by Karol Wachowski <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>--- drivers/accel/ivpu/ivpu_drv.c | 4 +--- drivers/accel/ivpu/ivpu_fw.c | 2 +- drivers/accel/ivpu/ivpu_pm.c | 4 +--- drivers/accel/ivpu/ivpu_pm.h | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-)drivers/accel/ivpu/ivpu_drv.c +1
-3@@ -551,9 +551,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)if (ret) goto err_fw_fini; - ret =ivpu_pm_init (vdev); -if (ret) - goto err_ipc_fini; +ivpu_pm_init (vdev); ret =ivpu_job_done_thread_init (vdev);if (ret)drivers/accel/ivpu/ivpu_fw.c +0
-0drivers/accel/ivpu/ivpu_fw.c static int ivpu_fw_request(struct ivpu_device *vdev) · line 80
Quoted 4 lines
drivers/accel/ivpu/ivpu_fw.c +1
-1@@ -78,7 +78,7 @@ static int ivpu_fw_request(struct ivpu_device *vdev) } } -ivpu_err (vdev,"Failed to request firmware: %d\n" , ret); +ivpu_err (vdev,"Failed to load firmware: %d\n" , ret);I feel that this is unrelated to $SUBJECT. With this dropped or moved to where it fits -
Quoted 1 line
Reviewed-by Jeffrey Hugo <[email protected]>
Yes, I supposed to drop this, not sure why it's still there. Will remove before applying.
Thanks
Stanislaw
PATCH v3 4/11 accel/ivpu: Add information about context on failure
In reply to Stanislaw GruszkaAdd additional ctx number to error messages on mmu context initialization failures.
--- drivers/accel/ivpu/ivpu_mmu_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/accel/ivpu/ivpu_mmu_context.c +2 -2
@@ -490,13 +490,13 @@ int ivpu_mmu_user_context_init(struct ivpu_device *vdev, struct ivpu_mmu_context ret =ivpu_mmu_context_init (vdev, ctx, ctx_id);if (ret) { -ivpu_err (vdev,"Failed to initialize context: %d\n" , ret); +ivpu_err (vdev,"Failed to initialize context %u: %d\n" , ctx_id, ret);return ret; } ret =ivpu_mmu_set_pgtable (vdev, ctx_id, &ctx->pgtable);if (ret) { -ivpu_err (vdev,"Failed to set page table: %d\n" , ret); +ivpu_err (vdev,"Failed to set page table for context %u: %d\n" , ctx_id, ret); goto err_context_fini; }
Signature · 1 line
2.25.1
Re: [PATCH v3 04/11] accel/ivpu: Add information about context on failure
Quoted 2 lines · Stanislaw Gruszka
Add additional ctx number to error messages on mmu context initialization failures.
Looking at this for the first time, the "why" doesn't seem obvious. Based on my understanding, I suggest -
"Identify the mmu context that failed to initialize in the error messages. This allows the error to be correlated with a specific user during debug."
If you have a different idea for the wording, go for it.
I think I can safely assume this will be resolved.
Quoted 27 lines
Reviewed-by Karol Wachowski <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>--- drivers/accel/ivpu/ivpu_mmu_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/accel/ivpu/ivpu_mmu_context.c +2
-2@@ -490,13 +490,13 @@ int ivpu_mmu_user_context_init(struct ivpu_device *vdev, struct ivpu_mmu_context ret =ivpu_mmu_context_init (vdev, ctx, ctx_id);if (ret) { -ivpu_err (vdev,"Failed to initialize context: %d\n" , ret); +ivpu_err (vdev,"Failed to initialize context %u: %d\n" , ctx_id, ret);return ret; } ret =ivpu_mmu_set_pgtable (vdev, ctx_id, &ctx->pgtable);if (ret) { -ivpu_err (vdev,"Failed to set page table: %d\n" , ret); +ivpu_err (vdev,"Failed to set page table for context %u: %d\n" , ctx_id, ret); goto err_context_fini; }
PATCH v3 5/11 accel/ivpu: Print information about used workarounds
In reply to Stanislaw GruszkaUse ivpu_dbg(MISC) to print information about workarounds.
--- drivers/accel/ivpu/ivpu_drv.h | 5 +++++ drivers/accel/ivpu/ivpu_hw_37xx.c | 5 +++++ drivers/accel/ivpu/ivpu_hw_40xx.c | 4 ++++ 3 files changed, 14 insertions(+)
drivers/accel/ivpu/ivpu_drv.h +5 -0
@@ -75,6 +75,11 @@#define IVPU_WA (wa_name) (vdev->wa.wa_name) +#define IVPU_PRINT_WA (wa_name) do { \ + if (IVPU_WA(wa_name)) \ + ivpu_dbg(vdev, MISC, "Using WA: " #wa_name "\n"); \ +} while (0) +struct ivpu_wa_table {bool punit_disabled;bool clear_runtime_mem;
drivers/accel/ivpu/ivpu_hw_37xx.c +5 -0
@@ -104,6 +104,11 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)if (ivpu_device_id (vdev) ==PCI_DEVICE_ID_MTL &&ivpu_revision (vdev) <4 ) vdev->wa.interrupt_clear_with_0 = true; + +IVPU_PRINT_WA (punit_disabled); +IVPU_PRINT_WA (clear_runtime_mem); +IVPU_PRINT_WA (d3hot_after_power_off); +IVPU_PRINT_WA (interrupt_clear_with_0); }static void ivpu_hw_timeouts_init (struct ivpu_device *vdev)
drivers/accel/ivpu/ivpu_hw_40xx.c +4 -0
@@ -126,6 +126,10 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)if (ivpu_hw_gen (vdev) ==IVPU_HW_40XX ) vdev->wa.disable_clock_relinquish = true; + +IVPU_PRINT_WA (punit_disabled); +IVPU_PRINT_WA (clear_runtime_mem); +IVPU_PRINT_WA (disable_clock_relinquish); }static void ivpu_hw_timeouts_init (struct ivpu_device *vdev)
Signature · 1 line
2.25.1
PATCH v3 6/11 accel/ivpu: Initialize context with SSID = 1
In reply to Stanislaw GruszkaFrom: Karol Wachowski <[email protected]>
Context with SSID = 1 is reserved and accesses on that context happen only when context is uninitialized on the VPU side. Such access triggers MMU fault (0xa) "Invalid CD Fetch", which doesn't contain any useful information besides context ID.
This commit will change that state, now (0x10) "Translation fault" will be triggered and accessed address will shown in the log.
--- drivers/accel/ivpu/ivpu_drv.c | 9 ++++++++- drivers/accel/ivpu/ivpu_drv.h | 12 +++++++----- drivers/accel/ivpu/ivpu_mmu_context.c | 10 ++++++++++ drivers/accel/ivpu/ivpu_mmu_context.h | 2 ++ 4 files changed, 27 insertions(+), 6 deletions(-)
drivers/accel/ivpu/ivpu_drv.c +8 -1
@@ -543,10 +543,14 @@ static int ivpu_dev_init(struct ivpu_device *vdev)if (ret) goto err_mmu_gctx_fini; - ret =ivpu_fw_init (vdev); + ret =ivpu_mmu_reserved_context_init (vdev);if (ret) goto err_mmu_gctx_fini; + ret =ivpu_fw_init (vdev); +if (ret) + goto err_mmu_rctx_fini; + ret =ivpu_ipc_init (vdev);if (ret) goto err_fw_fini;
@@ -575,6 +579,8 @@ static int ivpu_dev_init(struct ivpu_device *vdev)ivpu_ipc_fini (vdev); err_fw_fini:ivpu_fw_fini (vdev); +err_mmu_rctx_fini: +ivpu_mmu_reserved_context_fini (vdev); err_mmu_gctx_fini:ivpu_mmu_global_context_fini (vdev); err_power_down:
@@ -598,6 +604,7 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)ivpu_ipc_fini (vdev);ivpu_fw_fini (vdev); +ivpu_mmu_reserved_context_fini (vdev);ivpu_mmu_global_context_fini (vdev);drm_WARN_ON (&vdev->drm, !xa_empty (&vdev->submitted_jobs_xa));
drivers/accel/ivpu/ivpu_drv.h +7 -5
@@ -28,12 +28,13 @@#define IVPU_HW_37XX 37#define IVPU_HW_40XX 40 -#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0 -/* SSID 1 is used by the VPU to represent invalid context */ -#define IVPU_USER_CONTEXT_MIN_SSID 2 -#define IVPU_USER_CONTEXT_MAX_SSID (IVPU_USER_CONTEXT_MIN_SSID + 63) +#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0 +/* SSID 1 is used by the VPU to represent reserved context */ +#define IVPU_RESERVED_CONTEXT_MMU_SSID 1 +#define IVPU_USER_CONTEXT_MIN_SSID 2 +#define IVPU_USER_CONTEXT_MAX_SSID (IVPU_USER_CONTEXT_MIN_SSID + 63) -#define IVPU_NUM_ENGINES 2 +#define IVPU_NUM_ENGINES 2#define IVPU_PLATFORM_SILICON 0#define IVPU_PLATFORM_SIMICS 2
@@ -109,6 +110,7 @@ struct ivpu_device {struct ivpu_pm_info *pm;struct ivpu_mmu_context gctx; +struct ivpu_mmu_context rctx;struct xarray context_xa;struct xa_limit context_xa_limit;
drivers/accel/ivpu/ivpu_mmu_context.c +10 -0
@@ -469,6 +469,16 @@ void ivpu_mmu_global_context_fini(struct ivpu_device *vdev)return ivpu_mmu_context_fini (vdev, &vdev->gctx); } +int ivpu_mmu_reserved_context_init (struct ivpu_device *vdev) +{ +return ivpu_mmu_user_context_init (vdev, &vdev->rctx,IVPU_RESERVED_CONTEXT_MMU_SSID ); +} + +void ivpu_mmu_reserved_context_fini (struct ivpu_device *vdev) +{ +return ivpu_mmu_user_context_fini (vdev, &vdev->rctx); +} +void ivpu_mmu_user_context_mark_invalid (struct ivpu_device *vdev,u32 ssid) {struct ivpu_file_priv *file_priv;
drivers/accel/ivpu/ivpu_mmu_context.h +2 -0
@@ -32,6 +32,8 @@ struct ivpu_mmu_context {int ivpu_mmu_global_context_init (struct ivpu_device *vdev);void ivpu_mmu_global_context_fini (struct ivpu_device *vdev); +int ivpu_mmu_reserved_context_init (struct ivpu_device *vdev); +void ivpu_mmu_reserved_context_fini (struct ivpu_device *vdev);int ivpu_mmu_user_context_init (struct ivpu_device *vdev,struct ivpu_mmu_context *ctx,u32 ctx_id);void ivpu_mmu_user_context_fini (struct ivpu_device *vdev,struct ivpu_mmu_context *ctx);
Signature · 1 line
2.25.1
PATCH v3 7/11 accel/ivpu: Move ivpu_fw_load() to ivpu_fw_init()
In reply to Stanislaw GruszkaFrom: Jacek Lawrynowicz <[email protected]>
ivpu_fw_load() doesn't have to be called separately in ivpu_dev_init().
--- drivers/accel/ivpu/ivpu_drv.c | 4 ---- drivers/accel/ivpu/ivpu_fw.c | 6 +++--- drivers/accel/ivpu/ivpu_fw.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-)
drivers/accel/ivpu/ivpu_drv.c +0 -4
@@ -561,10 +561,6 @@ static int ivpu_dev_init(struct ivpu_device *vdev)if (ret) goto err_ipc_fini; - ret =ivpu_fw_load (vdev); -if (ret) - goto err_job_done_thread_fini; - ret =ivpu_boot (vdev);if (ret) goto err_job_done_thread_fini;
drivers/accel/ivpu/ivpu_fw.c +3 -3
@@ -301,6 +301,8 @@ int ivpu_fw_init(struct ivpu_device *vdev)if (ret) goto err_fw_release; +ivpu_fw_load (vdev); +return 0 ; err_fw_release:
@@ -314,7 +316,7 @@ void ivpu_fw_fini(struct ivpu_device *vdev)ivpu_fw_release (vdev); } -int ivpu_fw_load (struct ivpu_device *vdev) +void ivpu_fw_load (struct ivpu_device *vdev) {struct ivpu_fw_info *fw = vdev->fw;u64 image_end_offset = fw->image_load_offset + fw->image_size;
@@ -331,8 +333,6 @@ int ivpu_fw_load(struct ivpu_device *vdev) }wmb ();/* Flush WC buffers after writing fw->mem */ - -return 0 ; }static void ivpu_fw_boot_params_print (struct ivpu_device *vdev,struct vpu_boot_params *boot_params)
drivers/accel/ivpu/ivpu_fw.h +1 -1
@@ -31,7 +31,7 @@ struct ivpu_fw_info {int ivpu_fw_init (struct ivpu_device *vdev);void ivpu_fw_fini (struct ivpu_device *vdev); -int ivpu_fw_load (struct ivpu_device *vdev); +void ivpu_fw_load (struct ivpu_device *vdev);void ivpu_fw_boot_params_setup (struct ivpu_device *vdev,struct vpu_boot_params *bp);static inline bool ivpu_fw_is_cold_boot (struct ivpu_device *vdev)
Signature · 1 line
2.25.1
PATCH v3 8/11 accel/ivpu: Add ivpu_bo_vaddr() and ivpu_bo_size()
In reply to Stanislaw GruszkaFrom: Jacek Lawrynowicz <[email protected]>
Use:
- ivpu_bo_vaddr(bo) instead of bo->kvaddr
- ivpu_bo_size(bo) instead of bo->base.size
This is a preparation for switch to a drm_gem_shmem_object as a base for ivpu_bo, where:
- bo->kvaddr becomes bo->base.vaddr
- bo->base.size becomes bo->base.base.size
Using ivpu_bo_vaddr() and ivpu_bo_size() increases the readability of the code.
--- drivers/accel/ivpu/ivpu_fw.c | 18 +++++++++--------- drivers/accel/ivpu/ivpu_fw_log.c | 6 +++--- drivers/accel/ivpu/ivpu_gem.c | 30 +++++++++++++++--------------- drivers/accel/ivpu/ivpu_gem.h | 22 ++++++++++++++++------ drivers/accel/ivpu/ivpu_ipc.c | 6 +++--- drivers/accel/ivpu/ivpu_job.c | 8 ++++---- drivers/accel/ivpu/ivpu_pm.c | 2 +- 7 files changed, 51 insertions(+), 41 deletions(-)
drivers/accel/ivpu/ivpu_fw.c +9 -9
@@ -321,13 +321,13 @@ void ivpu_fw_load(struct ivpu_device *vdev)struct ivpu_fw_info *fw = vdev->fw;u64 image_end_offset = fw->image_load_offset + fw->image_size; -memset (fw->mem->kvaddr,0 , fw->image_load_offset); -memcpy (fw->mem->kvaddr + fw->image_load_offset, +memset (ivpu_bo_vaddr (fw->mem),0 , fw->image_load_offset); +memcpy (ivpu_bo_vaddr (fw->mem) + fw->image_load_offset, fw->file->data +FW_FILE_IMAGE_OFFSET , fw->image_size);if (IVPU_WA (clear_runtime_mem)) { -u8 *start = fw->mem->kvaddr + image_end_offset; -u64 size = fw->mem->base.size - image_end_offset; +u8 *start =ivpu_bo_vaddr (fw->mem) + image_end_offset; +u64 size =ivpu_bo_size (fw->mem) - image_end_offset;memset (start,0 , size); }
@@ -450,10 +450,10 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params vdev->hw->ranges.global.start; boot_params->ipc_header_area_start = ipc_mem_rx->vpu_addr; - boot_params->ipc_header_area_size = ipc_mem_rx->base.size /2 ; + boot_params->ipc_header_area_size =ivpu_bo_size (ipc_mem_rx) /2 ; - boot_params->ipc_payload_area_start = ipc_mem_rx->vpu_addr + ipc_mem_rx->base.size /2 ; - boot_params->ipc_payload_area_size = ipc_mem_rx->base.size /2 ; + boot_params->ipc_payload_area_start = ipc_mem_rx->vpu_addr +ivpu_bo_size (ipc_mem_rx) /2 ; + boot_params->ipc_payload_area_size =ivpu_bo_size (ipc_mem_rx) /2 ; boot_params->global_aliased_pio_base = vdev->hw->ranges.user.start; boot_params->global_aliased_pio_size =ivpu_hw_range_size (&vdev->hw->ranges.user);
@@ -485,9 +485,9 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params boot_params->trace_destination_mask = vdev->fw->trace_destination_mask; boot_params->trace_hw_component_mask = vdev->fw->trace_hw_component_mask; boot_params->crit_tracing_buff_addr = vdev->fw->mem_log_crit->vpu_addr; - boot_params->crit_tracing_buff_size = vdev->fw->mem_log_crit->base.size; + boot_params->crit_tracing_buff_size =ivpu_bo_size (vdev->fw->mem_log_crit); boot_params->verbose_tracing_buff_addr = vdev->fw->mem_log_verb->vpu_addr; - boot_params->verbose_tracing_buff_size = vdev->fw->mem_log_verb->base.size; + boot_params->verbose_tracing_buff_size =ivpu_bo_size (vdev->fw->mem_log_verb); boot_params->punit_telemetry_sram_base =ivpu_hw_reg_telemetry_offset_get (vdev); boot_params->punit_telemetry_sram_size =ivpu_hw_reg_telemetry_size_get (vdev);
drivers/accel/ivpu/ivpu_fw_log.c +3 -3
@@ -31,10 +31,10 @@ static int fw_log_ptr(struct ivpu_device *vdev, struct ivpu_bo *bo, u32 *offset, {struct vpu_tracing_buffer_header *log; -if ((*offset +sizeof (*log)) > bo->base.size) +if ((*offset +sizeof (*log)) >ivpu_bo_size (bo))return -EINVAL ; - log = bo->kvaddr + *offset; + log =ivpu_bo_vaddr (bo) + *offset;if (log->vpu_canary_start !=VPU_TRACING_BUFFER_CANARY )return -EINVAL ;
@@ -43,7 +43,7 @@ static int fw_log_ptr(struct ivpu_device *vdev, struct ivpu_bo *bo, u32 *offset,ivpu_dbg (vdev,FW_BOOT ,"Invalid header size 0x%x\n" , log->header_size);return -EINVAL ; } -if ((char *)log + log->size > (char *)bo->kvaddr + bo->base.size) { +if ((char *)log + log->size > (char *)ivpu_bo_vaddr (bo) +ivpu_bo_size (bo)) {ivpu_dbg (vdev,FW_BOOT ,"Invalid log size 0x%x\n" , log->size);return -EINVAL ; }
drivers/accel/ivpu/ivpu_gem.c +15 -15
@@ -69,7 +69,7 @@ static const struct ivpu_bo_ops prime_ops = {static int __must_check shmem_alloc_pages_locked (struct ivpu_bo *bo) { -int npages = bo->base.size >>PAGE_SHIFT ; +int npages =ivpu_bo_size (bo) >>PAGE_SHIFT ;struct page **pages; pages =drm_gem_get_pages (&bo->base);
@@ -88,7 +88,7 @@ static int __must_check shmem_alloc_pages_locked(struct ivpu_bo *bo)static void shmem_free_pages_locked (struct ivpu_bo *bo) {if (ivpu_bo_cache_mode (bo) !=DRM_IVPU_BO_CACHED ) -set_pages_array_wb (bo->pages, bo->base.size >>PAGE_SHIFT ); +set_pages_array_wb (bo->pages,ivpu_bo_size (bo) >>PAGE_SHIFT );drm_gem_put_pages (&bo->base, bo->pages, true, false); bo->pages =NULL ;
@@ -96,7 +96,7 @@ static void shmem_free_pages_locked(struct ivpu_bo *bo)static int ivpu_bo_map_pages_locked (struct ivpu_bo *bo) { -int npages = bo->base.size >>PAGE_SHIFT ; +int npages =ivpu_bo_size (bo) >>PAGE_SHIFT ;struct ivpu_device *vdev =ivpu_bo_to_vdev (bo);struct sg_table *sgt;int ret;
@@ -142,7 +142,7 @@ static const struct ivpu_bo_ops shmem_ops = {static int __must_check internal_alloc_pages_locked (struct ivpu_bo *bo) { -unsigned int i, npages = bo->base.size >>PAGE_SHIFT ; +unsigned int i, npages =ivpu_bo_size (bo) >>PAGE_SHIFT ;struct page **pages;int ret;
@@ -171,10 +171,10 @@ static int __must_check internal_alloc_pages_locked(struct ivpu_bo *bo)static void internal_free_pages_locked (struct ivpu_bo *bo) { -unsigned int i, npages = bo->base.size >>PAGE_SHIFT ; +unsigned int i, npages =ivpu_bo_size (bo) >>PAGE_SHIFT ;if (ivpu_bo_cache_mode (bo) !=DRM_IVPU_BO_CACHED ) -set_pages_array_wb (bo->pages, bo->base.size >>PAGE_SHIFT ); +set_pages_array_wb (bo->pages,ivpu_bo_size (bo) >>PAGE_SHIFT );for (i =0 ; i < npages; i++)put_page (bo->pages[i]);
@@ -291,7 +291,7 @@ ivpu_bo_alloc_vpu_addr(struct ivpu_bo *bo, struct ivpu_mmu_context *ctx, }mutex_lock (&ctx->lock); - ret =ivpu_mmu_context_insert_node_locked (ctx, range, bo->base.size, &bo->mm_node); + ret =ivpu_mmu_context_insert_node_locked (ctx, range,ivpu_bo_size (bo), &bo->mm_node);if (!ret) { bo->ctx = ctx; bo->vpu_addr = bo->mm_node.start;
@@ -438,7 +438,7 @@ static int ivpu_bo_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)struct ivpu_device *vdev =ivpu_bo_to_vdev (bo);ivpu_dbg (vdev,BO ,"mmap: ctx %u handle %u vpu_addr 0x%llx size %zu type %s" , - bo->ctx->id, bo->handle, bo->vpu_addr, bo->base.size, bo->ops->name); + bo->ctx->id, bo->handle, bo->vpu_addr,ivpu_bo_size (bo), bo->ops->name);if (obj->import_attach) {/* Drop the reference drm_gem_mmap_obj() acquired.*/
@@ -553,7 +553,7 @@ ivpu_bo_create_ioctl(struct drm_device *dev, void *data, struct drm_file *file)drm_gem_object_put (&bo->base);ivpu_dbg (vdev,BO ,"alloc shmem: ctx %u vpu_addr 0x%llx size %zu flags 0x%x\n" , - file_priv->ctx.id, bo->vpu_addr, bo->base.size, bo->flags); + file_priv->ctx.id, bo->vpu_addr,ivpu_bo_size (bo), bo->flags);return ret; }
@@ -590,22 +590,22 @@ ivpu_bo_alloc_internal(struct ivpu_device *vdev, u64 vpu_addr, u64 size, u32 fla goto err_put;if (ivpu_bo_cache_mode (bo) !=DRM_IVPU_BO_CACHED ) -drm_clflush_pages (bo->pages, bo->base.size >>PAGE_SHIFT ); +drm_clflush_pages (bo->pages,ivpu_bo_size (bo) >>PAGE_SHIFT );if (bo->flags &DRM_IVPU_BO_WC ) -set_pages_array_wc (bo->pages, bo->base.size >>PAGE_SHIFT ); +set_pages_array_wc (bo->pages,ivpu_bo_size (bo) >>PAGE_SHIFT );else if (bo->flags &DRM_IVPU_BO_UNCACHED ) -set_pages_array_uc (bo->pages, bo->base.size >>PAGE_SHIFT ); +set_pages_array_uc (bo->pages,ivpu_bo_size (bo) >>PAGE_SHIFT ); prot =ivpu_bo_pgprot (bo,PAGE_KERNEL ); - bo->kvaddr =vmap (bo->pages, bo->base.size >>PAGE_SHIFT ,VM_MAP , prot); + bo->kvaddr =vmap (bo->pages,ivpu_bo_size (bo) >>PAGE_SHIFT ,VM_MAP , prot);if (!bo->kvaddr) {ivpu_err (vdev,"Failed to map BO into kernel virtual memory\n" ); goto err_put; }ivpu_dbg (vdev,BO ,"alloc internal: ctx 0 vpu_addr 0x%llx size %zu flags 0x%x\n" , - bo->vpu_addr, bo->base.size, flags); + bo->vpu_addr,ivpu_bo_size (bo), flags);return bo;
@@ -718,7 +718,7 @@ static void ivpu_bo_print_info(struct ivpu_bo *bo, struct drm_printer *p) dma_refcount =atomic_long_read (&bo->base.dma_buf->file->f_count);drm_printf (p,"%5u %6d %16llx %10lu %10u %12lu %14s\n" , - bo->ctx->id, bo->handle, bo->vpu_addr, bo->base.size, + bo->ctx->id, bo->handle, bo->vpu_addr,ivpu_bo_size (bo),kref_read (&bo->base.refcount), dma_refcount, bo->ops->name); }
drivers/accel/ivpu/ivpu_gem.h +16 -6
@@ -68,9 +68,19 @@ static inline struct ivpu_bo *to_ivpu_bo(struct drm_gem_object *obj) return container_of(obj, struct ivpu_bo, base); } +static inline void *ivpu_bo_vaddr (struct ivpu_bo *bo) +{ +return bo->kvaddr; +} + +static inline size_t ivpu_bo_size (struct ivpu_bo *bo) +{ +return bo->base.size; +} +static inline struct page *ivpu_bo_get_page (struct ivpu_bo *bo,u64 offset) { -if (offset > bo->base.size || !bo->pages) +if (offset >ivpu_bo_size (bo) || !bo->pages)return NULL ;return bo->pages[offset /PAGE_SIZE ];
@@ -107,21 +117,21 @@ static inline void *ivpu_to_cpu_addr(struct ivpu_bo *bo, u32 vpu_addr)if (vpu_addr < bo->vpu_addr)return NULL ; -if (vpu_addr >= (bo->vpu_addr + bo->base.size)) +if (vpu_addr >= (bo->vpu_addr +ivpu_bo_size (bo)))return NULL ; - return bo->kvaddr + (vpu_addr - bo->vpu_addr); + return ivpu_bo_vaddr(bo) + (vpu_addr - bo->vpu_addr); }static inline u32 cpu_to_vpu_addr (struct ivpu_bo *bo,void *cpu_addr) { -if (cpu_addr < bo->kvaddr) +if (cpu_addr <ivpu_bo_vaddr (bo))return 0 ; -if (cpu_addr >= (bo->kvaddr + bo->base.size)) +if (cpu_addr >= (ivpu_bo_vaddr (bo) +ivpu_bo_size (bo)))return 0 ; -return bo->vpu_addr + (cpu_addr - bo->kvaddr); +return bo->vpu_addr + (cpu_addr -ivpu_bo_vaddr (bo)); }#endif /* __IVPU_GEM_H__ */
drivers/accel/ivpu/ivpu_ipc.c +3 -3
@@ -449,7 +449,7 @@ int ivpu_ipc_init(struct ivpu_device *vdev) goto err_free_rx; } - ret =gen_pool_add (ipc->mm_tx, ipc->mem_tx->vpu_addr, ipc->mem_tx->base.size,-1 ); + ret =gen_pool_add (ipc->mm_tx, ipc->mem_tx->vpu_addr,ivpu_bo_size (ipc->mem_tx),-1 );if (ret) {ivpu_err (vdev,"gen_pool_add failed, ret %d\n" , ret); goto err_free_rx;
@@ -505,8 +505,8 @@ void ivpu_ipc_reset(struct ivpu_device *vdev)mutex_lock (&ipc->lock); -memset (ipc->mem_tx->kvaddr,0 , ipc->mem_tx->base.size); -memset (ipc->mem_rx->kvaddr,0 , ipc->mem_rx->base.size); +memset (ivpu_bo_vaddr (ipc->mem_tx),0 ,ivpu_bo_size (ipc->mem_tx)); +memset (ivpu_bo_vaddr (ipc->mem_rx),0 ,ivpu_bo_size (ipc->mem_rx));wmb ();/* Flush WC buffers for TX and RX rings */ mutex_unlock (&ipc->lock);
drivers/accel/ivpu/ivpu_job.c +4 -4
@@ -48,10 +48,10 @@ static struct ivpu_cmdq *ivpu_cmdq_alloc(struct ivpu_file_priv *file_priv, u16 e goto cmdq_free; cmdq->db_id = file_priv->ctx.id + engine *ivpu_get_context_count (vdev); - cmdq->entry_count = (u32)((cmdq->mem->base.size -sizeof (struct vpu_job_queue_header )) / + cmdq->entry_count = (u32)((ivpu_bo_size (cmdq->mem) -sizeof (struct vpu_job_queue_header )) /sizeof (struct vpu_job_queue_entry )); - cmdq->jobq = (struct vpu_job_queue *)cmdq->mem->kvaddr; + cmdq->jobq = (struct vpu_job_queue *)ivpu_bo_vaddr (cmdq->mem); jobq_header = &cmdq->jobq->header; jobq_header->engine_idx = engine; jobq_header->head =0 ;
@@ -93,7 +93,7 @@ static struct ivpu_cmdq *ivpu_cmdq_acquire(struct ivpu_file_priv *file_priv, u16return cmdq; ret =ivpu_jsm_register_db (vdev, file_priv->ctx.id, cmdq->db_id, - cmdq->mem->vpu_addr, cmdq->mem->base.size); + cmdq->mem->vpu_addr,ivpu_bo_size (cmdq->mem));if (ret)return NULL ;
@@ -453,7 +453,7 @@ ivpu_job_prepare_bos_for_submit(struct drm_file *file, struct ivpu_job *job, u32return -EBUSY ; } -if (commands_offset >= bo->base.size) { +if (commands_offset >=ivpu_bo_size (bo)) {ivpu_warn (vdev,"Invalid command buffer offset %u\n" , commands_offset);return -EINVAL ; }
drivers/accel/ivpu/ivpu_pm.c +1 -1
@@ -37,7 +37,7 @@ static void ivpu_pm_prepare_cold_boot(struct ivpu_device *vdev)static void ivpu_pm_prepare_warm_boot (struct ivpu_device *vdev) {struct ivpu_fw_info *fw = vdev->fw; -struct vpu_boot_params *bp = fw->mem->kvaddr; +struct vpu_boot_params *bp =ivpu_bo_vaddr (fw->mem);if (!bp->save_restore_ret_address) {ivpu_pm_prepare_cold_boot (vdev);
Signature · 1 line
2.25.1
PATCH v3 9/11 accel/ivpu/37xx: Change register rename leftovers
In reply to Stanislaw GruszkaChange remaining MTL_VPU_ register names to generation based names.
--- drivers/accel/ivpu/ivpu_hw_37xx.c | 68 ++++++++++++------------- drivers/accel/ivpu/ivpu_hw_37xx_reg.h | 72 +++++++++++++-------------- 2 files changed, 70 insertions(+), 70 deletions(-)
drivers/accel/ivpu/ivpu_hw_37xx.c +34 -34
@@ -352,10 +352,10 @@ static int ivpu_boot_noc_qdeny_check(struct ivpu_device *vdev, u32 exp_val)static int ivpu_boot_top_noc_qrenqn_check (struct ivpu_device *vdev,u32 exp_val) { -u32 val =REGV_RD32 (MTL_VPU_TOP_NOC_QREQN ); +u32 val =REGV_RD32 (VPU_37XX_TOP_NOC_QREQN ); -if (!REG_TEST_FLD_NUM (MTL_VPU_TOP_NOC_QREQN ,CPU_CTRL , exp_val, val) || - !REG_TEST_FLD_NUM (MTL_VPU_TOP_NOC_QREQN ,HOSTIF_L2CACHE , exp_val, val)) +if (!REG_TEST_FLD_NUM (VPU_37XX_TOP_NOC_QREQN ,CPU_CTRL , exp_val, val) || + !REG_TEST_FLD_NUM (VPU_37XX_TOP_NOC_QREQN ,HOSTIF_L2CACHE , exp_val, val))return -EIO ;return 0 ;
@@ -363,10 +363,10 @@ static int ivpu_boot_top_noc_qrenqn_check(struct ivpu_device *vdev, u32 exp_val)static int ivpu_boot_top_noc_qacceptn_check (struct ivpu_device *vdev,u32 exp_val) { -u32 val =REGV_RD32 (MTL_VPU_TOP_NOC_QACCEPTN ); +u32 val =REGV_RD32 (VPU_37XX_TOP_NOC_QACCEPTN ); -if (!REG_TEST_FLD_NUM (MTL_VPU_TOP_NOC_QACCEPTN ,CPU_CTRL , exp_val, val) || - !REG_TEST_FLD_NUM (MTL_VPU_TOP_NOC_QACCEPTN ,HOSTIF_L2CACHE , exp_val, val)) +if (!REG_TEST_FLD_NUM (VPU_37XX_TOP_NOC_QACCEPTN ,CPU_CTRL , exp_val, val) || + !REG_TEST_FLD_NUM (VPU_37XX_TOP_NOC_QACCEPTN ,HOSTIF_L2CACHE , exp_val, val))return -EIO ;return 0 ;
@@ -374,10 +374,10 @@ static int ivpu_boot_top_noc_qacceptn_check(struct ivpu_device *vdev, u32 exp_vastatic int ivpu_boot_top_noc_qdeny_check (struct ivpu_device *vdev,u32 exp_val) { -u32 val =REGV_RD32 (MTL_VPU_TOP_NOC_QDENY ); +u32 val =REGV_RD32 (VPU_37XX_TOP_NOC_QDENY ); -if (!REG_TEST_FLD_NUM (MTL_VPU_TOP_NOC_QDENY ,CPU_CTRL , exp_val, val) || - !REG_TEST_FLD_NUM (MTL_VPU_TOP_NOC_QDENY ,HOSTIF_L2CACHE , exp_val, val)) +if (!REG_TEST_FLD_NUM (VPU_37XX_TOP_NOC_QDENY ,CPU_CTRL , exp_val, val) || + !REG_TEST_FLD_NUM (VPU_37XX_TOP_NOC_QDENY ,HOSTIF_L2CACHE , exp_val, val))return -EIO ;return 0 ;
@@ -430,15 +430,15 @@ static int ivpu_boot_host_ss_top_noc_drive(struct ivpu_device *vdev, bool enableint ret;u32 val; - val =REGV_RD32 (MTL_VPU_TOP_NOC_QREQN ); + val =REGV_RD32 (VPU_37XX_TOP_NOC_QREQN );if (enable) { - val =REG_SET_FLD (MTL_VPU_TOP_NOC_QREQN ,CPU_CTRL , val); - val =REG_SET_FLD (MTL_VPU_TOP_NOC_QREQN ,HOSTIF_L2CACHE , val); + val =REG_SET_FLD (VPU_37XX_TOP_NOC_QREQN ,CPU_CTRL , val); + val =REG_SET_FLD (VPU_37XX_TOP_NOC_QREQN ,HOSTIF_L2CACHE , val); }else { - val =REG_CLR_FLD (MTL_VPU_TOP_NOC_QREQN ,CPU_CTRL , val); - val =REG_CLR_FLD (MTL_VPU_TOP_NOC_QREQN ,HOSTIF_L2CACHE , val); + val =REG_CLR_FLD (VPU_37XX_TOP_NOC_QREQN ,CPU_CTRL , val); + val =REG_CLR_FLD (VPU_37XX_TOP_NOC_QREQN ,HOSTIF_L2CACHE , val); } -REGV_WR32 (MTL_VPU_TOP_NOC_QREQN , val); +REGV_WR32 (VPU_37XX_TOP_NOC_QREQN , val); ret =ivpu_boot_top_noc_qacceptn_check (vdev, enable ?0x1 :0x0 );if (ret) {
@@ -570,17 +570,17 @@ static void ivpu_boot_soc_cpu_boot(struct ivpu_device *vdev) {u32 val; - val =REGV_RD32 (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ); - val =REG_SET_FLD (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RSTRUN0 , val); + val =REGV_RD32 (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ); + val =REG_SET_FLD (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RSTRUN0 , val); - val =REG_CLR_FLD (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RSTVEC , val); -REGV_WR32 (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC , val); + val =REG_CLR_FLD (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RSTVEC , val); +REGV_WR32 (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC , val); - val =REG_SET_FLD (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RESUME0 , val); -REGV_WR32 (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC , val); + val =REG_SET_FLD (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RESUME0 , val); +REGV_WR32 (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC , val); - val =REG_CLR_FLD (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RESUME0 , val); -REGV_WR32 (MTL_VPU_CPU_SS_MSSCPU_CPR_LEON_RT_VEC , val); + val =REG_CLR_FLD (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC ,IRQI_RESUME0 , val); +REGV_WR32 (VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC , val); val = vdev->fw->entry_point >>9 ;REGV_WR32 (VPU_37XX_HOST_SS_LOADING_ADDRESS_LO , val);
@@ -784,17 +784,17 @@ static void ivpu_hw_37xx_wdt_disable(struct ivpu_device *vdev)u32 val;/* Enable writing and set non-zero WDT value */ -REGV_WR32 (MTL_VPU_CPU_SS_TIM_SAFE ,TIM_SAFE_ENABLE ); -REGV_WR32 (MTL_VPU_CPU_SS_TIM_WATCHDOG ,TIM_WATCHDOG_RESET_VALUE ); +REGV_WR32 (VPU_37XX_CPU_SS_TIM_SAFE ,TIM_SAFE_ENABLE ); +REGV_WR32 (VPU_37XX_CPU_SS_TIM_WATCHDOG ,TIM_WATCHDOG_RESET_VALUE );/* Enable writing and disable watchdog timer */ -REGV_WR32 (MTL_VPU_CPU_SS_TIM_SAFE ,TIM_SAFE_ENABLE ); -REGV_WR32 (MTL_VPU_CPU_SS_TIM_WDOG_EN ,0 ); +REGV_WR32 (VPU_37XX_CPU_SS_TIM_SAFE ,TIM_SAFE_ENABLE ); +REGV_WR32 (VPU_37XX_CPU_SS_TIM_WDOG_EN ,0 );/* Now clear the timeout interrupt */ - val =REGV_RD32 (MTL_VPU_CPU_SS_TIM_GEN_CONFIG ); - val =REG_CLR_FLD (MTL_VPU_CPU_SS_TIM_GEN_CONFIG ,WDOG_TO_INT_CLR , val); -REGV_WR32 (MTL_VPU_CPU_SS_TIM_GEN_CONFIG , val); + val =REGV_RD32 (VPU_37XX_CPU_SS_TIM_GEN_CONFIG ); + val =REG_CLR_FLD (VPU_37XX_CPU_SS_TIM_GEN_CONFIG ,WDOG_TO_INT_CLR , val); +REGV_WR32 (VPU_37XX_CPU_SS_TIM_GEN_CONFIG , val); }static u32 ivpu_hw_37xx_pll_to_freq (u32 ratio,u32 config)
@@ -841,10 +841,10 @@ static u32 ivpu_hw_37xx_reg_telemetry_enable_get(struct ivpu_device *vdev)static void ivpu_hw_37xx_reg_db_set (struct ivpu_device *vdev,u32 db_id) { -u32 reg_stride =MTL_VPU_CPU_SS_DOORBELL_1 -MTL_VPU_CPU_SS_DOORBELL_0 ; -u32 val =REG_FLD (MTL_VPU_CPU_SS_DOORBELL_0 ,SET ); +u32 reg_stride =VPU_37XX_CPU_SS_DOORBELL_1 -VPU_37XX_CPU_SS_DOORBELL_0 ; +u32 val =REG_FLD (VPU_37XX_CPU_SS_DOORBELL_0 ,SET ); -REGV_WR32I (MTL_VPU_CPU_SS_DOORBELL_0 , reg_stride, db_id, val); +REGV_WR32I (VPU_37XX_CPU_SS_DOORBELL_0 , reg_stride, db_id, val); }static u32 ivpu_hw_37xx_reg_ipc_rx_addr_get (struct ivpu_device *vdev)
@@ -861,7 +861,7 @@ static u32 ivpu_hw_37xx_reg_ipc_rx_count_get(struct ivpu_device *vdev)static void ivpu_hw_37xx_reg_ipc_tx_set (struct ivpu_device *vdev,u32 vpu_addr) { -REGV_WR32 (MTL_VPU_CPU_SS_TIM_IPC_FIFO , vpu_addr); +REGV_WR32 (VPU_37XX_CPU_SS_TIM_IPC_FIFO , vpu_addr); }static void ivpu_hw_37xx_irq_clear (struct ivpu_device *vdev)
drivers/accel/ivpu/ivpu_hw_37xx_reg.h +36 -36
97 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 10/11 accel/ivpu/37xx: White space cleanup
In reply to Stanislaw GruszkaNo functional change, adjust code formatting so that defines line up nicely to improve code readability.
--- drivers/accel/ivpu/ivpu_hw_37xx_reg.h | 100 +++++++++++++------------- 1 file changed, 50 insertions(+), 50 deletions(-)
drivers/accel/ivpu/ivpu_hw_37xx_reg.h +50 -50
@@ -8,65 +8,65 @@#include <linux/bits.h> -#define VPU_37XX_BUTTRESS_INTERRUPT_TYPE 0x00000000u +#define VPU_37XX_BUTTRESS_INTERRUPT_TYPE 0x00000000u -#define VPU_37XX_BUTTRESS_INTERRUPT_STAT 0x00000004u -#define VPU_37XX_BUTTRESS_INTERRUPT_STAT_FREQ_CHANGE_MASK BIT_MASK(0) +#define VPU_37XX_BUTTRESS_INTERRUPT_STAT 0x00000004u +#define VPU_37XX_BUTTRESS_INTERRUPT_STAT_FREQ_CHANGE_MASK BIT_MASK(0)#define VPU_37XX_BUTTRESS_INTERRUPT_STAT_ATS_ERR_MASK BIT_MASK(1)#define VPU_37XX_BUTTRESS_INTERRUPT_STAT_UFI_ERR_MASK BIT_MASK(2) -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD0 0x00000008u -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD0_MIN_RATIO_MASK GENMASK(15, 0) -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD0_MAX_RATIO_MASK GENMASK(31, 16) +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD0 0x00000008u +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD0_MIN_RATIO_MASK GENMASK(15, 0) +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD0_MAX_RATIO_MASK GENMASK(31, 16) -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD1 0x0000000cu -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD1_TARGET_RATIO_MASK GENMASK(15, 0) -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD1_EPP_MASK GENMASK(31, 16) +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD1 0x0000000cu +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD1_TARGET_RATIO_MASK GENMASK(15, 0) +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD1_EPP_MASK GENMASK(31, 16) -#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD2 0x00000010u +#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD2 0x00000010u#define VPU_37XX_BUTTRESS_WP_REQ_PAYLOAD2_CONFIG_MASK GENMASK(15, 0) -#define VPU_37XX_BUTTRESS_WP_REQ_CMD 0x00000014u +#define VPU_37XX_BUTTRESS_WP_REQ_CMD 0x00000014u#define VPU_37XX_BUTTRESS_WP_REQ_CMD_SEND_MASK BIT_MASK(0)#define VPU_37XX_BUTTRESS_WP_DOWNLOAD 0x00000018u#define VPU_37XX_BUTTRESS_WP_DOWNLOAD_TARGET_RATIO_MASK GENMASK(15, 0)#define VPU_37XX_BUTTRESS_CURRENT_PLL 0x0000001cu -#define VPU_37XX_BUTTRESS_CURRENT_PLL_RATIO_MASK GENMASK(15, 0) +#define VPU_37XX_BUTTRESS_CURRENT_PLL_RATIO_MASK GENMASK(15, 0) -#define VPU_37XX_BUTTRESS_PLL_ENABLE 0x00000020u +#define VPU_37XX_BUTTRESS_PLL_ENABLE 0x00000020u -#define VPU_37XX_BUTTRESS_FMIN_FUSE 0x00000024u -#define VPU_37XX_BUTTRESS_FMIN_FUSE_MIN_RATIO_MASK GENMASK(7, 0) -#define VPU_37XX_BUTTRESS_FMIN_FUSE_PN_RATIO_MASK GENMASK(15, 8) +#define VPU_37XX_BUTTRESS_FMIN_FUSE 0x00000024u +#define VPU_37XX_BUTTRESS_FMIN_FUSE_MIN_RATIO_MASK GENMASK(7, 0) +#define VPU_37XX_BUTTRESS_FMIN_FUSE_PN_RATIO_MASK GENMASK(15, 8) -#define VPU_37XX_BUTTRESS_FMAX_FUSE 0x00000028u -#define VPU_37XX_BUTTRESS_FMAX_FUSE_MAX_RATIO_MASK GENMASK(7, 0) +#define VPU_37XX_BUTTRESS_FMAX_FUSE 0x00000028u +#define VPU_37XX_BUTTRESS_FMAX_FUSE_MAX_RATIO_MASK GENMASK(7, 0) -#define VPU_37XX_BUTTRESS_TILE_FUSE 0x0000002cu +#define VPU_37XX_BUTTRESS_TILE_FUSE 0x0000002cu#define VPU_37XX_BUTTRESS_TILE_FUSE_VALID_MASK BIT_MASK(0) -#define VPU_37XX_BUTTRESS_TILE_FUSE_SKU_MASK GENMASK(3, 2) +#define VPU_37XX_BUTTRESS_TILE_FUSE_SKU_MASK GENMASK(3, 2) -#define VPU_37XX_BUTTRESS_LOCAL_INT_MASK 0x00000030u -#define VPU_37XX_BUTTRESS_GLOBAL_INT_MASK 0x00000034u +#define VPU_37XX_BUTTRESS_LOCAL_INT_MASK 0x00000030u +#define VPU_37XX_BUTTRESS_GLOBAL_INT_MASK 0x00000034u -#define VPU_37XX_BUTTRESS_PLL_STATUS 0x00000040u +#define VPU_37XX_BUTTRESS_PLL_STATUS 0x00000040u#define VPU_37XX_BUTTRESS_PLL_STATUS_LOCK_MASK BIT_MASK(1) -#define VPU_37XX_BUTTRESS_VPU_STATUS 0x00000044u +#define VPU_37XX_BUTTRESS_VPU_STATUS 0x00000044u#define VPU_37XX_BUTTRESS_VPU_STATUS_READY_MASK BIT_MASK(0)#define VPU_37XX_BUTTRESS_VPU_STATUS_IDLE_MASK BIT_MASK(1) -#define VPU_37XX_BUTTRESS_VPU_D0I3_CONTROL 0x00000060u -#define VPU_37XX_BUTTRESS_VPU_D0I3_CONTROL_INPROGRESS_MASK BIT_MASK(0) -#define VPU_37XX_BUTTRESS_VPU_D0I3_CONTROL_I3_MASK BIT_MASK(2) +#define VPU_37XX_BUTTRESS_VPU_D0I3_CONTROL 0x00000060u +#define VPU_37XX_BUTTRESS_VPU_D0I3_CONTROL_INPROGRESS_MASK BIT_MASK(0) +#define VPU_37XX_BUTTRESS_VPU_D0I3_CONTROL_I3_MASK BIT_MASK(2)#define VPU_37XX_BUTTRESS_VPU_IP_RESET 0x00000050u -#define VPU_37XX_BUTTRESS_VPU_IP_RESET_TRIGGER_MASK BIT_MASK(0) +#define VPU_37XX_BUTTRESS_VPU_IP_RESET_TRIGGER_MASK BIT_MASK(0)#define VPU_37XX_BUTTRESS_VPU_TELEMETRY_OFFSET 0x00000080u -#define VPU_37XX_BUTTRESS_VPU_TELEMETRY_SIZE 0x00000084u +#define VPU_37XX_BUTTRESS_VPU_TELEMETRY_SIZE 0x00000084u#define VPU_37XX_BUTTRESS_VPU_TELEMETRY_ENABLE 0x00000088u#define VPU_37XX_BUTTRESS_ATS_ERR_LOG_0 0x000000a0u
@@ -74,9 +74,9 @@#define VPU_37XX_BUTTRESS_ATS_ERR_CLEAR 0x000000a8u#define VPU_37XX_BUTTRESS_UFI_ERR_LOG 0x000000b0u -#define VPU_37XX_BUTTRESS_UFI_ERR_LOG_CQ_ID_MASK GENMASK(11, 0) -#define VPU_37XX_BUTTRESS_UFI_ERR_LOG_AXI_ID_MASK GENMASK(19, 12) -#define VPU_37XX_BUTTRESS_UFI_ERR_LOG_OPCODE_MASK GENMASK(24, 20) +#define VPU_37XX_BUTTRESS_UFI_ERR_LOG_CQ_ID_MASK GENMASK(11, 0) +#define VPU_37XX_BUTTRESS_UFI_ERR_LOG_AXI_ID_MASK GENMASK(19, 12) +#define VPU_37XX_BUTTRESS_UFI_ERR_LOG_OPCODE_MASK GENMASK(24, 20)#define VPU_37XX_BUTTRESS_UFI_ERR_CLEAR 0x000000b4u
@@ -140,9 +140,9 @@#define VPU_37XX_HOST_SS_ICB_STATUS_0_TIMER_2_INT_MASK BIT_MASK(2)#define VPU_37XX_HOST_SS_ICB_STATUS_0_TIMER_3_INT_MASK BIT_MASK(3)#define VPU_37XX_HOST_SS_ICB_STATUS_0_HOST_IPC_FIFO_INT_MASK BIT_MASK(4) -#define VPU_37XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_0_INT_MASK BIT_MASK(5) -#define VPU_37XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_1_INT_MASK BIT_MASK(6) -#define VPU_37XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_2_INT_MASK BIT_MASK(7) +#define VPU_37XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_0_INT_MASK BIT_MASK(5) +#define VPU_37XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_1_INT_MASK BIT_MASK(6) +#define VPU_37XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_2_INT_MASK BIT_MASK(7)#define VPU_37XX_HOST_SS_ICB_STATUS_0_NOC_FIREWALL_INT_MASK BIT_MASK(8)#define VPU_37XX_HOST_SS_ICB_STATUS_0_CPU_INT_REDIRECT_0_INT_MASK BIT_MASK(30)#define VPU_37XX_HOST_SS_ICB_STATUS_0_CPU_INT_REDIRECT_1_INT_MASK BIT_MASK(31)
@@ -164,14 +164,14 @@#define VPU_37XX_HOST_SS_TIM_IPC_FIFO_STAT_FILL_LEVEL_MASK GENMASK(23, 16)#define VPU_37XX_HOST_SS_TIM_IPC_FIFO_STAT_RSVD0_MASK GENMASK(31, 24) -#define VPU_37XX_HOST_SS_AON_PWR_ISO_EN0 0x00030020u +#define VPU_37XX_HOST_SS_AON_PWR_ISO_EN0 0x00030020u#define VPU_37XX_HOST_SS_AON_PWR_ISO_EN0_MSS_CPU_MASK BIT_MASK(3)#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_EN0 0x00030024u -#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_EN0_MSS_CPU_MASK BIT_MASK(3) +#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_EN0_MSS_CPU_MASK BIT_MASK(3)#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0 0x00030028u -#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0_MSS_CPU_MASK BIT_MASK(3) +#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0_MSS_CPU_MASK BIT_MASK(3)#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_STATUS0 0x0003002cu#define VPU_37XX_HOST_SS_AON_PWR_ISLAND_STATUS0_MSS_CPU_MASK BIT_MASK(3)
@@ -187,7 +187,7 @@#define VPU_37XX_HOST_SS_LOADING_ADDRESS_LO_IOSF_RS_ID_MASK GENMASK(2, 1)#define VPU_37XX_HOST_SS_LOADING_ADDRESS_LO_IMAGE_LOCATION_MASK GENMASK(31, 3) -#define VPU_37XX_HOST_SS_WORKPOINT_CONFIG_MIRROR 0x00082020u +#define VPU_37XX_HOST_SS_WORKPOINT_CONFIG_MIRROR 0x00082020u#define VPU_37XX_HOST_SS_WORKPOINT_CONFIG_MIRROR_FINAL_PLL_FREQ_MASK GENMASK(15, 0)#define VPU_37XX_HOST_SS_WORKPOINT_CONFIG_MIRROR_CONFIG_ID_MASK GENMASK(31, 16)
@@ -196,13 +196,13 @@#define VPU_37XX_HOST_MMU_IDR3 0x0020000cu#define VPU_37XX_HOST_MMU_IDR5 0x00200014u#define VPU_37XX_HOST_MMU_CR0 0x00200020u -#define VPU_37XX_HOST_MMU_CR0ACK 0x00200024u +#define VPU_37XX_HOST_MMU_CR0ACK 0x00200024u#define VPU_37XX_HOST_MMU_CR1 0x00200028u#define VPU_37XX_HOST_MMU_CR2 0x0020002cu#define VPU_37XX_HOST_MMU_IRQ_CTRL 0x00200050u#define VPU_37XX_HOST_MMU_IRQ_CTRLACK 0x00200054u -#define VPU_37XX_HOST_MMU_GERROR 0x00200060u +#define VPU_37XX_HOST_MMU_GERROR 0x00200060u#define VPU_37XX_HOST_MMU_GERROR_CMDQ_MASK BIT_MASK(0)#define VPU_37XX_HOST_MMU_GERROR_EVTQ_ABT_MASK BIT_MASK(2)#define VPU_37XX_HOST_MMU_GERROR_PRIQ_ABT_MASK BIT_MASK(3)
@@ -226,8 +226,8 @@#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES 0x00360000u#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_CACHE_OVERRIDE_EN_MASK BIT_MASK(0) -#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_AWCACHE_OVERRIDE_MASK BIT_MASK(1) -#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_ARCACHE_OVERRIDE_MASK BIT_MASK(2) +#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_AWCACHE_OVERRIDE_MASK BIT_MASK(1) +#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_ARCACHE_OVERRIDE_MASK BIT_MASK(2)#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_NOSNOOP_OVERRIDE_EN_MASK BIT_MASK(3)#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_AW_NOSNOOP_OVERRIDE_MASK BIT_MASK(4)#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_AR_NOSNOOP_OVERRIDE_MASK BIT_MASK(5)
@@ -246,11 +246,11 @@#define VPU_37XX_HOST_IF_TBU_MMUSSIDV_TBU4_AWMMUSSIDV_MASK BIT_MASK(8)#define VPU_37XX_HOST_IF_TBU_MMUSSIDV_TBU4_ARMMUSSIDV_MASK BIT_MASK(9) -#define VPU_37XX_CPU_SS_DSU_LEON_RT_BASE 0x04000000u +#define VPU_37XX_CPU_SS_DSU_LEON_RT_BASE 0x04000000u#define VPU_37XX_CPU_SS_DSU_LEON_RT_DSU_CTRL 0x04000000u#define VPU_37XX_CPU_SS_DSU_LEON_RT_PC_REG 0x04400010u#define VPU_37XX_CPU_SS_DSU_LEON_RT_NPC_REG 0x04400014u -#define VPU_37XX_CPU_SS_DSU_LEON_RT_DSU_TRAP_REG 0x04400020u +#define VPU_37XX_CPU_SS_DSU_LEON_RT_DSU_TRAP_REG 0x04400020u#define VPU_37XX_CPU_SS_MSSCPU_CPR_CLK_SET 0x06010004u#define VPU_37XX_CPU_SS_MSSCPU_CPR_CLK_SET_CPU_DSU_MASK BIT_MASK(1)
@@ -259,15 +259,15 @@#define VPU_37XX_CPU_SS_MSSCPU_CPR_RST_CLR_CPU_DSU_MASK BIT_MASK(1)#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC 0x06010040u -#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RSTRUN0_MASK BIT_MASK(0) -#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RESUME0_MASK BIT_MASK(1) -#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RSTRUN1_MASK BIT_MASK(2) -#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RESUME1_MASK BIT_MASK(3) +#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RSTRUN0_MASK BIT_MASK(0) +#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RESUME0_MASK BIT_MASK(1) +#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RSTRUN1_MASK BIT_MASK(2) +#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RESUME1_MASK BIT_MASK(3)#define VPU_37XX_CPU_SS_MSSCPU_CPR_LEON_RT_VEC_IRQI_RSTVEC_MASK GENMASK(31, 4)#define VPU_37XX_CPU_SS_TIM_WATCHDOG 0x0602009cu#define VPU_37XX_CPU_SS_TIM_WDOG_EN 0x060200a4u -#define VPU_37XX_CPU_SS_TIM_SAFE 0x060200a8u +#define VPU_37XX_CPU_SS_TIM_SAFE 0x060200a8u#define VPU_37XX_CPU_SS_TIM_IPC_FIFO 0x060200f0u#define VPU_37XX_CPU_SS_TIM_GEN_CONFIG 0x06021008u
Signature · 1 line
2.25.1
PATCH v3 11/11 accel/ivpu: Move MMU register definitions to ivpu_mmu.c
In reply to Stanislaw GruszkaFrom: Jacek Lawrynowicz <[email protected]>
MMU registers are not platform specific so they should be defined separate to platform regs.
--- drivers/accel/ivpu/ivpu_hw_37xx_reg.h | 33 -------- drivers/accel/ivpu/ivpu_mmu.c | 117 +++++++++++++++++--------- 2 files changed, 75 insertions(+), 75 deletions(-)
drivers/accel/ivpu/ivpu_hw_37xx_reg.h +0 -33
@@ -191,39 +191,6 @@#define VPU_37XX_HOST_SS_WORKPOINT_CONFIG_MIRROR_FINAL_PLL_FREQ_MASK GENMASK(15, 0)#define VPU_37XX_HOST_SS_WORKPOINT_CONFIG_MIRROR_CONFIG_ID_MASK GENMASK(31, 16) -#define VPU_37XX_HOST_MMU_IDR0 0x00200000u -#define VPU_37XX_HOST_MMU_IDR1 0x00200004u -#define VPU_37XX_HOST_MMU_IDR3 0x0020000cu -#define VPU_37XX_HOST_MMU_IDR5 0x00200014u -#define VPU_37XX_HOST_MMU_CR0 0x00200020u -#define VPU_37XX_HOST_MMU_CR0ACK 0x00200024u -#define VPU_37XX_HOST_MMU_CR1 0x00200028u -#define VPU_37XX_HOST_MMU_CR2 0x0020002cu -#define VPU_37XX_HOST_MMU_IRQ_CTRL 0x00200050u -#define VPU_37XX_HOST_MMU_IRQ_CTRLACK 0x00200054u - -#define VPU_37XX_HOST_MMU_GERROR 0x00200060u -#define VPU_37XX_HOST_MMU_GERROR_CMDQ_MASK BIT_MASK(0) -#define VPU_37XX_HOST_MMU_GERROR_EVTQ_ABT_MASK BIT_MASK(2) -#define VPU_37XX_HOST_MMU_GERROR_PRIQ_ABT_MASK BIT_MASK(3) -#define VPU_37XX_HOST_MMU_GERROR_MSI_CMDQ_ABT_MASK BIT_MASK(4) -#define VPU_37XX_HOST_MMU_GERROR_MSI_EVTQ_ABT_MASK BIT_MASK(5) -#define VPU_37XX_HOST_MMU_GERROR_MSI_PRIQ_ABT_MASK BIT_MASK(6) -#define VPU_37XX_HOST_MMU_GERROR_MSI_ABT_MASK BIT_MASK(7) - -#define VPU_37XX_HOST_MMU_GERRORN 0x00200064u - -#define VPU_37XX_HOST_MMU_STRTAB_BASE 0x00200080u -#define VPU_37XX_HOST_MMU_STRTAB_BASE_CFG 0x00200088u -#define VPU_37XX_HOST_MMU_CMDQ_BASE 0x00200090u -#define VPU_37XX_HOST_MMU_CMDQ_PROD 0x00200098u -#define VPU_37XX_HOST_MMU_CMDQ_CONS 0x0020009cu -#define VPU_37XX_HOST_MMU_EVTQ_BASE 0x002000a0u -#define VPU_37XX_HOST_MMU_EVTQ_PROD 0x002000a8u -#define VPU_37XX_HOST_MMU_EVTQ_CONS 0x002000acu -#define VPU_37XX_HOST_MMU_EVTQ_PROD_SEC (0x002000a8u + SZ_64K) -#define VPU_37XX_HOST_MMU_EVTQ_CONS_SEC (0x002000acu + SZ_64K) -#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES 0x00360000u#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_CACHE_OVERRIDE_EN_MASK BIT_MASK(0)#define VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES_AWCACHE_OVERRIDE_MASK BIT_MASK(1)
drivers/accel/ivpu/ivpu_mmu.c +75 -42
244 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 11 lines · Stanislaw Gruszka
Update for -next:
- various cleanups
- begin preparation for conversion to GEM SHMEM
- print information about used workaroundsv3:
- fix commit messages
- split patch 2 into separate patchesv2:
- fix compilation withoutCONFIG_PM
Made changes requested by Jeffrey and applied to drm-misc-next . Except patch 8 which require small change from mainline to apply cleanly. I will wait until 6.6-rc back-merge for it.
Thanks
Stanislaw