2 * Copyright (c) 2016, NVIDIA CORPORATION.
4 * SPDX-License-Identifier: GPL-2.0
12 struct sandbox_mbox_test {
13 struct mbox_chan chan;
16 int sandbox_mbox_test_get(struct udevice *dev)
18 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
20 return mbox_get_by_name(dev, "test", &sbmt->chan);
23 int sandbox_mbox_test_send(struct udevice *dev, uint32_t msg)
25 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
27 return mbox_send(&sbmt->chan, &msg);
30 int sandbox_mbox_test_recv(struct udevice *dev, uint32_t *msg)
32 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
34 return mbox_recv(&sbmt->chan, msg, 100);
37 int sandbox_mbox_test_free(struct udevice *dev)
39 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
41 return mbox_free(&sbmt->chan);
44 static const struct udevice_id sandbox_mbox_test_ids[] = {
45 { .compatible = "sandbox,mbox-test" },
49 U_BOOT_DRIVER(sandbox_mbox_test) = {
50 .name = "sandbox_mbox_test",
52 .of_match = sandbox_mbox_test_ids,
53 .priv_auto_alloc_size = sizeof(struct sandbox_mbox_test),