summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_data-sdm845.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-01-15 15:50:50 +0300
committerJakub Kicinski <kuba@kernel.org>2021-01-18 22:51:06 +0300
commitea151e1915ebef316893f1fdae6c2cd89ae3371b (patch)
tree45c196a831c10351b2dd5e1823ff8580c8e57994 /drivers/net/ipa/ipa_data-sdm845.c
parent10d0d3970187551645c7ab363e8c9d29e2122088 (diff)
downloadlinux-ea151e1915ebef316893f1fdae6c2cd89ae3371b.tar.xz
net: ipa: allow arbitrary number of interconnects
Currently we assume that the IPA hardware has exactly three interconnects. But that won't be guaranteed for all platforms, so allow any number of interconnects to be specified in the configuration data. For each platform, define an array of interconnect data entries (still associated with the IPA clock structure), and record the number of entries initialized in that array. Loop over all entries in this array when initializing, enabling, disabling, or tearing down the set of interconnects. With this change we no longer need the ipa_interconnect_id enumerated type, so get rid of it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ipa/ipa_data-sdm845.c')
-rw-r--r--drivers/net/ipa/ipa_data-sdm845.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c
index 3b556b5a6340..88c9c3562ab7 100644
--- a/drivers/net/ipa/ipa_data-sdm845.c
+++ b/drivers/net/ipa/ipa_data-sdm845.c
@@ -329,27 +329,30 @@ static struct ipa_mem_data ipa_mem_data = {
.smem_size = 0x00002000,
};
+/* Interconnect bandwidths are in 1000 byte/second units */
+static struct ipa_interconnect_data ipa_interconnect_data[] = {
+ {
+ .name = "memory",
+ .peak_bandwidth = 600000, /* 600 MBps */
+ .average_bandwidth = 80000, /* 80 MBps */
+ },
+ /* Average bandwidth is unused for the next two interconnects */
+ {
+ .name = "imem",
+ .peak_bandwidth = 350000, /* 350 MBps */
+ .average_bandwidth = 0, /* unused */
+ },
+ {
+ .name = "config",
+ .peak_bandwidth = 40000, /* 40 MBps */
+ .average_bandwidth = 0, /* unused */
+ },
+};
+
static struct ipa_clock_data ipa_clock_data = {
.core_clock_rate = 75 * 1000 * 1000, /* Hz */
- /* Interconnect bandwidths are in 1000 byte/second units */
- .interconnect = {
- [IPA_INTERCONNECT_MEMORY] = {
- .name = "memory",
- .peak_bandwidth = 600000, /* 600 MBps */
- .average_bandwidth = 80000, /* 80 MBps */
- },
- /* Average bandwidth unused for the next two interconnects */
- [IPA_INTERCONNECT_IMEM] = {
- .name = "imem",
- .peak_bandwidth = 350000, /* 350 MBps */
- .average_bandwidth = 0, /* unused */
- },
- [IPA_INTERCONNECT_CONFIG] = {
- .name = "config",
- .peak_bandwidth = 40000, /* 40 MBps */
- .average_bandwidth = 0, /* unused */
- },
- },
+ .interconnect_count = ARRAY_SIZE(ipa_interconnect_data),
+ .interconnect_data = ipa_interconnect_data,
};
/* Configuration data for the SDM845 SoC. */