1*c66ec88fSEmmanuel Vadot /* SPDX-License-Identifier: GPL-2.0 */ 2*c66ec88fSEmmanuel Vadot /* 3*c66ec88fSEmmanuel Vadot * This header provides constants for binding nvidia,tegra186-hsp. 4*c66ec88fSEmmanuel Vadot */ 5*c66ec88fSEmmanuel Vadot 6*c66ec88fSEmmanuel Vadot #ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H 7*c66ec88fSEmmanuel Vadot #define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel Vadot /* 10*c66ec88fSEmmanuel Vadot * These define the type of mailbox that is to be used (doorbell, shared 11*c66ec88fSEmmanuel Vadot * mailbox, shared semaphore or arbitrated semaphore). 12*c66ec88fSEmmanuel Vadot */ 13*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_MBOX_TYPE_DB 0x0 14*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_MBOX_TYPE_SM 0x1 15*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_MBOX_TYPE_SS 0x2 16*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_MBOX_TYPE_AS 0x3 17*c66ec88fSEmmanuel Vadot 18*c66ec88fSEmmanuel Vadot /* 19*c66ec88fSEmmanuel Vadot * These defines represent the bit associated with the given master ID in the 20*c66ec88fSEmmanuel Vadot * doorbell registers. 21*c66ec88fSEmmanuel Vadot */ 22*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_DB_MASTER_CCPLEX 17 23*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_DB_MASTER_BPMP 19 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel Vadot /* 26*c66ec88fSEmmanuel Vadot * Shared mailboxes are unidirectional, so the direction needs to be specified 27*c66ec88fSEmmanuel Vadot * in the device tree. 28*c66ec88fSEmmanuel Vadot */ 29*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_SM_MASK 0x00ffffff 30*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_SM_FLAG_RX (0 << 31) 31*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_SM_FLAG_TX (1 << 31) 32*c66ec88fSEmmanuel Vadot 33*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_SM_RX(x) (TEGRA_HSP_SM_FLAG_RX | ((x) & TEGRA_HSP_SM_MASK)) 34*c66ec88fSEmmanuel Vadot #define TEGRA_HSP_SM_TX(x) (TEGRA_HSP_SM_FLAG_TX | ((x) & TEGRA_HSP_SM_MASK)) 35*c66ec88fSEmmanuel Vadot 36*c66ec88fSEmmanuel Vadot #endif 37