diff options
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/lib/setup.c | 32 | ||||
-rw-r--r-- | arch/powerpc/lib/time.c | 2 |
3 files changed, 34 insertions, 1 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 3c97476a83..4f68613a41 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 0000000000..a4213359e2 --- /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; +} diff --git a/arch/powerpc/lib/time.c b/arch/powerpc/lib/time.c index 62b6c72f4e..de5f0be66d 100644 --- a/arch/powerpc/lib/time.c +++ b/arch/powerpc/lib/time.c @@ -60,7 +60,7 @@ unsigned long ticks2usec(unsigned long ticks) #endif /* ------------------------------------------------------------------------- */ -int init_timebase (void) +int timer_init(void) { unsigned long temp; |