summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/cpu_x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/cpu/cpu_x86.c')
-rw-r--r--arch/x86/cpu/cpu_x86.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 0941041..157f3de 100644
--- a/arch/x86/cpu/cpu_x86.c
+++ b/arch/x86/cpu/cpu_x86.c
@@ -15,9 +15,26 @@ DECLARE_GLOBAL_DATA_PTR;
int cpu_x86_bind(struct udevice *dev)
{
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+ struct cpuid_result res;
plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
"intel,apic-id", -1);
+ plat->family = gd->arch.x86;
+ res = cpuid(1);
+ plat->id[0] = res.eax;
+ plat->id[1] = res.edx;
+
+ 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;
}
@@ -60,6 +77,7 @@ static int cpu_x86_get_count(struct udevice *dev)
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[] = {