summaryrefslogtreecommitdiff
path: root/gxp-mcu-telemetry.h
diff options
context:
space:
mode:
authorAurora zuma automerger <aurora-zuma-automerger@google.com>2022-10-05 06:15:20 +0000
committerCopybara-Service <copybara-worker@google.com>2022-10-04 23:22:30 -0700
commit1504743bcf468241a23885317acb402834841e7d (patch)
tree47ba2a214a25061c9070936008a802fb9ad53684 /gxp-mcu-telemetry.h
parent17aafc7b07efe02549755826b1e8589d0958e589 (diff)
downloadzuma-1504743bcf468241a23885317acb402834841e7d.tar.gz
[Copybara Auto Merge] Merge branch 'zuma' into 'android13-gs-pixel-5.15'
gxp: fix typo an core gxp: Call MCU telemetry irq handler when KCI irq is fired BUg: 237099103 gxp: move DVFS macro out from lpm.h gxp: use BIT() for shifting operations gxp: introduce coherent buffer data structure Bug: 248436918 gxp: add europa platform driver Bug: 235918085 gxp: address review comments on gdomain alloc gxp: pass TPU client ID to allocate_vmbox Bug: 246520556 gxp: store client IDs in gxp_virtual_device Bug: 246520556 (repeat) gxp: clang-format gxp.h gxp: introduce {after,before}_{map,unmap}_tpu_mbx_queue callbacks Bug: 246520556 (repeat) gxp: call GCIP consume funcs from gxp-mailbox Bug: 245455607 gxp: remove gcip_{mailbox,kci} from gxp_{dci,uci,kci} Bug: 245455607 (repeat) gxp: manage gcip_{mailbox,kci} from gxp_mailbox Bug: 245455607 (repeat) gxp: expose GXP_KCI_TIMEOUT Bug: 245455607 (repeat) gxp: pass data size and wrap bit to gxp_mailbox_args Bug: 245455607 (repeat) gxp: pass GCIP operators to gxp_mailbox Bug: 245455607 (repeat) gxp: introduce enum gxp_mailbox_type Bug: 245455607 (repeat) gxp: call exposed response consuming funcs of gxp-mailbox-impl.h Bug: 245455607 (repeat) gxp: Add MCU telemetry support Bug: 237099103 (repeat) gxp: Add chip specific mmap handler Bug: 237099103 (repeat) gxp: Prefix the telemetry with core Bug: 237099103 (repeat) gxp: Rename gxp-telemetry to gxp-core-telemetry Bug: 237099103 (repeat) gcip: use rate limiting for reverse KCI failure warning GCIP_MAIN_REV_ID: 9292565f420c1c72373cd25b5254db01e1bdaccf gxp: add wrappers around iommu domain Bug: 248436918 (repeat) gxp: remove A0 coherency workaround Bug: 245238253 gxp: shrink the sem scope on uci cmd handling gxp: introduce gxp-mailbox-impl.[c|h] Bug: 237908534 gxp: Hide Amalthea only things of gxp-mailbox from Callisto Bug: 237908534 (repeat) gxp: introduce GXP_LEGACY_MAILBOX Bug: 245455607 (repeat) gxp: Remove the dependency of gxp_async_response from UCI Bug: 237908534 (repeat) gxp: update `allocate_vmbox` KCI command to support TPU offloading Bug: 246520556 (repeat) gxp: return error when gxp_fw_data_create_app fails Bug: 249402363 gcip: remote unnecessary pointer cast GCIP_MAIN_REV_ID: bdad0ac3a11f1d34b22f9640ca8ea0d19c400df6 gxp: fix memory leak on VD allocate resp queues Bug: 247662695 GitOrigin-RevId: efc002d6271c2ccb965f35ad53857379a9ec629d Change-Id: Ibe5397d5cfda935e983261f1297691dc673b114d
Diffstat (limited to 'gxp-mcu-telemetry.h')
-rw-r--r--gxp-mcu-telemetry.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/gxp-mcu-telemetry.h b/gxp-mcu-telemetry.h
new file mode 100644
index 0000000..4658fee
--- /dev/null
+++ b/gxp-mcu-telemetry.h
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * GXP MCU telemetry support
+ *
+ * Copyright (C) 2022 Google LLC
+ */
+
+#ifndef __GXP_MCU_TELEMETRY_H__
+#define __GXP_MCU_TELEMETRY_H__
+
+#include <linux/workqueue.h>
+
+#include <gcip/gcip-telemetry.h>
+
+#include "gxp-internal.h"
+
+/* Buffer size must be a power of 2 */
+#define GXP_MCU_TELEMETRY_LOG_BUFFER_SIZE (16 * 4096)
+#define GXP_MCU_TELEMETRY_TRACE_BUFFER_SIZE (64 * 4096)
+
+struct gxp_mcu;
+
+struct gxp_mcu_telemetry_ctx {
+ struct gcip_telemetry log;
+ struct gxp_mapped_resource log_mem;
+ struct gcip_telemetry trace;
+ struct gxp_mapped_resource trace_mem;
+};
+
+/*
+ * Allocates resources needed for @mcu->telemetry.
+ *
+ * Returns 0 on success, or a negative errno on error.
+ */
+int gxp_mcu_telemetry_init(struct gxp_mcu *mcu);
+
+/*
+ * Disable the MCU telemetry if enabled, release resources allocated in init().
+ */
+void gxp_mcu_telemetry_exit(struct gxp_mcu *mcu);
+
+/* Interrupt handler. */
+void gxp_mcu_telemetry_irq_handler(struct gxp_mcu *mcu);
+
+/*
+ * Sends the KCI commands about MCU telemetry buffers to the device.
+ *
+ * Returns the code of KCI response, or a negative errno on error.
+ */
+int gxp_mcu_telemetry_kci(struct gxp_mcu *mcu);
+
+/*
+ * Sets the eventfd to notify the runtime when an IRQ is sent from the device.
+ *
+ * Returns 0 on success, or a negative errno on error.
+ */
+int gxp_mcu_telemetry_register_eventfd(struct gxp_mcu *mcu,
+ enum gcip_telemetry_type type,
+ u32 eventfd);
+/* Removes previously set event. */
+int gxp_mcu_telemetry_unregister_eventfd(struct gxp_mcu *mcu,
+ enum gcip_telemetry_type type);
+
+/* Maps MCU telemetry buffer into user space. */
+int gxp_mcu_telemetry_mmap_buffer(struct gxp_mcu *mcu,
+ enum gcip_telemetry_type type,
+ struct vm_area_struct *vma);
+
+#endif /* __GXP_MCU_TELEMETRY_H__ */