summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/goya/goyaP.h
diff options
context:
space:
mode:
authorOded Gabbay2019-02-15 23:39:17 +0100
committerGreg Kroah-Hartman2019-02-18 09:46:45 +0100
commit9494a8dd8d22cbff8ce358aaa223fffe1b070cb0 (patch)
tree8a7b51e6440aa5248026140fa33d42172dde26de /drivers/misc/habanalabs/goya/goyaP.h
parenthabanalabs: add basic Goya h/w initialization (diff)
downloadkernel-qcow2-linux-9494a8dd8d22cbff8ce358aaa223fffe1b070cb0.tar.gz
kernel-qcow2-linux-9494a8dd8d22cbff8ce358aaa223fffe1b070cb0.tar.xz
kernel-qcow2-linux-9494a8dd8d22cbff8ce358aaa223fffe1b070cb0.zip
habanalabs: add h/w queues module
This patch adds the H/W queues module and the code to initialize Goya's various compute and DMA engines and their queues. Goya has 5 DMA channels, 8 TPC engines and a single MME engine. For each channel/engine, there is a H/W queue logic which is used to pass commands from the user to the H/W. That logic is called QMAN. There are two types of QMANs: external and internal. The DMA QMANs are considered external while the TPC and MME QMANs are considered internal. For each external queue there is a completion queue, which is located on the Host memory. The differences between external and internal QMANs are: 1. The location of the queue's memory. External QMANs are located on the Host memory while internal QMANs are located on the on-chip memory. 2. The external QMAN write an entry to a completion queue and sends an MSI-X interrupt upon completion of a command buffer that was given to it. The internal QMAN doesn't do that. Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs/goya/goyaP.h')
-rw-r--r--drivers/misc/habanalabs/goya/goyaP.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/goya/goyaP.h b/drivers/misc/habanalabs/goya/goyaP.h
index 65cbb45d7083..791605cbecfe 100644
--- a/drivers/misc/habanalabs/goya/goyaP.h
+++ b/drivers/misc/habanalabs/goya/goyaP.h
@@ -11,7 +11,9 @@
#include <uapi/misc/habanalabs.h>
#include "habanalabs.h"
#include "include/hl_boot_if.h"
+#include "include/goya/goya_packets.h"
#include "include/goya/goya.h"
+#include "include/goya/goya_async_events.h"
#include "include/goya/goya_fw_if.h"
#define NUMBER_OF_CMPLT_QUEUES 5
@@ -145,12 +147,17 @@ enum goya_fw_component {
};
struct goya_device {
+ int (*test_cpu_queue)(struct hl_device *hdev);
+
/* TODO: remove hw_queues_lock after moving to scheduler code */
spinlock_t hw_queues_lock;
u64 ddr_bar_cur_addr;
u32 hw_cap_initialized;
};
+int goya_test_cpu_queue(struct hl_device *hdev);
+int goya_send_cpu_message(struct hl_device *hdev, u32 *msg, u16 len,
+ u32 timeout, long *result);
void goya_init_security(struct hl_device *hdev);
#endif /* GOYAP_H_ */