xref: /openbmc/u-boot/drivers/core/simple-bus.c (revision 5cbbd9bd)
1 /*
2  * Copyright (c) 2014 Google, Inc
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <dm.h>
9 #include <dm/root.h>
10 
11 DECLARE_GLOBAL_DATA_PTR;
12 
13 static int simple_bus_post_bind(struct udevice *dev)
14 {
15 	return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
16 }
17 
18 UCLASS_DRIVER(simple_bus) = {
19 	.id		= UCLASS_SIMPLE_BUS,
20 	.name		= "simple_bus",
21 	.post_bind	= simple_bus_post_bind,
22 };
23 
24 static const struct udevice_id generic_simple_bus_ids[] = {
25 	{ .compatible = "simple-bus" },
26 	{ }
27 };
28 
29 U_BOOT_DRIVER(simple_bus_drv) = {
30 	.name	= "generic_simple_bus",
31 	.id	= UCLASS_SIMPLE_BUS,
32 	.of_match = generic_simple_bus_ids,
33 };
34