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 #define cpu_get_ops(dev) ((struct cpu_ops *)(dev)->driver->ops)
66 * cpu_get_desc() - Get a description string for a CPU
68 * @dev: Device to check (UCLASS_CPU)
69 * @buf: Buffer to place string
70 * @size: Size of string space
71 * @return 0 if OK, -ENOSPC if buffer is too small, other -ve on error
73 int cpu_get_desc(struct udevice *dev, char *buf, int size);
76 * cpu_get_info() - Get information about a CPU
78 * @dev: Device to check (UCLASS_CPU)
79 * @info: Returns CPU info
80 * @return 0 if OK, -ve on error
82 int cpu_get_info(struct udevice *dev, struct cpu_info *info);