Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: tegra186-hsp: Add shared mailboxes

Shared mailboxes are a mechanism to transport data from one processor in
the system to another. They are bidirectional links with both a producer
and a consumer. Interrupts are used to let the consumer know when data
was written to the mailbox by the producer, and to let the producer know
when the consumer has read the data from the mailbox. These interrupts
are mapped to one or more "shared interrupts". Typically each processor
in the system owns one of these shared interrupts.

Add documentation to the device tree bindings about how clients can use
mailbox specifiers to request a specific shared mailbox and select which
direction they drive. Also document how to specify the shared interrupts
in addition to the existing doorbell interrupt.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Mikko Perttunen and committed by
Jassi Brar
fed8b7e3 8ed82e23

+36 -5
+25 -5
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt
··· 15 15 Array of strings. 16 16 one of: 17 17 - "nvidia,tegra186-hsp" 18 + - "nvidia,tegra194-hsp", "nvidia,tegra186-hsp" 18 19 - reg : Offset and length of the register set for the device. 19 20 - interrupt-names 20 21 Array of strings. 21 22 Contains a list of names for the interrupts described by the interrupt 22 23 property. May contain the following entries, in any order: 23 24 - "doorbell" 25 + - "sharedN", where 'N' is a number from zero up to the number of 26 + external interrupts supported by the HSP instance minus one. 24 27 Users of this binding MUST look up entries in the interrupt property 25 28 by name, using this interrupt-names property to do so. 26 29 - interrupts ··· 32 29 in a matching order. 33 30 - #mbox-cells : Should be 2. 34 31 35 - The mbox specifier of the "mboxes" property in the client node should 36 - contain two data. The first one should be the HSP type and the second 37 - one should be the ID that the client is going to use. Those information 38 - can be found in the following file. 32 + The mbox specifier of the "mboxes" property in the client node should contain 33 + two cells. The first cell determines the HSP type and the second cell is used 34 + to identify the mailbox that the client is going to use. 39 35 40 - - <dt-bindings/mailbox/tegra186-hsp.h>. 36 + For doorbells, the second cell specifies the index of the doorbell to use. 37 + 38 + For shared mailboxes, the second cell is composed of two fields: 39 + - bits 31..24: 40 + A bit mask of flags that further specify how the shared mailbox will be 41 + used. Valid flags are: 42 + - bit 31: 43 + Defines the direction of the mailbox. If set, the mailbox will be used 44 + as a producer (i.e. used to send data). If cleared, the mailbox is the 45 + consumer of data sent by a producer. 46 + 47 + - bits 23.. 0: 48 + The index of the shared mailbox to use. The number of available mailboxes 49 + may vary by instance of the HSP block and SoC generation. 50 + 51 + The following file contains definitions that can be used to construct mailbox 52 + specifiers: 53 + 54 + <dt-bindings/mailbox/tegra186-hsp.h> 41 55 42 56 Example: 43 57
+11
include/dt-bindings/mailbox/tegra186-hsp.h
··· 22 22 #define TEGRA_HSP_DB_MASTER_CCPLEX 17 23 23 #define TEGRA_HSP_DB_MASTER_BPMP 19 24 24 25 + /* 26 + * Shared mailboxes are unidirectional, so the direction needs to be specified 27 + * in the device tree. 28 + */ 29 + #define TEGRA_HSP_SM_MASK 0x00ffffff 30 + #define TEGRA_HSP_SM_FLAG_RX (0 << 31) 31 + #define TEGRA_HSP_SM_FLAG_TX (1 << 31) 32 + 33 + #define TEGRA_HSP_SM_RX(x) (TEGRA_HSP_SM_FLAG_RX | ((x) & TEGRA_HSP_SM_MASK)) 34 + #define TEGRA_HSP_SM_TX(x) (TEGRA_HSP_SM_FLAG_TX | ((x) & TEGRA_HSP_SM_MASK)) 35 + 25 36 #endif