powerpc: Move setup_board_extra() into a PPC file
authorSimon Glass <sjg@chromium.org>
Fri, 31 Mar 2017 14:40:36 +0000 (08:40 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 5 Apr 2017 20:36:55 +0000 (16:36 -0400)
We don't need this PPC-specific function in generic code. Move it to
the powerpc directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/powerpc/lib/Makefile
arch/powerpc/lib/setup.c [new file with mode: 0644]
common/board_f.c
include/common.h

index 3c97476a8387906342e846a55b78f0ac7062480d..4f68613a4172dfcd9a863b91bab113c704ec7f88 100644 (file)
@@ -17,6 +17,7 @@ MINIMAL=y
 endif
 endif
 
+obj-$(CONFIG_SYS_EXTBDINFO) += setup.o
 ifdef MINIMAL
 obj-y += cache.o time.o
 obj-y += ticks.o
diff --git a/arch/powerpc/lib/setup.c b/arch/powerpc/lib/setup.c
new file mode 100644 (file)
index 0000000..a421335
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017 Google, Inc
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <version.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int setup_board_extra(void)
+{
+       bd_t *bd = gd->bd;
+
+       strncpy((char *)bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
+       strncpy((char *)bd->bi_r_version, U_BOOT_VERSION,
+               sizeof(bd->bi_r_version));
+
+       bd->bi_procfreq = gd->cpu_clk;  /* Processor Speed, In Hz */
+       bd->bi_plb_busfreq = gd->bus_clk;
+#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \
+               defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+               defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+       bd->bi_pci_busfreq = get_PCI_freq();
+       bd->bi_opbfreq = get_OPB_freq();
+#elif defined(CONFIG_XILINX_405)
+       bd->bi_pci_busfreq = get_PCI_freq();
+#endif
+
+       return 0;
+}
index e483b4b06c9f6f43ce5e75a1def32636536e156b..bafe3aa49ce268c36f64932ebaf64d0bec0937e1 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <common.h>
-#include <version.h>
 #include <console.h>
 #include <environment.h>
 #include <dm.h>
@@ -607,30 +606,6 @@ static int setup_board_part2(void)
 }
 #endif
 
-#ifdef CONFIG_SYS_EXTBDINFO
-static int setup_board_extra(void)
-{
-       bd_t *bd = gd->bd;
-
-       strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
-       strncpy((char *) bd->bi_r_version, U_BOOT_VERSION,
-               sizeof(bd->bi_r_version));
-
-       bd->bi_procfreq = gd->cpu_clk;  /* Processor Speed, In Hz */
-       bd->bi_plb_busfreq = gd->bus_clk;
-#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \
-               defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
-               defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
-       bd->bi_pci_busfreq = get_PCI_freq();
-       bd->bi_opbfreq = get_OPB_freq();
-#elif defined(CONFIG_XILINX_405)
-       bd->bi_pci_busfreq = get_PCI_freq();
-#endif
-
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_POST
 static int init_post(void)
 {
index c1f1712d5a3a4e3bfb0e8f78490b03788ebb77ae..26db67a034545ec0b2cd1be1015b85c6703a14a7 100644 (file)
@@ -302,6 +302,13 @@ int print_cpuinfo(void);
 int update_flash_size(int flash_size);
 int arch_early_init_r(void);
 
+/*
+ * setup_board_extra() - Fill in extra details in the bd_t structure
+ *
+ * @return 0 if OK, -ve on error
+ */
+int setup_board_extra(void);
+
 /**
  * arch_fsp_init() - perform firmware support package init
  *