diff options
author | Simon Glass <sjg@chromium.org> | 2014-10-04 11:29:37 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-10-22 10:36:56 -0600 |
commit | da802b9e2726c7467e0b402efeb6ad3d975f1282 (patch) | |
tree | 58d17374f4fbe3ff045b5901563a9c4bdb85d408 /drivers/core/simple-bus.c | |
parent | 3f0e935f2250110990875159552e1ff7eb7da39d (diff) | |
download | u-boot-da802b9e2726c7467e0b402efeb6ad3d975f1282.tar.gz |
dm: core: Add support for simple-bus
Add a driver for the simple-bus nodes, which allows devices within these
nodes to be bound.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/simple-bus.c')
-rw-r--r-- | drivers/core/simple-bus.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/core/simple-bus.c b/drivers/core/simple-bus.c new file mode 100644 index 0000000000..3ea4d8230b --- /dev/null +++ b/drivers/core/simple-bus.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> +#include <dm/root.h> + +DECLARE_GLOBAL_DATA_PTR; + +static int simple_bus_post_bind(struct udevice *dev) +{ + return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false); +} + +UCLASS_DRIVER(simple_bus) = { + .id = UCLASS_SIMPLE_BUS, + .name = "simple_bus", + .post_bind = simple_bus_post_bind, +}; + +static const struct udevice_id generic_simple_bus_ids[] = { + { .compatible = "simple-bus" }, + { } +}; + +U_BOOT_DRIVER(simple_bus_drv) = { + .name = "generic_simple_bus", + .id = UCLASS_SIMPLE_BUS, + .of_match = generic_simple_bus_ids, +}; |