2 * Copyright (C) 2016 Atmel Corporation
3 * Wenyou.Yang <wenyou.yang@atmel.com>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <clk-uclass.h>
10 #include <dm/device.h>
15 DECLARE_GLOBAL_DATA_PTR;
17 static int at91_pmc_bind(struct udevice *dev)
19 return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
22 static const struct udevice_id at91_pmc_match[] = {
23 { .compatible = "atmel,sama5d2-pmc" },
27 U_BOOT_DRIVER(at91_pmc) = {
28 .name = "at91-pmc-core",
30 .of_match = at91_pmc_match,
31 .bind = at91_pmc_bind,
34 int at91_pmc_core_probe(struct udevice *dev)
36 struct pmc_platdata *plat = dev_get_platdata(dev);
38 dev = dev_get_parent(dev);
40 plat->reg_base = (struct at91_pmc *)dev_get_addr_ptr(dev);
45 int at91_pmc_clk_node_bind(struct udevice *dev)
47 const void *fdt = gd->fdt_blob;
48 int offset = dev->of_offset;
52 for (offset = fdt_first_subnode(fdt, offset);
54 offset = fdt_next_subnode(fdt, offset)) {
55 name = fdt_get_name(fdt, offset, NULL);
59 ret = device_bind_driver_to_node(dev, "clk", name,
68 U_BOOT_DRIVER(clk_generic) = {