blob: 1202297d2ed56be417711979834f6a5937d7ab81 [file] [log] [blame]
Tom Rini8b0c8a12018-05-06 18:27:01 -04001// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
Patrick Delaunay8eb3b1e2018-03-12 10:46:18 +01002/*
3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
Patrick Delaunay8eb3b1e2018-03-12 10:46:18 +01004 */
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 Delaunay91be5942019-02-04 11:26:16 +010014#include <power/stpmic1.h>
Patrick Delaunay8eb3b1e2018-03-12 10:46:18 +010015#include <asm/arch/ddr.h>
16
17void spl_board_init(void)
18{
19 /* Keep vdd on during the reset cycle */
20#if defined(CONFIG_PMIC_STPMU1) && defined(CONFIG_SPL_POWER_SUPPORT)
21 struct udevice *dev;
22 int ret;
23
24 ret = uclass_get_device_by_driver(UCLASS_PMIC,
25 DM_GET_DRIVER(pmic_stpmu1), &dev);
26 if (!ret)
27 pmic_clrsetbits(dev,
28 STPMU1_MASK_RESET_BUCK,
29 STPMU1_MASK_RESET_BUCK3,
30 STPMU1_MASK_RESET_BUCK3);
31#endif
32}