blob: 8bcbd9793404b8860554acb15c67742397c069ae [file] [log] [blame]
Tom Rini8b0c8a12018-05-06 18:27:01 -04001// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
Patrick Delaunay089d4352018-03-20 11:45:14 +01002/*
3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
Patrick Delaunay089d4352018-03-20 11:45:14 +01004 */
5
Patrick Delaunay27e40d52021-06-29 12:04:23 +02006#include <clk.h>
Patrick Delaunay089d4352018-03-20 11:45:14 +01007#include <dm.h>
8#include <syscon.h>
9#include <asm/arch/stm32.h>
10
11static const struct udevice_id stm32mp_syscon_ids[] = {
Patrice Chotardd29531c2023-10-27 16:43:04 +020012 { .compatible = "st,stm32mp157-syscfg", .data = STM32MP_SYSCON_SYSCFG },
13 { .compatible = "st,stm32mp25-syscfg", .data = STM32MP_SYSCON_SYSCFG},
Patrick Delaunay089d4352018-03-20 11:45:14 +010014 { }
15};
16
Patrick Delaunay27e40d52021-06-29 12:04:23 +020017static int stm32mp_syscon_probe(struct udevice *dev)
18{
19 struct clk_bulk clk_bulk;
20 int ret;
21
22 ret = clk_get_bulk(dev, &clk_bulk);
23 if (!ret)
24 clk_enable_bulk(&clk_bulk);
25
26 return 0;
27}
28
Patrick Delaunay089d4352018-03-20 11:45:14 +010029U_BOOT_DRIVER(syscon_stm32mp) = {
30 .name = "stmp32mp_syscon",
31 .id = UCLASS_SYSCON,
32 .of_match = stm32mp_syscon_ids,
33 .bind = dm_scan_fdt_dev,
Patrick Delaunay27e40d52021-06-29 12:04:23 +020034 .probe = stm32mp_syscon_probe,
Patrick Delaunay089d4352018-03-20 11:45:14 +010035};