18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This header provides constants for binding nvidia,tegra186-hsp. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H 78c2ecf20Sopenharmony_ci#define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci/* 108c2ecf20Sopenharmony_ci * These define the type of mailbox that is to be used (doorbell, shared 118c2ecf20Sopenharmony_ci * mailbox, shared semaphore or arbitrated semaphore). 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_DB 0x0 148c2ecf20Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_SM 0x1 158c2ecf20Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_SS 0x2 168c2ecf20Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_AS 0x3 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* 198c2ecf20Sopenharmony_ci * These defines represent the bit associated with the given master ID in the 208c2ecf20Sopenharmony_ci * doorbell registers. 218c2ecf20Sopenharmony_ci */ 228c2ecf20Sopenharmony_ci#define TEGRA_HSP_DB_MASTER_CCPLEX 17 238c2ecf20Sopenharmony_ci#define TEGRA_HSP_DB_MASTER_BPMP 19 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* 268c2ecf20Sopenharmony_ci * Shared mailboxes are unidirectional, so the direction needs to be specified 278c2ecf20Sopenharmony_ci * in the device tree. 288c2ecf20Sopenharmony_ci */ 298c2ecf20Sopenharmony_ci#define TEGRA_HSP_SM_MASK 0x00ffffff 308c2ecf20Sopenharmony_ci#define TEGRA_HSP_SM_FLAG_RX (0 << 31) 318c2ecf20Sopenharmony_ci#define TEGRA_HSP_SM_FLAG_TX (1 << 31) 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define TEGRA_HSP_SM_RX(x) (TEGRA_HSP_SM_FLAG_RX | ((x) & TEGRA_HSP_SM_MASK)) 348c2ecf20Sopenharmony_ci#define TEGRA_HSP_SM_TX(x) (TEGRA_HSP_SM_FLAG_TX | ((x) & TEGRA_HSP_SM_MASK)) 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#endif 37