usb: bam: Return usb_pipe_mem_type from get_bam2bam_connection_info()
Some functions may need to know the pipe memory type, whether it is allocated memory or a private region of internal peripheral memory. Add an extra parameter to the get_bam2bam_connection_info() function to return this value based on the preconfigured BAM pipes. For most functions this info is unneeded. For QDSS, use this value to determine whether to pass MSM_INTERNAL_MEM to the SPS params when running on a device that requires it. Change-Id: Ia9f5630b08a90cb66489a11707919d1855c36ec9 Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
parent
1559d92364
commit
8c9c7eb18f
|
@ -459,7 +459,8 @@ static void tmc_etr_fill_usb_bam_data(struct tmc_drvdata *drvdata)
|
|||
&bamdata->dest_pipe_idx,
|
||||
&bamdata->src_pipe_idx,
|
||||
&bamdata->desc_fifo,
|
||||
&bamdata->data_fifo);
|
||||
&bamdata->data_fifo,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void __tmc_etr_enable_to_bam(struct tmc_drvdata *drvdata)
|
||||
|
|
|
@ -3364,7 +3364,8 @@ void usb_bam_set_qdss_core(const char *qdss_core)
|
|||
|
||||
int get_bam2bam_connection_info(u8 idx, unsigned long *usb_bam_handle,
|
||||
u32 *usb_bam_pipe_idx, u32 *peer_pipe_idx,
|
||||
struct sps_mem_buffer *desc_fifo, struct sps_mem_buffer *data_fifo)
|
||||
struct sps_mem_buffer *desc_fifo, struct sps_mem_buffer *data_fifo,
|
||||
enum usb_pipe_mem_type *mem_type)
|
||||
{
|
||||
struct usb_bam_pipe_connect *pipe_connect = &usb_bam_connections[idx];
|
||||
enum usb_bam_pipe_dir dir = pipe_connect->dir;
|
||||
|
@ -3386,6 +3387,9 @@ int get_bam2bam_connection_info(u8 idx, unsigned long *usb_bam_handle,
|
|||
if (desc_fifo)
|
||||
memcpy(desc_fifo, &pipe_connect->desc_mem_buf,
|
||||
sizeof(struct sps_mem_buffer));
|
||||
if (mem_type)
|
||||
*mem_type = pipe_connect->mem_type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(get_bam2bam_connection_info);
|
||||
|
|
|
@ -875,7 +875,7 @@ static void configure_data_fifo(u8 idx, struct usb_ep *ep,
|
|||
&bam_info.usb_bam_handle,
|
||||
&bam_info.usb_bam_pipe_idx,
|
||||
&bam_info.peer_pipe_idx,
|
||||
NULL, &data_fifo);
|
||||
NULL, &data_fifo, NULL);
|
||||
|
||||
msm_data_fifo_config(ep,
|
||||
data_fifo.phys_base,
|
||||
|
|
|
@ -699,7 +699,7 @@ static void configure_usb_data_fifo(u8 idx, struct usb_ep *ep,
|
|||
&bam_info.usb_bam_handle,
|
||||
&bam_info.usb_bam_pipe_idx,
|
||||
&bam_info.peer_pipe_idx,
|
||||
NULL, &data_fifo);
|
||||
NULL, &data_fifo, NULL);
|
||||
|
||||
msm_data_fifo_config(ep,
|
||||
data_fifo.phys_base,
|
||||
|
|
|
@ -22,6 +22,7 @@ struct usb_qdss_bam_connect_info {
|
|||
u32 peer_pipe_idx;
|
||||
unsigned long usb_bam_handle;
|
||||
struct sps_mem_buffer *data_fifo;
|
||||
enum usb_pipe_mem_type mem_type;
|
||||
};
|
||||
|
||||
static struct usb_qdss_bam_connect_info bam_info;
|
||||
|
@ -43,8 +44,10 @@ int send_sps_req(struct usb_ep *data_ep)
|
|||
|
||||
if (gadget_is_dwc3(gadget)) {
|
||||
req->length = 32*1024;
|
||||
sps_params = MSM_SPS_MODE | MSM_DISABLE_WB | MSM_INTERNAL_MEM |
|
||||
sps_params = MSM_SPS_MODE | MSM_DISABLE_WB |
|
||||
bam_info.usb_bam_pipe_idx;
|
||||
if (bam_info.mem_type == USB_PRIVATE_MEM)
|
||||
sps_params |= MSM_INTERNAL_MEM;
|
||||
} else {
|
||||
/* non DWC3 BAM requires req->length to be 0 */
|
||||
req->length = 0;
|
||||
|
@ -88,7 +91,7 @@ static int set_qdss_data_connection(struct usb_gadget *gadget,
|
|||
get_bam2bam_connection_info(idx,
|
||||
&bam_info.usb_bam_handle,
|
||||
&bam_info.usb_bam_pipe_idx, &bam_info.peer_pipe_idx,
|
||||
NULL, bam_info.data_fifo);
|
||||
NULL, bam_info.data_fifo, &bam_info.mem_type);
|
||||
|
||||
if (gadget_is_dwc3(gadget))
|
||||
msm_data_fifo_config(data_ep,
|
||||
|
|
|
@ -356,7 +356,7 @@ int usb_bam_disconnect_pipe(u8 idx);
|
|||
int get_bam2bam_connection_info(u8 idx,
|
||||
unsigned long *usb_bam_handle, u32 *usb_bam_pipe_idx,
|
||||
u32 *peer_pipe_idx, struct sps_mem_buffer *desc_fifo,
|
||||
struct sps_mem_buffer *data_fifo);
|
||||
struct sps_mem_buffer *data_fifo, enum usb_pipe_mem_type *mem_type);
|
||||
|
||||
/**
|
||||
* Resets the USB BAM that has A2 pipes
|
||||
|
@ -490,7 +490,7 @@ static inline int usb_bam_disconnect_pipe(u8 idx)
|
|||
static inline int get_bam2bam_connection_info(u8 idx,
|
||||
unsigned long *usb_bam_handle, u32 *usb_bam_pipe_idx,
|
||||
u32 *peer_pipe_idx, struct sps_mem_buffer *desc_fifo,
|
||||
struct sps_mem_buffer *data_fifo)
|
||||
struct sps_mem_buffer *data_fifo, enum usb_pipe_mem_type *mem_type)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue