11558Srgrimes/* SPDX-License-Identifier: GPL-2.0 */
21558Srgrimes/*
31558Srgrimes * This header provides constants for binding nvidia,tegra186-hsp.
41558Srgrimes */
51558Srgrimes
61558Srgrimes#ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H
71558Srgrimes#define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H
81558Srgrimes
91558Srgrimes/*
101558Srgrimes * These define the type of mailbox that is to be used (doorbell, shared
111558Srgrimes * mailbox, shared semaphore or arbitrated semaphore).
121558Srgrimes */
131558Srgrimes#define TEGRA_HSP_MBOX_TYPE_DB 0x0
141558Srgrimes#define TEGRA_HSP_MBOX_TYPE_SM 0x1
151558Srgrimes#define TEGRA_HSP_MBOX_TYPE_SS 0x2
161558Srgrimes#define TEGRA_HSP_MBOX_TYPE_AS 0x3
171558Srgrimes
181558Srgrimes/*
191558Srgrimes * These define the types of shared mailbox supported based on data size.
201558Srgrimes */
211558Srgrimes#define TEGRA_HSP_MBOX_TYPE_SM_128BIT (1 << 8)
221558Srgrimes
231558Srgrimes/*
241558Srgrimes * These defines represent the bit associated with the given master ID in the
251558Srgrimes * doorbell registers.
261558Srgrimes */
271558Srgrimes#define TEGRA_HSP_DB_MASTER_CCPLEX 17
281558Srgrimes#define TEGRA_HSP_DB_MASTER_BPMP 19
291558Srgrimes
301558Srgrimes/*
311558Srgrimes * Shared mailboxes are unidirectional, so the direction needs to be specified
321558Srgrimes * in the device tree.
331558Srgrimes */
34114589Sobrien#define TEGRA_HSP_SM_MASK 0x00ffffff
351558Srgrimes#define TEGRA_HSP_SM_FLAG_RX (0 << 31)
3623675Speter#define TEGRA_HSP_SM_FLAG_TX (1 << 31)
37114589Sobrien
3841477Sjulian#define TEGRA_HSP_SM_RX(x) (TEGRA_HSP_SM_FLAG_RX | ((x) & TEGRA_HSP_SM_MASK))
39114589Sobrien#define TEGRA_HSP_SM_TX(x) (TEGRA_HSP_SM_FLAG_TX | ((x) & TEGRA_HSP_SM_MASK))
40114589Sobrien
411558Srgrimes#endif
421558Srgrimes