PRU/RTU/Tx_PRU Core on TI SoCs
==============================

Each PRUSS has dual PRU cores, each represented by a PRU node. Each PRU core
has a dedicated Instruction RAM, Control and Debug register sets, and use
the Data RAMs present within the PRUSS for code execution.

The K3 SoCs containing ICSSG v1.0 (eg: AM65x SR1.0) have two additional PRU
cores called RTUs with slightly different IP integration. The K3 SoCs
containing the revised ICSSG v1.1 (eg: J721E, AM65x SR2.0) have an extra two
auxiliary PRU cores called Tx_PRUs that augment the PRUs. Each RTU or Tx_PRU
core can be used independently like a PRU, or alongside a corresponding PRU
core to provide/implement auxiliary functionality/support.

Each PRU, RTU or Tx_PRU core node should be defined as a child node of the
corresponding PRUSS node. Each node can optionally be rendered inactive by
using the standard DT string property, "status".

Please see the overall PRUSS bindings document for additional details
including a complete example,
    Documentation/devicetree/bindings/soc/ti/ti,pruss.txt

Required Properties:
--------------------
- compatible     : should be
                       "ti,am3356-pru" for AM335x family of SoCs
                       "ti,am4376-pru" for AM437x family of SoCs
                       "ti,am5728-pru" for AM57xx family of SoCs
                       "ti,k2g-pru" for 66AK2G family of SoCs
                       "ti,am654-pru" for PRUs in K3 AM65x family of SoCs
                       "ti,am654-rtu" for RTUs in K3 AM65x family of SoCs
                       "ti,am654-tx-pru" for Tx_PRU in K3 AM65x SR2.0 SoCs
                       "ti,j721e-pru" for PRUs in K3 J721E family of SoCs
                       "ti,j721e-rtu" for RTUs in K3 J721E family of SoCs
                       "ti,j721e-tx-pru" for Tx_PRUs in K3 J721E family of SoCs
- reg            : base address and size for each of the 3 sub-module address
                   spaces as mentioned in reg-names, and in the same order as
                   the reg-names
- reg-names      : should contain each of the following 3 names, the binding is
                   agnostic of the order of these reg-names, preferable to have
                   the "iram" entry as the first one
                       "iram" for Instruction RAM,
                       "control" for the CTRL sub-module registers,
                       "debug" for the Debug sub-module registers,
- firmware-name  : should contain the name of the default firmware image file
                   located on the firmware search path

Optional Properties:
--------------------
The virtio based communication between the MPU and a PRU core _requires_
either the 'mboxes' property, or the set of 'interrupt-parent', 'interrupts'
and 'interrupt-names' properties to be defined. The latter option is the
preferred choice. The 'mboxes' property is not applicable for 66AK2G and
DA850/OMAP-L138 SoCs.

- mboxes           : OMAP Mailbox specifier denoting the sub-mailbox, if using
                     a mailbox for IPC signalling between host and a PRU core.
                     The specifier format is as per the bindings,
                         Documentation/devicetree/bindings/mailbox/omap-mailbox.txt
                     This property should match with the sub-mailbox node used
                     in the corresponding firmware image.
- interrupt-parent : phandle to the PRUSS INTC node. Should be defined if
                     interrupts property is to be used.
- interrupts       : array of interrupt specifiers if using PRU system events
                     for IPC signalling between host and a PRU core. This
                     property should match with the PRU system event used in
                     the corresponding firmware image.
- interrupt-names  : should use one of the following names for each interrupt,
                     the name should match the corresponding PRU system event
                     number,
                         "vring" - for PRU to HOST virtqueue signalling
                         "kick"  - for HOST to PRU virtqueue signalling


Application/Consumer Nodes
==========================
A PRU application/consumer/user node typically uses one or more PRU device nodes
to implement a PRU application/functionality. Each application/client node would
need a reference to at least a PRU node, and optionally define some properties
needed for hardware/firmware configuration. The below properties are a list of
common properties supported by the PRU remoteproc infrastructure.

The application nodes shall define their own bindings like regular platform
devices, so below are in addition to each node's bindings.

Required Properties:
--------------------
- prus                 : phandles to the PRU, RTU or Tx_PRU nodes used

Optional Properties:
--------------------
- firmware-name        : firmwares for the PRU cores, the default firmware
                         for the core from the PRU node will be used if not
                         provided. The firmware names should correspond to
                         the PRU cores listed in the 'prus' property
- ti,pruss-gp-mux-sel  : array of values for the GP_MUX_SEL under PRUSS_GPCFG
                         register for a PRU. This selects the internal muxing
                         scheme for the PRU instance. If not provided, the
                         default out-of-reset value (0) for the PRU core is
                         used. Values should correspond to the PRU cores listed
                         in the 'prus' property
- ti,pru-interrupt-map : PRU interrupt mappings, containing an array of entries
                         with each entry consisting of 4 cell-values. First one
                         is an index towards the "prus" property to identify the
                         PRU core for the interrupt map, second is the PRU
                         System Event id, third is the PRU interrupt channel id
                         and fourth is the PRU host interrupt id. If provided,
                         this map will supercede any other configuration
                         provided through firmware


Example:
--------

1.	/* AM33xx PRU-ICSS */
	pruss_tm: target-module@300000 {	/* 0x4a300000, ap 9 04.0 */
		compatible = "ti,sysc-pruss", "ti,sysc";
		ranges = <0x0 0x300000 0x80000>;
		...

		pruss: pruss@0 {
			compatible = "ti,am3356-pruss";
			reg = <0x0 0x80000>;
			...

			pruss_mem: memories@0 {
				reg = <0x0 0x2000>,
				      <0x2000 0x2000>,
				      <0x10000 0x3000>;
				reg-names = "dram0", "dram1", "shrdram2";
			};

			pru0: pru@34000 {
				compatible = "ti,am3356-pru";
				reg = <0x34000 0x2000>,
				      <0x22000 0x400>,
				      <0x22400 0x100>;
				reg-names = "iram", "control", "debug";
				firmware-name = "am335x-pru0-fw";
				interrupt-parent = <&pruss_intc>;
				interrupts = <16>, <17>;
				interrupt-names = "vring", "kick";
			};

			pru1: pru@38000 {
				compatible = "ti,am3356-pru";
				reg = <0x38000 0x2000>,
				      <0x24000 0x400>,
				      <0x24400 0x100>;
				reg-names = "iram", "control", "debug";
				firmware-name = "am335x-pru1-fw";
				interrupt-parent = <&pruss_intc>;
				interrupts = <18>, <19>;
				interrupt-names = "vring", "kick";
				/* mboxes = <&mailbox &mbox_pru1>; */
			};
		};
	};

3:	/* PRU application node example */
	app_node: pru-app {
		...
		prus = <&pru0>, <&pru1>;
		firmware-name = "pruss-app-fw", "pruss-app-fw-2";
		ti,pruss-gp-mux-sel = <2>, <1>;
		/* setup interrupts for prus:
		   prus[0] => pru1_0: ev=16, chnl=2, host-irq=7,
		   prus[1] => pru1_1: ev=19, chnl=1, host-irq=3 */
		ti,pru-interrupt-map = <0 16 2 7 >, <1 19 1 3>;
	}
