#include <log.h>
#include <spl_gpio.h>
#include <asm/io.h>
-#include <power/regulator.h>
#include <asm/arch-rockchip/cru.h>
#include <asm/arch-rockchip/gpio.h>
#include <asm/arch-rockchip/grf_rk3399.h>
-#ifndef CONFIG_SPL_BUILD
-int board_early_init_f(void)
-{
- struct udevice *regulator;
- int ret;
-
- ret = regulator_get_by_platname("vcc5v0_host", ®ulator);
- if (ret) {
- debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
- goto out;
- }
-
- ret = regulator_set_enable(regulator, true);
- if (ret)
- debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret);
-out:
- return 0;
-}
-
-#else
+#ifdef CONFIG_SPL_BUILD
#define PMUGRF_BASE 0xff320000
#define GPIO0_BASE 0xff720000
#include <asm/arch-rockchip/grf_rk3399.h>
#include <asm/arch-rockchip/hardware.h>
#include <linux/printk.h>
-#include <power/regulator.h>
#define GRF_IO_VSEL_BT565_SHIFT 0
#define PMUGRF_CON0_VSEL_SHIFT 8
-#ifndef CONFIG_SPL_BUILD
-int board_early_init_f(void)
-{
- struct udevice *regulator;
- int ret;
-
- ret = regulator_get_by_platname("vcc5v0_usb", ®ulator);
- if (ret) {
- pr_debug("%s vcc5v0_usb init fail! ret %d\n", __func__, ret);
- goto out;
- }
-
- ret = regulator_set_enable(regulator, true);
- if (ret)
- pr_debug("%s vcc5v0-host-en-gpio set fail! ret %d\n", __func__, ret);
-
-out:
- return 0;
-}
-#endif
-
#ifdef CONFIG_MISC_INIT_R
static void setup_iodomain(void)
{
#include <asm/arch-rockchip/clock.h>
#include <asm/arch-rockchip/grf_rk3399.h>
#include <asm/arch-rockchip/hardware.h>
-#include <power/regulator.h>
#define GRF_IO_VSEL_BT565_GPIO2AB 1
#define GRF_IO_VSEL_AUDIO_GPIO3D4A 2
#define PMUGRF_CON0_VSEL_SHIFT 8
-#ifndef CONFIG_SPL_BUILD
-int board_early_init_f(void)
-{
- struct udevice *regulator;
- int ret;
-
- ret = regulator_get_by_platname("vcc5v0_usb", ®ulator);
- if (ret) {
- pr_debug("%s vcc5v0_usb init fail! ret %d\n", __func__, ret);
- goto out;
- }
-
- ret = regulator_set_enable(regulator, true);
- if (ret)
- pr_debug("%s vcc5v0-host-en-gpio set fail! ret %d\n", __func__, ret);
-
-out:
- return 0;
-}
-#endif
-
#ifdef CONFIG_MISC_INIT_R
static void setup_iodomain(void)
{
#include <log.h>
#include <asm/arch-rockchip/periph.h>
#include <linux/kernel.h>
-#include <power/regulator.h>
#define ROCKPI4_UPDATABLE_IMAGES 2
#endif
#ifndef CONFIG_SPL_BUILD
-int board_early_init_f(void)
-{
- struct udevice *regulator;
- int ret;
-
- ret = regulator_get_by_platname("vcc5v0_host", ®ulator);
- if (ret) {
- debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
- goto out;
- }
-
- ret = regulator_set_enable(regulator, true);
- if (ret)
- debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret);
-
-out:
- return 0;
-}
-
#if defined(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && defined(CONFIG_EFI_PARTITION)
static bool board_is_rockpi_4b(void)
{