aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/arm/keystone/knav-qmss.txt26
-rw-r--r--Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt1
-rw-r--r--drivers/soc/ti/knav_qmss.h1
-rw-r--r--drivers/soc/ti/knav_qmss_queue.c47
4 files changed, 54 insertions, 21 deletions
diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
index 79946d184d76..da34a5babfbe 100644
--- a/Documentation/arm/keystone/knav-qmss.txt
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -22,3 +22,29 @@ pool management.
22knav qmss driver provides a set of APIs to drivers to open/close qmss queues, 22knav qmss driver provides a set of APIs to drivers to open/close qmss queues,
23allocate descriptor pools, map the descriptors, push/pop to queues etc. For 23allocate descriptor pools, map the descriptors, push/pop to queues etc. For
24details of the available APIs, please refers to include/linux/soc/ti/knav_qmss.h 24details of the available APIs, please refers to include/linux/soc/ti/knav_qmss.h
25
26DT documentation is available at
27Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
28
29Accumulator QMSS queues using PDSP firmware
30============================================
31The QMSS PDSP firmware support accumulator channel that can monitor a single
32queue or multiple contiguous queues. drivers/soc/ti/knav_qmss_acc.c is the
33driver that interface with the accumulator PDSP. This configures
34accumulator channels defined in DTS (example in DT documentation) to monitor
351 or 32 queues per channel. More description on the firmware is available in
36CPPI/QMSS Low Level Driver document (docs/CPPI_QMSS_LLD_SDS.pdf) at
37 git://git.ti.com/keystone-rtos/qmss-lld.git
38
39k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin firmware supports upto 48 accumulator
40channels. This firmware is available under ti-keystone folder of
41firmware.git at
42 git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
43
44To use copy the firmware image to lib/firmware folder of the initramfs or
45ubifs file system and provide a sym link to k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin
46in the file system and boot up the kernel. User would see
47
48 "firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP"
49
50in the boot up log if loading of firmware to PDSP is successful.
diff --git a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
index d8e8cdb733f9..d1ce21a4904d 100644
--- a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
+++ b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
@@ -221,7 +221,6 @@ qmss: qmss@2a40000 {
221 #size-cells = <1>; 221 #size-cells = <1>;
222 ranges; 222 ranges;
223 pdsp0@0x2a10000 { 223 pdsp0@0x2a10000 {
224 firmware = "keystone/qmss_pdsp_acc48_k2_le_1_0_0_8.fw";
225 reg = <0x2a10000 0x1000>, 224 reg = <0x2a10000 0x1000>,
226 <0x2a0f000 0x100>, 225 <0x2a0f000 0x100>,
227 <0x2a0c000 0x3c8>, 226 <0x2a0c000 0x3c8>,
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index 51da2341280d..c31b8d826794 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -135,7 +135,6 @@ struct knav_pdsp_info {
135 }; 135 };
136 void __iomem *intd; 136 void __iomem *intd;
137 u32 __iomem *iram; 137 u32 __iomem *iram;
138 const char *firmware;
139 u32 id; 138 u32 id;
140 struct list_head list; 139 struct list_head list;
141}; 140};
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 6d8646db52cc..06d9de826758 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -68,6 +68,12 @@ static DEFINE_MUTEX(knav_dev_lock);
68 idx < (kdev)->num_queues_in_use; \ 68 idx < (kdev)->num_queues_in_use; \
69 idx++, inst = knav_queue_idx_to_inst(kdev, idx)) 69 idx++, inst = knav_queue_idx_to_inst(kdev, idx))
70 70
71/* All firmware file names end up here. List the firmware file names below.
72 * Newest followed by older ones. Search is done from start of the array
73 * until a firmware file is found.
74 */
75const char *knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin"};
76
71/** 77/**
72 * knav_queue_notify: qmss queue notfier call 78 * knav_queue_notify: qmss queue notfier call
73 * 79 *
@@ -1439,7 +1445,6 @@ static int knav_queue_init_pdsps(struct knav_device *kdev,
1439 struct device *dev = kdev->dev; 1445 struct device *dev = kdev->dev;
1440 struct knav_pdsp_info *pdsp; 1446 struct knav_pdsp_info *pdsp;
1441 struct device_node *child; 1447 struct device_node *child;
1442 int ret;
1443 1448
1444 for_each_child_of_node(pdsps, child) { 1449 for_each_child_of_node(pdsps, child) {
1445 pdsp = devm_kzalloc(dev, sizeof(*pdsp), GFP_KERNEL); 1450 pdsp = devm_kzalloc(dev, sizeof(*pdsp), GFP_KERNEL);
@@ -1448,17 +1453,6 @@ static int knav_queue_init_pdsps(struct knav_device *kdev,
1448 return -ENOMEM; 1453 return -ENOMEM;
1449 } 1454 }
1450 pdsp->name = knav_queue_find_name(child); 1455 pdsp->name = knav_queue_find_name(child);
1451 ret = of_property_read_string(child, "firmware",
1452 &pdsp->firmware);
1453 if (ret < 0 || !pdsp->firmware) {
1454 dev_err(dev, "unknown firmware for pdsp %s\n",
1455 pdsp->name);
1456 devm_kfree(dev, pdsp);
1457 continue;
1458 }
1459 dev_dbg(dev, "pdsp name %s fw name :%s\n", pdsp->name,
1460 pdsp->firmware);
1461
1462 pdsp->iram = 1456 pdsp->iram =
1463 knav_queue_map_reg(kdev, child, 1457 knav_queue_map_reg(kdev, child,
1464 KNAV_QUEUE_PDSP_IRAM_REG_INDEX); 1458 KNAV_QUEUE_PDSP_IRAM_REG_INDEX);
@@ -1489,9 +1483,9 @@ static int knav_queue_init_pdsps(struct knav_device *kdev,
1489 } 1483 }
1490 of_property_read_u32(child, "id", &pdsp->id); 1484 of_property_read_u32(child, "id", &pdsp->id);
1491 list_add_tail(&pdsp->list, &kdev->pdsps); 1485 list_add_tail(&pdsp->list, &kdev->pdsps);
1492 dev_dbg(dev, "added pdsp %s: command %p, iram %p, regs %p, intd %p, firmware %s\n", 1486 dev_dbg(dev, "added pdsp %s: command %p, iram %p, regs %p, intd %p\n",
1493 pdsp->name, pdsp->command, pdsp->iram, pdsp->regs, 1487 pdsp->name, pdsp->command, pdsp->iram, pdsp->regs,
1494 pdsp->intd, pdsp->firmware); 1488 pdsp->intd);
1495 } 1489 }
1496 return 0; 1490 return 0;
1497} 1491}
@@ -1518,14 +1512,29 @@ static int knav_queue_load_pdsp(struct knav_device *kdev,
1518{ 1512{
1519 int i, ret, fwlen; 1513 int i, ret, fwlen;
1520 const struct firmware *fw; 1514 const struct firmware *fw;
1515 bool found = false;
1521 u32 *fwdata; 1516 u32 *fwdata;
1522 1517
1523 ret = request_firmware(&fw, pdsp->firmware, kdev->dev); 1518 for (i = 0; i < ARRAY_SIZE(knav_acc_firmwares); i++) {
1524 if (ret) { 1519 if (knav_acc_firmwares[i]) {
1525 dev_err(kdev->dev, "failed to get firmware %s for pdsp %s\n", 1520 ret = request_firmware(&fw,
1526 pdsp->firmware, pdsp->name); 1521 knav_acc_firmwares[i],
1527 return ret; 1522 kdev->dev);
1523 if (!ret) {
1524 found = true;
1525 break;
1526 }
1527 }
1528 }
1529
1530 if (!found) {
1531 dev_err(kdev->dev, "failed to get firmware for pdsp\n");
1532 return -ENODEV;
1528 } 1533 }
1534
1535 dev_info(kdev->dev, "firmware file %s downloaded for PDSP\n",
1536 knav_acc_firmwares[i]);
1537
1529 writel_relaxed(pdsp->id + 1, pdsp->command + 0x18); 1538 writel_relaxed(pdsp->id + 1, pdsp->command + 0x18);
1530 /* download the firmware */ 1539 /* download the firmware */
1531 fwdata = (u32 *)fw->data; 1540 fwdata = (u32 *)fw->data;