blob: a0e8e1dfdc504709dc6a24847ca554eed004a003 [file] [log] [blame]
Tom Rini4549e782018-05-06 18:27:01 -04001// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
Patrick Delaunaye16750f2018-03-20 11:45:14 +01002/*
3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
Patrick Delaunaye16750f2018-03-20 11:45:14 +01004 */
5
6#include <common.h>
Patrick Delaunay7c552492021-06-29 12:04:23 +02007#include <clk.h>
Patrick Delaunaye16750f2018-03-20 11:45:14 +01008#include <dm.h>
9#include <syscon.h>
10#include <asm/arch/stm32.h>
11
12static const struct udevice_id stm32mp_syscon_ids[] = {
Patrick Delaunay6c09eb92019-02-27 17:01:23 +010013 { .compatible = "st,stm32mp157-syscfg",
14 .data = STM32MP_SYSCON_SYSCFG },
Patrick Delaunaye16750f2018-03-20 11:45:14 +010015 { }
16};
17
Patrick Delaunay7c552492021-06-29 12:04:23 +020018static int stm32mp_syscon_probe(struct udevice *dev)
19{
20 struct clk_bulk clk_bulk;
21 int ret;
22
23 ret = clk_get_bulk(dev, &clk_bulk);
24 if (!ret)
25 clk_enable_bulk(&clk_bulk);
26
27 return 0;
28}
29
Patrick Delaunaye16750f2018-03-20 11:45:14 +010030U_BOOT_DRIVER(syscon_stm32mp) = {
31 .name = "stmp32mp_syscon",
32 .id = UCLASS_SYSCON,
33 .of_match = stm32mp_syscon_ids,
34 .bind = dm_scan_fdt_dev,
Patrick Delaunay7c552492021-06-29 12:04:23 +020035 .probe = stm32mp_syscon_probe,
Patrick Delaunaye16750f2018-03-20 11:45:14 +010036};