cpu: Add get_vendor callback

The CPU udevice already has a few callbacks to retreive information
about the currently running CPUs. This patch adds a new get_vendor()
call that returns the vendor of the main CPUs.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 39004ee..157f3de 100644
--- a/arch/x86/cpu/cpu_x86.c
+++ b/arch/x86/cpu/cpu_x86.c
@@ -27,6 +27,18 @@
 	return 0;
 }
 
+int cpu_x86_get_vendor(struct udevice *dev, char *buf, int size)
+{
+	const char *vendor = cpu_vendor_name(gd->arch.x86_vendor);
+
+	if (size < (strlen(vendor) + 1))
+		return -ENOSPC;
+
+	strcpy(buf, vendor);
+
+	return 0;
+}
+
 int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
 {
 	if (size < CPU_MAX_NAME_LEN)
@@ -65,6 +77,7 @@
 static const struct cpu_ops cpu_x86_ops = {
 	.get_desc	= cpu_x86_get_desc,
 	.get_count	= cpu_x86_get_count,
+	.get_vendor	= cpu_x86_get_vendor,
 };
 
 static const struct udevice_id cpu_x86_ids[] = {