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 <peng.fan@nxp.com>
void spl_board_init(void)
{
void spl_board_init(void)
{
- struct udevice *dev;
- int ret;
-
-
- ret = uclass_get_device_by_name(UCLASS_CLK,
- "clock-controller@30380000",
- &dev);
- if (ret < 0)
- printf("Failed to find clock node. Check device tree\n");
}
#ifdef CONFIG_SPL_LOAD_FIT
}
#ifdef CONFIG_SPL_LOAD_FIT
void board_init_f(ulong dummy)
{
void board_init_f(ulong dummy)
{
int ret;
arch_cpu_init();
int ret;
arch_cpu_init();
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
+ ret = spl_early_init();
- 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@30380000",
+ &dev);
+ if (ret < 0) {
+ printf("Failed to find clock node. Check device tree\n");