From c8ca64ec0522b28e33906e68515b1ef5ecb61e9f Mon Sep 17 00:00:00 2001 From: Sivan Reinstein Date: Mon, 27 Apr 2020 12:10:07 +0300 Subject: [PATCH] msm: gsi: Add support for EV RP DDR access feature Allocate memory on DDR for event RP and providing it to the GSI context. Accessing the event RP using the DDR pointer instead of reading the GSI register. Change-Id: Ib25ae4ee8abbc73a74f24d360f64b1295a9d4520 Acked-by: Nadav Levintov Signed-off-by: Sivan Reinstein --- include/linux/msm_gsi.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/msm_gsi.h b/include/linux/msm_gsi.h index 796e430f26d2..0efdebceff52 100644 --- a/include/linux/msm_gsi.h +++ b/include/linux/msm_gsi.h @@ -176,7 +176,7 @@ enum gsi_evt_ring_elem_size { * @ring_len: length of ring in bytes (must be integral multiple of * re_size) * @ring_base_addr: physical base address of ring. Address must be aligned to - * ring_len rounded to power of two + * ring_len rounded to power of two * @ring_base_vaddr: virtual base address of ring (set to NULL when not * applicable) * @int_modt: cycles base interrupt moderation (32KHz clock) @@ -186,6 +186,8 @@ enum gsi_evt_ring_elem_size { * @rp_update_addr: physical address to which event read pointer should be * written on every event generation. must be set to 0 when * no update is desdired + * @rp_update_vaddr: virtual address of event ring read pointer (set to NULL + * when not applicable) * @exclusive: if true, only one GSI channel can be associated with this * event ring. if false, the event ring can be shared among * multiple GSI channels but in that case no polling @@ -196,6 +198,7 @@ enum gsi_evt_ring_elem_size { * @evchid: the event ID that is being specifically requested (this is * relevant for MHI where doorbell routing requires ERs to be * physically contiguous) + * @gsi_read_event_ring_rp: function reads the value of the event ring RP. */ struct gsi_evt_ring_props { enum gsi_evt_chtype intf; @@ -209,11 +212,14 @@ struct gsi_evt_ring_props { uint32_t intvec; uint64_t msi_addr; uint64_t rp_update_addr; + void *rp_update_vaddr; bool exclusive; void (*err_cb)(struct gsi_evt_err_notify *notify); void *user_data; bool evchid_valid; uint8_t evchid; + uint64_t (*gsi_read_event_ring_rp)(struct gsi_evt_ring_props *props, + uint8_t id, int ee); }; enum gsi_chan_mode { @@ -2021,6 +2027,5 @@ static inline void gsi_wdi3_write_evt_ring_db( static inline void gsi_wdi3_dump_register(unsigned long chan_hdl) { } - #endif /* IS_ENABLED(CONFIG_GSI) */ #endif