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