Skip to content

Commit

Permalink
net: ipa: add HW_PARAM_4 GSI register
Browse files Browse the repository at this point in the history
Starting at IPA v5.0, the number of event rings per EE is defined
in a field in a new HW_PARAM_4 GSI register rather than HW_PARAM_2.
Define this new register and its fields, and update the code that
checks the number of rings supported by hardware to use the proper
field based on IPA version.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Alex Elder authored and Paolo Abeni committed Feb 20, 2023
1 parent 37cd29e commit f651334
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion drivers/net/ipa/gsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,12 @@ static int gsi_ring_setup(struct gsi *gsi)
}
gsi->channel_count = count;

count = reg_decode(reg, NUM_EV_PER_EE, val);
if (gsi->version < IPA_VERSION_5_0) {
count = reg_decode(reg, NUM_EV_PER_EE, val);
} else {
reg = gsi_reg(gsi, HW_PARAM_4);
count = reg_decode(reg, EV_PER_EE, val);
}
if (!count) {
dev_err(dev, "GSI reports zero event rings supported\n");
return -EINVAL;
Expand Down
9 changes: 8 additions & 1 deletion drivers/net/ipa/gsi_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ enum gsi_reg_id {
EV_CH_CMD,
GENERIC_CMD,
HW_PARAM_2, /* IPA v3.5.1+ */
HW_PARAM_4, /* IPA v5.0+ */
CNTXT_TYPE_IRQ,
CNTXT_TYPE_IRQ_MSK,
CNTXT_SRC_CH_IRQ,
Expand Down Expand Up @@ -224,7 +225,7 @@ enum gsi_generic_cmd_opcode {
enum gsi_hw_param_2_field_id {
IRAM_SIZE,
NUM_CH_PER_EE,
NUM_EV_PER_EE,
NUM_EV_PER_EE, /* Not IPA v5.0+ */
GSI_CH_PEND_TRANSLATE,
GSI_CH_FULL_LOGIC,
GSI_USE_SDMA, /* IPA v4.0+ */
Expand All @@ -247,6 +248,12 @@ enum gsi_iram_size {
IRAM_SIZE_FOUR_KB = 0x5,
};

/* HW_PARAM_4 register */ /* IPA v5.0+ */
enum gsi_hw_param_4_field_id {
EV_PER_EE,
IRAM_PROTOCOL_COUNT,
};

/**
* enum gsi_irq_type_id: GSI IRQ types
* @GSI_CH_CTRL: Channel allocation, deallocation, etc.
Expand Down

0 comments on commit f651334

Please sign in to comment.