2 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <dm/pinctrl.h>
9 #include <asm/arch/periph.h>
10 #include <power/regulator.h>
12 DECLARE_GLOBAL_DATA_PTR;
16 struct udevice *pinctrl, *regulator;
20 * The PWM do not have decicated interrupt number in dts and can
21 * not get periph_id by pinctrl framework, so let's init them here.
22 * The PWM2 and PWM3 are for pwm regulater.
24 ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
26 debug("%s: Cannot find pinctrl device\n", __func__);
30 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM2);
32 debug("%s PWM2 pinctrl init fail!\n", __func__);
36 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM3);
38 debug("%s PWM3 pinctrl init fail!\n", __func__);
42 ret = regulator_get_by_platname("vcc5v0_host", ®ulator);
44 debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
48 ret = regulator_set_enable(regulator, true);
50 debug("%s vcc5v0-host-en set fail!\n", __func__);
60 gd->ram_size = 0x80000000;
64 void dram_init_banksize(void)
66 /* Reserve 0x200000 for ATF bl31 */
67 gd->bd->bi_dram[0].start = 0x200000;
68 gd->bd->bi_dram[0].size = 0x80000000;