aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2015-10-13 16:49:04 -0400
committerSantosh Shilimkar <ssantosh@kernel.org>2015-10-13 16:49:04 -0400
commit045016902bf7abeeb2a86fc9284c30dce228f055 (patch)
tree5d3555a274a3f27b79c46cdd7ac43ea0bca466c9 /drivers/soc
parent96ee19becc3bd7b2cebae5828c3eacfebb50b993 (diff)
soc: ti: qmss: make acc queue support optional in the driver
acc channels are available only if accumulator PDSP is loaded and running in the SoC. As this requires firmware and user may not have firmware in the file system, make the accumulator queue support available in qmss driver optional. To use accumulator queus user needs to add firmware to the file system and boot up kernel. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/ti/knav_qmss.h2
-rw-r--r--drivers/soc/ti/knav_qmss_acc.c10
-rw-r--r--drivers/soc/ti/knav_qmss_queue.c20
3 files changed, 25 insertions, 7 deletions
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index c31b8d826794..6ff936cacb70 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -137,6 +137,8 @@ struct knav_pdsp_info {
137 u32 __iomem *iram; 137 u32 __iomem *iram;
138 u32 id; 138 u32 id;
139 struct list_head list; 139 struct list_head list;
140 bool loaded;
141 bool started;
140}; 142};
141 143
142struct knav_qmgr_info { 144struct knav_qmgr_info {
diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c
index ef6f69db0bd0..37c4aa95492d 100644
--- a/drivers/soc/ti/knav_qmss_acc.c
+++ b/drivers/soc/ti/knav_qmss_acc.c
@@ -482,8 +482,8 @@ struct knav_range_ops knav_acc_range_ops = {
482 * Return 0 on success or error 482 * Return 0 on success or error
483 */ 483 */
484int knav_init_acc_range(struct knav_device *kdev, 484int knav_init_acc_range(struct knav_device *kdev,
485 struct device_node *node, 485 struct device_node *node,
486 struct knav_range_info *range) 486 struct knav_range_info *range)
487{ 487{
488 struct knav_acc_channel *acc; 488 struct knav_acc_channel *acc;
489 struct knav_pdsp_info *pdsp; 489 struct knav_pdsp_info *pdsp;
@@ -526,6 +526,12 @@ int knav_init_acc_range(struct knav_device *kdev,
526 return -EINVAL; 526 return -EINVAL;
527 } 527 }
528 528
529 if (!pdsp->started) {
530 dev_err(kdev->dev, "pdsp id %d not started for range %s\n",
531 info->pdsp_id, range->name);
532 return -ENODEV;
533 }
534
529 info->pdsp = pdsp; 535 info->pdsp = pdsp;
530 channels = range->num_queues; 536 channels = range->num_queues;
531 if (of_get_property(node, "multi-queue", NULL)) { 537 if (of_get_property(node, "multi-queue", NULL)) {
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 06d9de826758..f3a0b6a4b54e 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1504,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev,
1504 dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name); 1504 dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name);
1505 return ret; 1505 return ret;
1506 } 1506 }
1507 pdsp->loaded = false;
1508 pdsp->started = false;
1507 return 0; 1509 return 0;
1508} 1510}
1509 1511
@@ -1592,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev)
1592 int ret; 1594 int ret;
1593 1595
1594 knav_queue_stop_pdsps(kdev); 1596 knav_queue_stop_pdsps(kdev);
1595 /* now load them all */ 1597 /* now load them all. We return success even if pdsp
1598 * is not loaded as acc channels are optional on having
1599 * firmware availability in the system. We set the loaded
1600 * and stated flag and when initialize the acc range, check
1601 * it and init the range only if pdsp is started.
1602 */
1596 for_each_pdsp(kdev, pdsp) { 1603 for_each_pdsp(kdev, pdsp) {
1597 ret = knav_queue_load_pdsp(kdev, pdsp); 1604 ret = knav_queue_load_pdsp(kdev, pdsp);
1598 if (ret < 0) 1605 if (!ret)
1599 return ret; 1606 pdsp->loaded = true;
1600 } 1607 }
1601 1608
1602 for_each_pdsp(kdev, pdsp) { 1609 for_each_pdsp(kdev, pdsp) {
1603 ret = knav_queue_start_pdsp(kdev, pdsp); 1610 if (pdsp->loaded) {
1604 WARN_ON(ret); 1611 ret = knav_queue_start_pdsp(kdev, pdsp);
1612 if (!ret)
1613 pdsp->started = true;
1614 }
1605 } 1615 }
1606 return 0; 1616 return 0;
1607} 1617}