summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_data-sc7180.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-03-26 18:11:13 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-27 01:02:38 +0300
commit47f71d6e677cfa2853203ea77c0a47c23fea92c0 (patch)
treec2389ab66d15bbe8d99345f7ab9fb9c0abe6e645 /drivers/net/ipa/ipa_data-sc7180.c
parenta749c6c03762f71ba4d04ead60b4f5df9ca2bf5e (diff)
downloadlinux-47f71d6e677cfa2853203ea77c0a47c23fea92c0.tar.xz
net: ipa: identify resource groups
Define a new ipa_resource_group_id enumerated type, whose members have numeric values that match the resource group number used when programming the hardware. Each platform supports a different number of source and destination resource groups, so define the type separately for each platform in its configuration data file. Use these new symbolic values when specifying the resource group an endpoint is associated with. And use them to index the limits arrays for source and destination resources, making it clearer how these values are used. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_data-sc7180.c')
-rw-r--r--drivers/net/ipa/ipa_data-sc7180.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c
index 621ad15c9e67..e9b741832a1d 100644
--- a/drivers/net/ipa/ipa_data-sc7180.c
+++ b/drivers/net/ipa/ipa_data-sc7180.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
-/* Copyright (C) 2019-2020 Linaro Ltd. */
+/* Copyright (C) 2019-2021 Linaro Ltd. */
#include <linux/log2.h>
@@ -9,6 +9,15 @@
#include "ipa_endpoint.h"
#include "ipa_mem.h"
+/* Resource groups used for the SC7180 SoC */
+enum ipa_rsrc_group_id {
+ /* Source resource group identifiers */
+ IPA_RSRC_GROUP_SRC_UL_DL = 0,
+
+ /* Destination resource group identifiers */
+ IPA_RSRC_GROUP_DST_UL_DL_DPL = 0,
+};
+
/* QSB configuration for the SC7180 SoC. */
static const struct ipa_qsb_data ipa_qsb_data[] = {
[IPA_QSB_MASTER_DDR] = {
@@ -32,7 +41,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
},
.endpoint = {
.config = {
- .resource_group = 0,
+ .resource_group = IPA_RSRC_GROUP_SRC_UL_DL,
.dma_mode = true,
.dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
.tx = {
@@ -53,7 +62,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
},
.endpoint = {
.config = {
- .resource_group = 0,
+ .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL,
.aggregation = true,
.status_enable = true,
.rx = {
@@ -75,7 +84,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
.endpoint = {
.filter_support = true,
.config = {
- .resource_group = 0,
+ .resource_group = IPA_RSRC_GROUP_SRC_UL_DL,
.checksum = true,
.qmap = true,
.status_enable = true,
@@ -100,7 +109,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
},
.endpoint = {
.config = {
- .resource_group = 0,
+ .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL,
.checksum = true,
.qmap = true,
.aggregation = true,
@@ -139,58 +148,57 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
},
};
-/* For the SC7180, resource groups are allocated this way:
- * group 0: UL_DL
- */
+/* Source resource configuration data for the SC7180 SoC */
static const struct ipa_resource_src ipa_resource_src[] = {
{
.type = IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
.min = 3,
.max = 63,
},
},
{
.type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
.min = 3,
.max = 3,
},
},
{
.type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
.min = 10,
.max = 10,
},
},
{
.type = IPA_RESOURCE_TYPE_SRC_HPS_DMARS,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
.min = 1,
.max = 1,
},
},
{
.type = IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
.min = 5,
.max = 5,
},
},
};
+/* Destination resource configuration data for the SC7180 SoC */
static const struct ipa_resource_dst ipa_resource_dst[] = {
{
.type = IPA_RESOURCE_TYPE_DST_DATA_SECTORS,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = {
.min = 3,
.max = 3,
},
},
{
.type = IPA_RESOURCE_TYPE_DST_DPS_DMARS,
- .limits[0] = {
+ .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = {
.min = 1,
.max = 63,
},