cpu.c 710 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2014 Google, Inc
  3. * (C) Copyright 2008
  4. * Graeme Russ, graeme.russ@gmail.com.
  5. *
  6. * Some portions from coreboot src/mainboard/google/link/romstage.c
  7. * Copyright (C) 2007-2010 coresystems GmbH
  8. * Copyright (C) 2011 Google Inc.
  9. *
  10. * SPDX-License-Identifier: GPL-2.0
  11. */
  12. #include <common.h>
  13. #include <asm/cpu.h>
  14. #include <asm/processor.h>
  15. DECLARE_GLOBAL_DATA_PTR;
  16. int arch_cpu_init(void)
  17. {
  18. int ret;
  19. timer_set_base(rdtsc());
  20. ret = x86_cpu_init_f();
  21. if (ret)
  22. return ret;
  23. return 0;
  24. }
  25. int print_cpuinfo(void)
  26. {
  27. char processor_name[CPU_MAX_NAME_LEN];
  28. const char *name;
  29. /* Print processor name */
  30. name = cpu_get_name(processor_name);
  31. printf("CPU: %s\n", name);
  32. return 0;
  33. }