summaryrefslogtreecommitdiff
path: root/board/dhelectronics
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-05-25 13:19:46 +0300
committerPatrick Delaunay <patrick.delaunay@st.com>2020-07-07 17:01:23 +0300
commitd1a4b09de6431fbc2f6a9dc53efe8d84cdd31134 (patch)
tree5ef7a6a3cdf9564eedcdca03a1f4c67ae0ce8e28 /board/dhelectronics
parent4e62642aef59ef89e00fe05ef1c27f263d80bcf6 (diff)
downloadu-boot-d1a4b09de6431fbc2f6a9dc53efe8d84cdd31134.tar.xz
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 <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'board/dhelectronics')
-rw-r--r--board/dhelectronics/dh_stm32mp1/Makefile4
-rw-r--r--board/dhelectronics/dh_stm32mp1/board.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/board/dhelectronics/dh_stm32mp1/Makefile b/board/dhelectronics/dh_stm32mp1/Makefile
index 5758d9816b..b368b396a4 100644
--- a/board/dhelectronics/dh_stm32mp1/Makefile
+++ b/board/dhelectronics/dh_stm32mp1/Makefile
@@ -3,10 +3,6 @@
# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
#
-ifdef CONFIG_SPL_BUILD
-obj-y += ../../st/stm32mp1/spl.o
-endif
-
obj-y += ../../st/common/stpmic1.o board.o
obj-$(CONFIG_SYS_MTDPARTS_RUNTIME) += ../../st/common/stm32mp_mtdparts.o
diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c
index 26e827bc38..0e745ec733 100644
--- a/board/dhelectronics/dh_stm32mp1/board.c
+++ b/board/dhelectronics/dh_stm32mp1/board.c
@@ -41,6 +41,7 @@
#include <usb.h>
#include <usb/dwc2_udc.h>
#include <watchdog.h>
+#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;