aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-03-31 08:40:36 -0600
committerTom Rini <trini@konsulko.com>2017-04-05 16:36:55 -0400
commite5fb573f6431d7585ef43eb02b67ac1a07f40094 (patch)
tree27eb55a8cb2672f73849fe23c15aadd3baa978e5 /arch
parent056285fd454362ec1aa5e8bfedff38d9ef7a9fb1 (diff)
downloadu-boot-e5fb573f6431d7585ef43eb02b67ac1a07f40094.zip
u-boot-e5fb573f6431d7585ef43eb02b67ac1a07f40094.tar.gz
u-boot-e5fb573f6431d7585ef43eb02b67ac1a07f40094.tar.bz2
powerpc: Move setup_board_extra() into a PPC file
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/lib/Makefile1
-rw-r--r--arch/powerpc/lib/setup.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 3c97476..4f68613 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -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
index 0000000..a421335
--- /dev/null
+++ b/arch/powerpc/lib/setup.c
@@ -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;
+}