1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
8 #include <dm/pinctrl.h>
9 #include <asm/arch-rockchip/periph.h>
10 #include <power/regulator.h>
15 struct udevice *pinctrl, *regulator;
19 * The PWM do not have decicated interrupt number in dts and can
20 * not get periph_id by pinctrl framework, so let's init them here.
21 * The PWM2 and PWM3 are for pwm regulater.
23 ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
25 debug("%s: Cannot find pinctrl device\n", __func__);
29 /* Enable pwm0 for panel backlight */
30 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM0);
32 debug("%s PWM0 pinctrl init fail! (ret=%d)\n", __func__, ret);
36 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM2);
38 debug("%s PWM2 pinctrl init fail!\n", __func__);
42 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM3);
44 debug("%s PWM3 pinctrl init fail!\n", __func__);
48 ret = regulators_enable_boot_on(false);
50 debug("%s: Cannot enable boot on regulator\n", __func__);
52 ret = regulator_get_by_platname("vcc5v0_host", ®ulator);
54 debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
58 ret = regulator_set_enable(regulator, true);
60 debug("%s vcc5v0-host-en set fail!\n", __func__);
68 void spl_board_init(void)
70 preloader_console_init();