From 68fff71bb34b08bb468e9177508271e0f25fdad8 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 24 Jul 2019 20:57:07 +0800 Subject: [PATCH] rockchip: evb-rk3128: enable rk818 current limit early Some rk3128 board like fireprime is using rk818, and it may limit the current before change the pmic setting, the normal process need to enable the fuelguage and its dts which is too late, the U-Boot may HANG at regulator_power_on_init() in board_init(). Change-Id: I7bd058d8bd8fac01377c3cef6b3681c1c6110ee7 Signed-off-by: Kever Yang --- board/rockchip/evb_rk3128/evb-rk3128.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/board/rockchip/evb_rk3128/evb-rk3128.c b/board/rockchip/evb_rk3128/evb-rk3128.c index bf36e25a7c..0decdf2339 100644 --- a/board/rockchip/evb_rk3128/evb-rk3128.c +++ b/board/rockchip/evb_rk3128/evb-rk3128.c @@ -5,5 +5,24 @@ */ #include +#include +#include DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_r(void) +{ + struct udevice *pmic; + int ret; + + ret = uclass_first_device_err(UCLASS_PMIC, &pmic); + if (ret) + return ret; + + /* Increase USB input current to 2A */ + ret = rk818_spl_configure_usb_input_current(pmic, 2000); + if (ret) + return ret; + + return 0; +}