setup.c 776 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2017 Google, Inc
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <version.h>
  8. DECLARE_GLOBAL_DATA_PTR;
  9. int setup_board_extra(void)
  10. {
  11. bd_t *bd = gd->bd;
  12. strncpy((char *)bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
  13. strncpy((char *)bd->bi_r_version, U_BOOT_VERSION,
  14. sizeof(bd->bi_r_version));
  15. bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */
  16. bd->bi_plb_busfreq = gd->bus_clk;
  17. #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \
  18. defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
  19. defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
  20. bd->bi_pci_busfreq = get_PCI_freq();
  21. bd->bi_opbfreq = get_OPB_freq();
  22. #elif defined(CONFIG_XILINX_405)
  23. bd->bi_pci_busfreq = get_PCI_freq();
  24. #endif
  25. return 0;
  26. }