1 // SPDX-License-Identifier: GPL-2.0
3 * Sandbox adder for p2sb testing
5 * Copyright 2019 Google LLC
8 #define LOG_CATEGORY UCLASS_MISC
17 struct sandbox_adder_priv {
21 int sandbox_adder_read(struct udevice *dev, ulong address, void *data,
24 struct p2sb_child_plat *pplat = dev_get_parent_plat(dev);
27 *val = pplat->pid << 24 | address;
32 int sandbox_adder_write(struct udevice *dev, ulong address, void *data,
38 static int sandbox_adder_probe(struct udevice *dev)
43 static struct axi_ops sandbox_adder_ops = {
44 .read = sandbox_adder_read,
45 .write = sandbox_adder_write,
48 static const struct udevice_id sandbox_adder_ids[] = {
49 { .compatible = "sandbox,adder" },
53 U_BOOT_DRIVER(adder_sandbox) = {
54 .name = "sandbox_adder",
56 .of_match = sandbox_adder_ids,
57 .probe = sandbox_adder_probe,
58 .ops = &sandbox_adder_ops,
59 .priv_auto = sizeof(struct sandbox_adder_priv),