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 | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2018, STMicroelectronics - All Rights Reserved |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <config.h> |
| 7 | #include <common.h> |
| 8 | #include <spl.h> |
| 9 | #include <dm.h> |
| 10 | #include <ram.h> |
| 11 | #include <asm/io.h> |
| 12 | #include <post.h> |
| 13 | #include <power/pmic.h> |
Patrick Delaunay | 91be594 | 2019-02-04 11:26:16 +0100 | [diff] [blame] | 14 | #include <power/stpmic1.h> |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 15 | #include <asm/arch/ddr.h> |
| 16 | |
| 17 | void spl_board_init(void) |
| 18 | { |
| 19 | /* Keep vdd on during the reset cycle */ |
Patrick Delaunay | d79218f | 2019-02-04 11:26:17 +0100 | [diff] [blame] | 20 | #if defined(CONFIG_PMIC_STPMIC1) && defined(CONFIG_SPL_POWER_SUPPORT) |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 21 | struct udevice *dev; |
| 22 | int ret; |
| 23 | |
| 24 | ret = uclass_get_device_by_driver(UCLASS_PMIC, |
Patrick Delaunay | d79218f | 2019-02-04 11:26:17 +0100 | [diff] [blame] | 25 | DM_GET_DRIVER(pmic_stpmic1), &dev); |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 26 | if (!ret) |
| 27 | pmic_clrsetbits(dev, |
Patrick Delaunay | 880f29b | 2019-02-04 11:26:18 +0100 | [diff] [blame] | 28 | STPMIC1_BUCKS_MRST_CR, |
| 29 | STPMIC1_MRST_BUCK(STPMIC1_BUCK3), |
| 30 | STPMIC1_MRST_BUCK(STPMIC1_BUCK3)); |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 31 | #endif |
| 32 | } |