*/
mxlogger_enable(mxlogger, true);
mxlogger_to_shared_dram(mxlogger);
+#ifdef CONFIG_SCSC_LOG_COLLECTION
+ scsc_log_collector_is_observer(false);
+#endif
} else {
mxlogger_to_host(mxlogger);
+#ifdef CONFIG_SCSC_LOG_COLLECTION
+ scsc_log_collector_is_observer(true);
+#endif
/* Enabling AFTER communicating direction HOST
* to avoid wrongly spilling messages into the
* rings early at start (like at boot).
mxlogger->configured = false;
mxlogger->initialized = false;
mxlogger_to_host(mxlogger);
+#ifdef CONFIG_SCSC_LOG_COLLECTION
+ scsc_log_collector_is_observer(true);
+#endif
mxlogger_enable(mxlogger, false);
mxmgmt_transport_register_channel_handler(scsc_mx_get_mxmgmt_transport(mxlogger->mx),
MMTRANS_CHAN_ID_MAXWELL_LOGGING,
/* Switch logs to host */
mxlogger_to_host(mxlogger);
+#ifdef CONFIG_SCSC_LOG_COLLECTION
+ scsc_log_collector_is_observer(true);
+#endif
mutex_unlock(&mxlogger->lock);
SCSC_TAG_INFO(MXMAN, "UN-register observer[%d] -- %s\n",
mxlogger->observers, name);
- if (mxlogger->observers == 0)
+ if (mxlogger->observers == 0) {
mxlogger_to_shared_dram(mxlogger);
+#ifdef CONFIG_SCSC_LOG_COLLECTION
+ scsc_log_collector_is_observer(false);
+#endif
+ }
mutex_unlock(&mxlogger->lock);
enum scsc_log_reason collect_reason;
u16 reason_code;
struct mutex collection_serial;
+ bool observer_present;
} log_status;
static DEFINE_MUTEX(log_mutex);
sbl_header.num_chunks = num_chunks;
sbl_header.trigger = reason;
sbl_header.reason_code = reason_code;
+ sbl_header.observer = log_status.observer_present;
sbl_header.offset_data = first_chunk_pos;
mxman_get_fw_version(version_fw, SCSC_LOG_FW_VERSION_SIZE);
memcpy(sbl_header.fw_version, version_fw, SCSC_LOG_FW_VERSION_SIZE);
}
EXPORT_SYMBOL(scsc_log_collector_write_fapi);
+void scsc_log_collector_is_observer(bool observer)
+{
+ log_status.observer_present = observer;
+}
+EXPORT_SYMBOL(scsc_log_collector_is_observer);
+
MODULE_DESCRIPTION("SCSC Log collector");
MODULE_AUTHOR("SLSI");
MODULE_LICENSE("GPL and additional rights");
/* High nibble is Major, Low nibble is Minor */
#define SCSC_LOG_HEADER_VERSION_MAJOR 0x02
-#define SCSC_LOG_HEADER_VERSION_MINOR 0x00
+#define SCSC_LOG_HEADER_VERSION_MINOR 0x01
/* Magic string. 4 bytes "SCSC"*/
/* Header version. 1 byte */
/* Num chunks. 1 byte */
/* Collection reason. 1 byte */
/* Reserved. 1 byte */
/* Reason Code . 2 bytes */
-#define SCSC_LOG_HEADER_SIZE (12)
+/* Observer present . 1 bytes */
+#define SCSC_LOG_HEADER_SIZE (13)
#define SCSC_LOG_FW_VERSION_SIZE (128)
#define SCSC_LOG_HOST_VERSION_SIZE (64)
#define SCSC_LOG_FAPI_VERSION_SIZE (64)
/* Reserved 2 . 4 byte */
-#define SCSC_LOG_RESERVED_2 4
+#define SCSC_LOG_RESERVED_2 3
/* Ideally header + versions should be 16 bytes aligne*/
#define SCSC_SUPPORTED_CHUNKS_HEADER 48
char host_version[SCSC_LOG_HOST_VERSION_SIZE];
char fapi_version[SCSC_LOG_FAPI_VERSION_SIZE];
u16 reason_code;
+ bool observer;
u8 reserved2[SCSC_LOG_RESERVED_2];
char supported_chunks[SCSC_SUPPORTED_CHUNKS_HEADER];
} __packed;
/* Public method to register FAPI version. */
void scsc_log_collector_write_fapi(char __user *buf, size_t len);
+/* Public method to notify the presence/absense of observers */
+void scsc_log_collector_is_observer(bool observer);
+
void scsc_log_collector_schedule_collection(enum scsc_log_reason reason, u16 reason_code);
int scsc_log_collector_write(char __user *buf, size_t count, u8 align);
#endif /* __SCSC_LOG_COLLECTOR_H__ */