blob: 32d39719d817fe15b8eb9ae9e35fcc909190ae34 [file] [log] [blame]
Christophe Kerello4e280b92017-09-13 18:00:08 +02001/*
Patrice Chotard3bc599c2017-10-23 09:53:58 +02002 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
3 * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
Christophe Kerello4e280b92017-09-13 18:00:08 +02004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <dm.h>
10#include <misc.h>
11#include <dm/lists.h>
12
13static int stm32_rcc_bind(struct udevice *dev)
14{
15 int ret;
16 struct udevice *child;
17
18 debug("%s(dev=%p)\n", __func__, dev);
19
20 ret = device_bind_driver_to_node(dev, "stm32h7_rcc_clock",
21 "stm32h7_rcc_clock",
22 dev_ofnode(dev), &child);
23 if (ret)
24 return ret;
25
26 return device_bind_driver_to_node(dev, "stm32_rcc_reset",
27 "stm32_rcc_reset",
28 dev_ofnode(dev), &child);
29}
30
31static const struct misc_ops stm32_rcc_ops = {
32};
33
34static const struct udevice_id stm32_rcc_ids[] = {
35 {.compatible = "st,stm32h743-rcc"},
36 { }
37};
38
39U_BOOT_DRIVER(stm32_rcc) = {
40 .name = "stm32-rcc",
41 .id = UCLASS_MISC,
42 .of_match = stm32_rcc_ids,
43 .bind = stm32_rcc_bind,
44 .ops = &stm32_rcc_ops,
45};