Lines Matching defs:bpmp
10 #include <soc/tegra/bpmp.h>
11 #include <soc/tegra/bpmp-abi.h>
14 #include "bpmp-private.h"
81 static int tegra186_bpmp_ring_doorbell(struct tegra_bpmp *bpmp)
83 struct tegra186_bpmp *priv = bpmp->priv;
97 struct tegra_bpmp *bpmp = data;
98 struct tegra186_bpmp *priv = bpmp->priv;
103 tegra186_bpmp_ring_doorbell(bpmp);
107 struct tegra_bpmp *bpmp,
110 struct tegra186_bpmp *priv = bpmp->priv;
115 channel->ivc = devm_kzalloc(bpmp->dev, sizeof(*channel->ivc),
128 bpmp);
130 dev_err(bpmp->dev, "failed to setup IVC for channel %u: %d\n",
136 channel->bpmp = bpmp;
158 struct tegra_bpmp *bpmp = mbox_client_to_bpmp(client);
160 tegra_bpmp_handle_rx(bpmp);
163 static int tegra186_bpmp_init(struct tegra_bpmp *bpmp)
169 priv = devm_kzalloc(bpmp->dev, sizeof(*priv), GFP_KERNEL);
173 bpmp->priv = priv;
174 priv->parent = bpmp;
176 priv->tx.pool = of_gen_pool_get(bpmp->dev->of_node, "shmem", 0);
178 dev_err(bpmp->dev, "TX shmem pool not found\n");
184 dev_err(bpmp->dev, "failed to allocate from TX pool\n");
188 priv->rx.pool = of_gen_pool_get(bpmp->dev->of_node, "shmem", 1);
190 dev_err(bpmp->dev, "RX shmem pool not found\n");
197 dev_err(bpmp->dev, "failed to allocate from RX pool\n");
202 err = tegra186_bpmp_channel_init(bpmp->tx_channel, bpmp,
203 bpmp->soc->channels.cpu_tx.offset);
207 err = tegra186_bpmp_channel_init(bpmp->rx_channel, bpmp,
208 bpmp->soc->channels.cpu_rx.offset);
212 for (i = 0; i < bpmp->threaded.count; i++) {
213 unsigned int index = bpmp->soc->channels.thread.offset + i;
215 err = tegra186_bpmp_channel_init(&bpmp->threaded_channels[i],
216 bpmp, index);
222 priv->mbox.client.dev = bpmp->dev;
230 dev_err(bpmp->dev, "failed to get HSP mailbox: %d\n", err);
234 tegra186_bpmp_channel_reset(bpmp->tx_channel);
235 tegra186_bpmp_channel_reset(bpmp->rx_channel);
237 for (i = 0; i < bpmp->threaded.count; i++)
238 tegra186_bpmp_channel_reset(&bpmp->threaded_channels[i]);
243 for (i = 0; i < bpmp->threaded.count; i++) {
244 if (!bpmp->threaded_channels[i].bpmp)
247 tegra186_bpmp_channel_cleanup(&bpmp->threaded_channels[i]);
250 tegra186_bpmp_channel_cleanup(bpmp->rx_channel);
252 tegra186_bpmp_channel_cleanup(bpmp->tx_channel);
261 static void tegra186_bpmp_deinit(struct tegra_bpmp *bpmp)
263 struct tegra186_bpmp *priv = bpmp->priv;
268 for (i = 0; i < bpmp->threaded.count; i++)
269 tegra186_bpmp_channel_cleanup(&bpmp->threaded_channels[i]);
271 tegra186_bpmp_channel_cleanup(bpmp->rx_channel);
272 tegra186_bpmp_channel_cleanup(bpmp->tx_channel);
278 static int tegra186_bpmp_resume(struct tegra_bpmp *bpmp)
283 tegra186_bpmp_channel_reset(bpmp->tx_channel);
284 tegra186_bpmp_channel_reset(bpmp->rx_channel);
286 for (i = 0; i < bpmp->threaded.count; i++)
287 tegra186_bpmp_channel_reset(&bpmp->threaded_channels[i]);