habanalabs: pass-through request from user to f/w
authorfarah kassabri <fkassabri@habana.ai>
Wed, 16 Nov 2022 13:40:30 +0000 (15:40 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Thu, 26 Jan 2023 08:56:22 +0000 (10:56 +0200)
commitc2239a251d2d738f435c46bae7d66899c62ce493
tree6fae149dd390cffa35067eb4bf04fb22086d2c42
parent2dd89591d8c7fe7b24daeac0faf8a0afa30f9b0b
habanalabs: pass-through request from user to f/w

Add a uAPI, as part of the INFO IOCTL, to allow users to send
requests directly to f/w, according to a pre-defined set of opcodes
that the f/w exposes.

The f/w will put the result in a kernel-allocated buffer, which the
driver will then copy to the user-supplied buffer.

This will allow f/w tools to communicate directly with the f/w
without the need to add a new uAPI to the driver for each new type
of request.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/firmware_if.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/common/habanalabs_ioctl.c
drivers/misc/habanalabs/include/common/cpucp_if.h
include/uapi/misc/habanalabs.h