Commit 37cd29ec authored by Alex Elder's avatar Alex Elder Committed by Paolo Abeni

net: ipa: support different event ring encoding

Starting with IPA v5.0, a channel's event ring index is encoded in
a field in the CH_C_CNTXT_1 GSI register rather than CH_C_CNTXT_0.
Define a new field ID for the former register and encode the event
ring in the appropriate register.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 62747512
...@@ -840,12 +840,15 @@ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell) ...@@ -840,12 +840,15 @@ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell)
val = ch_c_cntxt_0_type_encode(gsi->version, reg, GSI_CHANNEL_TYPE_GPI); val = ch_c_cntxt_0_type_encode(gsi->version, reg, GSI_CHANNEL_TYPE_GPI);
if (channel->toward_ipa) if (channel->toward_ipa)
val |= reg_bit(reg, CHTYPE_DIR); val |= reg_bit(reg, CHTYPE_DIR);
if (gsi->version < IPA_VERSION_5_0)
val |= reg_encode(reg, ERINDEX, channel->evt_ring_id); val |= reg_encode(reg, ERINDEX, channel->evt_ring_id);
val |= reg_encode(reg, ELEMENT_SIZE, GSI_RING_ELEMENT_SIZE); val |= reg_encode(reg, ELEMENT_SIZE, GSI_RING_ELEMENT_SIZE);
iowrite32(val, gsi->virt + reg_n_offset(reg, channel_id)); iowrite32(val, gsi->virt + reg_n_offset(reg, channel_id));
reg = gsi_reg(gsi, CH_C_CNTXT_1); reg = gsi_reg(gsi, CH_C_CNTXT_1);
val = reg_encode(reg, CH_R_LENGTH, size); val = reg_encode(reg, CH_R_LENGTH, size);
if (gsi->version >= IPA_VERSION_5_0)
val |= reg_encode(reg, CH_ERINDEX, channel->evt_ring_id);
iowrite32(val, gsi->virt + reg_n_offset(reg, channel_id)); iowrite32(val, gsi->virt + reg_n_offset(reg, channel_id));
/* The context 2 and 3 registers store the low-order and /* The context 2 and 3 registers store the low-order and
......
...@@ -102,7 +102,7 @@ enum gsi_reg_ch_c_cntxt_0_field_id { ...@@ -102,7 +102,7 @@ enum gsi_reg_ch_c_cntxt_0_field_id {
CH_EE, CH_EE,
CHID, CHID,
CHTYPE_PROTOCOL_MSB, /* IPA v4.5-4.11 */ CHTYPE_PROTOCOL_MSB, /* IPA v4.5-4.11 */
ERINDEX, ERINDEX, /* Not IPA v5.0+ */
CHSTATE, CHSTATE,
ELEMENT_SIZE, ELEMENT_SIZE,
}; };
...@@ -124,6 +124,7 @@ enum gsi_channel_type { ...@@ -124,6 +124,7 @@ enum gsi_channel_type {
/* CH_C_CNTXT_1 register */ /* CH_C_CNTXT_1 register */
enum gsi_reg_ch_c_cntxt_1_field_id { enum gsi_reg_ch_c_cntxt_1_field_id {
CH_R_LENGTH, CH_R_LENGTH,
CH_ERINDEX, /* IPA v5.0+ */
}; };
/* CH_C_QOS register */ /* CH_C_QOS register */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment