accel/ivpu: Merge register headers and extend tile fuse config
Karol Wachowski
maintainercover accel/ivpu: Merge register headers and extend tile fuse config
This series removes duplication between the per-generation register definitions and code in the ivpu driver, and adds a debug test mode.
Patch 1 adds a test mode that enables the buttress FREQ_CHANGE interrupt and stores the buttress interrupt mask in struct ivpu_hw_info.
Patches 2-4 merge the 37xx/40xx IP register headers, the identical 37xx and 40xx IP functions, and the MTL/LNL buttress register headers. There is no functional change.
Patch 5 extends the tile fuse config field to 7 bits.
Karol Wachowski (5):
accel/ivpu: Add test mode to enable the FREQ_CHANGE interrupt accel/ivpu: Merge NPU IP register headers accel/ivpu: Merge identical 37xx and 40xx IP functions accel/ivpu: Merge buttress register headers accel/ivpu: Extend tile fuse config to 7 bits
drivers/accel/ivpu/ivpu_drv.h | 1 +
drivers/accel/ivpu/ivpu_hw.c | 5 -
drivers/accel/ivpu/ivpu_hw.h | 7 +-
drivers/accel/ivpu/ivpu_hw_40xx_reg.h | 195 ---------
drivers/accel/ivpu/ivpu_hw_btrs.c | 32 +-
drivers/accel/ivpu/ivpu_hw_btrs.h | 2 -
drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h | 83 ----
...u_hw_btrs_lnl_reg.h => ivpu_hw_btrs_reg.h} | 84 +++-
drivers/accel/ivpu/ivpu_hw_ip.c | 396 +++---------------
drivers/accel/ivpu/ivpu_hw_ip.h | 3 +-
.../{ivpu_hw_37xx_reg.h => ivpu_hw_ip_reg.h} | 69 ++-
11 files changed, 232 insertions(+), 645 deletions(-)
delete mode 100644 drivers/accel/ivpu/ivpu_hw_40xx_reg.h
delete mode 100644 drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h
rename drivers/accel/ivpu/{ivpu_hw_btrs_lnl_reg.h => ivpu_hw_btrs_reg.h} (58%)
rename drivers/accel/ivpu/{ivpu_hw_37xx_reg.h => ivpu_hw_ip_reg.h} (73%)Signature · 1 line
2.43.0
Karol Wachowski
maintainerPATCH 1/5 accel/ivpu: Add test mode to enable the FREQ_CHANGE interrupt
The buttress FREQ_CHANGE interrupt is not enabled by the driver, but there is no way to turn it on for testing and debugging.
Store the buttress interrupt mask in struct ivpu_hw_info, so it is set up once during HW info initialization instead of being a compile time constant, and use it everywhere the mask is needed. Add the IVPU_TEST_MODE_FREQ_CHANGE_ENABLE test mode that adds FREQ_CHANGE to this mask.
No functional change with the test mode disabled.
--- drivers/accel/ivpu/ivpu_drv.h | 1 + drivers/accel/ivpu/ivpu_hw.h | 1 + drivers/accel/ivpu/ivpu_hw_btrs.c | 22 ++++++++++++++++------ 3 files changed, 18 insertions(+), 6 deletions(-)
drivers/accel/ivpu/ivpu_drv.h +1 -0
@@ -230,6 +230,7 @@ extern bool ivpu_force_snoop;#define IVPU_TEST_MODE_FW_TEST BIT(0)#define IVPU_TEST_MODE_NULL_HW BIT(1)#define IVPU_TEST_MODE_NULL_SUBMISSION BIT(2) +#define IVPU_TEST_MODE_FREQ_CHANGE_ENABLE BIT(3)#define IVPU_TEST_MODE_MIP_DISABLE BIT(6)#define IVPU_TEST_MODE_DISABLE_TIMEOUTS BIT(8)#define IVPU_TEST_MODE_TURBO_ENABLE BIT(9)
drivers/accel/ivpu/ivpu_hw.h +1 -0
@@ -51,6 +51,7 @@ struct ivpu_hw_info {u16 config;ktime_t d0i3_entry_host_ts;u64 d0i3_entry_vpu_ts; +u32 btrs_irq_mask;atomic_t firewall_irq_counter; };
drivers/accel/ivpu/ivpu_hw_btrs.c +16 -6
@@ -141,6 +141,11 @@ static int info_init_mtl(struct ivpu_device *vdev) hw->tile_fuse =BTRS_MTL_TILE_FUSE_ENABLE_BOTH ; hw->sku =BTRS_MTL_TILE_SKU_BOTH ; hw->config =WP_CONFIG (MTL_CONFIG_2_TILE ,MTL_PLL_RATIO_4_3 ); + hw->btrs_irq_mask =BTRS_MTL_IRQ_MASK ; + +if (ivpu_test_mode &IVPU_TEST_MODE_FREQ_CHANGE_ENABLE ) + hw->btrs_irq_mask =REG_SET_FLD (VPU_HW_BTRS_MTL_INTERRUPT_STAT ,FREQ_CHANGE , + hw->btrs_irq_mask);return 0 ; }
@@ -157,6 +162,11 @@ static int info_init_lnl(struct ivpu_device *vdev) hw->tile_fuse = tile_fuse_config; hw->pll.profiling_freq =PLL_PROFILING_FREQ_DEFAULT ; + hw->btrs_irq_mask =BTRS_LNL_IRQ_MASK ; + +if (ivpu_test_mode &IVPU_TEST_MODE_FREQ_CHANGE_ENABLE ) + hw->btrs_irq_mask =REG_SET_FLD (VPU_HW_BTRS_LNL_INTERRUPT_STAT ,FREQ_CHANGE , + hw->btrs_irq_mask);return 0 ; }
@@ -683,7 +693,7 @@ int ivpu_hw_btrs_cfg_freq_init(struct ivpu_device *vdev)/* Handler for IRQs from Buttress core (irqB) */ bool ivpu_hw_btrs_irq_handler_mtl (struct ivpu_device *vdev,int irq) { -u32 status =REGB_RD32 (VPU_HW_BTRS_MTL_INTERRUPT_STAT ) &BTRS_MTL_IRQ_MASK ; +u32 status =REGB_RD32 (VPU_HW_BTRS_MTL_INTERRUPT_STAT ) & vdev->hw->btrs_irq_mask;bool schedule_recovery = false;if (!status)
@@ -725,7 +735,7 @@ bool ivpu_hw_btrs_irq_handler_mtl(struct ivpu_device *vdev, int irq)/* Handler for IRQs from Buttress core (irqB) */ bool ivpu_hw_btrs_irq_handler_lnl (struct ivpu_device *vdev,int irq) { -u32 status =REGB_RD32 (VPU_HW_BTRS_LNL_INTERRUPT_STAT ) &BTRS_LNL_IRQ_MASK ; +u32 status =REGB_RD32 (VPU_HW_BTRS_LNL_INTERRUPT_STAT ) & vdev->hw->btrs_irq_mask;bool schedule_recovery = false;if (!status)
@@ -867,10 +877,10 @@ void ivpu_hw_btrs_global_int_enable(struct ivpu_device *vdev)void ivpu_hw_btrs_irq_enable (struct ivpu_device *vdev) {if (ivpu_hw_btrs_gen (vdev) ==IVPU_HW_BTRS_MTL ) { -REGB_WR32 (VPU_HW_BTRS_MTL_LOCAL_INT_MASK , (u32)(~BTRS_MTL_IRQ_MASK )); +REGB_WR32 (VPU_HW_BTRS_MTL_LOCAL_INT_MASK , (u32)(~vdev->hw->btrs_irq_mask));REGB_WR32 (VPU_HW_BTRS_MTL_GLOBAL_INT_MASK ,0x0 ); }else { -REGB_WR32 (VPU_HW_BTRS_LNL_LOCAL_INT_MASK , (u32)(~BTRS_LNL_IRQ_MASK )); +REGB_WR32 (VPU_HW_BTRS_LNL_LOCAL_INT_MASK , (u32)(~vdev->hw->btrs_irq_mask));REGB_WR32 (VPU_HW_BTRS_LNL_GLOBAL_INT_MASK ,0x0 ); } }
@@ -888,7 +898,7 @@ void ivpu_hw_btrs_irq_disable(struct ivpu_device *vdev)static void diagnose_failure_mtl (struct ivpu_device *vdev) { -u32 reg =REGB_RD32 (VPU_HW_BTRS_MTL_INTERRUPT_STAT ) &BTRS_MTL_IRQ_MASK ; +u32 reg =REGB_RD32 (VPU_HW_BTRS_MTL_INTERRUPT_STAT ) & vdev->hw->btrs_irq_mask;if (REG_TEST_FLD (VPU_HW_BTRS_MTL_INTERRUPT_STAT ,ATS_ERR , reg))ivpu_err (vdev,"ATS_ERR irq 0x%016llx" ,REGB_RD64 (VPU_HW_BTRS_MTL_ATS_ERR_LOG_0 ));
@@ -905,7 +915,7 @@ static void diagnose_failure_mtl(struct ivpu_device *vdev)static void diagnose_failure_lnl (struct ivpu_device *vdev) { -u32 reg =REGB_RD32 (VPU_HW_BTRS_LNL_INTERRUPT_STAT ) &BTRS_LNL_IRQ_MASK ; +u32 reg =REGB_RD32 (VPU_HW_BTRS_LNL_INTERRUPT_STAT ) & vdev->hw->btrs_irq_mask;if (REG_TEST_FLD (VPU_HW_BTRS_LNL_INTERRUPT_STAT ,ATS_ERR , reg)) { ivpu_err(vdev, "ATS_ERR_LOG1 0x%08x ATS_ERR_LOG2 0x%08x\n",
Signature · 1 line
2.43.0
Karol Wachowski
maintainerPATCH 3/5 accel/ivpu: Merge identical 37xx and 40xx IP functions
In reply to Karol WachowskiWith a single register header, many 37xx and 40xx functions became identical, including the IRQ handler. Keep one copy of each and call the IRQ handler directly instead of through a function pointer.
No functional change.
--- drivers/accel/ivpu/ivpu_hw.c | 5 - drivers/accel/ivpu/ivpu_hw.h | 6 - drivers/accel/ivpu/ivpu_hw_ip.c | 353 +++++--------------------------- drivers/accel/ivpu/ivpu_hw_ip.h | 3 +- 4 files changed, 49 insertions(+), 318 deletions(-)
drivers/accel/ivpu/ivpu_hw.c +0 -5
@@ -374,11 +374,6 @@ void ivpu_hw_profiling_freq_drive(struct ivpu_device *vdev, bool enable)void ivpu_irq_handlers_init (struct ivpu_device *vdev) { -if (ivpu_hw_ip_gen (vdev) ==IVPU_HW_IP_37XX ) - vdev->hw->irq.ip_irq_handler = ivpu_hw_ip_irq_handler_37xx; -else - vdev->hw->irq.ip_irq_handler = ivpu_hw_ip_irq_handler_40xx; -if (ivpu_hw_btrs_gen (vdev) ==IVPU_HW_BTRS_MTL ) vdev->hw->irq.btrs_irq_handler = ivpu_hw_btrs_irq_handler_mtl;else
drivers/accel/ivpu/ivpu_hw.h +0 -6
@@ -18,7 +18,6 @@ struct ivpu_addr_range {struct ivpu_hw_info {struct {bool (*btrs_irq_handler)(struct ivpu_device *vdev,int irq); -bool (*ip_irq_handler)(struct ivpu_device *vdev,int irq); } irq;struct {struct ivpu_addr_range runtime;
@@ -74,11 +73,6 @@ static inline u32 ivpu_hw_btrs_irq_handler(struct ivpu_device *vdev, int irq)return vdev->hw->irq.btrs_irq_handler (vdev, irq); } -static inline u32 ivpu_hw_ip_irq_handler (struct ivpu_device *vdev,int irq) -{ -return vdev->hw->irq.ip_irq_handler (vdev, irq); -} -static inline u64 ivpu_hw_range_size (const struct ivpu_addr_range *range) {return range->end - range->start;
drivers/accel/ivpu/ivpu_hw_ip.c +48 -305
486 lines not on this page · raw message
drivers/accel/ivpu/ivpu_hw_ip.h +1 -2
@@ -22,8 +22,7 @@ void ivpu_hw_ip_wdt_disable(struct ivpu_device *vdev);void ivpu_hw_ip_diagnose_failure (struct ivpu_device *vdev);u32 ivpu_hw_ip_ipc_rx_count_get (struct ivpu_device *vdev);void ivpu_hw_ip_irq_clear (struct ivpu_device *vdev); -bool ivpu_hw_ip_irq_handler_37xx (struct ivpu_device *vdev,int irq); -bool ivpu_hw_ip_irq_handler_40xx (struct ivpu_device *vdev,int irq); +bool ivpu_hw_ip_irq_handler (struct ivpu_device *vdev,int irq);void ivpu_hw_ip_db_set (struct ivpu_device *vdev,u32 db_id);u32 ivpu_hw_ip_ipc_rx_addr_get (struct ivpu_device *vdev);void ivpu_hw_ip_ipc_tx_set (struct ivpu_device *vdev,u32 vpu_addr);
Signature · 1 line
2.43.0
Karol Wachowski
maintainerPATCH 2/5 accel/ivpu: Merge NPU IP register headers
In reply to Karol WachowskiMost registers in the 37xx and 40xx IP headers are the same, with only the prefix differing, which forces a lot of code to be duplicated per generation.
Merge them into ivpu_hw_ip_reg.h. Each register is defined once with the prefix of the first generation that has it. New or changed fields use the prefix of the generation that introduced them. The CPU_SS registers that moved in 40xx are defined right below the 37xx ones. This leaves some 37xx and 40xx code paths identical, which the next patch merges.
No functional change.
---
drivers/accel/ivpu/ivpu_hw_40xx_reg.h | 195 ------------------
drivers/accel/ivpu/ivpu_hw_btrs.h | 2 -
drivers/accel/ivpu/ivpu_hw_ip.c | 173 ++++++++--------
.../{ivpu_hw_37xx_reg.h => ivpu_hw_ip_reg.h} | 69 ++++++-
4 files changed, 151 insertions(+), 288 deletions(-)
delete mode 100644 drivers/accel/ivpu/ivpu_hw_40xx_reg.h
rename drivers/accel/ivpu/{ivpu_hw_37xx_reg.h => ivpu_hw_ip_reg.h} (73%)drivers/accel/ivpu/ivpu_hw_40xx_reg.h deleted +0 -195
@@ -1,195 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* Copyright (C) 2020-2023 Intel Corporation -*/ - -#ifndef __IVPU_HW_40XX_REG_H__ -#define __IVPU_HW_40XX_REG_H__ - -#include <linux/bits.h> - -#define VPU_40XX_HOST_SS_CPR_CLK_EN 0x00000080u -#define VPU_40XX_HOST_SS_CPR_CLK_EN_TOP_NOC_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_CPR_CLK_EN_DSS_MAS_MASK BIT_MASK(10) -#define VPU_40XX_HOST_SS_CPR_CLK_EN_CSS_MAS_MASK BIT_MASK(11) - -#define VPU_40XX_HOST_SS_CPR_CLK_SET 0x00000084u -#define VPU_40XX_HOST_SS_CPR_CLK_SET_TOP_NOC_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_CPR_CLK_SET_DSS_MAS_MASK BIT_MASK(10) -#define VPU_40XX_HOST_SS_CPR_CLK_SET_MSS_MAS_MASK BIT_MASK(11) - -#define VPU_40XX_HOST_SS_CPR_RST_EN 0x00000090u -#define VPU_40XX_HOST_SS_CPR_RST_EN_TOP_NOC_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_CPR_RST_EN_DSS_MAS_MASK BIT_MASK(10) -#define VPU_40XX_HOST_SS_CPR_RST_EN_CSS_MAS_MASK BIT_MASK(11) - -#define VPU_40XX_HOST_SS_CPR_RST_SET 0x00000094u -#define VPU_40XX_HOST_SS_CPR_RST_SET_TOP_NOC_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_CPR_RST_SET_DSS_MAS_MASK BIT_MASK(10) -#define VPU_40XX_HOST_SS_CPR_RST_SET_MSS_MAS_MASK BIT_MASK(11) - -#define VPU_40XX_HOST_SS_CPR_RST_CLR 0x00000098u -#define VPU_40XX_HOST_SS_CPR_RST_CLR_TOP_NOC_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_CPR_RST_CLR_DSS_MAS_MASK BIT_MASK(10) -#define VPU_40XX_HOST_SS_CPR_RST_CLR_MSS_MAS_MASK BIT_MASK(11) - -#define VPU_40XX_HOST_SS_HW_VERSION 0x00000108u -#define VPU_40XX_HOST_SS_HW_VERSION_SOC_REVISION_MASK GENMASK(7, 0) -#define VPU_40XX_HOST_SS_HW_VERSION_SOC_NUMBER_MASK GENMASK(15, 8) -#define VPU_40XX_HOST_SS_HW_VERSION_VPU_GENERATION_MASK GENMASK(23, 16) - -#define VPU_40XX_HOST_SS_SW_VERSION 0x0000010cu - -#define VPU_40XX_HOST_SS_GEN_CTRL 0x00000118u -#define VPU_40XX_HOST_SS_GEN_CTRL_PS_MASK GENMASK(31, 29) - -#define VPU_40XX_HOST_SS_NOC_QREQN 0x00000154u -#define VPU_40XX_HOST_SS_NOC_QREQN_TOP_SOCMMIO_MASK BIT_MASK(0) - -#define VPU_40XX_HOST_SS_NOC_QACCEPTN 0x00000158u -#define VPU_40XX_HOST_SS_NOC_QACCEPTN_TOP_SOCMMIO_MASK BIT_MASK(0) - -#define VPU_40XX_HOST_SS_NOC_QDENY 0x0000015cu -#define VPU_40XX_HOST_SS_NOC_QDENY_TOP_SOCMMIO_MASK BIT_MASK(0) - -#define VPU_40XX_TOP_NOC_QREQN 0x00000160u -#define VPU_40XX_TOP_NOC_QREQN_CPU_CTRL_MASK BIT_MASK(0) -#define VPU_40XX_TOP_NOC_QREQN_HOSTIF_L2CACHE_MASK BIT_MASK(2) - -#define VPU_40XX_TOP_NOC_QACCEPTN 0x00000164u -#define VPU_40XX_TOP_NOC_QACCEPTN_CPU_CTRL_MASK BIT_MASK(0) -#define VPU_40XX_TOP_NOC_QACCEPTN_HOSTIF_L2CACHE_MASK BIT_MASK(2) - -#define VPU_40XX_TOP_NOC_QDENY 0x00000168u -#define VPU_40XX_TOP_NOC_QDENY_CPU_CTRL_MASK BIT_MASK(0) -#define VPU_40XX_TOP_NOC_QDENY_HOSTIF_L2CACHE_MASK BIT_MASK(2) - -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN 0x00000170u -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_CSS_ROM_CMX_MASK BIT_MASK(0) -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_CSS_DBG_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_CSS_CTRL_MASK BIT_MASK(2) -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_DEC400_MASK BIT_MASK(3) -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_MSS_NCE_MASK BIT_MASK(4) -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_MSS_MBI_MASK BIT_MASK(5) -#define VPU_40XX_HOST_SS_FW_SOC_IRQ_EN_MSS_MBI_CMX_MASK BIT_MASK(6) - -#define VPU_40XX_HOST_SS_ICB_STATUS_0 0x00010210u -#define VPU_40XX_HOST_SS_ICB_STATUS_0_TIMER_0_INT_MASK BIT_MASK(0) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_TIMER_1_INT_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_TIMER_2_INT_MASK BIT_MASK(2) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_TIMER_3_INT_MASK BIT_MASK(3) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_HOST_IPC_FIFO_INT_MASK BIT_MASK(4) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_0_INT_MASK BIT_MASK(5) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_1_INT_MASK BIT_MASK(6) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_MMU_IRQ_2_INT_MASK BIT_MASK(7) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_NOC_FIREWALL_INT_MASK BIT_MASK(8) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_CPU_INT_REDIRECT_0_INT_MASK BIT_MASK(30) -#define VPU_40XX_HOST_SS_ICB_STATUS_0_CPU_INT_REDIRECT_1_INT_MASK BIT_MASK(31) - -#define VPU_40XX_HOST_SS_ICB_STATUS_1 0x00010214u -#define VPU_40XX_HOST_SS_ICB_STATUS_1_CPU_INT_REDIRECT_2_INT_MASK BIT_MASK(0) -#define VPU_40XX_HOST_SS_ICB_STATUS_1_CPU_INT_REDIRECT_3_INT_MASK BIT_MASK(1) -#define VPU_40XX_HOST_SS_ICB_STATUS_1_CPU_INT_REDIRECT_4_INT_MASK BIT_MASK(2) - -#define VPU_40XX_HOST_SS_ICB_CLEAR_0 0x00010220u -#define VPU_40XX_HOST_SS_ICB_CLEAR_1 0x00010224u -#define VPU_40XX_HOST_SS_ICB_ENABLE_0 0x00010240u -#define VPU_40XX_HOST_SS_ICB_ENABLE_1 0x00010244u - -#define VPU_40XX_HOST_SS_TIM_IPC_FIFO_ATM 0x000200f4u - -#define VPU_40XX_HOST_SS_TIM_IPC_FIFO_STAT 0x000200fcu -#define VPU_40XX_HOST_SS_TIM_IPC_FIFO_STAT_FILL_LEVEL_MASK GENMASK(23, 16) - -#define VPU_40XX_HOST_SS_AON_PWR_ISO_EN0 0x00030020u -#define VPU_40XX_HOST_SS_AON_PWR_ISO_EN0_CSS_CPU_MASK BIT_MASK(3) - -#define VPU_40XX_HOST_SS_AON_PWR_ISLAND_EN0 0x00030024u -#define VPU_40XX_HOST_SS_AON_PWR_ISLAND_EN0_CSS_CPU_MASK BIT_MASK(3) - -#define VPU_40XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0 0x00030028u -#define VPU_40XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0_CSS_CPU_MASK BIT_MASK(3) - -#define VPU_40XX_HOST_SS_AON_PWR_ISLAND_STATUS0 0x0003002cu -#define VPU_40XX_HOST_SS_AON_PWR_ISLAND_STATUS0_CSS_CPU_MASK BIT_MASK(3) - -#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY 0x00030068u -#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY_POST_DLY_MASK GENMASK(7, 0) -#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY_POST1_DLY_MASK GENMASK(15, 8) -#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY_POST2_DLY_MASK GENMASK(23, 16) - -#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY 0x0003006cu -#define VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY_STATUS_DLY_MASK GENMASK(7, 0) - -#define VPU_40XX_HOST_SS_AON_IDLE_GEN 0x00030200u -#define VPU_40XX_HOST_SS_AON_IDLE_GEN_EN_MASK BIT_MASK(0) -#define VPU_40XX_HOST_SS_AON_IDLE_GEN_HW_PG_EN_MASK BIT_MASK(1) - -#define VPU_40XX_HOST_SS_AON_DPU_ACTIVE 0x00030204u -#define VPU_40XX_HOST_SS_AON_DPU_ACTIVE_DPU_ACTIVE_MASK BIT_MASK(0) - -#define VPU_50XX_HOST_SS_AON_FABRIC_REQ_OVERRIDE 0x00030210u -#define VPU_50XX_HOST_SS_AON_FABRIC_REQ_OVERRIDE_REQ_OVERRIDE_MASK BIT_MASK(0) - -#define VPU_40XX_HOST_SS_VERIFICATION_ADDRESS_LO 0x00040040u -#define VPU_40XX_HOST_SS_VERIFICATION_ADDRESS_LO_DONE_MASK BIT_MASK(0) -#define VPU_40XX_HOST_SS_VERIFICATION_ADDRESS_LO_IOSF_RS_ID_MASK GENMASK(2, 1) -#define VPU_40XX_HOST_SS_VERIFICATION_ADDRESS_LO_IMAGE_LOCATION_MASK GENMASK(31, 3) - -#define VPU_40XX_HOST_SS_WORKPOINT_CONFIG_MIRROR 0x00082020u -#define VPU_40XX_HOST_SS_WORKPOINT_CONFIG_MIRROR_FINAL_PLL_FREQ_MASK GENMASK(15, 0) -#define VPU_40XX_HOST_SS_WORKPOINT_CONFIG_MIRROR_CONFIG_ID_MASK GENMASK(31, 16) - -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES 0x00360000u -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_CACHE_OVERRIDE_EN_MASK BIT_MASK(0) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_AWCACHE_OVERRIDE_MASK BIT_MASK(1) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_ARCACHE_OVERRIDE_MASK BIT_MASK(2) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_SNOOP_OVERRIDE_EN_MASK BIT_MASK(3) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_AW_SNOOP_OVERRIDE_MASK BIT_MASK(4) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_AR_SNOOP_OVERRIDE_MASK BIT_MASK(5) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_PTW_AW_CONTEXT_FLAG_MASK GENMASK(10, 6) -#define VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES_PTW_AR_CONTEXT_FLAG_MASK GENMASK(15, 11) - -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV 0x00360004u -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU0_AWMMUSSIDV_MASK BIT_MASK(0) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU0_ARMMUSSIDV_MASK BIT_MASK(1) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU1_AWMMUSSIDV_MASK BIT_MASK(2) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU1_ARMMUSSIDV_MASK BIT_MASK(3) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU2_AWMMUSSIDV_MASK BIT_MASK(4) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU2_ARMMUSSIDV_MASK BIT_MASK(5) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU3_AWMMUSSIDV_MASK BIT_MASK(6) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU3_ARMMUSSIDV_MASK BIT_MASK(7) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU4_AWMMUSSIDV_MASK BIT_MASK(8) -#define VPU_40XX_HOST_IF_TBU_MMUSSIDV_TBU4_ARMMUSSIDV_MASK BIT_MASK(9) - -#define VPU_40XX_CPU_SS_DSU_LEON_RT_BASE 0x04000000u -#define VPU_40XX_CPU_SS_DSU_LEON_RT_DSU_CTRL 0x04000000u -#define VPU_40XX_CPU_SS_DSU_LEON_RT_PC_REG 0x04400010u -#define VPU_40XX_CPU_SS_DSU_LEON_RT_NPC_REG 0x04400014u -#define VPU_40XX_CPU_SS_DSU_LEON_RT_DSU_TRAP_REG 0x04400020u - -#define VPU_40XX_CPU_SS_TIM_WATCHDOG 0x0102009cu -#define VPU_40XX_CPU_SS_TIM_WDOG_EN 0x010200a4u -#define VPU_40XX_CPU_SS_TIM_SAFE 0x010200a8u - -#define VPU_40XX_CPU_SS_TIM_GEN_CONFIG 0x01021008u -#define VPU_40XX_CPU_SS_TIM_GEN_CONFIG_WDOG_TO_INT_CLR_MASK BIT_MASK(9) - -#define VPU_40XX_CPU_SS_CPR_NOC_QREQN 0x01010030u -#define VPU_40XX_CPU_SS_CPR_NOC_QREQN_TOP_MMIO_MASK BIT_MASK(0) - -#define VPU_40XX_CPU_SS_CPR_NOC_QACCEPTN 0x01010034u -#define VPU_40XX_CPU_SS_CPR_NOC_QACCEPTN_TOP_MMIO_MASK BIT_MASK(0) - -#define VPU_40XX_CPU_SS_CPR_NOC_QDENY 0x01010038u -#define VPU_40XX_CPU_SS_CPR_NOC_QDENY_TOP_MMIO_MASK BIT_MASK(0) - -#define VPU_40XX_CPU_SS_TIM_IPC_FIFO 0x010200f0u -#define VPU_40XX_CPU_SS_TIM_PERF_EXT_FREE_CNT 0x01029008u - -#define VPU_40XX_CPU_SS_DOORBELL_0 0x01300000u -#define VPU_40XX_CPU_SS_DOORBELL_0_SET_MASK BIT_MASK(0) - -#define VPU_40XX_CPU_SS_DOORBELL_1 0x01301000u - -#endif /* __IVPU_HW_40XX_REG_H__ */
drivers/accel/ivpu/ivpu_hw_btrs.h +0 -2
@@ -7,8 +7,6 @@#define __IVPU_HW_BTRS_H__#include "ivpu_drv.h" -#include "ivpu_hw_37xx_reg.h" -#include "ivpu_hw_40xx_reg.h" #include "ivpu_hw_reg_io.h" #define PLL_PROFILING_FREQ_DEFAULT 38400000
drivers/accel/ivpu/ivpu_hw_ip.c +86 -87
392 lines not on this page · raw message
drivers/accel/ivpu/ivpu_hw_ip_reg.h renamed from drivers/accel/ivpu/ivpu_hw_37xx_reg.h +65 -4
151 lines not on this page · raw message
Signature · 1 line
2.43.0
Karol Wachowski
maintainerPATCH 5/5 accel/ivpu: Extend tile fuse config to 7 bits
In reply to Karol WachowskiThe buttress code that reads the tile fuse register is shared by all generations, so the register field definition should not differ between them. Extend the TILE_CONFIG mask from [6:1] to [7:1] and use it everywhere, instead of having a different field width per generation.
The tile count range check in tile_disable_check() depended on the previous field width. It only logs a warning, and it would now warn on a valid value, so drop it together with the tile count defines it used.
--- drivers/accel/ivpu/ivpu_hw_btrs.c | 7 ------- drivers/accel/ivpu/ivpu_hw_btrs_reg.h | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/accel/ivpu/ivpu_hw_btrs.c +0 -7
@@ -45,9 +45,6 @@#define BTRS_MTL_TILE_FUSE_ENABLE_BOTH 0x0#define BTRS_MTL_TILE_SKU_BOTH 0x3630 -#define BTRS_LNL_TILE_MAX_NUM 6 -#define BTRS_LNL_TILE_MAX_MASK 0x3f -#define WEIGHTS_DEFAULT 0xf711f711u#define WEIGHTS_ATS_DEFAULT 0x0000f711u
@@ -99,13 +96,9 @@ void ivpu_hw_btrs_freq_ratios_init(struct ivpu_device *vdev)static bool tile_disable_check (u32 config) { -/* Allowed values: 0 or one bit from range 0-5 (6 tiles) */ if (config ==0 )return true; -if (config >BIT (BTRS_LNL_TILE_MAX_NUM -1 )) -return false; -if ((config & (config -1 )) ==0 )return true;
drivers/accel/ivpu/ivpu_hw_btrs_reg.h +1 -1
@@ -151,7 +151,7 @@#define VPU_HW_BTRS_LNL_TILE_FUSE 0x00000150u#define VPU_HW_BTRS_LNL_TILE_FUSE_VALID_MASK BIT_MASK(0) -#define VPU_HW_BTRS_LNL_TILE_FUSE_CONFIG_MASK GENMASK(6, 1) +#define VPU_HW_BTRS_LNL_TILE_FUSE_CONFIG_MASK GENMASK(7, 1)#define VPU_HW_BTRS_LNL_VPU_STATUS 0x00000154u#define VPU_HW_BTRS_LNL_VPU_STATUS_READY_MASK BIT_MASK(0)
Signature · 1 line
2.43.0
Karol Wachowski
maintainerPATCH 4/5 accel/ivpu: Merge buttress register headers
In reply to Karol WachowskiPut the MTL and LNL buttress registers in a single header, like the IP registers. No register shares its offset between MTL and LNL, so the MTL ones are simply followed by the LNL ones.
Also fix the DUP_IDLE typo (should be DPU_IDLE).
No functional change.
---
drivers/accel/ivpu/ivpu_hw_btrs.c | 3 +-
drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h | 83 -------------------
...u_hw_btrs_lnl_reg.h => ivpu_hw_btrs_reg.h} | 82 ++++++++++++++++--
3 files changed, 78 insertions(+), 90 deletions(-)
delete mode 100644 drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h
rename drivers/accel/ivpu/{ivpu_hw_btrs_lnl_reg.h => ivpu_hw_btrs_reg.h} (59%)drivers/accel/ivpu/ivpu_hw_btrs.c +1 -2
@@ -8,8 +8,7 @@#include "ivpu_drv.h" #include "ivpu_hw.h" #include "ivpu_hw_btrs.h" -#include "ivpu_hw_btrs_lnl_reg.h" -#include "ivpu_hw_btrs_mtl_reg.h" +#include "ivpu_hw_btrs_reg.h" #include "ivpu_hw_reg_io.h" #include "ivpu_jsm_msg.h" #include "ivpu_pm.h"
drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h deleted +0 -83
83 lines not on this page · raw message
drivers/accel/ivpu/ivpu_hw_btrs_reg.h renamed from drivers/accel/ivpu/ivpu_hw_btrs_lnl_reg.h +77 -5
101 lines not on this page · raw message
Signature · 1 line
2.43.0
Quoted 11 lines · Karol Wachowski
This series removes duplication between the per-generation register definitions and code in the ivpu driver, and adds a debug test mode.
Patch 1 adds a test mode that enables the buttress
FREQ_CHANGEinterrupt and stores the buttress interrupt mask in structivpu_hw_info.Patches 2-4 merge the 37xx/40xx IP register headers, the identical 37xx and 40xx IP functions, and the MTL/LNL buttress register headers. There is no functional change.
Patch 5 extends the tile fuse config field to 7 bits.
For the series
Quoted 25 lines
Karol Wachowski (5):
accel/ivpu: Add test mode to enable theFREQ_CHANGEinterrupt accel/ivpu: Merge NPU IP register headers accel/ivpu: Merge identical 37xx and 40xx IP functions accel/ivpu: Merge buttress register headers accel/ivpu: Extend tile fuse config to 7 bitsdrivers/accel/ivpu/ivpu_drv.h | 1 + drivers/accel/ivpu/ivpu_hw.c | 5 - drivers/accel/ivpu/ivpu_hw.h | 7 +- drivers/accel/ivpu/ivpu_hw_40xx_reg.h | 195 --------- drivers/accel/ivpu/ivpu_hw_btrs.c | 32 +- drivers/accel/ivpu/ivpu_hw_btrs.h | 2 - drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h | 83 ---- ...u_hw_btrs_lnl_reg.h => ivpu_hw_btrs_reg.h} | 84 +++- drivers/accel/ivpu/ivpu_hw_ip.c | 396 +++--------------- drivers/accel/ivpu/ivpu_hw_ip.h | 3 +- .../{ivpu_hw_37xx_reg.h => ivpu_hw_ip_reg.h} | 69 ++- 11 files changed, 232 insertions(+), 645 deletions(-)delete mode 100644
drivers/accel/ivpu/ivpu_hw_40xx_reg.h
delete mode 100644drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.hrenamedrivers/accel/ivpu/{ivpu_hw_btrs_lnl_reg.h=>ivpu_hw_btrs_reg.h} (58%) renamedrivers/accel/ivpu/{ivpu_hw_37xx_reg.h=>ivpu_hw_ip_reg.h} (73%)
Quoted 11 lines · Dawid Osuchowski
Quoted 10 lines · Karol Wachowski
This series removes duplication between the per-generation register definitions and code in the ivpu driver, and adds a debug test mode.
Patch 1 adds a test mode that enables the buttress
FREQ_CHANGEinterrupt and stores the buttress interrupt mask in structivpu_hw_info.Patches 2-4 merge the 37xx/40xx IP register headers, the identical 37xx and 40xx IP functions, and the MTL/LNL buttress register headers. There is no functional change.
Quoted 5 lines
Quoted 1 line
Patch 5 extends the tile fuse config field to 7 bits.
For the series
Reviewed-by Dawid Osuchowski <[email protected]>
Thanks, applied to drm-misc-next.
Quoted 27 lines
Quoted 26 lines
Karol Wachowski (5):
accel/ivpu: Add test mode to enable theFREQ_CHANGEinterrupt accel/ivpu: Merge NPU IP register headers accel/ivpu: Merge identical 37xx and 40xx IP functions accel/ivpu: Merge buttress register headers accel/ivpu: Extend tile fuse config to 7 bitsdrivers/accel/ivpu/ivpu_drv.h | 1 + drivers/accel/ivpu/ivpu_hw.c | 5 - drivers/accel/ivpu/ivpu_hw.h | 7 +- drivers/accel/ivpu/ivpu_hw_40xx_reg.h | 195 --------- drivers/accel/ivpu/ivpu_hw_btrs.c | 32 +- drivers/accel/ivpu/ivpu_hw_btrs.h | 2 - drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.h | 83 ----
...u_hw_btrs_lnl_reg.h=>ivpu_hw_btrs_reg.h} | 84 +++- drivers/accel/ivpu/ivpu_hw_ip.c | 396 +++--------------- drivers/accel/ivpu/ivpu_hw_ip.h | 3 +-.../{ivpu_hw_37xx_reg.h=> ivpu_hw_ip_reg.h} | 69 ++-11 files changed, 232 insertions(+), 645 deletions(-)delete mode 100644
drivers/accel/ivpu/ivpu_hw_40xx_reg.h
delete mode 100644drivers/accel/ivpu/ivpu_hw_btrs_mtl_reg.hrenamedrivers/accel/ivpu/{ivpu_hw_btrs_lnl_reg.h=>ivpu_hw_btrs_reg.h} (58%) renamedrivers/accel/ivpu/{ivpu_hw_37xx_reg.h=>ivpu_hw_ip_reg.h} (73%)