cpu_x86.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #ifndef _ASM_CPU_X86_H
  6. #define _ASM_CPU_X86_H
  7. /**
  8. * cpu_x86_bind() - Bind an x86 CPU with the driver
  9. *
  10. * This updates cpu device's platform data with information from device tree,
  11. * like the processor local apic id.
  12. *
  13. * @dev: Device to check (UCLASS_CPU)
  14. * @return 0 always
  15. */
  16. int cpu_x86_bind(struct udevice *dev);
  17. /**
  18. * cpu_x86_get_desc() - Get a description string for an x86 CPU
  19. *
  20. * This uses cpu_get_name() and is suitable to use as the get_desc() method for
  21. * the CPU uclass.
  22. *
  23. * @dev: Device to check (UCLASS_CPU)
  24. * @buf: Buffer to place string
  25. * @size: Size of string space
  26. * @return: 0 if OK, -ENOSPC if buffer is too small, other -ve on error
  27. */
  28. int cpu_x86_get_desc(const struct udevice *dev, char *buf, int size);
  29. /**
  30. * cpu_x86_get_count() - Get the number of cores for an x86 CPU
  31. *
  32. * This function is suitable to use as the get_count() method for
  33. * the CPU uclass.
  34. *
  35. * @dev: Device to check (UCLASS_CPU)
  36. * @return: Number of cores if successful,
  37. * -ENOENT if not "/cpus" entry is found in the device tree
  38. */
  39. int cpu_x86_get_count(const struct udevice *dev);
  40. /**
  41. * cpu_x86_get_vendor() - Get a vendor string for an x86 CPU
  42. *
  43. * This uses cpu_vendor_name() and is suitable to use as the get_vendor()
  44. * method for the CPU uclass.
  45. *
  46. * @dev: Device to check (UCLASS_CPU)
  47. * @buf: Buffer to place string
  48. * @size: Size of string space
  49. * @return: 0 if OK, -ENOSPC if buffer is too small, other -ve on error
  50. */
  51. int cpu_x86_get_vendor(const struct udevice *dev, char *buf, int size);
  52. #endif /* _ASM_CPU_X86_H */