Commit 1690d8a7 authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

net: ipa: sequencer type is for TX endpoints only

We only program the sequencer type for TX endpoints.  So move the
definition of the sequencer type fields into the TX-specific portion
of the endpoint configuration data.  There's no need to maintain
this in the IPA structure; we can extract it from the configuration
data it points to in the one spot it's needed.

We previously specified the sequencer type for RX endpoints with
INVALID values.  These are no longer needed, so get rid of them.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ee5df65
...@@ -31,11 +31,13 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -31,11 +31,13 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.tlv_count = 20, .tlv_count = 20,
}, },
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_DMA,
.config = { .config = {
.resource_group = 0, .resource_group = 0,
.dma_mode = true, .dma_mode = true,
.dma_endpoint = IPA_ENDPOINT_AP_LAN_RX, .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
.tx = {
.seq_type = IPA_SEQ_DMA,
},
}, },
}, },
}, },
...@@ -50,8 +52,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -50,8 +52,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.tlv_count = 6, .tlv_count = 6,
}, },
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_INVALID,
.seq_rep_type = IPA_SEQ_REP_INVALID,
.config = { .config = {
.resource_group = 0, .resource_group = 0,
.aggregation = true, .aggregation = true,
...@@ -74,14 +74,14 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -74,14 +74,14 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
}, },
.endpoint = { .endpoint = {
.filter_support = true, .filter_support = true,
.seq_type = IPA_SEQ_1_PASS_SKIP_LAST_UC,
.seq_rep_type = IPA_SEQ_REP_DMA_PARSER,
.config = { .config = {
.resource_group = 0, .resource_group = 0,
.checksum = true, .checksum = true,
.qmap = true, .qmap = true,
.status_enable = true, .status_enable = true,
.tx = { .tx = {
.seq_type = IPA_SEQ_1_PASS_SKIP_LAST_UC,
.seq_rep_type = IPA_SEQ_REP_DMA_PARSER,
.status_endpoint = .status_endpoint =
IPA_ENDPOINT_MODEM_AP_RX, IPA_ENDPOINT_MODEM_AP_RX,
}, },
...@@ -99,8 +99,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -99,8 +99,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.tlv_count = 6, .tlv_count = 6,
}, },
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_INVALID,
.seq_rep_type = IPA_SEQ_REP_INVALID,
.config = { .config = {
.resource_group = 0, .resource_group = 0,
.checksum = true, .checksum = true,
......
...@@ -36,11 +36,13 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -36,11 +36,13 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.tlv_count = 20, .tlv_count = 20,
}, },
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_DMA,
.config = { .config = {
.resource_group = 1, .resource_group = 1,
.dma_mode = true, .dma_mode = true,
.dma_endpoint = IPA_ENDPOINT_AP_LAN_RX, .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
.tx = {
.seq_type = IPA_SEQ_DMA,
},
}, },
}, },
}, },
...@@ -55,8 +57,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -55,8 +57,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.tlv_count = 8, .tlv_count = 8,
}, },
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_INVALID,
.seq_rep_type = IPA_SEQ_REP_INVALID,
.config = { .config = {
.resource_group = 1, .resource_group = 1,
.aggregation = true, .aggregation = true,
...@@ -79,13 +79,13 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -79,13 +79,13 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
}, },
.endpoint = { .endpoint = {
.filter_support = true, .filter_support = true,
.seq_type = IPA_SEQ_2_PASS_SKIP_LAST_UC,
.config = { .config = {
.resource_group = 1, .resource_group = 1,
.checksum = true, .checksum = true,
.qmap = true, .qmap = true,
.status_enable = true, .status_enable = true,
.tx = { .tx = {
.seq_type = IPA_SEQ_2_PASS_SKIP_LAST_UC,
.status_endpoint = .status_endpoint =
IPA_ENDPOINT_MODEM_AP_RX, IPA_ENDPOINT_MODEM_AP_RX,
}, },
...@@ -103,8 +103,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { ...@@ -103,8 +103,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.tlv_count = 8, .tlv_count = 8,
}, },
.endpoint = { .endpoint = {
.seq_type = IPA_SEQ_INVALID,
.seq_rep_type = IPA_SEQ_REP_INVALID,
.config = { .config = {
.resource_group = 1, .resource_group = 1,
.checksum = true, .checksum = true,
......
...@@ -97,12 +97,16 @@ struct gsi_channel_data { ...@@ -97,12 +97,16 @@ struct gsi_channel_data {
/** /**
* struct ipa_endpoint_tx_data - configuration data for TX endpoints * struct ipa_endpoint_tx_data - configuration data for TX endpoints
* @seq_type: primary packet processing sequencer type
* @seq_rep_type: sequencer type for replication processing
* @status_endpoint: endpoint to which status elements are sent * @status_endpoint: endpoint to which status elements are sent
* *
* The @status_endpoint is only valid if the endpoint's @status_enable * The @status_endpoint is only valid if the endpoint's @status_enable
* flag is set. * flag is set.
*/ */
struct ipa_endpoint_tx_data { struct ipa_endpoint_tx_data {
enum ipa_seq_type seq_type;
enum ipa_seq_rep_type seq_rep_type;
enum ipa_endpoint_name status_endpoint; enum ipa_endpoint_name status_endpoint;
}; };
...@@ -154,8 +158,6 @@ struct ipa_endpoint_config_data { ...@@ -154,8 +158,6 @@ struct ipa_endpoint_config_data {
/** /**
* struct ipa_endpoint_data - IPA endpoint configuration data * struct ipa_endpoint_data - IPA endpoint configuration data
* @filter_support: whether endpoint supports filtering * @filter_support: whether endpoint supports filtering
* @seq_type: primary packet processing sequencer type
* @seq_rep_type: sequencer type for replication processing
* @config: hardware configuration (see above) * @config: hardware configuration (see above)
* *
* Not all endpoints support the IPA filtering capability. A filter table * Not all endpoints support the IPA filtering capability. A filter table
...@@ -165,15 +167,10 @@ struct ipa_endpoint_config_data { ...@@ -165,15 +167,10 @@ struct ipa_endpoint_config_data {
* in the system, and indicate whether they support filtering. * in the system, and indicate whether they support filtering.
* *
* The remaining endpoint configuration data applies only to AP endpoints. * The remaining endpoint configuration data applies only to AP endpoints.
* The IPA hardware is implemented by sequencers, and the AP must program
* the type(s) of these sequencers at initialization time. The remaining
* endpoint configuration data is defined above.
*/ */
struct ipa_endpoint_data { struct ipa_endpoint_data {
bool filter_support; bool filter_support;
/* The next three are specified only for AP endpoints */ /* Everything else is specified only for AP endpoints */
enum ipa_seq_type seq_type;
enum ipa_seq_rep_type seq_rep_type;
struct ipa_endpoint_config_data config; struct ipa_endpoint_config_data config;
}; };
......
...@@ -890,10 +890,11 @@ static void ipa_endpoint_init_seq(struct ipa_endpoint *endpoint) ...@@ -890,10 +890,11 @@ static void ipa_endpoint_init_seq(struct ipa_endpoint *endpoint)
return; /* Register not valid for RX endpoints */ return; /* Register not valid for RX endpoints */
/* Low-order byte configures primary packet processing */ /* Low-order byte configures primary packet processing */
val |= u32_encode_bits(endpoint->seq_type, SEQ_TYPE_FMASK); val |= u32_encode_bits(endpoint->data->tx.seq_type, SEQ_TYPE_FMASK);
/* Second byte configures replicated packet processing */ /* Second byte configures replicated packet processing */
val |= u32_encode_bits(endpoint->seq_rep_type, SEQ_REP_TYPE_FMASK); val |= u32_encode_bits(endpoint->data->tx.seq_rep_type,
SEQ_REP_TYPE_FMASK);
iowrite32(val, endpoint->ipa->reg_virt + offset); iowrite32(val, endpoint->ipa->reg_virt + offset);
} }
...@@ -1764,8 +1765,6 @@ static void ipa_endpoint_init_one(struct ipa *ipa, enum ipa_endpoint_name name, ...@@ -1764,8 +1765,6 @@ static void ipa_endpoint_init_one(struct ipa *ipa, enum ipa_endpoint_name name,
endpoint->ipa = ipa; endpoint->ipa = ipa;
endpoint->ee_id = data->ee_id; endpoint->ee_id = data->ee_id;
endpoint->seq_type = data->endpoint.seq_type;
endpoint->seq_rep_type = data->endpoint.seq_rep_type;
endpoint->channel_id = data->channel_id; endpoint->channel_id = data->channel_id;
endpoint->endpoint_id = data->endpoint_id; endpoint->endpoint_id = data->endpoint_id;
endpoint->toward_ipa = data->toward_ipa; endpoint->toward_ipa = data->toward_ipa;
......
...@@ -46,8 +46,6 @@ enum ipa_endpoint_name { ...@@ -46,8 +46,6 @@ enum ipa_endpoint_name {
*/ */
struct ipa_endpoint { struct ipa_endpoint {
struct ipa *ipa; struct ipa *ipa;
enum ipa_seq_type seq_type;
enum ipa_seq_rep_type seq_rep_type;
enum gsi_ee_id ee_id; enum gsi_ee_id ee_id;
u32 channel_id; u32 channel_id;
u32 endpoint_id; u32 endpoint_id;
......
...@@ -602,7 +602,6 @@ enum ipa_seq_type { ...@@ -602,7 +602,6 @@ enum ipa_seq_type {
IPA_SEQ_1_PASS_SKIP_LAST_UC = 0x06, IPA_SEQ_1_PASS_SKIP_LAST_UC = 0x06,
IPA_SEQ_2_PASS = 0x0a, IPA_SEQ_2_PASS = 0x0a,
IPA_SEQ_3_PASS_SKIP_LAST_UC = 0x0c, IPA_SEQ_3_PASS_SKIP_LAST_UC = 0x0c,
IPA_SEQ_INVALID = 0x0c,
}; };
/** /**
...@@ -615,7 +614,6 @@ enum ipa_seq_type { ...@@ -615,7 +614,6 @@ enum ipa_seq_type {
*/ */
enum ipa_seq_rep_type { enum ipa_seq_rep_type {
IPA_SEQ_REP_DMA_PARSER = 0x08, IPA_SEQ_REP_DMA_PARSER = 0x08,
IPA_SEQ_REP_INVALID = 0x0c,
}; };
#define IPA_REG_ENDP_STATUS_N_OFFSET(ep) \ #define IPA_REG_ENDP_STATUS_N_OFFSET(ep) \
......
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