Commit e938d7ef authored by Alex Elder's avatar Alex Elder Committed by Jakub Kicinski

net: ipa: add interconnect name to configuration data

Add the name to the configuration data for each interconnect.  Use
this information rather than a constant string during initialization.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent db6cd514
...@@ -76,7 +76,7 @@ static int ipa_interconnect_init(struct ipa_clock *clock, struct device *dev, ...@@ -76,7 +76,7 @@ static int ipa_interconnect_init(struct ipa_clock *clock, struct device *dev,
struct ipa_interconnect *interconnect; struct ipa_interconnect *interconnect;
struct icc_path *path; struct icc_path *path;
path = ipa_interconnect_init_one(dev, "memory"); path = ipa_interconnect_init_one(dev, data->name);
if (IS_ERR(path)) if (IS_ERR(path))
goto err_return; goto err_return;
interconnect = &clock->interconnect[IPA_INTERCONNECT_MEMORY]; interconnect = &clock->interconnect[IPA_INTERCONNECT_MEMORY];
...@@ -85,7 +85,7 @@ static int ipa_interconnect_init(struct ipa_clock *clock, struct device *dev, ...@@ -85,7 +85,7 @@ static int ipa_interconnect_init(struct ipa_clock *clock, struct device *dev,
interconnect->peak_bandwidth = data->peak_bandwidth; interconnect->peak_bandwidth = data->peak_bandwidth;
data++; data++;
path = ipa_interconnect_init_one(dev, "imem"); path = ipa_interconnect_init_one(dev, data->name);
if (IS_ERR(path)) if (IS_ERR(path))
goto err_memory_path_put; goto err_memory_path_put;
interconnect = &clock->interconnect[IPA_INTERCONNECT_IMEM]; interconnect = &clock->interconnect[IPA_INTERCONNECT_IMEM];
...@@ -94,7 +94,7 @@ static int ipa_interconnect_init(struct ipa_clock *clock, struct device *dev, ...@@ -94,7 +94,7 @@ static int ipa_interconnect_init(struct ipa_clock *clock, struct device *dev,
interconnect->peak_bandwidth = data->peak_bandwidth; interconnect->peak_bandwidth = data->peak_bandwidth;
data++; data++;
path = ipa_interconnect_init_one(dev, "config"); path = ipa_interconnect_init_one(dev, data->name);
if (IS_ERR(path)) if (IS_ERR(path))
goto err_imem_path_put; goto err_imem_path_put;
interconnect = &clock->interconnect[IPA_INTERCONNECT_CONFIG]; interconnect = &clock->interconnect[IPA_INTERCONNECT_CONFIG];
......
...@@ -314,15 +314,18 @@ static struct ipa_clock_data ipa_clock_data = { ...@@ -314,15 +314,18 @@ static struct ipa_clock_data ipa_clock_data = {
/* Interconnect bandwidths are in 1000 byte/second units */ /* Interconnect bandwidths are in 1000 byte/second units */
.interconnect = { .interconnect = {
[IPA_INTERCONNECT_MEMORY] = { [IPA_INTERCONNECT_MEMORY] = {
.name = "memory",
.peak_bandwidth = 465000, /* 465 MBps */ .peak_bandwidth = 465000, /* 465 MBps */
.average_bandwidth = 80000, /* 80 MBps */ .average_bandwidth = 80000, /* 80 MBps */
}, },
/* Average bandwidth unused for the next two interconnects */ /* Average bandwidth unused for the next two interconnects */
[IPA_INTERCONNECT_IMEM] = { [IPA_INTERCONNECT_IMEM] = {
.name = "imem",
.peak_bandwidth = 68570, /* 68.57 MBps */ .peak_bandwidth = 68570, /* 68.57 MBps */
.average_bandwidth = 0, /* unused */ .average_bandwidth = 0, /* unused */
}, },
[IPA_INTERCONNECT_CONFIG] = { [IPA_INTERCONNECT_CONFIG] = {
.name = "config",
.peak_bandwidth = 30000, /* 30 MBps */ .peak_bandwidth = 30000, /* 30 MBps */
.average_bandwidth = 0, /* unused */ .average_bandwidth = 0, /* unused */
}, },
......
...@@ -334,15 +334,18 @@ static struct ipa_clock_data ipa_clock_data = { ...@@ -334,15 +334,18 @@ static struct ipa_clock_data ipa_clock_data = {
/* Interconnect bandwidths are in 1000 byte/second units */ /* Interconnect bandwidths are in 1000 byte/second units */
.interconnect = { .interconnect = {
[IPA_INTERCONNECT_MEMORY] = { [IPA_INTERCONNECT_MEMORY] = {
.name = "memory",
.peak_bandwidth = 600000, /* 600 MBps */ .peak_bandwidth = 600000, /* 600 MBps */
.average_bandwidth = 80000, /* 80 MBps */ .average_bandwidth = 80000, /* 80 MBps */
}, },
/* Average bandwidth unused for the next two interconnects */ /* Average bandwidth unused for the next two interconnects */
[IPA_INTERCONNECT_IMEM] = { [IPA_INTERCONNECT_IMEM] = {
.name = "imem",
.peak_bandwidth = 350000, /* 350 MBps */ .peak_bandwidth = 350000, /* 350 MBps */
.average_bandwidth = 0, /* unused */ .average_bandwidth = 0, /* unused */
}, },
[IPA_INTERCONNECT_CONFIG] = { [IPA_INTERCONNECT_CONFIG] = {
.name = "config",
.peak_bandwidth = 40000, /* 40 MBps */ .peak_bandwidth = 40000, /* 40 MBps */
.average_bandwidth = 0, /* unused */ .average_bandwidth = 0, /* unused */
}, },
......
...@@ -268,10 +268,12 @@ enum ipa_interconnect_id { ...@@ -268,10 +268,12 @@ enum ipa_interconnect_id {
/** /**
* struct ipa_interconnect_data - description of IPA interconnect bandwidths * struct ipa_interconnect_data - description of IPA interconnect bandwidths
* @name: Interconnect name (matches interconnect-name in DT)
* @peak_bandwidth: Peak interconnect bandwidth (in 1000 byte/sec units) * @peak_bandwidth: Peak interconnect bandwidth (in 1000 byte/sec units)
* @average_bandwidth: Average interconnect bandwidth (in 1000 byte/sec units) * @average_bandwidth: Average interconnect bandwidth (in 1000 byte/sec units)
*/ */
struct ipa_interconnect_data { struct ipa_interconnect_data {
const char *name;
u32 peak_bandwidth; u32 peak_bandwidth;
u32 average_bandwidth; u32 average_bandwidth;
}; };
......
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