2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
12 * struct cpu_platdata - platform data for a CPU
14 * This can be accessed with dev_get_parent_platdata() for any UCLASS_CPU
17 * @cpu_id: Platform-specific way of identifying the CPU.
23 /* CPU features - mostly just a placeholder for now */
25 CPU_FEAT_L1_CACHE = 0, /* Supports level 1 cache */
26 CPU_FEAT_MMU = 1, /* Supports virtual memory */
32 * struct cpu_info - Information about a CPU
34 * @cpu_freq: Current CPU frequency in Hz
35 * @features: Flags for supported CPU features
44 * get_desc() - Get a description string for a CPU
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
51 int (*get_desc)(struct udevice *dev, char *buf, int size);
54 * get_info() - Get information about a CPU
56 * @dev: Device to check (UCLASS_CPU)
57 * @info: Returns CPU info
58 * @return 0 if OK, -ve on error
60 int (*get_info)(struct udevice *dev, struct cpu_info *info);
63 * get_count() - Get number of CPUs
65 * @dev: Device to check (UCLASS_CPU)
66 * @return CPU count if OK, -ve on error
68 int (*get_count)(struct udevice *dev);
71 #define cpu_get_ops(dev) ((struct cpu_ops *)(dev)->driver->ops)
74 * cpu_get_desc() - Get a description string for a CPU
76 * @dev: Device to check (UCLASS_CPU)
77 * @buf: Buffer to place string
78 * @size: Size of string space
79 * @return 0 if OK, -ENOSPC if buffer is too small, other -ve on error
81 int cpu_get_desc(struct udevice *dev, char *buf, int size);
84 * cpu_get_info() - Get information about a CPU
86 * @dev: Device to check (UCLASS_CPU)
87 * @info: Returns CPU info
88 * @return 0 if OK, -ve on error
90 int cpu_get_info(struct udevice *dev, struct cpu_info *info);
93 * cpu_get_count() - Get number of CPUs
95 * @dev: Device to check (UCLASS_CPU)
96 * @return CPU count if OK, -ve on error
98 int cpu_get_count(struct udevice *dev);