mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
cpu: Add cpu_probe_all method
Add a method to probe all CPUs of the board. Signed-off-by: Mario Six <mario.six@gdsys.cc>
This commit is contained in:
@@ -11,6 +11,29 @@
|
|||||||
#include <dm/lists.h>
|
#include <dm/lists.h>
|
||||||
#include <dm/root.h>
|
#include <dm/root.h>
|
||||||
|
|
||||||
|
int cpu_probe_all(void)
|
||||||
|
{
|
||||||
|
struct udevice *cpu;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = uclass_first_device(UCLASS_CPU, &cpu);
|
||||||
|
if (ret) {
|
||||||
|
debug("%s: No CPU found (err = %d)\n", __func__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (cpu) {
|
||||||
|
ret = uclass_next_device(&cpu);
|
||||||
|
if (ret) {
|
||||||
|
debug("%s: Error while probing CPU (err = %d)\n",
|
||||||
|
__func__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int cpu_get_desc(struct udevice *dev, char *buf, int size)
|
int cpu_get_desc(struct udevice *dev, char *buf, int size)
|
||||||
{
|
{
|
||||||
struct cpu_ops *ops = cpu_get_ops(dev);
|
struct cpu_ops *ops = cpu_get_ops(dev);
|
||||||
|
@@ -125,4 +125,11 @@ int cpu_get_count(struct udevice *dev);
|
|||||||
*/
|
*/
|
||||||
int cpu_get_vendor(struct udevice *dev, char *buf, int size);
|
int cpu_get_vendor(struct udevice *dev, char *buf, int size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cpu_probe_all() - Probe all available CPUs
|
||||||
|
*
|
||||||
|
* Return: 0 if OK, -ve on error
|
||||||
|
*/
|
||||||
|
int cpu_probe_all(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user