[U-Boot] [PATCH 09/10] imx8m: evk: spl: probe clk in spl early stage

2019-11-04 Thread sbabic
> We are going to add i2c pmic support before dram could be used.
> So we need enable clk driver earlier, so use spl_early_init
> and move clock controller probe eariler to board_init_f.
> Signed-off-by: Peng Fan 

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 09/10] imx8m: evk: spl: probe clk in spl early stage

2019-10-16 Thread Peng Fan
We are going to add i2c pmic support before dram could be used.
So we need enable clk driver earlier, so use spl_early_init
and move clock controller probe eariler to board_init_f.

Signed-off-by: Peng Fan 
---
 board/freescale/imx8mm_evk/spl.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
index 043b5f4342..2a5fb27a73 100644
--- a/board/freescale/imx8mm_evk/spl.c
+++ b/board/freescale/imx8mm_evk/spl.c
@@ -41,16 +41,7 @@ void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-   struct udevice *dev;
-   int ret;
-
puts("Normal Boot\n");
-
-   ret = uclass_get_device_by_name(UCLASS_CLK,
-   "clock-controller@3038",
-   );
-   if (ret < 0)
-   printf("Failed to find clock node. Check device tree\n");
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
@@ -90,6 +81,7 @@ int board_early_init_f(void)
 
 void board_init_f(ulong dummy)
 {
+   struct udevice *dev;
int ret;
 
arch_cpu_init();
@@ -105,9 +97,17 @@ void board_init_f(ulong dummy)
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
 
-   ret = spl_init();
+   ret = spl_early_init();
if (ret) {
-   debug("spl_init() failed: %d\n", ret);
+   debug("spl_early_init() failed: %d\n", ret);
+   hang();
+   }
+
+   ret = uclass_get_device_by_name(UCLASS_CLK,
+   "clock-controller@3038",
+   );
+   if (ret < 0) {
+   printf("Failed to find clock node. Check device tree\n");
hang();
}
 
-- 
2.16.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot