Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Bin Meng | 12d4105 | 2015-06-12 14:52:20 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> |
Bin Meng | 12d4105 | 2015-06-12 14:52:20 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_CPU_X86_H |
| 7 | #define _ASM_CPU_X86_H |
| 8 | |
| 9 | /** |
| 10 | * cpu_x86_bind() - Bind an x86 CPU with the driver |
| 11 | * |
| 12 | * This updates cpu device's platform data with information from device tree, |
| 13 | * like the processor local apic id. |
| 14 | * |
| 15 | * @dev: Device to check (UCLASS_CPU) |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 16 | * Return: 0 always |
Bin Meng | 12d4105 | 2015-06-12 14:52:20 +0800 | [diff] [blame] | 17 | */ |
| 18 | int cpu_x86_bind(struct udevice *dev); |
| 19 | |
| 20 | /** |
| 21 | * cpu_x86_get_desc() - Get a description string for an x86 CPU |
| 22 | * |
| 23 | * This uses cpu_get_name() and is suitable to use as the get_desc() method for |
| 24 | * the CPU uclass. |
| 25 | * |
| 26 | * @dev: Device to check (UCLASS_CPU) |
| 27 | * @buf: Buffer to place string |
| 28 | * @size: Size of string space |
| 29 | * @return: 0 if OK, -ENOSPC if buffer is too small, other -ve on error |
| 30 | */ |
Simon Glass | 791fa45 | 2020-01-26 22:06:27 -0700 | [diff] [blame] | 31 | int cpu_x86_get_desc(const struct udevice *dev, char *buf, int size); |
Bin Meng | 12d4105 | 2015-06-12 14:52:20 +0800 | [diff] [blame] | 32 | |
Alexander Graf | 67f66bd | 2016-08-19 01:23:27 +0200 | [diff] [blame] | 33 | /** |
Wolfgang Wallner | b965558 | 2020-02-25 13:19:47 +0100 | [diff] [blame] | 34 | * cpu_x86_get_count() - Get the number of cores for an x86 CPU |
| 35 | * |
| 36 | * This function is suitable to use as the get_count() method for |
| 37 | * the CPU uclass. |
| 38 | * |
| 39 | * @dev: Device to check (UCLASS_CPU) |
| 40 | * @return: Number of cores if successful, |
| 41 | * -ENOENT if not "/cpus" entry is found in the device tree |
| 42 | */ |
Simon Glass | 791fa45 | 2020-01-26 22:06:27 -0700 | [diff] [blame] | 43 | int cpu_x86_get_count(const struct udevice *dev); |
Wolfgang Wallner | b965558 | 2020-02-25 13:19:47 +0100 | [diff] [blame] | 44 | |
| 45 | /** |
Alexander Graf | 67f66bd | 2016-08-19 01:23:27 +0200 | [diff] [blame] | 46 | * cpu_x86_get_vendor() - Get a vendor string for an x86 CPU |
| 47 | * |
| 48 | * This uses cpu_vendor_name() and is suitable to use as the get_vendor() |
| 49 | * method for the CPU uclass. |
| 50 | * |
| 51 | * @dev: Device to check (UCLASS_CPU) |
| 52 | * @buf: Buffer to place string |
| 53 | * @size: Size of string space |
| 54 | * @return: 0 if OK, -ENOSPC if buffer is too small, other -ve on error |
| 55 | */ |
Simon Glass | 791fa45 | 2020-01-26 22:06:27 -0700 | [diff] [blame] | 56 | int cpu_x86_get_vendor(const struct udevice *dev, char *buf, int size); |
Alexander Graf | 67f66bd | 2016-08-19 01:23:27 +0200 | [diff] [blame] | 57 | |
Bin Meng | 12d4105 | 2015-06-12 14:52:20 +0800 | [diff] [blame] | 58 | #endif /* _ASM_CPU_X86_H */ |