162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This header provides constants for binding nvidia,tegra186-hsp.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H
762306a36Sopenharmony_ci#define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci/*
1062306a36Sopenharmony_ci * These define the type of mailbox that is to be used (doorbell, shared
1162306a36Sopenharmony_ci * mailbox, shared semaphore or arbitrated semaphore).
1262306a36Sopenharmony_ci */
1362306a36Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_DB 0x0
1462306a36Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_SM 0x1
1562306a36Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_SS 0x2
1662306a36Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_AS 0x3
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/*
1962306a36Sopenharmony_ci * These define the types of shared mailbox supported based on data size.
2062306a36Sopenharmony_ci */
2162306a36Sopenharmony_ci#define TEGRA_HSP_MBOX_TYPE_SM_128BIT (1 << 8)
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci/*
2462306a36Sopenharmony_ci * These defines represent the bit associated with the given master ID in the
2562306a36Sopenharmony_ci * doorbell registers.
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_ci#define TEGRA_HSP_DB_MASTER_CCPLEX 17
2862306a36Sopenharmony_ci#define TEGRA_HSP_DB_MASTER_BPMP 19
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/*
3162306a36Sopenharmony_ci * Shared mailboxes are unidirectional, so the direction needs to be specified
3262306a36Sopenharmony_ci * in the device tree.
3362306a36Sopenharmony_ci */
3462306a36Sopenharmony_ci#define TEGRA_HSP_SM_MASK 0x00ffffff
3562306a36Sopenharmony_ci#define TEGRA_HSP_SM_FLAG_RX (0 << 31)
3662306a36Sopenharmony_ci#define TEGRA_HSP_SM_FLAG_TX (1 << 31)
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#define TEGRA_HSP_SM_RX(x) (TEGRA_HSP_SM_FLAG_RX | ((x) & TEGRA_HSP_SM_MASK))
3962306a36Sopenharmony_ci#define TEGRA_HSP_SM_TX(x) (TEGRA_HSP_SM_FLAG_TX | ((x) & TEGRA_HSP_SM_MASK))
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#endif
42