Ejemplo n.º 1
0
static enum MHI_STATUS mhi_event_ring_init(struct mhi_event_ctxt *ev_list,
				struct mhi_ring *ring, u32 el_per_ring,
				u32 intmodt_val, u32 msi_vec)
{
	ev_list->mhi_event_er_type  = MHI_EVENT_RING_TYPE_VALID;
	ev_list->mhi_msi_vector     = msi_vec;
	ev_list->mhi_event_ring_len = el_per_ring*sizeof(union mhi_event_pkt);
	MHI_SET_EV_CTXT(EVENT_CTXT_INTMODT, ev_list, intmodt_val);
	ring->len = ((size_t)(el_per_ring)*sizeof(union mhi_event_pkt));
	ring->el_size = sizeof(union mhi_event_pkt);
	ring->overwrite_en = 0;
	/* Flush writes to MMIO */
	wmb();
	return MHI_STATUS_SUCCESS;
}
Ejemplo n.º 2
0
/**
 * mhi_event_ring_init - Initialize an event ring
 *
 * @ev_list:		Event ring context to initialize
 * @trb_list_phy_addr:  Pointer to phy mem to the tre list for event ring
 * @trb_list_virt_addr: Pointer to virt mem to the tre list for event ring
 * @el_per_ring:	Number of event ring elements in this ring
 * @ring:		Pointer to the shadow context of this event ring
 *
 * @Return MHI_STATUS
 */
static enum MHI_STATUS mhi_event_ring_init(struct mhi_event_ctxt *ev_list,
		uintptr_t trb_list_phy_addr, uintptr_t trb_list_virt_addr,
		size_t el_per_ring, struct mhi_ring *ring,
		u32 intmodt_val, u32 msi_vec)
{
	ev_list->mhi_event_er_type = MHI_EVENT_RING_TYPE_VALID;
	ev_list->mhi_msi_vector     = msi_vec;
	ev_list->mhi_event_ring_base_addr = trb_list_phy_addr;
	ev_list->mhi_event_ring_len = el_per_ring*sizeof(union mhi_event_pkt);
	ev_list->mhi_event_read_ptr = trb_list_phy_addr;
	ev_list->mhi_event_write_ptr = trb_list_phy_addr;
	MHI_SET_EV_CTXT(EVENT_CTXT_INTMODT, ev_list, intmodt_val);
	ring->wp = (void *)(uintptr_t)trb_list_virt_addr;
	ring->rp = (void *)(uintptr_t)trb_list_virt_addr;
	ring->base = (void *)(uintptr_t)(trb_list_virt_addr);
	ring->len = ((size_t)(el_per_ring)*sizeof(union mhi_event_pkt));
	ring->el_size = sizeof(union mhi_event_pkt);
	ring->overwrite_en = 0;
	return MHI_STATUS_SUCCESS;
}