Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

accel/amdxdna: Remove NPU2 support

NPU2 hardware was never publicly released and is now obsolete.
Remove all remaining NPU2 support from the driver.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20251217190818.2145781-1-lizhi.hou@amd.com

Lizhi Hou 3ef93841 281a2263

-120
-1
drivers/accel/amdxdna/Makefile
··· 18 18 amdxdna_sysfs.o \ 19 19 amdxdna_ubuf.o \ 20 20 npu1_regs.o \ 21 - npu2_regs.o \ 22 21 npu4_regs.o \ 23 22 npu5_regs.o \ 24 23 npu6_regs.o
-1
drivers/accel/amdxdna/amdxdna_pci_drv.c
··· 51 51 52 52 static const struct amdxdna_device_id amdxdna_ids[] = { 53 53 { 0x1502, 0x0, &dev_npu1_info }, 54 - { 0x17f0, 0x0, &dev_npu2_info }, 55 54 { 0x17f0, 0x10, &dev_npu4_info }, 56 55 { 0x17f0, 0x11, &dev_npu5_info }, 57 56 { 0x17f0, 0x20, &dev_npu6_info },
-1
drivers/accel/amdxdna/amdxdna_pci_drv.h
··· 137 137 138 138 /* Add device info below */ 139 139 extern const struct amdxdna_dev_info dev_npu1_info; 140 - extern const struct amdxdna_dev_info dev_npu2_info; 141 140 extern const struct amdxdna_dev_info dev_npu4_info; 142 141 extern const struct amdxdna_dev_info dev_npu5_info; 143 142 extern const struct amdxdna_dev_info dev_npu6_info;
-117
drivers/accel/amdxdna/npu2_regs.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * Copyright (C) 2023-2024, Advanced Micro Devices, Inc. 4 - */ 5 - 6 - #include <drm/amdxdna_accel.h> 7 - #include <drm/drm_device.h> 8 - #include <drm/gpu_scheduler.h> 9 - #include <linux/sizes.h> 10 - 11 - #include "aie2_pci.h" 12 - #include "amdxdna_mailbox.h" 13 - #include "amdxdna_pci_drv.h" 14 - 15 - /* NPU Public Registers on MpNPUAxiXbar (refer to Diag npu_registers.h) */ 16 - #define MPNPU_PWAITMODE 0x301003C 17 - #define MPNPU_PUB_SEC_INTR 0x3010060 18 - #define MPNPU_PUB_PWRMGMT_INTR 0x3010064 19 - #define MPNPU_PUB_SCRATCH0 0x301006C 20 - #define MPNPU_PUB_SCRATCH1 0x3010070 21 - #define MPNPU_PUB_SCRATCH2 0x3010074 22 - #define MPNPU_PUB_SCRATCH3 0x3010078 23 - #define MPNPU_PUB_SCRATCH4 0x301007C 24 - #define MPNPU_PUB_SCRATCH5 0x3010080 25 - #define MPNPU_PUB_SCRATCH6 0x3010084 26 - #define MPNPU_PUB_SCRATCH7 0x3010088 27 - #define MPNPU_PUB_SCRATCH8 0x301008C 28 - #define MPNPU_PUB_SCRATCH9 0x3010090 29 - #define MPNPU_PUB_SCRATCH10 0x3010094 30 - #define MPNPU_PUB_SCRATCH11 0x3010098 31 - #define MPNPU_PUB_SCRATCH12 0x301009C 32 - #define MPNPU_PUB_SCRATCH13 0x30100A0 33 - #define MPNPU_PUB_SCRATCH14 0x30100A4 34 - #define MPNPU_PUB_SCRATCH15 0x30100A8 35 - #define MP0_C2PMSG_73 0x3810A24 36 - #define MP0_C2PMSG_123 0x3810AEC 37 - 38 - #define MP1_C2PMSG_0 0x3B10900 39 - #define MP1_C2PMSG_60 0x3B109F0 40 - #define MP1_C2PMSG_61 0x3B109F4 41 - 42 - #define MPNPU_SRAM_X2I_MAILBOX_0 0x3600000 43 - #define MPNPU_SRAM_X2I_MAILBOX_15 0x361E000 44 - #define MPNPU_SRAM_X2I_MAILBOX_31 0x363E000 45 - #define MPNPU_SRAM_I2X_MAILBOX_31 0x363F000 46 - 47 - #define MMNPU_APERTURE0_BASE 0x3000000 48 - #define MMNPU_APERTURE1_BASE 0x3600000 49 - #define MMNPU_APERTURE3_BASE 0x3810000 50 - #define MMNPU_APERTURE4_BASE 0x3B10000 51 - 52 - /* PCIe BAR Index for NPU2 */ 53 - #define NPU2_REG_BAR_INDEX 0 54 - #define NPU2_MBOX_BAR_INDEX 0 55 - #define NPU2_PSP_BAR_INDEX 4 56 - #define NPU2_SMU_BAR_INDEX 5 57 - #define NPU2_SRAM_BAR_INDEX 2 58 - /* Associated BARs and Apertures */ 59 - #define NPU2_REG_BAR_BASE MMNPU_APERTURE0_BASE 60 - #define NPU2_MBOX_BAR_BASE MMNPU_APERTURE0_BASE 61 - #define NPU2_PSP_BAR_BASE MMNPU_APERTURE3_BASE 62 - #define NPU2_SMU_BAR_BASE MMNPU_APERTURE4_BASE 63 - #define NPU2_SRAM_BAR_BASE MMNPU_APERTURE1_BASE 64 - 65 - static const struct amdxdna_dev_priv npu2_dev_priv = { 66 - .fw_path = "amdnpu/17f0_00/npu.sbin", 67 - .protocol_major = 0x6, 68 - .protocol_minor = 0x6, 69 - .rt_config = npu4_default_rt_cfg, 70 - .dpm_clk_tbl = npu4_dpm_clk_table, 71 - .fw_feature_tbl = npu4_fw_feature_table, 72 - .col_align = COL_ALIGN_NATURE, 73 - .mbox_dev_addr = NPU2_MBOX_BAR_BASE, 74 - .mbox_size = 0, /* Use BAR size */ 75 - .sram_dev_addr = NPU2_SRAM_BAR_BASE, 76 - .hwctx_limit = 16, 77 - .sram_offs = { 78 - DEFINE_BAR_OFFSET(MBOX_CHANN_OFF, NPU2_SRAM, MPNPU_SRAM_X2I_MAILBOX_0), 79 - DEFINE_BAR_OFFSET(FW_ALIVE_OFF, NPU2_SRAM, MPNPU_SRAM_X2I_MAILBOX_15), 80 - }, 81 - .psp_regs_off = { 82 - DEFINE_BAR_OFFSET(PSP_CMD_REG, NPU2_PSP, MP0_C2PMSG_123), 83 - DEFINE_BAR_OFFSET(PSP_ARG0_REG, NPU2_REG, MPNPU_PUB_SCRATCH3), 84 - DEFINE_BAR_OFFSET(PSP_ARG1_REG, NPU2_REG, MPNPU_PUB_SCRATCH4), 85 - DEFINE_BAR_OFFSET(PSP_ARG2_REG, NPU2_REG, MPNPU_PUB_SCRATCH9), 86 - DEFINE_BAR_OFFSET(PSP_INTR_REG, NPU2_PSP, MP0_C2PMSG_73), 87 - DEFINE_BAR_OFFSET(PSP_STATUS_REG, NPU2_PSP, MP0_C2PMSG_123), 88 - DEFINE_BAR_OFFSET(PSP_RESP_REG, NPU2_REG, MPNPU_PUB_SCRATCH3), 89 - DEFINE_BAR_OFFSET(PSP_PWAITMODE_REG, NPU2_REG, MPNPU_PWAITMODE), 90 - }, 91 - .smu_regs_off = { 92 - DEFINE_BAR_OFFSET(SMU_CMD_REG, NPU2_SMU, MP1_C2PMSG_0), 93 - DEFINE_BAR_OFFSET(SMU_ARG_REG, NPU2_SMU, MP1_C2PMSG_60), 94 - DEFINE_BAR_OFFSET(SMU_INTR_REG, NPU2_SMU, MMNPU_APERTURE4_BASE), 95 - DEFINE_BAR_OFFSET(SMU_RESP_REG, NPU2_SMU, MP1_C2PMSG_61), 96 - DEFINE_BAR_OFFSET(SMU_OUT_REG, NPU2_SMU, MP1_C2PMSG_60), 97 - }, 98 - .hw_ops = { 99 - .set_dpm = npu4_set_dpm, 100 - }, 101 - }; 102 - 103 - const struct amdxdna_dev_info dev_npu2_info = { 104 - .reg_bar = NPU2_REG_BAR_INDEX, 105 - .mbox_bar = NPU2_MBOX_BAR_INDEX, 106 - .sram_bar = NPU2_SRAM_BAR_INDEX, 107 - .psp_bar = NPU2_PSP_BAR_INDEX, 108 - .smu_bar = NPU2_SMU_BAR_INDEX, 109 - .first_col = 0, 110 - .dev_mem_buf_shift = 15, /* 32 KiB aligned */ 111 - .dev_mem_base = AIE2_DEVM_BASE, 112 - .dev_mem_size = AIE2_DEVM_SIZE, 113 - .vbnv = "RyzenAI-npu2", 114 - .device_type = AMDXDNA_DEV_TYPE_KMQ, 115 - .dev_priv = &npu2_dev_priv, 116 - .ops = &aie2_ops, /* NPU2 can share NPU1's callback */ 117 - };