summaryrefslogtreecommitdiff
path: root/gxp-dma.h
diff options
context:
space:
mode:
authorNeela Chithirala <chithiralan@google.com>2021-11-19 02:37:22 +0000
committerNeela Chithirala <chithiralan@google.com>2021-11-19 07:37:45 +0000
commite14069f1739b05c7a7f60ae73c8ce14b91ef12e0 (patch)
tree49b54f216dc0556c514ce692e13f3bfa53d442dc /gxp-dma.h
parentde16475969ca7dfaecf7144ece32b929cf193861 (diff)
downloadgs201-e14069f1739b05c7a7f60ae73c8ce14b91ef12e0.tar.gz
Merge branch 'gs201-release' to android13-gs-pixel-5.10
* gs201-release: gxp: Initial commit for PM interface gxp: map and unmap TPU mailbox queues buffer gxp: unittests: add a gxp-debugfs-test.c gxp: unittests: add a gxp-platform-test.c gxp: unittests: add a gxp-vd-test.c gxp: unittests: add a gxp-firmware-test.c gxp: Update the logging/tracing device/host shared structures. gxp: Add ability to mmap telemetry buffers gxp: Move ETM trace_data off the stack gxp: Add IOCTL for configuring ETM registers gxp: Update copyright to "Google LLC" gxp: Remove NEED_SG_DMA_LENGTH from Kconfig gxp: unittests: fix kunit path in kokoro gxp: unittests: let LPM be always active gxp: unittests: add a fake firmware loader gxp: unittests: support device tree in unit tests gxp: unittests: use kokoro to execute tests Signed-off-by: Neela Chithirala <chithiralan@google.com> Change-Id: I8fa8dfaaa70d2a40503ff3bffe636380b69e443c
Diffstat (limited to 'gxp-dma.h')
-rw-r--r--gxp-dma.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/gxp-dma.h b/gxp-dma.h
index 37692af..d3dd81e 100644
--- a/gxp-dma.h
+++ b/gxp-dma.h
@@ -10,6 +10,9 @@
#include <linux/dma-direction.h>
#include <linux/dma-mapping.h>
#include <linux/types.h>
+#ifdef CONFIG_ANDROID
+#include <soc/google/tpu-ext.h>
+#endif
#include "gxp-internal.h"
@@ -74,6 +77,29 @@ int gxp_dma_map_resources(struct gxp_dev *gxp);
*/
void gxp_dma_unmap_resources(struct gxp_dev *gxp);
+#ifdef CONFIG_ANDROID
+/**
+ * gxp_dma_map_tpu_buffer() - Map the tpu mbx queue buffers with fixed IOVAs
+ * @gxp: The GXP device to setup the mappings for
+ * @core_list: A bitfield enumerating the physical cores the mapping is for
+ * @mbx_info: Structure holding TPU-DSP mailbox queue buffer information
+ *
+ * Return:
+ * * 0 - Mappings created successfully
+ * * -EIO - Failed to create the mappings
+ */
+int gxp_dma_map_tpu_buffer(struct gxp_dev *gxp, uint core_list,
+ struct edgetpu_ext_mailbox_info *mbx_info);
+
+/**
+ * gxp_dma_unmap_tpu_buffer() - Unmap IOVAs mapped by gxp_dma_map_tpu_buffer()
+ * @gxp: The GXP device that was passed to gxp_dma_map_tpu_buffer()
+ * @mbx_desc: Structure holding info for already mapped TPU-DSP mailboxes.
+ */
+void gxp_dma_unmap_tpu_buffer(struct gxp_dev *gxp,
+ struct gxp_tpu_mbx_desc mbx_desc);
+#endif // CONFIG_ANDROID
+
/**
* gxp_dma_alloc_coherent() - Allocate and map a coherent buffer for a GXP core
* @gxp: The GXP device to map the allocated buffer for