From: Lizhi Hou <lizhi.hou@amd.com>
To: <ogabbay@kernel.org>, <quic_jhugo@quicinc.com>,
<dri-devel@lists.freedesktop.org>
Cc: Lizhi Hou <lizhi.hou@amd.com>, <linux-kernel@vger.kernel.org>,
<min.ma@amd.com>, <max.zhen@amd.com>, <sonal.santan@amd.com>,
<king.tam@amd.com>
Subject: [PATCH V7 00/10] AMD XDNA driver
Date: Thu, 7 Nov 2024 20:34:38 -0800 [thread overview]
Message-ID: <20241108043448.449314-1-lizhi.hou@amd.com> (raw)
This patchset introduces a new Linux Kernel Driver, amdxdna for AMD NPUs.
The driver is based on Linux accel subsystem.
NPU (Neural Processing Unit) is an AI inference accelerator integrated
into AMD client CPUs. NPU enables efficient execution of Machine Learning
applications like CNNs, LLMs, etc. NPU is based on AMD XDNA
architecture [1].
AMD NPU consists of the following components:
- Tiled array of AMD AI Engine processors.
- Micro Controller which runs the NPU Firmware responsible for
command processing, AIE array configuration, and execution management.
- PCI EP for host control of the NPU device.
- Interconnect for connecting the NPU components together.
- SRAM for use by the NPU Firmware.
- Address translation hardware for protected host memory access by the
NPU.
NPU supports multiple concurrent fully isolated contexts. Concurrent
contexts may be bound to AI Engine array spatially and or temporarily.
The driver is licensed under GPL-2.0 except for UAPI header which is
licensed GPL-2.0 WITH Linux-syscall-note.
User mode driver stack consists of XRT [2] and AMD AIE Plugin for IREE [3].
The firmware for the NPU is distributed as a closed source binary, and has
already been pushed to the DRM firmware repository [4].
[1] https://www.amd.com/en/technologies/xdna.html
[2] https://github.com/Xilinx/XRT
[3] https://github.com/nod-ai/iree-amd-aie
[4] https://gitlab.freedesktop.org/drm/firmware/-/tree/amd-ipu-staging/amdnpu
Changes since v6:
- Revise command submission flow
Changes since v5:
- Remove wait_cmd ioctl and use syncobj instead
- Cleanup spelling errors
- Add dependencies in Kconfig
Changes since v4:
- Fix lockdep errors
- Use __u* structure for struct aie_error
Changes since v3:
- Remove debug BO patch
- Changes based on code review comments
Changes since v2:
- Add document amdnpu.rst
- Change AIE2_DEVM_SIZE to 64M due to firmware change
- Changes based on code review comments
Changes since v1:
- Remove some inline defines
- Minor changes based on code review comments
Lizhi Hou (10):
accel/amdxdna: Add documentation for AMD NPU accelerator driver
accel/amdxdna: Add a new driver for AMD AI Engine
accel/amdxdna: Support hardware mailbox
accel/amdxdna: Add hardware resource solver
accel/amdxdna: Add hardware context
accel/amdxdna: Add GEM buffer object management
accel/amdxdna: Add command execution
accel/amdxdna: Add suspend and resume
accel/amdxdna: Add error handling
accel/amdxdna: Add query functions
Documentation/accel/amdxdna/amdnpu.rst | 281 ++++++
Documentation/accel/amdxdna/index.rst | 11 +
Documentation/accel/index.rst | 1 +
MAINTAINERS | 11 +
drivers/accel/Kconfig | 1 +
drivers/accel/Makefile | 1 +
drivers/accel/amdxdna/Kconfig | 18 +
drivers/accel/amdxdna/Makefile | 21 +
drivers/accel/amdxdna/TODO | 5 +
drivers/accel/amdxdna/aie2_ctx.c | 927 ++++++++++++++++++
drivers/accel/amdxdna/aie2_error.c | 360 +++++++
drivers/accel/amdxdna/aie2_message.c | 791 +++++++++++++++
drivers/accel/amdxdna/aie2_msg_priv.h | 370 +++++++
drivers/accel/amdxdna/aie2_pci.c | 761 ++++++++++++++
drivers/accel/amdxdna/aie2_pci.h | 260 +++++
drivers/accel/amdxdna/aie2_psp.c | 146 +++
drivers/accel/amdxdna/aie2_smu.c | 119 +++
drivers/accel/amdxdna/aie2_solver.c | 330 +++++++
drivers/accel/amdxdna/aie2_solver.h | 154 +++
drivers/accel/amdxdna/amdxdna_ctx.c | 553 +++++++++++
drivers/accel/amdxdna/amdxdna_ctx.h | 162 +++
drivers/accel/amdxdna/amdxdna_gem.c | 622 ++++++++++++
drivers/accel/amdxdna/amdxdna_gem.h | 65 ++
drivers/accel/amdxdna/amdxdna_mailbox.c | 576 +++++++++++
drivers/accel/amdxdna/amdxdna_mailbox.h | 124 +++
.../accel/amdxdna/amdxdna_mailbox_helper.c | 61 ++
.../accel/amdxdna/amdxdna_mailbox_helper.h | 42 +
drivers/accel/amdxdna/amdxdna_pci_drv.c | 409 ++++++++
drivers/accel/amdxdna/amdxdna_pci_drv.h | 123 +++
drivers/accel/amdxdna/amdxdna_sysfs.c | 67 ++
drivers/accel/amdxdna/npu1_regs.c | 101 ++
drivers/accel/amdxdna/npu2_regs.c | 118 +++
drivers/accel/amdxdna/npu4_regs.c | 118 +++
drivers/accel/amdxdna/npu5_regs.c | 118 +++
include/trace/events/amdxdna.h | 101 ++
include/uapi/drm/amdxdna_accel.h | 436 ++++++++
36 files changed, 8364 insertions(+)
create mode 100644 Documentation/accel/amdxdna/amdnpu.rst
create mode 100644 Documentation/accel/amdxdna/index.rst
create mode 100644 drivers/accel/amdxdna/Kconfig
create mode 100644 drivers/accel/amdxdna/Makefile
create mode 100644 drivers/accel/amdxdna/TODO
create mode 100644 drivers/accel/amdxdna/aie2_ctx.c
create mode 100644 drivers/accel/amdxdna/aie2_error.c
create mode 100644 drivers/accel/amdxdna/aie2_message.c
create mode 100644 drivers/accel/amdxdna/aie2_msg_priv.h
create mode 100644 drivers/accel/amdxdna/aie2_pci.c
create mode 100644 drivers/accel/amdxdna/aie2_pci.h
create mode 100644 drivers/accel/amdxdna/aie2_psp.c
create mode 100644 drivers/accel/amdxdna/aie2_smu.c
create mode 100644 drivers/accel/amdxdna/aie2_solver.c
create mode 100644 drivers/accel/amdxdna/aie2_solver.h
create mode 100644 drivers/accel/amdxdna/amdxdna_ctx.c
create mode 100644 drivers/accel/amdxdna/amdxdna_ctx.h
create mode 100644 drivers/accel/amdxdna/amdxdna_gem.c
create mode 100644 drivers/accel/amdxdna/amdxdna_gem.h
create mode 100644 drivers/accel/amdxdna/amdxdna_mailbox.c
create mode 100644 drivers/accel/amdxdna/amdxdna_mailbox.h
create mode 100644 drivers/accel/amdxdna/amdxdna_mailbox_helper.c
create mode 100644 drivers/accel/amdxdna/amdxdna_mailbox_helper.h
create mode 100644 drivers/accel/amdxdna/amdxdna_pci_drv.c
create mode 100644 drivers/accel/amdxdna/amdxdna_pci_drv.h
create mode 100644 drivers/accel/amdxdna/amdxdna_sysfs.c
create mode 100644 drivers/accel/amdxdna/npu1_regs.c
create mode 100644 drivers/accel/amdxdna/npu2_regs.c
create mode 100644 drivers/accel/amdxdna/npu4_regs.c
create mode 100644 drivers/accel/amdxdna/npu5_regs.c
create mode 100644 include/trace/events/amdxdna.h
create mode 100644 include/uapi/drm/amdxdna_accel.h
--
2.34.1
next reply other threads:[~2024-11-08 4:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 4:34 Lizhi Hou [this message]
2024-11-08 4:34 ` [PATCH V7 01/10] accel/amdxdna: Add documentation for AMD NPU accelerator driver Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 02/10] accel/amdxdna: Add a new driver for AMD AI Engine Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 03/10] accel/amdxdna: Support hardware mailbox Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 04/10] accel/amdxdna: Add hardware resource solver Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 05/10] accel/amdxdna: Add hardware context Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 06/10] accel/amdxdna: Add GEM buffer object management Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 07/10] accel/amdxdna: Add command execution Lizhi Hou
2024-11-08 17:21 ` Matthew Brost
2024-11-08 22:18 ` Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 08/10] accel/amdxdna: Add suspend and resume Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 09/10] accel/amdxdna: Add error handling Lizhi Hou
2024-11-08 4:34 ` [PATCH V7 10/10] accel/amdxdna: Add query functions Lizhi Hou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241108043448.449314-1-lizhi.hou@amd.com \
--to=lizhi.hou@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=king.tam@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=max.zhen@amd.com \
--cc=min.ma@amd.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
--cc=sonal.santan@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®