1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
8 #include <asm/arch-rockchip/periph.h>
9 #include <power/regulator.h>
12 #include <asm/arch-rockchip/gpio.h>
14 #ifndef CONFIG_SPL_BUILD
15 int board_early_init_f(void)
17 struct udevice *regulator;
20 ret = regulator_get_by_platname("vcc5v0_host", ®ulator);
22 debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
26 ret = regulator_set_enable(regulator, true);
28 debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret);
34 #if defined(CONFIG_TPL_BUILD)
36 #define GPIO0_BASE 0xff720000
38 int board_early_init_f(void)
40 struct rockchip_gpio_regs * const gpio0 = (void *)GPIO0_BASE;
42 /* Turn on red LED, indicating full power mode */
43 spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);