Tom Rini | 8b0c8a1 | 2018-05-06 18:27:01 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
Patrick Delaunay | 089d435 | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2018, STMicroelectronics - All Rights Reserved |
Patrick Delaunay | 089d435 | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Patrick Delaunay | 27e40d5 | 2021-06-29 12:04:23 +0200 | [diff] [blame] | 7 | #include <clk.h> |
Patrick Delaunay | 089d435 | 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 | 63ae49e | 2019-02-27 17:01:23 +0100 | [diff] [blame] | 13 | { .compatible = "st,stm32mp157-syscfg", |
| 14 | .data = STM32MP_SYSCON_SYSCFG }, |
Patrick Delaunay | 089d435 | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 15 | { } |
| 16 | }; |
| 17 | |
Patrick Delaunay | 27e40d5 | 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 | 089d435 | 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 | 27e40d5 | 2021-06-29 12:04:23 +0200 | [diff] [blame] | 35 | .probe = stm32mp_syscon_probe, |
Patrick Delaunay | 089d435 | 2018-03-20 11:45:14 +0100 | [diff] [blame] | 36 | }; |