Merge 'goog/upstream-master' into D2-TM-001

Release notes:
  debug_dump: Add support new API to get GSC debug message

Bug: 194113345
Bug: 203610954
Test: release tests, QMC
Signed-off-by: Bill Richardson <wfrichar@google.com>
Change-Id: Ie60e5d25182e56d9904329855cc84b2b3aa8a45e
diff --git a/nugget/include/app_nugget.h b/nugget/include/app_nugget.h
index 1ef9f31..c278558 100644
--- a/nugget/include/app_nugget.h
+++ b/nugget/include/app_nugget.h
@@ -414,6 +414,28 @@
  * @errors             APP_ERROR_BOGUS_ARGS
  */
 
+#define GSC_DEBUG_DUMP_VERSION 0
+struct gsc_debug_dump_msg {
+	uint8_t timestamp[6];   // Bottom 48 bits of system time; enough for 8 years @ 1 us
+	uint8_t channel;        // log channel (task_id or system call)
+	uint8_t version;        // gsc_debug_dump_msg struct version
+	uint32_t error_code;    // error code
+	uint32_t reserved;      // reserved for other useful log
+};
+
+#define DEBUG_MESSAGE_MAX_COUNT 64
+#define DEBUG_MESSAGE_BUFFER_SIZE (DEBUG_MESSAGE_MAX_COUNT * sizeof(struct gsc_debug_dump_msg))
+
+#define NUGGET_PARAM_DEBUG_DUMP 0x0016
+/*
+ * Get GSC debug message from 1KB ring buffer
+ *
+ * @param args         <none>
+ * @param arg_len      0
+ * @param reply        recent debug buffer output
+ * @param reply_len    1KB
+ */
+
 /****************************************************************************/
 /* Test related commands */