From e56ad58d2c990433edb731563737d1bde83c539f Mon Sep 17 00:00:00 2001 From: Shashank Mittal Date: Fri, 20 May 2016 13:06:09 -0700 Subject: coresight: enable stm logging for trace events, marker and printk Dup ftrace event traffic and writes to trace_marker file from userspace to STM. Also dup trace printk traffic to STM. This allows Linux tracing and log data to be correlated with other data transported over STM. Change-Id: I4fcb42f2e97ab963fdc85853f4f3ea1f208bfc3c Signed-off-by: Pratik Patel [spjoshi@codeaurora.org: 3.18 code fixup] Signed-off-by: Sarangdhar Joshi [mittals@codeaurora.org: 4.4 code fixup] Signed-off-by: Shashank Mittal --- include/linux/trace_events.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index 429fdfc3baf5..f01c2ff9845b 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -8,6 +8,7 @@ #include #include #include +#include struct trace_array; struct trace_buffer; @@ -231,7 +232,8 @@ void *trace_event_buffer_reserve(struct trace_event_buffer *fbuffer, struct trace_event_file *trace_file, unsigned long len); -void trace_event_buffer_commit(struct trace_event_buffer *fbuffer); +void trace_event_buffer_commit(struct trace_event_buffer *fbuffer, + unsigned long len); enum { TRACE_EVENT_FL_FILTERED_BIT, @@ -500,6 +502,7 @@ __event_trigger_test_discard(struct trace_event_file *file, * @entry: The event itself * @irq_flags: The state of the interrupts at the start of the event * @pc: The state of the preempt count at the start of the event. + * @len: The length of the payload data required for stm logging. * * This is a helper function to handle triggers that require data * from the event itself. It also tests the event against filters and @@ -509,12 +512,16 @@ static inline void event_trigger_unlock_commit(struct trace_event_file *file, struct ring_buffer *buffer, struct ring_buffer_event *event, - void *entry, unsigned long irq_flags, int pc) + void *entry, unsigned long irq_flags, int pc, + unsigned long len) { enum event_trigger_type tt = ETT_NONE; - if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) + if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) { + if (len) + stm_log(OST_ENTITY_FTRACE_EVENTS, entry, len); trace_buffer_unlock_commit(file->tr, buffer, event, irq_flags, pc); + } if (tt) event_triggers_post_call(file, tt); -- cgit v1.2.3 From d920806870fdb511b977c9f9ac65883d8b33b73e Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Thu, 19 May 2016 13:56:25 -0700 Subject: extcon: Add support for USB connector speed This allows extcon to notify the USB controller driver to enumerate host/peripheral in high or super speed mode. Change-Id: I425087a02b680a5a1bc0579fd4d1410eb92d8e4c Signed-off-by: Hemant Kumar --- include/linux/extcon.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux') diff --git a/include/linux/extcon.h b/include/linux/extcon.h index faf9ae79ca3c..e1360198955a 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -58,6 +58,9 @@ /* connector orientation 0 - CC1, 1 - CC2 */ #define EXTCON_USB_CC 28 +/* connector speed 0 - High Speed, 1 - super speed */ +#define EXTCON_USB_SPEED 29 + /* Display external connector */ #define EXTCON_DISP_HDMI 40 /* High-Definition Multimedia Interface */ #define EXTCON_DISP_MHL 41 /* Mobile High-Definition Link */ -- cgit v1.2.3 From 8f0763f7c70e8127e692781b54529ee6a93faece Mon Sep 17 00:00:00 2001 From: Amir Levy Date: Tue, 24 May 2016 20:19:07 +0300 Subject: msm: ipa3: add ipa_mhi to ipa_clients As part of of IPA driver refactoring a separation has been made between IPA core driver and the IPA clients. MHI specific code in ipa_mhi.c has been transferred to a new file called ipa_mhi_client.c. IPA clients drivers are the interface between IPA core driver and external drivers. Specifically, ipa_mhi driver is the interface between the MHI driver and IPA core. CRs-fixed: 989505 Change-Id: Iebcde6d233ff8580aa83b1885f1e8a01644dd1f4 Signed-off-by: Amir Levy --- include/linux/ipa.h | 142 ------------------------------------------ include/linux/ipa_mhi.h | 161 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 142 deletions(-) create mode 100644 include/linux/ipa_mhi.h (limited to 'include/linux') diff --git a/include/linux/ipa.h b/include/linux/ipa.h index 0dd2f0bf9c23..a0dd21d215d2 100644 --- a/include/linux/ipa.h +++ b/include/linux/ipa.h @@ -1055,92 +1055,6 @@ struct ipa_wdi_buffer_info { int result; }; -/** - * enum ipa_mhi_event_type - event type for mhi callback - * - * @IPA_MHI_EVENT_READY: IPA MHI is ready and IPA uC is loaded. After getting - * this event MHI client is expected to call to ipa_mhi_start() API - * @IPA_MHI_EVENT_DATA_AVAILABLE: downlink data available on MHI channel - */ -enum ipa_mhi_event_type { - IPA_MHI_EVENT_READY, - IPA_MHI_EVENT_DATA_AVAILABLE, - IPA_MHI_EVENT_MAX, -}; - -typedef void (*mhi_client_cb)(void *priv, enum ipa_mhi_event_type event, - unsigned long data); - -/** - * struct ipa_mhi_msi_info - parameters for MSI (Message Signaled Interrupts) - * @addr_low: MSI lower base physical address - * @addr_hi: MSI higher base physical address - * @data: Data Pattern to use when generating the MSI - * @mask: Mask indicating number of messages assigned by the host to device - * - * msi value is written according to this formula: - * ((data & ~mask) | (mmio.msiVec & mask)) - */ -struct ipa_mhi_msi_info { - u32 addr_low; - u32 addr_hi; - u32 data; - u32 mask; -}; - -/** - * struct ipa_mhi_init_params - parameters for IPA MHI initialization API - * - * @msi: MSI (Message Signaled Interrupts) parameters - * @mmio_addr: MHI MMIO physical address - * @first_ch_idx: First channel ID for hardware accelerated channels. - * @first_er_idx: First event ring ID for hardware accelerated channels. - * @assert_bit40: should assert bit 40 in order to access hots space. - * if PCIe iATU is configured then not need to assert bit40 - * @notify: client callback - * @priv: client private data to be provided in client callback - * @test_mode: flag to indicate if IPA MHI is in unit test mode - */ -struct ipa_mhi_init_params { - struct ipa_mhi_msi_info msi; - u32 mmio_addr; - u32 first_ch_idx; - u32 first_er_idx; - bool assert_bit40; - mhi_client_cb notify; - void *priv; - bool test_mode; -}; - -/** - * struct ipa_mhi_start_params - parameters for IPA MHI start API - * - * @host_ctrl_addr: Base address of MHI control data structures - * @host_data_addr: Base address of MHI data buffers - * @channel_context_addr: channel context array address in host address space - * @event_context_addr: event context array address in host address space - */ -struct ipa_mhi_start_params { - u32 host_ctrl_addr; - u32 host_data_addr; - u64 channel_context_array_addr; - u64 event_context_array_addr; -}; - -/** - * struct ipa_mhi_connect_params - parameters for IPA MHI channel connect API - * - * @sys: IPA EP configuration info - * @channel_id: MHI channel id - */ -struct ipa_mhi_connect_params { - struct ipa_sys_connect_params sys; - u8 channel_id; -}; - -/* bit #40 in address should be asserted for MHI transfers over pcie */ -#define IPA_MHI_HOST_ADDR(addr) ((addr) | BIT_ULL(40)) - /** * struct ipa_gsi_ep_config - IPA GSI endpoint configurations * @@ -1435,23 +1349,6 @@ int ipa_dma_uc_memcpy(phys_addr_t dest, phys_addr_t src, int len); void ipa_dma_destroy(void); -/* - * MHI - */ -int ipa_mhi_init(struct ipa_mhi_init_params *params); - -int ipa_mhi_start(struct ipa_mhi_start_params *params); - -int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl); - -int ipa_mhi_disconnect_pipe(u32 clnt_hdl); - -int ipa_mhi_suspend(bool force); - -int ipa_mhi_resume(void); - -void ipa_mhi_destroy(void); - /* * mux id */ @@ -2111,45 +2008,6 @@ static inline void ipa_dma_destroy(void) return; } -/* - * MHI - */ -static inline int ipa_mhi_init(struct ipa_mhi_init_params *params) -{ - return -EPERM; -} - -static inline int ipa_mhi_start(struct ipa_mhi_start_params *params) -{ - return -EPERM; -} - -static inline int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, - u32 *clnt_hdl) -{ - return -EPERM; -} - -static inline int ipa_mhi_disconnect_pipe(u32 clnt_hdl) -{ - return -EPERM; -} - -static inline int ipa_mhi_suspend(bool force) -{ - return -EPERM; -} - -static inline int ipa_mhi_resume(void) -{ - return -EPERM; -} - -static inline void ipa_mhi_destroy(void) -{ - return; -} - /* * mux id */ diff --git a/include/linux/ipa_mhi.h b/include/linux/ipa_mhi.h new file mode 100644 index 000000000000..4d3b9747a876 --- /dev/null +++ b/include/linux/ipa_mhi.h @@ -0,0 +1,161 @@ +/* Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef IPA_MHI_H_ +#define IPA_MHI_H_ + +#include +#include + +/** + * enum ipa_mhi_event_type - event type for mhi callback + * + * @IPA_MHI_EVENT_READY: IPA MHI is ready and IPA uC is loaded. After getting + * this event MHI client is expected to call to ipa_mhi_start() API + * @IPA_MHI_EVENT_DATA_AVAILABLE: downlink data available on MHI channel + */ +enum ipa_mhi_event_type { + IPA_MHI_EVENT_READY, + IPA_MHI_EVENT_DATA_AVAILABLE, + IPA_MHI_EVENT_MAX, +}; + +typedef void (*mhi_client_cb)(void *priv, enum ipa_mhi_event_type event, + unsigned long data); + +/** + * struct ipa_mhi_msi_info - parameters for MSI (Message Signaled Interrupts) + * @addr_low: MSI lower base physical address + * @addr_hi: MSI higher base physical address + * @data: Data Pattern to use when generating the MSI + * @mask: Mask indicating number of messages assigned by the host to device + * + * msi value is written according to this formula: + * ((data & ~mask) | (mmio.msiVec & mask)) + */ +struct ipa_mhi_msi_info { + u32 addr_low; + u32 addr_hi; + u32 data; + u32 mask; +}; + +/** + * struct ipa_mhi_init_params - parameters for IPA MHI initialization API + * + * @msi: MSI (Message Signaled Interrupts) parameters + * @mmio_addr: MHI MMIO physical address + * @first_ch_idx: First channel ID for hardware accelerated channels. + * @first_er_idx: First event ring ID for hardware accelerated channels. + * @assert_bit40: should assert bit 40 in order to access host space. + * if PCIe iATU is configured then not need to assert bit40 + * @notify: client callback + * @priv: client private data to be provided in client callback + * @test_mode: flag to indicate if IPA MHI is in unit test mode + */ +struct ipa_mhi_init_params { + struct ipa_mhi_msi_info msi; + u32 mmio_addr; + u32 first_ch_idx; + u32 first_er_idx; + bool assert_bit40; + mhi_client_cb notify; + void *priv; + bool test_mode; +}; + +/** + * struct ipa_mhi_start_params - parameters for IPA MHI start API + * + * @host_ctrl_addr: Base address of MHI control data structures + * @host_data_addr: Base address of MHI data buffers + * @channel_context_addr: channel context array address in host address space + * @event_context_addr: event context array address in host address space + */ +struct ipa_mhi_start_params { + u32 host_ctrl_addr; + u32 host_data_addr; + u64 channel_context_array_addr; + u64 event_context_array_addr; +}; + +/** + * struct ipa_mhi_connect_params - parameters for IPA MHI channel connect API + * + * @sys: IPA EP configuration info + * @channel_id: MHI channel id + */ +struct ipa_mhi_connect_params { + struct ipa_sys_connect_params sys; + u8 channel_id; +}; + +/* bit #40 in address should be asserted for MHI transfers over pcie */ +#define IPA_MHI_HOST_ADDR(addr) ((addr) | BIT_ULL(40)) + +#if defined CONFIG_IPA || defined CONFIG_IPA3 + +int ipa_mhi_init(struct ipa_mhi_init_params *params); + +int ipa_mhi_start(struct ipa_mhi_start_params *params); + +int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl); + +int ipa_mhi_disconnect_pipe(u32 clnt_hdl); + +int ipa_mhi_suspend(bool force); + +int ipa_mhi_resume(void); + +void ipa_mhi_destroy(void); + +#else /* (CONFIG_IPA || CONFIG_IPA3) */ + +static inline int ipa_mhi_init(struct ipa_mhi_init_params *params) +{ + return -EPERM; +} + +static inline int ipa_mhi_start(struct ipa_mhi_start_params *params) +{ + return -EPERM; +} + +static inline int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, + u32 *clnt_hdl) +{ + return -EPERM; +} + +static inline int ipa_mhi_disconnect_pipe(u32 clnt_hdl) +{ + return -EPERM; +} + +static inline int ipa_mhi_suspend(bool force) +{ + return -EPERM; +} + +static inline int ipa_mhi_resume(void) +{ + return -EPERM; +} + +static inline void ipa_mhi_destroy(void) +{ + +} + +#endif /* (CONFIG_IPA || CONFIG_IPA3) */ + +#endif /* IPA_MHI_H_ */ -- cgit v1.2.3