]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: rockchip: rk3399: Remove unused board_early_init_f functions
authorJonas Karlman <jonas@kwiboo.se>
Tue, 12 Mar 2024 23:36:13 +0000 (23:36 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 10:19:27 +0000 (18:19 +0800)
These functions is excluded from SPL build and BOARD_EARLY_INIT_F is not
enabled for any of the affected boards, so this legacy code is not used.

Rockchip common board code already enable all regulators flagged as
always-on or boot-on in device tree, and fixed/gpio regulators now have
basic reference counting support so the original intent of this code is
no longer valid.

Remove the unneeded and unused code that used to enable usb regulators.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c
board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c
board/rockchip/evb_rk3399/evb-rk3399.c

index 93e7d776fb2fcfa3093d35d36d3612cfaa84373a..590519b32af2a812ba05c7eaed95d2944421845c 100644 (file)
@@ -9,32 +9,12 @@
 #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", &regulator);
-       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
index 5e758ea6cd92300f61ccb0b0e8b26fe3fdd1ee50..0001022c62a6d342b6c242108c99d323f2b982d1 100644 (file)
 #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", &regulator);
-       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)
 {
index c9b0d5a061d63cea7bc2053f826306a21f9bade7..06dc512c57d8627afb10c79c1acc1d83e3bf02a7 100644 (file)
 #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", &regulator);
-       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)
 {
index 3c773d0930cc2b1bf8b1a0dedcb951e72392b56a..ebdd74a7b97f0c2846af58b4df18653d96588d98 100644 (file)
@@ -10,7 +10,6 @@
 #include <log.h>
 #include <asm/arch-rockchip/periph.h>
 #include <linux/kernel.h>
-#include <power/regulator.h>
 
 #define ROCKPI4_UPDATABLE_IMAGES       2
 
@@ -25,25 +24,6 @@ struct efi_capsule_update_info update_info = {
 #endif
 
 #ifndef CONFIG_SPL_BUILD
-int board_early_init_f(void)
-{
-       struct udevice *regulator;
-       int ret;
-
-       ret = regulator_get_by_platname("vcc5v0_host", &regulator);
-       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)
 {