Hi All,
The following is a v2 version of the series [1] that adds the platform driver
for the Programmable Real-Time Unit and Industrial Communication Subsystem
(PRU-ICSS), which is present on various TI SoCs. Please see the v1
cover-letter [1] for details about the features of this subsystem.
Please see the individual patches for exact changes in each patch, following are
the main changes from v1:
- dt-bindings was updated regarding to Rob Herring comments;
- support for K3 J721E SoCs ICSSG was enabled in patch #7.
[1] https://patchwork.kernel.org/cover/11690777/
Best regards,
Grzegorz
Grzegorz Jaszczyk (1):
dt-bindings: soc: ti: Add TI PRUSS bindings
Suman Anna (6):
soc: ti: pruss: Add a platform driver for PRUSS in TI SoCs
soc: ti: pruss: Add support for PRU-ICSSs on AM437x SoCs
soc: ti: pruss: Add support for PRU-ICSS subsystems on AM57xx SoCs
soc: ti: pruss: Add support for PRU-ICSS subsystems on 66AK2G SoC
soc: ti: pruss: Enable support for ICSSG subsystems on K3 AM65x SoCs
soc: ti: pruss: Enable support for ICSSG subsystems on K3 J721E SoCs
.../devicetree/bindings/soc/ti/ti,pruss.yaml | 320 +++++++++++++++++++++
drivers/soc/ti/Kconfig | 11 +
drivers/soc/ti/Makefile | 1 +
drivers/soc/ti/pruss.c | 184 ++++++++++++
include/linux/pruss_driver.h | 48 ++++
5 files changed, 564 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
create mode 100644 drivers/soc/ti/pruss.c
create mode 100644 include/linux/pruss_driver.h
--
2.7.4
This patch adds the bindings for the Programmable Real-Time Unit
and Industrial Communication Subsystem (PRU-ICSS) present on various
TI SoCs. The IP is present on multiple TI SoC architecture families
including the OMAP architecture SoCs such as AM33xx, AM437x and
AM57xx; and on a Keystone 2 architecture based 66AK2G SoC. It is
also present on the Davinci based OMAPL138 SoCs and K3 architecture
based AM65x and J721E SoCs as well.
The IP has a number of sub-modules some of which are represented as
their own devices. This binding covers only the top-level sub-system
devices, and some sub-modules like MDIO, MII_RT (Ethernet MII_RT module
with MII ports) and IEP (Industrial Ethernet Peripheral). The remaining
sub-modules bindings shall be defined in the respective driver
subsystem bindings folders. Couple of full examples have also been
added demonstrating the devices on AM335x and AM437x SoCs.
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1-v2 (requested by Rob):
- Add unit address pattern for all sub-nodes.
- Add "additionalProperties: false" to all sub-nodes and entire
description. This allow to catch and fix some issues like missing
"#address-cells" property description.
- Drop ranges description.
- Fix compatible name in example binding for AM43xx.
- Drop the *.yaml references from description as they are not merged yet
and therefore they can't be converted to $ref.
- Drop reviewed-by tag due to introduced changes.
---
.../devicetree/bindings/soc/ti/ti,pruss.yaml | 320 +++++++++++++++++++++
1 file changed, 320 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
new file mode 100644
index 0000000..a13e4df
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
@@ -0,0 +1,320 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/ti/ti,pruss.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: |+
+ TI Programmable Real-Time Unit and Industrial Communication Subsystem
+
+maintainers:
+ - Suman Anna <[email protected]>
+
+description: |+
+
+ The Programmable Real-Time Unit and Industrial Communication Subsystem
+ (PRU-ICSS a.k.a. PRUSS) is present on various TI SoCs such as AM335x, AM437x,
+ Keystone 66AK2G, OMAP-L138/DA850 etc. A PRUSS consists of dual 32-bit RISC
+ cores (Programmable Real-Time Units, or PRUs), shared RAM, data and
+ instruction RAMs, some internal peripheral modules to facilitate industrial
+ communication, and an interrupt controller.
+
+ The programmable nature of the PRUs provide flexibility to implement custom
+ peripheral interfaces, fast real-time responses, or specialized data handling.
+ The common peripheral modules include the following,
+ - an Ethernet MII_RT module with two MII ports
+ - an MDIO port to control external Ethernet PHYs
+ - an Industrial Ethernet Peripheral (IEP) to manage/generate Industrial
+ Ethernet functions
+ - an Enhanced Capture Module (eCAP)
+ - an Industrial Ethernet Timer with 7/9 capture and 16 compare events
+ - a 16550-compatible UART to support PROFIBUS
+ - Enhanced GPIO with async capture and serial support
+
+ A PRU-ICSS subsystem can have up to three shared data memories. A PRU core
+ acts on a primary Data RAM (there are usually 2 Data RAMs) at its address
+ 0x0, but also has access to a secondary Data RAM (primary to the other PRU
+ core) at its address 0x2000. A shared Data RAM, if present, can be accessed
+ by both the PRU cores. The Interrupt Controller (INTC) and a CFG module are
+ common to both the PRU cores. Each PRU core also has a private instruction
+ RAM, and specific register spaces for Control and Debug functionalities.
+
+ Various sub-modules within a PRU-ICSS subsystem are represented as individual
+ nodes and are defined using a parent-child hierarchy depending on their
+ integration within the IP and the SoC. These nodes are described in the
+ following sections.
+
+
+ PRU-ICSS Node
+ ==============
+ Each PRU-ICSS instance is represented as its own node with the individual PRU
+ processor cores, the memories node, an INTC node and an MDIO node represented
+ as child nodes within this PRUSS node. This node shall be a child of the
+ corresponding interconnect bus nodes or target-module nodes.
+
+ See ../../mfd/syscon.yaml for generic SysCon binding details.
+
+
+properties:
+ $nodename:
+ pattern: "^(pruss|icssg)@[0-9a-f]+$"
+
+ compatible:
+ enum:
+ - ti,am3356-pruss # for AM335x SoC family
+ - ti,am4376-pruss0 # for AM437x SoC family and PRUSS unit 0
+ - ti,am4376-pruss1 # for AM437x SoC family and PRUSS unit 1
+ - ti,am5728-pruss # for AM57xx SoC family
+ - ti,k2g-pruss # for 66AK2G SoC family
+ - ti,am654-icssg # for K3 AM65x SoC family
+ - ti,j721e-icssg # for K3 J721E SoC family
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 1
+
+ ranges:
+ maxItems: 1
+
+ power-domains:
+ description: |
+ This property is as per sci-pm-domain.txt.
+
+patternProperties:
+
+ memories@[a-f0-9]+$:
+ description: |
+ The various Data RAMs within a single PRU-ICSS unit are represented as a
+ single node with the name 'memories'.
+
+ type: object
+
+ properties:
+ reg:
+ minItems: 2 # On AM437x one of two PRUSS units don't contain Shared RAM.
+ maxItems: 3
+ items:
+ - description: Address and size of the Data RAM0.
+ - description: Address and size of the Data RAM1.
+ - description: |
+ Address and size of the Shared Data RAM. Note that on AM437x one
+ of two PRUSS units don't contain Shared RAM, while the second one
+ has it.
+
+ reg-names:
+ minItems: 2
+ maxItems: 3
+ items:
+ - const: dram0
+ - const: dram1
+ - const: shrdram2
+
+ required:
+ - reg
+ - reg-names
+
+ additionalProperties: false
+
+ cfg@[a-f0-9]+$:
+ description: |
+ PRU-ICSS configuration space. CFG sub-module represented as a SysCon.
+
+ type: object
+
+ properties:
+ compatible:
+ items:
+ - const: ti,pruss-cfg
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ additionalProperties: false
+
+ iep@[a-f0-9]+$:
+ description: |
+ Industrial Ethernet Peripheral to manage/generate Industrial Ethernet
+ functions such as time stamping. Each PRUSS has either 1 IEP (on AM335x,
+ AM437x, AM57xx & 66AK2G SoCs) or 2 IEPs (on K3 AM65x & J721E SoCs ). IEP
+ is used for creating PTP clocks and generating PPS signals.
+
+ type: object
+
+ mii-rt@[a-f0-9]+$:
+ description: |
+ Real-Time Ethernet to support multiple industrial communication protocols.
+ MII-RT sub-module represented as a SysCon.
+
+ type: object
+
+ properties:
+ compatible:
+ items:
+ - const: ti,pruss-mii
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ additionalProperties: false
+
+ mii-g-rt@[a-f0-9]+$:
+ description: |
+ The Real-time Media Independent Interface to support multiple industrial
+ communication protocols (G stands for Gigabit). MII-G-RT sub-module
+ represented as a SysCon.
+
+ type: object
+
+ properties:
+ compatible:
+ items:
+ - const: ti,pruss-mii-g
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ additionalProperties: false
+
+ interrupt-controller@[a-f0-9]+$:
+ description: |
+ PRUSS INTC Node. Each PRUSS has a single interrupt controller instance
+ that is common to all the PRU cores. This should be represented as an
+ interrupt-controller node.
+
+ type: object
+
+ mdio@[a-f0-9]+$:
+ description: |
+ MDIO Node. Each PRUSS has an MDIO module that can be used to control
+ external PHYs. The MDIO module used within the PRU-ICSS is an instance of
+ the MDIO Controller used in TI Davinci SoCs.
+
+ allOf:
+ - $ref: /schemas/net/ti,davinci-mdio.yaml#
+
+ type: object
+
+ "^(pru|rtu|txpru)@[0-9a-f]+$":
+ description: |
+ PRU Node. Each PRUSS has dual PRU cores, each represented as a RemoteProc
+ device through a PRU child node each. Each node can optionally be rendered
+ inactive by using the standard DT string property, "status". The ICSSG IP
+ present on K3 SoCs have additional auxiliary PRU cores with slightly
+ different IP integration.
+
+ type: object
+
+required:
+ - compatible
+ - reg
+ - ranges
+
+additionalProperties: false
+
+# Due to inability of correctly verifying sub-nodes with an @address through
+# the "required" list, the required sub-nodes below are commented out for now.
+
+#required:
+# - memories
+# - interrupt-controller
+# - pru
+
+if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - ti,k2g-pruss
+ - ti,am654-icssg
+ - ti,j721e-icssg
+then:
+ required:
+ - power-domains
+
+examples:
+ - |
+
+ /* Example 1 AM33xx PRU-ICSS */
+ pruss: pruss@0 {
+ compatible = "ti,am3356-pruss";
+ reg = <0x0 0x80000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ pruss_mem: memories@0 {
+ reg = <0x0 0x2000>,
+ <0x2000 0x2000>,
+ <0x10000 0x3000>;
+ reg-names = "dram0", "dram1", "shrdram2";
+ };
+
+ pruss_cfg: cfg@26000 {
+ compatible = "ti,pruss-cfg", "syscon";
+ reg = <0x26000 0x2000>;
+ };
+
+ pruss_mii_rt: mii-rt@32000 {
+ compatible = "ti,pruss-mii", "syscon";
+ reg = <0x32000 0x58>;
+ };
+
+ pruss_mdio: mdio@32400 {
+ compatible = "ti,davinci_mdio";
+ reg = <0x32400 0x90>;
+ clocks = <&dpll_core_m4_ck>;
+ clock-names = "fck";
+ bus_freq = <1000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
+ - |
+
+ /* Example 2 AM43xx PRU-ICSS with PRUSS1 node */
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ pruss1: pruss@0 {
+ compatible = "ti,am4376-pruss1";
+ reg = <0x0 0x40000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ pruss1_mem: memories@0 {
+ reg = <0x0 0x2000>,
+ <0x2000 0x2000>,
+ <0x10000 0x8000>;
+ reg-names = "dram0", "dram1", "shrdram2";
+ };
+
+ pruss1_cfg: cfg@26000 {
+ compatible = "ti,pruss-cfg", "syscon";
+ reg = <0x26000 0x2000>;
+ };
+
+ pruss1_mii_rt: mii-rt@32000 {
+ compatible = "ti,pruss-mii", "syscon";
+ reg = <0x32000 0x58>;
+ };
+
+ pruss1_mdio: mdio@32400 {
+ compatible = "ti,davinci_mdio";
+ reg = <0x32400 0x90>;
+ clocks = <&dpll_core_m4_ck>;
+ clock-names = "fck";
+ bus_freq = <1000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
+...
--
2.7.4
From: Suman Anna <[email protected]>
The AM57xx family of SoCs supports two PRU-ICSS instances, each of
which has two PRU processor cores. The two PRU-ICSS instances are
identical to each other, and are very similar to the PRU-ICSS1 of
AM33xx/AM43xx except for a few minor differences like the RAM sizes
and the number of interrupts coming into the MPU INTC. They do
not have a programmable module reset line unlike those present on
AM33xx/AM43xx SoCs. The modules are reset just like any other IP
with the SoC's global cold/warm resets. Each PRU-ICSS's INTC is also
preceded by a Crossbar that enables multiple external events to be
routed to a specific number of input interrupt events. Any interrupt
event directed towards PRUSS needs this crossbar to be setup properly
on the firmware side.
The existing PRUSS platform driver has been enhanced to support
these AM57xx PRU-ICSS instances through new AM57xx specific
compatible for properly probing and booting all the different PRU
cores in each PRU-ICSS processor subsystem. A build dependency with
SOC_DRA7XX is also added to enable the driver to be built in
AM57xx-only configuration (there is no separate Kconfig option
for AM57xx vs DRA7xx).
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1->v2:
- No changes.
---
drivers/soc/ti/Kconfig | 2 +-
drivers/soc/ti/pruss.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index 40d6a22..99dbc14 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -103,7 +103,7 @@ config TI_K3_SOCINFO
config TI_PRUSS
tristate "TI PRU-ICSS Subsystem Platform drivers"
- depends on SOC_AM33XX || SOC_AM43XX
+ depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX
select MFD_SYSCON
help
TI PRU-ICSS Subsystem platform specific support.
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index 04938ba..5df4caa 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -161,6 +161,7 @@ static const struct of_device_id pruss_of_match[] = {
{ .compatible = "ti,am3356-pruss" },
{ .compatible = "ti,am4376-pruss0", .data = &am437x_pruss0_data, },
{ .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, },
+ { .compatible = "ti,am5728-pruss" },
{},
};
MODULE_DEVICE_TABLE(of, pruss_of_match);
--
2.7.4
From: Suman Anna <[email protected]>
The 66AK2G SoC supports two PRU-ICSS instances, named PRUSS0 and PRUSS1,
each of which has two PRU processor cores. The two PRU-ICSS instances
are identical to each other with few minor SoC integration differences,
and are very similar to the PRU-ICSS1 of AM57xx/AM43xx. The Shared Data
RAM size is larger and the number of interrupts coming into MPU INTC
is like the instances on AM437x. There are also few other differences
attributing to integration in Keystone architecture (like no SYSCFG
register or PRCM handshake protocols). Other IP level differences
include different constant table, differences in system event interrupt
input sources etc. They also do not have a programmable module reset
line like those present on AM33xx/AM43xx SoCs. The modules are reset
just like any other IP with the SoC's global cold/warm resets.
The existing PRUSS platform driver has been enhanced to support these
66AK2G PRU-ICSS instances through new 66AK2G specific compatible for
properly probing and booting all the different PRU cores in each
PRU-ICSS processor subsystem. A build dependency with ARCH_KEYSTONE
is added to enable the driver to be built in K2G-only configuration.
Signed-off-by: Andrew F. Davis <[email protected]>
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1->v2:
- No changes.
---
drivers/soc/ti/Kconfig | 2 +-
drivers/soc/ti/pruss.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index 99dbc14..c290343 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -103,7 +103,7 @@ config TI_K3_SOCINFO
config TI_PRUSS
tristate "TI PRU-ICSS Subsystem Platform drivers"
- depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX
+ depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE
select MFD_SYSCON
help
TI PRU-ICSS Subsystem platform specific support.
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index 5df4caa..d5f128e 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -162,6 +162,7 @@ static const struct of_device_id pruss_of_match[] = {
{ .compatible = "ti,am4376-pruss0", .data = &am437x_pruss0_data, },
{ .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, },
{ .compatible = "ti,am5728-pruss" },
+ { .compatible = "ti,k2g-pruss" },
{},
};
MODULE_DEVICE_TABLE(of, pruss_of_match);
--
2.7.4
From: Suman Anna <[email protected]>
The Programmable Real-Time Unit - Industrial Communication
Subsystem (PRU-ICSS) is present on various TI SoCs such as
AM335x or AM437x or the Keystone 66AK2G. Each SoC can have
one or more PRUSS instances that may or may not be identical.
For example, AM335x SoCs have a single PRUSS, while AM437x has
two PRUSS instances PRUSS1 and PRUSS0, with the PRUSS0 being
a cut-down version of the PRUSS1.
The PRUSS consists of dual 32-bit RISC cores called the
Programmable Real-Time Units (PRUs), some shared, data and
instruction memories, some internal peripheral modules, and
an interrupt controller. The programmable nature of the PRUs
provide flexibility to implement custom peripheral interfaces,
fast real-time responses, or specialized data handling.
The PRU-ICSS functionality is achieved through three different
platform drivers addressing a specific portion of the PRUSS.
Some sub-modules of the PRU-ICSS IP reuse some of the existing
drivers (like davinci mdio driver or the generic syscon driver).
This design provides flexibility in representing the different
modules of PRUSS accordingly, and at the same time allowing the
PRUSS driver to add some instance specific configuration within
an SoC.
The PRUSS platform driver deals with the overall PRUSS and is
used for managing the subsystem level resources like various
memories and the CFG module. It is responsible for the creation
and deletion of the platform devices for the child PRU devices
and other child devices (like Interrupt Controller, MDIO node
and some syscon nodes) so that they can be managed by specific
platform drivers. The PRUSS interrupt controller is managed by
an irqchip driver, while the individual PRU RISC cores are
managed by a PRU remoteproc driver.
The driver currently supports the AM335x SoC, and support for
other TI SoCs will be added in subsequent patches.
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Andrew F. Davis <[email protected]>
Signed-off-by: Tero Kristo <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1->v2:
- No changes.
---
drivers/soc/ti/Kconfig | 11 ++++
drivers/soc/ti/Makefile | 1 +
drivers/soc/ti/pruss.c | 147 +++++++++++++++++++++++++++++++++++++++++++
include/linux/pruss_driver.h | 48 ++++++++++++++
4 files changed, 207 insertions(+)
create mode 100644 drivers/soc/ti/pruss.c
create mode 100644 include/linux/pruss_driver.h
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index e192fb7..b934bc3 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -101,6 +101,17 @@ config TI_K3_SOCINFO
platforms to provide information about the SoC family and
variant to user space.
+config TI_PRUSS
+ tristate "TI PRU-ICSS Subsystem Platform drivers"
+ depends on SOC_AM33XX
+ select MFD_SYSCON
+ help
+ TI PRU-ICSS Subsystem platform specific support.
+
+ Say Y or M here to support the Programmable Realtime Unit (PRU)
+ processors on various TI SoCs. It's safe to say N here if you're
+ not interested in the PRU or if you are unsure.
+
endif # SOC_TI
config TI_SCI_INTA_MSI_DOMAIN
diff --git a/drivers/soc/ti/Makefile b/drivers/soc/ti/Makefile
index 1110e5c..18129aa 100644
--- a/drivers/soc/ti/Makefile
+++ b/drivers/soc/ti/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_TI_SCI_PM_DOMAINS) += ti_sci_pm_domains.o
obj-$(CONFIG_TI_SCI_INTA_MSI_DOMAIN) += ti_sci_inta_msi.o
obj-$(CONFIG_TI_K3_RINGACC) += k3-ringacc.o
obj-$(CONFIG_TI_K3_SOCINFO) += k3-socinfo.o
+obj-$(CONFIG_TI_PRUSS) += pruss.o
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
new file mode 100644
index 0000000..c071bb2
--- /dev/null
+++ b/drivers/soc/ti/pruss.c
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * PRU-ICSS platform driver for various TI SoCs
+ *
+ * Copyright (C) 2014-2020 Texas Instruments Incorporated - http://www.ti.com/
+ * Author(s):
+ * Suman Anna <[email protected]>
+ * Andrew F. Davis <[email protected]>
+ */
+
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/of_address.h>
+#include <linux/of_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/pruss_driver.h>
+
+static int pruss_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct device_node *np = dev_of_node(dev);
+ struct device_node *child;
+ struct pruss *pruss;
+ struct resource res;
+ int ret, i, index;
+ const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
+
+ ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+ if (ret) {
+ dev_err(dev, "failed to set the DMA coherent mask");
+ return ret;
+ }
+
+ pruss = devm_kzalloc(dev, sizeof(*pruss), GFP_KERNEL);
+ if (!pruss)
+ return -ENOMEM;
+
+ pruss->dev = dev;
+
+ child = of_get_child_by_name(np, "memories");
+ if (!child) {
+ dev_err(dev, "%pOF is missing its 'memories' node\n", child);
+ return -ENODEV;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(mem_names); i++) {
+ index = of_property_match_string(child, "reg-names",
+ mem_names[i]);
+ if (index < 0) {
+ of_node_put(child);
+ return index;
+ }
+
+ if (of_address_to_resource(child, index, &res)) {
+ of_node_put(child);
+ return -EINVAL;
+ }
+
+ pruss->mem_regions[i].va = devm_ioremap(dev, res.start,
+ resource_size(&res));
+ if (!pruss->mem_regions[i].va) {
+ dev_err(dev, "failed to parse and map memory resource %d %s\n",
+ i, mem_names[i]);
+ of_node_put(child);
+ return -ENOMEM;
+ }
+ pruss->mem_regions[i].pa = res.start;
+ pruss->mem_regions[i].size = resource_size(&res);
+
+ dev_dbg(dev, "memory %8s: pa %pa size 0x%zx va %pK\n",
+ mem_names[i], &pruss->mem_regions[i].pa,
+ pruss->mem_regions[i].size, pruss->mem_regions[i].va);
+ }
+ of_node_put(child);
+
+ platform_set_drvdata(pdev, pruss);
+
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0) {
+ dev_err(dev, "couldn't enable module\n");
+ pm_runtime_put_noidle(dev);
+ goto rpm_disable;
+ }
+
+ child = of_get_child_by_name(np, "cfg");
+ if (!child) {
+ dev_err(dev, "%pOF is missing its 'cfg' node\n", child);
+ ret = -ENODEV;
+ goto rpm_put;
+ }
+
+ pruss->cfg_regmap = syscon_node_to_regmap(child);
+ of_node_put(child);
+ if (IS_ERR(pruss->cfg_regmap)) {
+ ret = -ENODEV;
+ goto rpm_put;
+ }
+
+ ret = devm_of_platform_populate(dev);
+ if (ret) {
+ dev_err(dev, "failed to register child devices\n");
+ goto rpm_put;
+ }
+
+ return 0;
+
+rpm_put:
+ pm_runtime_put_sync(dev);
+rpm_disable:
+ pm_runtime_disable(dev);
+ return ret;
+}
+
+static int pruss_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+
+ devm_of_platform_depopulate(dev);
+
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+
+ return 0;
+}
+
+static const struct of_device_id pruss_of_match[] = {
+ { .compatible = "ti,am3356-pruss" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, pruss_of_match);
+
+static struct platform_driver pruss_driver = {
+ .driver = {
+ .name = "pruss",
+ .of_match_table = pruss_of_match,
+ },
+ .probe = pruss_probe,
+ .remove = pruss_remove,
+};
+module_platform_driver(pruss_driver);
+
+MODULE_AUTHOR("Suman Anna <[email protected]>");
+MODULE_DESCRIPTION("PRU-ICSS Subsystem Driver");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/pruss_driver.h b/include/linux/pruss_driver.h
new file mode 100644
index 0000000..0701fe1
--- /dev/null
+++ b/include/linux/pruss_driver.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * PRU-ICSS sub-system specific definitions
+ *
+ * Copyright (C) 2014-2020 Texas Instruments Incorporated - http://www.ti.com/
+ * Suman Anna <[email protected]>
+ */
+
+#ifndef _PRUSS_DRIVER_H_
+#define _PRUSS_DRIVER_H_
+
+#include <linux/types.h>
+
+/*
+ * enum pruss_mem - PRUSS memory range identifiers
+ */
+enum pruss_mem {
+ PRUSS_MEM_DRAM0 = 0,
+ PRUSS_MEM_DRAM1,
+ PRUSS_MEM_SHRD_RAM2,
+ PRUSS_MEM_MAX,
+};
+
+/**
+ * struct pruss_mem_region - PRUSS memory region structure
+ * @va: kernel virtual address of the PRUSS memory region
+ * @pa: physical (bus) address of the PRUSS memory region
+ * @size: size of the PRUSS memory region
+ */
+struct pruss_mem_region {
+ void __iomem *va;
+ phys_addr_t pa;
+ size_t size;
+};
+
+/**
+ * struct pruss - PRUSS parent structure
+ * @dev: pruss device pointer
+ * @cfg_regmap: regmap for config region
+ * @mem_regions: data for each of the PRUSS memory regions
+ */
+struct pruss {
+ struct device *dev;
+ struct regmap *cfg_regmap;
+ struct pruss_mem_region mem_regions[PRUSS_MEM_MAX];
+};
+
+#endif /* _PRUSS_DRIVER_H_ */
--
2.7.4
From: Suman Anna <[email protected]>
The AM437x SoCs have two different PRU-ICSS subsystems: PRU-ICSS1
and a smaller PRU-ICSS0. Enhance the PRUSS platform driver to support
both the PRU-ICSS sub-systems on these SoCs.
The PRU-ICSS1 on AM437x is very similar to the PRU-ICSS on AM33xx
except for few minor differences - increased Instruction RAM, increased
Shared Data RAM2, and 1 less interrupt (PRUSS host interrupt 7 which is
redirected to the other PRUSS) towards the MPU INTC. The PRU-ICSS0 is
a cut-down version of the IP, with less DRAM per PRU, no Shared DRAM etc.
It also does not have direct access to L3 bus regions, there is a single
interface to L3 for both PRUSS0 and PRUSS1, and it would have to go
through the PRUSS1's interface. The PRUSS_SYSCFG register is reserved on
PRUSS0, so any external access requires the programming the corresponding
PRUSS_SYSCFG register in PRUSS1. It does have its own dedicated I/O lines
though. Note that this instance does not support any PRU Ethernet related
use cases.
The adaptation uses SoC-specific compatibles in the driver and uses
a newly introduced pruss_match_private_data structure and the
pruss_get_private_data() function to retrieve a PRUSS instance specific
data using a device-name based lookup logic. The reset and the L3 external
access are managed by the parent interconnect ti-sysc bus driver so that
PRUSS1 and PRUSS0 can be independently supported.
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Andrew F. Davis <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1->v2:
- No changes.
---
drivers/soc/ti/Kconfig | 2 +-
drivers/soc/ti/pruss.c | 35 ++++++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index b934bc3..40d6a22 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -103,7 +103,7 @@ config TI_K3_SOCINFO
config TI_PRUSS
tristate "TI PRU-ICSS Subsystem Platform drivers"
- depends on SOC_AM33XX
+ depends on SOC_AM33XX || SOC_AM43XX
select MFD_SYSCON
help
TI PRU-ICSS Subsystem platform specific support.
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index c071bb2..04938ba 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -17,6 +17,14 @@
#include <linux/pm_runtime.h>
#include <linux/pruss_driver.h>
+/**
+ * struct pruss_private_data - PRUSS driver private data
+ * @has_no_sharedram: flag to indicate the absence of PRUSS Shared Data RAM
+ */
+struct pruss_private_data {
+ bool has_no_sharedram;
+};
+
static int pruss_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -25,8 +33,15 @@ static int pruss_probe(struct platform_device *pdev)
struct pruss *pruss;
struct resource res;
int ret, i, index;
+ const struct pruss_private_data *data;
const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
+ data = of_device_get_match_data(&pdev->dev);
+ if (IS_ERR(data)) {
+ dev_err(dev, "missing private data\n");
+ return -ENODEV;
+ }
+
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
if (ret) {
dev_err(dev, "failed to set the DMA coherent mask");
@@ -45,7 +60,14 @@ static int pruss_probe(struct platform_device *pdev)
return -ENODEV;
}
- for (i = 0; i < ARRAY_SIZE(mem_names); i++) {
+ for (i = 0; i < PRUSS_MEM_MAX; i++) {
+ /*
+ * On AM437x one of two PRUSS units don't contain Shared RAM,
+ * skip it
+ */
+ if (data && data->has_no_sharedram && i == PRUSS_MEM_SHRD_RAM2)
+ continue;
+
index = of_property_match_string(child, "reg-names",
mem_names[i]);
if (index < 0) {
@@ -126,8 +148,19 @@ static int pruss_remove(struct platform_device *pdev)
return 0;
}
+/* instance-specific driver private data */
+static const struct pruss_private_data am437x_pruss1_data = {
+ .has_no_sharedram = false,
+};
+
+static const struct pruss_private_data am437x_pruss0_data = {
+ .has_no_sharedram = true,
+};
+
static const struct of_device_id pruss_of_match[] = {
{ .compatible = "ti,am3356-pruss" },
+ { .compatible = "ti,am4376-pruss0", .data = &am437x_pruss0_data, },
+ { .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, },
{},
};
MODULE_DEVICE_TABLE(of, pruss_of_match);
--
2.7.4
From: Suman Anna <[email protected]>
The K3 AM65x family of SoCs have the next generation of the PRU-ICSS
processor subsystem capable of supporting Gigabit Ethernet, and is
commonly referred to as ICSSG. These SoCs contain typically three
ICSSG instances named ICSSG0, ICSSG1 and ICSSG2. The three ICSSGs are
identical to each other for the most part with minor SoC integration
differences and capabilities. The ICSSG2 supports slightly enhanced
features like SGMII mode Ethernet, while the ICSS0 and ICSSG1 instances
are limited to MII mode only.
The ICSSGs on K3 AM65x SoCs are in general super-sets of the PRUSS on the
AM57xx/66AK2G SoCs. They include two additional auxiliary PRU cores called
RTUs and few other additional sub-modules. The interrupt integration is
also different on the K3 AM65x SoCs and are propagated through various
SoC-level Interrupt Router and Interrupt Aggregator blocks. Other IP level
differences include different constant tables, differences in system event
interrupt input sources etc. They also do not have a programmable module
reset line like those present on AM33xx/AM43xx SoCs. The modules are reset
just like any other IP with the SoC's global cold/warm resets.
The existing pruss platform driver has been updated to support these new
ICSSG instances through new AM65x specific compatibles. A build dependency
with ARCH_K3 is added to enable building all the existing PRUSS platform
drivers for this ARMv8 platform.
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1->v2:
- No changes.
---
drivers/soc/ti/Kconfig | 2 +-
drivers/soc/ti/pruss.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index c290343..f5b82ff 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -103,7 +103,7 @@ config TI_K3_SOCINFO
config TI_PRUSS
tristate "TI PRU-ICSS Subsystem Platform drivers"
- depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE
+ depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE || ARCH_K3
select MFD_SYSCON
help
TI PRU-ICSS Subsystem platform specific support.
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index d5f128e..ccc9783 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -163,6 +163,7 @@ static const struct of_device_id pruss_of_match[] = {
{ .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, },
{ .compatible = "ti,am5728-pruss" },
{ .compatible = "ti,k2g-pruss" },
+ { .compatible = "ti,am654-icssg" },
{},
};
MODULE_DEVICE_TABLE(of, pruss_of_match);
--
2.7.4
From: Suman Anna <[email protected]>
The K3 J721E family of SoCs have a revised version of the PRU-ICSS (ICSSG)
processor subsystem present on K3 AM65x SoCs. These SoCs contain typically
two ICSSG instances named ICSSG0 and ICSSG1. The two ICSSGs are identical
to each other for the most part with minor SoC integration differences and
capabilities. The ICSSG1 supports slightly enhanced features like SGMII
mode Ethernet, while the ICSSG0 instance is limited to MII mode only.
There is no change in the Interrupt Controller w.r.t AM65x. All other
integration aspects are very similar to the ICSSGs on AM65x SoCs.
The existing pruss platform driver has been updated to support these new
ICSSG instances through new J721E specific compatibles.
Signed-off-by: Suman Anna <[email protected]>
Signed-off-by: Grzegorz Jaszczyk <[email protected]>
---
v1->v2:
- New patch which was not present in v1.
---
drivers/soc/ti/pruss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index ccc9783..37df543 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -164,6 +164,7 @@ static const struct of_device_id pruss_of_match[] = {
{ .compatible = "ti,am5728-pruss" },
{ .compatible = "ti,k2g-pruss" },
{ .compatible = "ti,am654-icssg" },
+ { .compatible = "ti,j721e-icssg" },
{},
};
MODULE_DEVICE_TABLE(of, pruss_of_match);
--
2.7.4
Hi Rob,
On 8/21/20 9:42 AM, Grzegorz Jaszczyk wrote:
> This patch adds the bindings for the Programmable Real-Time Unit
> and Industrial Communication Subsystem (PRU-ICSS) present on various
> TI SoCs. The IP is present on multiple TI SoC architecture families
> including the OMAP architecture SoCs such as AM33xx, AM437x and
> AM57xx; and on a Keystone 2 architecture based 66AK2G SoC. It is
> also present on the Davinci based OMAPL138 SoCs and K3 architecture
> based AM65x and J721E SoCs as well.
>
> The IP has a number of sub-modules some of which are represented as
> their own devices. This binding covers only the top-level sub-system
> devices, and some sub-modules like MDIO, MII_RT (Ethernet MII_RT module
> with MII ports) and IEP (Industrial Ethernet Peripheral). The remaining
> sub-modules bindings shall be defined in the respective driver
> subsystem bindings folders. Couple of full examples have also been
> added demonstrating the devices on AM335x and AM437x SoCs.
>
> Signed-off-by: Suman Anna <[email protected]>
> Signed-off-by: Roger Quadros <[email protected]>
> Signed-off-by: Grzegorz Jaszczyk <[email protected]>
> ---
> v1-v2 (requested by Rob):
> - Add unit address pattern for all sub-nodes.
> - Add "additionalProperties: false" to all sub-nodes and entire
> description. This allow to catch and fix some issues like missing
> "#address-cells" property description.
> - Drop ranges description.
> - Fix compatible name in example binding for AM43xx.
> - Drop the *.yaml references from description as they are not merged yet
> and therefore they can't be converted to $ref.
> - Drop reviewed-by tag due to introduced changes.
Any comments on this fixed up version, Greg has addressed all your comments?
Also appreciate it if you can review an add-on patch on this very same binding
while at this,
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]/
regards
Suman
> ---
> .../devicetree/bindings/soc/ti/ti,pruss.yaml | 320 +++++++++++++++++++++
> 1 file changed, 320 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
>
> diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
> new file mode 100644
> index 0000000..a13e4df
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
> @@ -0,0 +1,320 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/ti/ti,pruss.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: |+
> + TI Programmable Real-Time Unit and Industrial Communication Subsystem
> +
> +maintainers:
> + - Suman Anna <[email protected]>
> +
> +description: |+
> +
> + The Programmable Real-Time Unit and Industrial Communication Subsystem
> + (PRU-ICSS a.k.a. PRUSS) is present on various TI SoCs such as AM335x, AM437x,
> + Keystone 66AK2G, OMAP-L138/DA850 etc. A PRUSS consists of dual 32-bit RISC
> + cores (Programmable Real-Time Units, or PRUs), shared RAM, data and
> + instruction RAMs, some internal peripheral modules to facilitate industrial
> + communication, and an interrupt controller.
> +
> + The programmable nature of the PRUs provide flexibility to implement custom
> + peripheral interfaces, fast real-time responses, or specialized data handling.
> + The common peripheral modules include the following,
> + - an Ethernet MII_RT module with two MII ports
> + - an MDIO port to control external Ethernet PHYs
> + - an Industrial Ethernet Peripheral (IEP) to manage/generate Industrial
> + Ethernet functions
> + - an Enhanced Capture Module (eCAP)
> + - an Industrial Ethernet Timer with 7/9 capture and 16 compare events
> + - a 16550-compatible UART to support PROFIBUS
> + - Enhanced GPIO with async capture and serial support
> +
> + A PRU-ICSS subsystem can have up to three shared data memories. A PRU core
> + acts on a primary Data RAM (there are usually 2 Data RAMs) at its address
> + 0x0, but also has access to a secondary Data RAM (primary to the other PRU
> + core) at its address 0x2000. A shared Data RAM, if present, can be accessed
> + by both the PRU cores. The Interrupt Controller (INTC) and a CFG module are
> + common to both the PRU cores. Each PRU core also has a private instruction
> + RAM, and specific register spaces for Control and Debug functionalities.
> +
> + Various sub-modules within a PRU-ICSS subsystem are represented as individual
> + nodes and are defined using a parent-child hierarchy depending on their
> + integration within the IP and the SoC. These nodes are described in the
> + following sections.
> +
> +
> + PRU-ICSS Node
> + ==============
> + Each PRU-ICSS instance is represented as its own node with the individual PRU
> + processor cores, the memories node, an INTC node and an MDIO node represented
> + as child nodes within this PRUSS node. This node shall be a child of the
> + corresponding interconnect bus nodes or target-module nodes.
> +
> + See ../../mfd/syscon.yaml for generic SysCon binding details.
> +
> +
> +properties:
> + $nodename:
> + pattern: "^(pruss|icssg)@[0-9a-f]+$"
> +
> + compatible:
> + enum:
> + - ti,am3356-pruss # for AM335x SoC family
> + - ti,am4376-pruss0 # for AM437x SoC family and PRUSS unit 0
> + - ti,am4376-pruss1 # for AM437x SoC family and PRUSS unit 1
> + - ti,am5728-pruss # for AM57xx SoC family
> + - ti,k2g-pruss # for 66AK2G SoC family
> + - ti,am654-icssg # for K3 AM65x SoC family
> + - ti,j721e-icssg # for K3 J721E SoC family
> +
> + reg:
> + maxItems: 1
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 1
> +
> + ranges:
> + maxItems: 1
> +
> + power-domains:
> + description: |
> + This property is as per sci-pm-domain.txt.
> +
> +patternProperties:
> +
> + memories@[a-f0-9]+$:
> + description: |
> + The various Data RAMs within a single PRU-ICSS unit are represented as a
> + single node with the name 'memories'.
> +
> + type: object
> +
> + properties:
> + reg:
> + minItems: 2 # On AM437x one of two PRUSS units don't contain Shared RAM.
> + maxItems: 3
> + items:
> + - description: Address and size of the Data RAM0.
> + - description: Address and size of the Data RAM1.
> + - description: |
> + Address and size of the Shared Data RAM. Note that on AM437x one
> + of two PRUSS units don't contain Shared RAM, while the second one
> + has it.
> +
> + reg-names:
> + minItems: 2
> + maxItems: 3
> + items:
> + - const: dram0
> + - const: dram1
> + - const: shrdram2
> +
> + required:
> + - reg
> + - reg-names
> +
> + additionalProperties: false
> +
> + cfg@[a-f0-9]+$:
> + description: |
> + PRU-ICSS configuration space. CFG sub-module represented as a SysCon.
> +
> + type: object
> +
> + properties:
> + compatible:
> + items:
> + - const: ti,pruss-cfg
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> + additionalProperties: false
> +
> + iep@[a-f0-9]+$:
> + description: |
> + Industrial Ethernet Peripheral to manage/generate Industrial Ethernet
> + functions such as time stamping. Each PRUSS has either 1 IEP (on AM335x,
> + AM437x, AM57xx & 66AK2G SoCs) or 2 IEPs (on K3 AM65x & J721E SoCs ). IEP
> + is used for creating PTP clocks and generating PPS signals.
> +
> + type: object
> +
> + mii-rt@[a-f0-9]+$:
> + description: |
> + Real-Time Ethernet to support multiple industrial communication protocols.
> + MII-RT sub-module represented as a SysCon.
> +
> + type: object
> +
> + properties:
> + compatible:
> + items:
> + - const: ti,pruss-mii
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> + additionalProperties: false
> +
> + mii-g-rt@[a-f0-9]+$:
> + description: |
> + The Real-time Media Independent Interface to support multiple industrial
> + communication protocols (G stands for Gigabit). MII-G-RT sub-module
> + represented as a SysCon.
> +
> + type: object
> +
> + properties:
> + compatible:
> + items:
> + - const: ti,pruss-mii-g
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> + additionalProperties: false
> +
> + interrupt-controller@[a-f0-9]+$:
> + description: |
> + PRUSS INTC Node. Each PRUSS has a single interrupt controller instance
> + that is common to all the PRU cores. This should be represented as an
> + interrupt-controller node.
> +
> + type: object
> +
> + mdio@[a-f0-9]+$:
> + description: |
> + MDIO Node. Each PRUSS has an MDIO module that can be used to control
> + external PHYs. The MDIO module used within the PRU-ICSS is an instance of
> + the MDIO Controller used in TI Davinci SoCs.
> +
> + allOf:
> + - $ref: /schemas/net/ti,davinci-mdio.yaml#
> +
> + type: object
> +
> + "^(pru|rtu|txpru)@[0-9a-f]+$":
> + description: |
> + PRU Node. Each PRUSS has dual PRU cores, each represented as a RemoteProc
> + device through a PRU child node each. Each node can optionally be rendered
> + inactive by using the standard DT string property, "status". The ICSSG IP
> + present on K3 SoCs have additional auxiliary PRU cores with slightly
> + different IP integration.
> +
> + type: object
> +
> +required:
> + - compatible
> + - reg
> + - ranges
> +
> +additionalProperties: false
> +
> +# Due to inability of correctly verifying sub-nodes with an @address through
> +# the "required" list, the required sub-nodes below are commented out for now.
> +
> +#required:
> +# - memories
> +# - interrupt-controller
> +# - pru
> +
> +if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - ti,k2g-pruss
> + - ti,am654-icssg
> + - ti,j721e-icssg
> +then:
> + required:
> + - power-domains
> +
> +examples:
> + - |
> +
> + /* Example 1 AM33xx PRU-ICSS */
> + pruss: pruss@0 {
> + compatible = "ti,am3356-pruss";
> + reg = <0x0 0x80000>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + pruss_mem: memories@0 {
> + reg = <0x0 0x2000>,
> + <0x2000 0x2000>,
> + <0x10000 0x3000>;
> + reg-names = "dram0", "dram1", "shrdram2";
> + };
> +
> + pruss_cfg: cfg@26000 {
> + compatible = "ti,pruss-cfg", "syscon";
> + reg = <0x26000 0x2000>;
> + };
> +
> + pruss_mii_rt: mii-rt@32000 {
> + compatible = "ti,pruss-mii", "syscon";
> + reg = <0x32000 0x58>;
> + };
> +
> + pruss_mdio: mdio@32400 {
> + compatible = "ti,davinci_mdio";
> + reg = <0x32400 0x90>;
> + clocks = <&dpll_core_m4_ck>;
> + clock-names = "fck";
> + bus_freq = <1000000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> + };
> +
> + - |
> +
> + /* Example 2 AM43xx PRU-ICSS with PRUSS1 node */
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + pruss1: pruss@0 {
> + compatible = "ti,am4376-pruss1";
> + reg = <0x0 0x40000>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + pruss1_mem: memories@0 {
> + reg = <0x0 0x2000>,
> + <0x2000 0x2000>,
> + <0x10000 0x8000>;
> + reg-names = "dram0", "dram1", "shrdram2";
> + };
> +
> + pruss1_cfg: cfg@26000 {
> + compatible = "ti,pruss-cfg", "syscon";
> + reg = <0x26000 0x2000>;
> + };
> +
> + pruss1_mii_rt: mii-rt@32000 {
> + compatible = "ti,pruss-mii", "syscon";
> + reg = <0x32000 0x58>;
> + };
> +
> + pruss1_mdio: mdio@32400 {
> + compatible = "ti,davinci_mdio";
> + reg = <0x32400 0x90>;
> + clocks = <&dpll_core_m4_ck>;
> + clock-names = "fck";
> + bus_freq = <1000000>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> + };
> +
> +...
>
On Fri, 21 Aug 2020 16:42:38 +0200, Grzegorz Jaszczyk wrote:
> This patch adds the bindings for the Programmable Real-Time Unit
> and Industrial Communication Subsystem (PRU-ICSS) present on various
> TI SoCs. The IP is present on multiple TI SoC architecture families
> including the OMAP architecture SoCs such as AM33xx, AM437x and
> AM57xx; and on a Keystone 2 architecture based 66AK2G SoC. It is
> also present on the Davinci based OMAPL138 SoCs and K3 architecture
> based AM65x and J721E SoCs as well.
>
> The IP has a number of sub-modules some of which are represented as
> their own devices. This binding covers only the top-level sub-system
> devices, and some sub-modules like MDIO, MII_RT (Ethernet MII_RT module
> with MII ports) and IEP (Industrial Ethernet Peripheral). The remaining
> sub-modules bindings shall be defined in the respective driver
> subsystem bindings folders. Couple of full examples have also been
> added demonstrating the devices on AM335x and AM437x SoCs.
>
> Signed-off-by: Suman Anna <[email protected]>
> Signed-off-by: Roger Quadros <[email protected]>
> Signed-off-by: Grzegorz Jaszczyk <[email protected]>
> ---
> v1-v2 (requested by Rob):
> - Add unit address pattern for all sub-nodes.
> - Add "additionalProperties: false" to all sub-nodes and entire
> description. This allow to catch and fix some issues like missing
> "#address-cells" property description.
> - Drop ranges description.
> - Fix compatible name in example binding for AM43xx.
> - Drop the *.yaml references from description as they are not merged yet
> and therefore they can't be converted to $ref.
> - Drop reviewed-by tag due to introduced changes.
> ---
> .../devicetree/bindings/soc/ti/ti,pruss.yaml | 320 +++++++++++++++++++++
> 1 file changed, 320 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
>
Reviewed-by: Rob Herring <[email protected]>