common: Move device-tree setup functions to fdt_support.h
[oweals/u-boot.git] / board / freescale / mpc8313erdb / mpc8313erdb.c
index 591a4c61d06902ef28285d03b7f5a5636934b812..1445d29bad2cb5528a274379ada3ec13842af081 100644 (file)
@@ -1,14 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) Freescale Semiconductor, Inc. 2006-2007
  *
  * Author: Scott Wood <scottwood@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <fdt_support.h>
+#include <init.h>
 #if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #endif
 #include <pci.h>
 #include <mpc83xx.h>
@@ -116,12 +117,14 @@ int misc_init_r(void)
 }
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif
 #else /* CONFIG_SPL_BUILD */
@@ -129,12 +132,12 @@ void board_init_f(ulong bootflag)
 {
        board_early_init_f();
        NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
-                    CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
+                    CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
        puts("NAND boot... ");
-       init_timebase();
-       initdram(0);
+       timer_init();
+       dram_init();
        relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC_SP, (gd_t *)gd,
-                     CONFIG_SYS_NAND_U_BOOT_RELOC);
+                     CONFIG_SYS_NAND_U_BOOT_RELOC);
 }
 
 void board_init_r(gd_t *gd, ulong dest_addr)