| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 6 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 9 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 10 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 11 | | - * more details. |
|---|
| 12 | 4 | */ |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #ifndef __SOC_TEGRA_BPMP_H |
|---|
| .. | .. |
|---|
| 23 | 15 | #include <soc/tegra/bpmp-abi.h> |
|---|
| 24 | 16 | |
|---|
| 25 | 17 | struct tegra_bpmp_clk; |
|---|
| 18 | +struct tegra_bpmp_ops; |
|---|
| 26 | 19 | |
|---|
| 27 | 20 | struct tegra_bpmp_soc { |
|---|
| 28 | 21 | struct { |
|---|
| .. | .. |
|---|
| 32 | 25 | unsigned int timeout; |
|---|
| 33 | 26 | } cpu_tx, thread, cpu_rx; |
|---|
| 34 | 27 | } channels; |
|---|
| 28 | + |
|---|
| 29 | + const struct tegra_bpmp_ops *ops; |
|---|
| 35 | 30 | unsigned int num_resets; |
|---|
| 36 | 31 | }; |
|---|
| 37 | 32 | |
|---|
| .. | .. |
|---|
| 47 | 42 | struct tegra_bpmp_mb_data *ob; |
|---|
| 48 | 43 | struct completion completion; |
|---|
| 49 | 44 | struct tegra_ivc *ivc; |
|---|
| 45 | + unsigned int index; |
|---|
| 50 | 46 | }; |
|---|
| 51 | 47 | |
|---|
| 52 | 48 | typedef void (*tegra_bpmp_mrq_handler_t)(unsigned int mrq, |
|---|
| .. | .. |
|---|
| 63 | 59 | struct tegra_bpmp { |
|---|
| 64 | 60 | const struct tegra_bpmp_soc *soc; |
|---|
| 65 | 61 | struct device *dev; |
|---|
| 66 | | - |
|---|
| 67 | | - struct { |
|---|
| 68 | | - struct gen_pool *pool; |
|---|
| 69 | | - dma_addr_t phys; |
|---|
| 70 | | - void *virt; |
|---|
| 71 | | - } tx, rx; |
|---|
| 62 | + void *priv; |
|---|
| 72 | 63 | |
|---|
| 73 | 64 | struct { |
|---|
| 74 | 65 | struct mbox_client client; |
|---|
| .. | .. |
|---|
| 129 | 120 | tegra_bpmp_mrq_handler_t handler, void *data); |
|---|
| 130 | 121 | void tegra_bpmp_free_mrq(struct tegra_bpmp *bpmp, unsigned int mrq, |
|---|
| 131 | 122 | void *data); |
|---|
| 123 | +bool tegra_bpmp_mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq); |
|---|
| 132 | 124 | #else |
|---|
| 133 | 125 | static inline struct tegra_bpmp *tegra_bpmp_get(struct device *dev) |
|---|
| 134 | 126 | { |
|---|
| .. | .. |
|---|
| 164 | 156 | unsigned int mrq, void *data) |
|---|
| 165 | 157 | { |
|---|
| 166 | 158 | } |
|---|
| 159 | + |
|---|
| 160 | +static inline bool tegra_bpmp_mrq_is_supported(struct tegra_bpmp *bpmp, |
|---|
| 161 | + unsigned int mrq) |
|---|
| 162 | +{ |
|---|
| 163 | + return false; |
|---|
| 164 | +} |
|---|
| 167 | 165 | #endif |
|---|
| 168 | 166 | |
|---|
| 167 | +void tegra_bpmp_handle_rx(struct tegra_bpmp *bpmp); |
|---|
| 168 | + |
|---|
| 169 | 169 | #if IS_ENABLED(CONFIG_CLK_TEGRA_BPMP) |
|---|
| 170 | 170 | int tegra_bpmp_init_clocks(struct tegra_bpmp *bpmp); |
|---|
| 171 | 171 | #else |
|---|