Skip to content

Commit 9c52a26

Browse files
committed
Merge tag 'drivers_soc_for_5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into arm/drivers
SOC: TI Keystone driver update for v5.9 - TI K3 Ring Accelerator updates - Few non critical warining fixes * tag 'drivers_soc_for_5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: soc: TI knav_qmss: make symbol 'knav_acc_range_ops' static firmware: ti_sci: Replace HTTP links with HTTPS ones soc: ti/ti_sci_protocol.h: drop a duplicated word + clarify soc: ti: k3: fix semicolon.cocci warnings soc: ti: k3-ringacc: fix: warn: variable dereferenced before check 'ring' dmaengine: ti: k3-udma: Switch to k3_ringacc_request_rings_pair soc: ti: k3-ringacc: separate soc specific initialization soc: ti: k3-ringacc: add request pair of rings api. soc: ti: k3-ringacc: add ring's flags to dump soc: ti: k3-ringacc: Move state tracking variables under a struct dt-bindings: soc: ti: k3-ringacc: convert bindings to json-schema Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents ab274a7 + 09241e6 commit 9c52a26

File tree

15 files changed

+276
-187
lines changed

15 files changed

+276
-187
lines changed

Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Required Properties:
5555
corresponds to a range of host irqs.
5656

5757
For more details on TISCI IRQ resource management refer:
58-
http://downloads.ti.com/tisci/esd/latest/2_tisci_msgs/rm/rm_irq.html
58+
https://downloads.ti.com/tisci/esd/latest/2_tisci_msgs/rm/rm_irq.html
5959

6060
Example:
6161
--------

Documentation/devicetree/bindings/soc/ti/k3-ringacc.txt

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/soc/ti/k3-ringacc.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: Texas Instruments K3 NavigatorSS Ring Accelerator
9+
10+
maintainers:
11+
- Santosh Shilimkar <[email protected]>
12+
- Grygorii Strashko <[email protected]>
13+
14+
description: |
15+
The Ring Accelerator (RA) is a machine which converts read/write accesses
16+
from/to a constant address into corresponding read/write accesses from/to a
17+
circular data structure in memory. The RA eliminates the need for each DMA
18+
controller which needs to access ring elements from having to know the current
19+
state of the ring (base address, current offset). The DMA controller
20+
performs a read or write access to a specific address range (which maps to the
21+
source interface on the RA) and the RA replaces the address for the transaction
22+
with a new address which corresponds to the head or tail element of the ring
23+
(head for reads, tail for writes).
24+
25+
The Ring Accelerator is a hardware module that is responsible for accelerating
26+
management of the packet queues. The K3 SoCs can have more than one RA instances
27+
28+
properties:
29+
compatible:
30+
items:
31+
- const: ti,am654-navss-ringacc
32+
33+
reg:
34+
items:
35+
- description: real time registers regions
36+
- description: fifos registers regions
37+
- description: proxy gcfg registers regions
38+
- description: proxy target registers regions
39+
40+
reg-names:
41+
items:
42+
- const: rt
43+
- const: fifos
44+
- const: proxy_gcfg
45+
- const: proxy_target
46+
47+
msi-parent: true
48+
49+
ti,num-rings:
50+
$ref: /schemas/types.yaml#/definitions/uint32
51+
description: Number of rings supported by RA
52+
53+
ti,sci-rm-range-gp-rings:
54+
$ref: /schemas/types.yaml#/definitions/uint32
55+
description: TI-SCI RM subtype for GP ring range
56+
57+
ti,sci:
58+
$ref: /schemas/types.yaml#definitions/phandle-array
59+
description: phandle on TI-SCI compatible System controller node
60+
61+
ti,sci-dev-id:
62+
$ref: /schemas/types.yaml#/definitions/uint32
63+
description: TI-SCI device id of the ring accelerator
64+
65+
ti,dma-ring-reset-quirk:
66+
$ref: /schemas/types.yaml#definitions/flag
67+
description: |
68+
enable ringacc/udma ring state interoperability issue software w/a
69+
70+
required:
71+
- compatible
72+
- reg
73+
- reg-names
74+
- msi-parent
75+
- ti,num-rings
76+
- ti,sci-rm-range-gp-rings
77+
- ti,sci
78+
- ti,sci-dev-id
79+
80+
additionalProperties: false
81+
82+
examples:
83+
- |
84+
bus {
85+
#address-cells = <2>;
86+
#size-cells = <2>;
87+
88+
ringacc: ringacc@3c000000 {
89+
compatible = "ti,am654-navss-ringacc";
90+
reg = <0x0 0x3c000000 0x0 0x400000>,
91+
<0x0 0x38000000 0x0 0x400000>,
92+
<0x0 0x31120000 0x0 0x100>,
93+
<0x0 0x33000000 0x0 0x40000>;
94+
reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
95+
ti,num-rings = <818>;
96+
ti,sci-rm-range-gp-rings = <0x2>; /* GP ring range */
97+
ti,dma-ring-reset-quirk;
98+
ti,sci = <&dmsc>;
99+
ti,sci-dev-id = <187>;
100+
msi-parent = <&inta_main_udmass>;
101+
};
102+
};

