From d1a4b09de6431fbc2f6a9dc53efe8d84cdd31134 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Mon, 25 May 2020 12:19:46 +0200 Subject: board: st: stpmic1: add function stpmic1_init Add a function stmpic_init to early initialize the PMIC STPMIC1 - keep vdd on during the reset cycle (to avoid issue when backup battery is absent) - Check if debug is enabled to program PMIC according to the bit This patch allows to remove the compilation of spl.c file from stm32mp1 board in dh_stm32mp1. CONFIG_SPL_BOARD_INIT is removed as the new function is called earlier in SPL, in the function board_early_init_f. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/dhelectronics/dh_stm32mp1/board.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'board/dhelectronics/dh_stm32mp1/board.c') diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index 26e827bc384..0e745ec7336 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -41,6 +41,7 @@ #include #include #include +#include "../../st/common/stpmic1.h" /* SYSCFG registers */ #define SYSCFG_BOOTR 0x00 @@ -198,6 +199,8 @@ int board_stm32mp1_ddr_config_name_match(struct udevice *dev, int board_early_init_f(void) { + if (IS_ENABLED(CONFIG_SPL_BUILD)) + stpmic1_init(); board_get_coding_straps(); return 0; -- cgit v1.2.3 From 2f238327b7273656eb7670804fdb16de097b39b9 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Mon, 25 May 2020 12:19:47 +0200 Subject: board: stm32mp1: update vddcore in SPL For board using STPMIC1, the vddcore is provided by BUCK1 of STPMIC1 and need to be updated for 800MHz support and only after the clock tree initialization. The VDDCORE voltage value is provided by clock driver, saved in global variable opp_voltage_mv and udpated in SPL board_early_init_f(), just after clock tree initialization. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/dhelectronics/dh_stm32mp1/board.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'board/dhelectronics/dh_stm32mp1/board.c') diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index 0e745ec7336..b2b4f3974d2 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -140,6 +140,7 @@ int checkboard(void) static u8 brdcode __section("data"); static u8 ddr3code __section("data"); static u8 somcode __section("data"); +static u32 opp_voltage_mv __section(".data"); static void board_get_coding_straps(void) { @@ -197,10 +198,16 @@ int board_stm32mp1_ddr_config_name_match(struct udevice *dev, return -EINVAL; } +void board_vddcore_init(u32 voltage_mv) +{ + if (IS_ENABLED(CONFIG_SPL_BUILD)) + opp_voltage_mv = voltage_mv; +} + int board_early_init_f(void) { if (IS_ENABLED(CONFIG_SPL_BUILD)) - stpmic1_init(); + stpmic1_init(opp_voltage_mv); board_get_coding_straps(); return 0; -- cgit v1.2.3 From 6826d0d82ba6ca2b466117aafdaa3305b666e37b Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Thu, 2 Jul 2020 15:20:47 +0200 Subject: board: dh_stm32mp1: update the gpio hog support This patch update the current gpio hog implementation with the new API gpio_hog_probe_all() activated with CONFIG_GPIO_HOG. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/dhelectronics/dh_stm32mp1/board.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'board/dhelectronics/dh_stm32mp1/board.c') diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index b2b4f3974d2..b8625f25d3e 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -523,17 +523,11 @@ static void board_init_fmc2(void) /* board dependent setup after realloc */ int board_init(void) { - struct udevice *dev; - /* address of boot parameters */ gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100; - /* probe all PINCTRL for hog */ - for (uclass_first_device(UCLASS_PINCTRL, &dev); - dev; - uclass_next_device(&dev)) { - pr_debug("probe pincontrol = %s\n", dev->name); - } + if (CONFIG_IS_ENABLED(DM_GPIO_HOG)) + gpio_hog_probe_all(); board_key_check(); -- cgit v1.2.3