Tom Rini | 4549e78 | 2018-05-06 18:27:01 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
Patrick Delaunay | e16750f | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2018, STMicroelectronics - All Rights Reserved |
Patrick Delaunay | e16750f | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Patrick Delaunay | 7c55249 | 2021-06-29 12:04:23 +0200 | [diff] [blame] | 7 | #include <clk.h> |
Patrick Delaunay | e16750f | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 8 | #include <dm.h> |
| 9 | #include <syscon.h> |
| 10 | #include <asm/arch/stm32.h> |
| 11 | |
| 12 | static const struct udevice_id stm32mp_syscon_ids[] = { |
Patrick Delaunay | 6c09eb9 | 2019-02-27 17:01:23 +0100 | [diff] [blame] | 13 | { .compatible = "st,stm32mp157-syscfg", |
| 14 | .data = STM32MP_SYSCON_SYSCFG }, |
Patrick Delaunay | e16750f | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 15 | { } |
| 16 | }; |
| 17 | |
Patrick Delaunay | 7c55249 | 2021-06-29 12:04:23 +0200 | [diff] [blame] | 18 | static 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 Delaunay | e16750f | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 30 | U_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 Delaunay | 7c55249 | 2021-06-29 12:04:23 +0200 | [diff] [blame] | 35 | .probe = stm32mp_syscon_probe, |
Patrick Delaunay | e16750f | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 36 | }; |