drivers/dma/ti/k3-udma-glue.c

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -271,20 +271,12 @@ struct k3_udma_glue_tx_channel *k3_udma_glue_request_tx_chn(struct device *dev,
271271
atomic_set(&tx_chn->free_pkts, cfg->txcq_cfg.size);
272272

273273
/* request and cfg rings */
274-
tx_chn->ringtx = k3_ringacc_request_ring(tx_chn->common.ringacc,
275-
tx_chn->udma_tchan_id, 0);
276-
if (!tx_chn->ringtx) {
277-
ret = -ENODEV;
278-
dev_err(dev, "Failed to get TX ring %u\n",
279-
tx_chn->udma_tchan_id);
280-
goto err;
281-
}
282-
283-
tx_chn->ringtxcq = k3_ringacc_request_ring(tx_chn->common.ringacc,
284-
-1, 0);
285-
if (!tx_chn->ringtxcq) {
286-
ret = -ENODEV;
287-
dev_err(dev, "Failed to get TXCQ ring\n");
274+
ret = k3_ringacc_request_rings_pair(tx_chn->common.ringacc,
275+
tx_chn->udma_tchan_id, -1,
276+
&tx_chn->ringtx,
277+
&tx_chn->ringtxcq);
278+
if (ret) {
279+
dev_err(dev, "Failed to get TX/TXCQ rings %d\n", ret);
288280
goto err;
289281
}
290282

@@ -587,22 +579,16 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
587579
}
588580

589581
/* request and cfg rings */
590-
flow->ringrx = k3_ringacc_request_ring(rx_chn->common.ringacc,
591-
flow_cfg->ring_rxq_id, 0);
592-
if (!flow->ringrx) {
593-
ret = -ENODEV;
594-
dev_err(dev, "Failed to get RX ring\n");
582+
ret = k3_ringacc_request_rings_pair(rx_chn->common.ringacc,
583+
flow_cfg->ring_rxq_id,
584+
flow_cfg->ring_rxfdq0_id,
585+
&flow->ringrxfdq,
586+
&flow->ringrx);
587+
if (ret) {
588+
dev_err(dev, "Failed to get RX/RXFDQ rings %d\n", ret);
595589
goto err_rflow_put;
596590
}
597591

598-
flow->ringrxfdq = k3_ringacc_request_ring(rx_chn->common.ringacc,
599-
flow_cfg->ring_rxfdq0_id, 0);
600-
if (!flow->ringrxfdq) {
601-
ret = -ENODEV;
602-
dev_err(dev, "Failed to get RXFDQ ring\n");
603-
goto err_ringrx_free;
604-
}
605-
606592
ret = k3_ringacc_ring_cfg(flow->ringrx, &flow_cfg->rx_cfg);
607593
if (ret) {
608594
dev_err(dev, "Failed to cfg ringrx %d\n", ret);
@@ -673,8 +659,6 @@ static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
673659

674660
err_ringrxfdq_free:
675661
k3_ringacc_ring_free(flow->ringrxfdq);
676-
677-
err_ringrx_free:
678662
k3_ringacc_ring_free(flow->ringrx);
679663

680664
err_rflow_put:

drivers/dma/ti/k3-udma.c

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,17 +1418,12 @@ static int udma_alloc_tx_resources(struct udma_chan *uc)
14181418
if (ret)
14191419
return ret;
14201420

1421-
uc->tchan->t_ring = k3_ringacc_request_ring(ud->ringacc,
1422-
uc->tchan->id, 0);
1423-
if (!uc->tchan->t_ring) {
1424-
ret = -EBUSY;
1425-
goto err_tx_ring;
1426-
}
1427-
1428-
uc->tchan->tc_ring = k3_ringacc_request_ring(ud->ringacc, -1, 0);
1429-
if (!uc->tchan->tc_ring) {
1421+
ret = k3_ringacc_request_rings_pair(ud->ringacc, uc->tchan->id, -1,
1422+
&uc->tchan->t_ring,
1423+
&uc->tchan->tc_ring);
1424+
if (ret) {
14301425
ret = -EBUSY;
1431-
goto err_txc_ring;
1426+
goto err_ring;
14321427
}
14331428

14341429
memset(&ring_cfg, 0, sizeof(ring_cfg));
@@ -1447,10 +1442,9 @@ static int udma_alloc_tx_resources(struct udma_chan *uc)
14471442
err_ringcfg:
14481443
k3_ringacc_ring_free(uc->tchan->tc_ring);
14491444
uc->tchan->tc_ring = NULL;
1450-
err_txc_ring:
14511445
k3_ringacc_ring_free(uc->tchan->t_ring);
14521446
uc->tchan->t_ring = NULL;
1453-
err_tx_ring:
1447+
err_ring:
14541448
udma_put_tchan(uc);
14551449

14561450
return ret;
@@ -1499,16 +1493,11 @@ static int udma_alloc_rx_resources(struct udma_chan *uc)
14991493

15001494
rflow = uc->rflow;
15011495
fd_ring_id = ud->tchan_cnt + ud->echan_cnt + uc->rchan->id;
1502-
rflow->fd_ring = k3_ringacc_request_ring(ud->ringacc, fd_ring_id, 0);
1503-
if (!rflow->fd_ring) {
1504-
ret = -EBUSY;
1505-
goto err_rx_ring;
1506-
}
1507-
1508-
rflow->r_ring = k3_ringacc_request_ring(ud->ringacc, -1, 0);
1509-
if (!rflow->r_ring) {
1496+
ret = k3_ringacc_request_rings_pair(ud->ringacc, fd_ring_id, -1,
1497+
&rflow->fd_ring, &rflow->r_ring);
1498+
if (ret) {
15101499
ret = -EBUSY;
1511-
goto err_rxc_ring;
1500+
goto err_ring;
15121501
}
15131502

15141503
memset(&ring_cfg, 0, sizeof(ring_cfg));
@@ -1533,10 +1522,9 @@ static int udma_alloc_rx_resources(struct udma_chan *uc)
15331522
err_ringcfg:
15341523
k3_ringacc_ring_free(rflow->r_ring);
15351524
rflow->r_ring = NULL;
1536-
err_rxc_ring:
15371525
k3_ringacc_ring_free(rflow->fd_ring);
15381526
rflow->fd_ring = NULL;
1539-
err_rx_ring:
1527+
err_ring:
15401528
udma_put_rflow(uc);
15411529
err_rflow:
15421530
udma_put_rchan(uc);

drivers/firmware/ti_sci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Texas Instruments System Control Interface Protocol Driver
44
*
5-
* Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
5+
* Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
66
* Nishanth Menon
77
*/
88

drivers/firmware/ti_sci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* The system works in a message response protocol
77
* See: http://processors.wiki.ti.com/index.php/TISCI for details
88
*
9-
* Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
9+
* Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
1010
*/
1111

1212
#ifndef __TI_SCI_H

drivers/irqchip/irq-ti-sci-inta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Texas Instruments' K3 Interrupt Aggregator irqchip driver
44
*
5-
* Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
5+
* Copyright (C) 2018-2019 Texas Instruments Incorporated - https://www.ti.com/
66
* Lokesh Vutla <[email protected]>
77
*/
88

drivers/irqchip/irq-ti-sci-intr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Texas Instruments' K3 Interrupt Router irqchip driver
44
*
5-
* Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
5+
* Copyright (C) 2018-2019 Texas Instruments Incorporated - https://www.ti.com/
66
* Lokesh Vutla <[email protected]>
77
*/
88

drivers/reset/reset-ti-sci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Texas Instrument's System Control Interface (TI-SCI) reset driver
33
*
4-
* Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
4+
* Copyright (C) 2015-2017 Texas Instruments Incorporated - https://www.ti.com/
55
* Andrew F. Davis <[email protected]>
66
*
77
* This program is free software; you can redistribute it and/or modify

0 commit comments

Comments
 (0)